+
+
{{ reply.name }}
-
+
@@ -25,7 +22,11 @@
append-to-body
destroy-on-close
>
-
+
@@ -49,27 +50,27 @@
-
+
diff --git a/src/views/mp/components/wx-reply/components/types.ts b/src/views/mp/components/wx-reply/components/types.ts
index d5273334..3e07d6e5 100644
--- a/src/views/mp/components/wx-reply/components/types.ts
+++ b/src/views/mp/components/wx-reply/components/types.ts
@@ -1,25 +1,54 @@
-type ReplyType = '' | 'news' | 'image' | 'voice' | 'video' | 'music' | 'text'
+enum ReplyType {
+ News = 'news',
+ Image = 'image',
+ Voice = 'voice',
+ Video = 'video',
+ Music = 'music',
+ Text = 'text'
+}
-interface ObjData {
+interface _Reply {
accountId: number
type: ReplyType
- name: string | null
- content: string | null
- mediaId: string | null
- url: string | null
- title: string | null
- description: string | null
- thumbMediaId: string | null
- thumbMediaUrl: string | null
- musicUrl: string | null
- hqMusicUrl: string | null
- introduction: string | null
- articles: any[]
+ name?: string | null
+ content?: string | null
+ mediaId?: string | null
+ url?: string | null
+ title?: string | null
+ description?: string | null
+ thumbMediaId?: string | null
+ thumbMediaUrl?: string | null
+ musicUrl?: string | null
+ hqMusicUrl?: string | null
+ introduction?: string | null
+ articles?: any[]
}
+type Reply = _Reply //Partial<_Reply>
+
enum NewsType {
Published = '1',
Draft = '2'
}
-export { ObjData, NewsType }
+/** 利用旧的reply[accountId, type]初始化新的Reply */
+const createEmptyReply = (old: Reply | Ref
): Reply => {
+ return {
+ accountId: unref(old).accountId,
+ type: unref(old).type,
+ name: null,
+ content: null,
+ mediaId: null,
+ url: null,
+ title: null,
+ description: null,
+ thumbMediaId: null,
+ thumbMediaUrl: null,
+ musicUrl: null,
+ hqMusicUrl: null,
+ introduction: null,
+ articles: []
+ }
+}
+
+export { Reply, NewsType, ReplyType, createEmptyReply }
diff --git a/src/views/mp/components/wx-reply/index.ts b/src/views/mp/components/wx-reply/index.ts
new file mode 100644
index 00000000..d1da217e
--- /dev/null
+++ b/src/views/mp/components/wx-reply/index.ts
@@ -0,0 +1,7 @@
+import { Reply, NewsType, ReplyType, createEmptyReply } from './components/types'
+
+import WxReplySelect from './main.vue'
+
+export type { Reply }
+export { createEmptyReply, NewsType, ReplyType }
+export default WxReplySelect
diff --git a/src/views/mp/components/wx-reply/main.vue b/src/views/mp/components/wx-reply/main.vue
index b00e4345..32a31222 100644
--- a/src/views/mp/components/wx-reply/main.vue
+++ b/src/views/mp/components/wx-reply/main.vue
@@ -8,24 +8,59 @@
④ 支持发送【视频】消息时,支持新建视频
-->
-
+
-
+
+
+ 文本
+
+
+
+
-
+
+
+ 图片
+
+
+
+
-
+
+
+ 语音
+
+
+
+
-
+
+
+ 视频
+
+
+
+
-
+
+
+ 图文
+
+
+
+
-
+
+
+ 音乐
+
+
+