diff --git a/src/views/mp/autoReply/components/ReplyTable.vue b/src/views/mp/autoReply/components/ReplyTable.vue index 0b739cef..e3e53905 100644 --- a/src/views/mp/autoReply/components/ReplyTable.vue +++ b/src/views/mp/autoReply/components/ReplyTable.vue @@ -94,10 +94,10 @@ diff --git a/src/views/mp/components/wx-reply/components/TabMusic.vue b/src/views/mp/components/wx-reply/components/TabMusic.vue index 2c3b04e5..b19fb592 100644 --- a/src/views/mp/components/wx-reply/components/TabMusic.vue +++ b/src/views/mp/components/wx-reply/components/TabMusic.vue @@ -1,14 +1,11 @@ diff --git a/src/views/mp/components/wx-reply/components/TabNews.vue b/src/views/mp/components/wx-reply/components/TabNews.vue index bb9272e7..88a82a53 100644 --- a/src/views/mp/components/wx-reply/components/TabNews.vue +++ b/src/views/mp/components/wx-reply/components/TabNews.vue @@ -1,11 +1,8 @@ diff --git a/src/views/mp/components/wx-reply/components/TabText.vue b/src/views/mp/components/wx-reply/components/TabText.vue index bd7b0187..aac698e8 100644 --- a/src/views/mp/components/wx-reply/components/TabText.vue +++ b/src/views/mp/components/wx-reply/components/TabText.vue @@ -1,15 +1,10 @@ diff --git a/src/views/mp/components/wx-reply/components/TabVoice.vue b/src/views/mp/components/wx-reply/components/TabVoice.vue index 6d40a052..c4868cf8 100644 --- a/src/views/mp/components/wx-reply/components/TabVoice.vue +++ b/src/views/mp/components/wx-reply/components/TabVoice.vue @@ -1,12 +1,9 @@ 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 @@ ④ 支持发送【视频】消息时,支持新建视频 -->