From 0beda6ecc3e392cb9e25b6e015eeadd4b4d88d53 Mon Sep 17 00:00:00 2001 From: dhb52 Date: Tue, 18 Apr 2023 11:19:13 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84MP/autoReply,=20?= =?UTF-8?q?=E6=8B=86=E5=88=86=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mp/autoReply/components/ReplyTable.vue | 118 ++++++++++ src/views/mp/autoReply/components/types.ts | 47 ++++ src/views/mp/autoReply/index.vue | 210 ++++-------------- 3 files changed, 205 insertions(+), 170 deletions(-) create mode 100644 src/views/mp/autoReply/components/ReplyTable.vue create mode 100644 src/views/mp/autoReply/components/types.ts diff --git a/src/views/mp/autoReply/components/ReplyTable.vue b/src/views/mp/autoReply/components/ReplyTable.vue new file mode 100644 index 00000000..ef17dfe8 --- /dev/null +++ b/src/views/mp/autoReply/components/ReplyTable.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/src/views/mp/autoReply/components/types.ts b/src/views/mp/autoReply/components/types.ts new file mode 100644 index 00000000..d4d79ca4 --- /dev/null +++ b/src/views/mp/autoReply/components/types.ts @@ -0,0 +1,47 @@ +// 消息类型(Follow: 关注时回复;Message: 消息回复;Keyword: 关键词回复) +// 作为tab.name,enum的数字不能随意修改,与api参数相关 +export enum MsgType { + Follow = 1, + Message = 2, + Keyword = 3 +} + +type ReplyType = 'text' | 'image' | 'voice' | 'video' | 'shortvideo' | 'location' | 'link' + +export interface ReplyForm { + // relation: + id?: number + accountId?: number + type?: MsgType + // request: + requestMessageType?: ReplyType + requestMatch?: number + requestKeyword?: string + // response: + responseMessageType?: ReplyType + responseContent?: string + responseMediaId?: number + responseMediaUrl?: string + responseTitle?: string + responseDescription?: number + responseThumbMediaId?: string + responseThumbMediaUrl?: string + responseArticles?: any[] + responseMusicUrl?: string + responseHqMusicUrl?: string +} + +export interface ObjData { + type: ReplyType + accountId?: number + content?: string + mediaId?: number + url?: string + title?: string + description?: string + thumbMediaId?: number + thumbMediaUrl?: string + articles?: any[] + musicUrl?: string + hqMusicUrl?: string +} diff --git a/src/views/mp/autoReply/index.vue b/src/views/mp/autoReply/index.vue index 0fd6001d..a28d23d5 100644 --- a/src/views/mp/autoReply/index.vue +++ b/src/views/mp/autoReply/index.vue @@ -12,14 +12,14 @@ - + @@ -30,117 +30,31 @@ - - - - - - - - - - - - - - - - - + - + @@ -172,35 +86,25 @@