diff --git a/pages.json b/pages.json
index 18ca7c4..17fa7bb 100644
--- a/pages.json
+++ b/pages.json
@@ -656,6 +656,12 @@
"navigationBarTitleText": "视频预览",
"navigationBarBackgroundColor": "#fff"
}
+ },{
+ "path": "AiDrama",
+ "style": {
+ "navigationBarTitleText": "AI 剧本助手",
+ "navigationBarBackgroundColor": "#fff"
+ }
}]
},
{
diff --git a/pages/fun/AiDrama.vue b/pages/fun/AiDrama.vue
new file mode 100644
index 0000000..93e169b
--- /dev/null
+++ b/pages/fun/AiDrama.vue
@@ -0,0 +1,634 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ message.time }}
+
+
+
+
+
+ 确认使用此剧本
+
+
+
+
+
+
+
+
+ {{ message.content }}
+
+ {{ message.time }}
+
+
+
+
+
+
+
+ 正在生成剧本...
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 发送
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/fun/markdown.js b/pages/fun/markdown.js
new file mode 100644
index 0000000..10ee336
--- /dev/null
+++ b/pages/fun/markdown.js
@@ -0,0 +1,64 @@
+// 简单的Markdown渲染函数
+export function renderMarkdown(content) {
+ if (!content) return '';
+
+ // 由于UniApp的rich-text组件支持HTML,我们将Markdown转换为HTML
+ // 这是一个简化版的Markdown解析器,仅支持基本语法
+
+ let html = content
+ // 转义HTML特殊字符
+ .replace(/&/g, '&')
+ .replace(//g, '>')
+
+ // 标题
+ .replace(/^# (.*$)/gm, '
$1
')
+ .replace(/^## (.*$)/gm, '$1
')
+ .replace(/^### (.*$)/gm, '$1
')
+ .replace(/^#### (.*$)/gm, '$1
')
+ .replace(/^##### (.*$)/gm, '$1
')
+ .replace(/^###### (.*$)/gm, '$1
')
+
+ // 粗体和斜体
+ .replace(/\*\*(.*?)\*\*/g, '$1')
+ .replace(/\*(.*?)\*/g, '$1')
+ .replace(/__(.*?)__/g, '$1')
+ .replace(/_(.*?)_/g, '$1')
+
+ // 链接
+ .replace(/\[([^\]]+)\]$$([^)]+)$$/g, '$1')
+
+ // 图片
+ .replace(/!\[([^\]]+)\]$$([^)]+)$$/g, '
')
+
+ // 无序列表
+ .replace(/^\s*[-*+]\s+(.*$)/gm, '$1')
+
+ // 有序列表
+ .replace(/^\s*\d+\.\s+(.*$)/gm, '$1')
+
+ // 代码块
+ .replace(/```([\s\S]*?)```/g, '$1
')
+
+ // 行内代码
+ .replace(/`([^`]+)`/g, '$1
')
+
+ // 引用
+ .replace(/^\> (.*$)/gm, '$1
')
+
+ // 段落
+ .replace(/\n\s*\n/g, '')
+
+ // 换行
+ .replace(/\n/g, '
');
+
+ // 包装在段落标签中
+ html = '
' + html + '
';
+
+ // 修复列表
+ html = html.replace(/.*?<\/li>/g, function(match) {
+ return '';
+ });
+
+ return html;
+}
\ No newline at end of file
diff --git a/pages/fun/materialEdit.vue b/pages/fun/materialEdit.vue
index ca5ab1d..a0833c2 100644
--- a/pages/fun/materialEdit.vue
+++ b/pages/fun/materialEdit.vue
@@ -8,6 +8,16 @@
+
+
+ 剧本 视频的剧本
+
+
+
+
+ Ai生成剧本
+
+
{{ item.attrTitle }} {{ item.attrHint ? '(' +item.attrHint + ')' : '' }}
@@ -100,6 +110,7 @@
audioType: ['.wav', '.mp3', '.aac', '.flac', '.ogg'],
audioH5Type: ['wav', 'mp3', 'aac', 'flac', 'ogg'],
buttonLoading:false,
+ scriptContent:'',
// videoType: ['.avi', '.mp4', '.mkv', '.flv', '.mov', '.wmv', '.mpeg', '.3gp'],
}
},
@@ -112,6 +123,14 @@
this.getProductDetail();
},
methods: {
+ getAiDramaTxt(txt){
+ this.scriptContent = txt;
+ },
+ openAiDrama(){
+ uni.navigateTo({
+ url:'./AiDrama'
+ })
+ },
getDisabledStatus(){
if(this.commitState !== 'add' && this.commitState !== 'draft' && this.commitState !== 'back'){
return true;