From b45b85984ce55f09e80d0b3a4ba7e788ad1c8742 Mon Sep 17 00:00:00 2001 From: dhb52 Date: Fri, 21 Apr 2023 20:22:11 +0800 Subject: [PATCH 1/5] =?UTF-8?q?refactor:=20mp=E6=A8=A1=E5=9D=97=EF=BC=8C?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=A4=A7=E5=A4=A7=E7=9A=84=E9=87=8D=E6=9E=84?= =?UTF-8?q?+fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mp/autoReply/components/ReplyTable.vue | 8 +- src/views/mp/autoReply/components/types.ts | 41 ------- src/views/mp/autoReply/index.vue | 55 ++++----- .../mp/components/wx-account-select/index.ts | 3 + .../mp/components/wx-account-select/main.vue | 14 ++- src/views/mp/components/wx-location/index.ts | 3 + .../mp/components/wx-material-select/index.ts | 6 + .../mp/components/wx-material-select/main.vue | 58 +++++----- .../mp/components/wx-material-select/types.ts | 11 ++ src/views/mp/components/wx-msg/index.ts | 6 + src/views/mp/components/wx-msg/main.vue | 28 ++--- src/views/mp/components/wx-music/index.ts | 3 + src/views/mp/components/wx-news/index.ts | 3 + src/views/mp/components/wx-news/main.vue | 36 +++--- .../wx-reply/components/TabImage.vue | 50 ++++----- .../wx-reply/components/TabMusic.vue | 41 ++++--- .../wx-reply/components/TabNews.vue | 34 +++--- .../wx-reply/components/TabText.vue | 11 +- .../wx-reply/components/TabVideo.vue | 52 ++++----- .../wx-reply/components/TabVoice.vue | 54 ++++----- .../components/wx-reply/components/types.ts | 59 +++++++--- src/views/mp/components/wx-reply/index.ts | 7 ++ src/views/mp/components/wx-reply/main.vue | 105 ++++++++++++++---- .../mp/components/wx-video-play/index.ts | 3 + .../mp/components/wx-voice-play/index.ts | 3 + .../mp/components/wx-voice-play/main.vue | 6 +- src/views/mp/draft/components/CoverSelect.vue | 36 ++---- src/views/mp/draft/components/DraftTable.vue | 2 +- src/views/mp/draft/index.vue | 9 +- src/views/mp/freePublish/index.vue | 10 +- src/views/mp/hooks/useUpload.ts | 12 +- .../mp/material/components/UploadFile.vue | 15 +-- .../mp/material/components/UploadVideo.vue | 28 ++--- .../mp/material/components/VideoTable.vue | 2 +- .../mp/material/components/VoiceTable.vue | 2 +- src/views/mp/material/components/upload.ts | 12 +- src/views/mp/material/index.vue | 28 ++--- src/views/mp/menu/components/MenuEditor.vue | 14 +-- src/views/mp/menu/index.vue | 8 +- src/views/mp/message/MessageTable.vue | 10 +- src/views/mp/message/index.vue | 20 ++-- src/views/mp/tag/index.vue | 32 ++++-- src/views/mp/user/index.vue | 16 ++- 43 files changed, 518 insertions(+), 438 deletions(-) create mode 100644 src/views/mp/components/wx-account-select/index.ts create mode 100644 src/views/mp/components/wx-location/index.ts create mode 100644 src/views/mp/components/wx-material-select/index.ts create mode 100644 src/views/mp/components/wx-material-select/types.ts create mode 100644 src/views/mp/components/wx-msg/index.ts create mode 100644 src/views/mp/components/wx-music/index.ts create mode 100644 src/views/mp/components/wx-news/index.ts create mode 100644 src/views/mp/components/wx-reply/index.ts create mode 100644 src/views/mp/components/wx-video-play/index.ts create mode 100644 src/views/mp/components/wx-voice-play/index.ts 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 @@ ④ 支持发送【视频】消息时,支持新建视频 --> diff --git a/src/views/mp/components/wx-msg/card.scss b/src/views/mp/components/wx-msg/card.scss index 67ac9219..7fbbe802 100644 --- a/src/views/mp/components/wx-msg/card.scss +++ b/src/views/mp/components/wx-msg/card.scss @@ -1,25 +1,27 @@ -.avue-card{ - &__item{ +.avue-card { + &__item { margin-bottom: 16px; border: 1px solid #e8e8e8; background-color: #fff; box-sizing: border-box; - color: rgba(0,0,0,.65); + color: rgba(0, 0, 0, 0.65); font-size: 14px; font-variant: tabular-nums; line-height: 1.5; list-style: none; - font-feature-settings: "tnum"; + font-feature-settings: 'tnum'; cursor: pointer; - height:200px; - &:hover{ - border-color: rgba(0,0,0,.09); - box-shadow: 0 2px 8px rgba(0,0,0,.09); + height: 200px; + + &:hover { + border-color: rgba(0, 0, 0, 0.09); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09); } - &--add{ - border:1px dashed #000; + + &--add { + border: 1px dashed #000; width: 100%; - color: rgba(0,0,0,.45); + color: rgba(0, 0, 0, 0.45); background-color: #fff; border-color: #d9d9d9; border-radius: 2px; @@ -27,74 +29,87 @@ align-items: center; justify-content: center; font-size: 16px; - i{ + + i { margin-right: 10px; } - &:hover{ + + &:hover { color: #40a9ff; background-color: #fff; border-color: #40a9ff; } } } - &__body{ + + &__body { display: flex; padding: 24px; } - &__detail{ - flex:1 + + &__detail { + flex: 1; } - &__avatar{ + + &__avatar { width: 48px; height: 48px; border-radius: 48px; overflow: hidden; margin-right: 12px; - img{ + + img { width: 100%; height: 100%; } } - &__title{ - color: rgba(0,0,0,.85); + + &__title { + color: rgba(0, 0, 0, 0.85); margin-bottom: 12px; font-size: 16px; - &:hover{ - color:#1890ff; + + &:hover { + color: #1890ff; } } - &__info{ - color: rgba(0,0,0,.45); + + &__info { + color: rgba(0, 0, 0, 0.45); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; height: 64px; } - &__menu{ + + &__menu { display: flex; - justify-content:space-around; + justify-content: space-around; height: 50px; background: #f7f9fa; - color: rgba(0,0,0,.45); + color: rgba(0, 0, 0, 0.45); text-align: center; line-height: 50px; - &:hover{ - color:#1890ff; + + &:hover { + color: #1890ff; } } } /** joolun 额外加的 */ .avue-comment__main { - flex: unset!important; - border-radius: 5px!important; - margin: 0 8px!important; + flex: unset !important; + border-radius: 5px !important; + margin: 0 8px !important; } + .avue-comment__header { border-top-left-radius: 5px; border-top-right-radius: 5px; } + .avue-comment__body { border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; diff --git a/src/views/mp/components/wx-msg/comment.scss b/src/views/mp/components/wx-msg/comment.scss index 3f1341b2..aaeaccaf 100644 --- a/src/views/mp/components/wx-msg/comment.scss +++ b/src/views/mp/components/wx-msg/comment.scss @@ -1,27 +1,33 @@ /* 来自 https://github.com/nmxiaowei/avue/blob/master/styles/src/element-ui/comment.scss */ -.avue-comment{ +.avue-comment { margin-bottom: 30px; display: flex; align-items: flex-start; - &--reverse{ - flex-direction:row-reverse; - .avue-comment__main{ - &:before,&:after{ + + &--reverse { + flex-direction: row-reverse; + + .avue-comment__main { + &:before, + &:after { left: auto; right: -8px; border-width: 8px 0 8px 8px; } - &:before{ + + &:before { border-left-color: #dedede; } - &:after{ + + &:after { border-left-color: #f8f8f8; margin-right: 1px; margin-left: auto; } } } - &__avatar{ + + &__avatar { width: 48px; height: 48px; border-radius: 50%; @@ -29,7 +35,8 @@ box-sizing: border-box; vertical-align: middle; } - &__header{ + + &__header { padding: 5px 15px; background: #f8f8f8; border-bottom: 1px solid #eee; @@ -37,18 +44,22 @@ align-items: center; justify-content: space-between; } - &__author{ + + &__author { font-weight: 700; font-size: 14px; color: #999; } - &__main{ - flex:1; + + &__main { + flex: 1; margin: 0 20px; position: relative; border: 1px solid #dedede; border-radius: 2px; - &:before,&:after{ + + &:before, + &:after { position: absolute; top: 10px; left: -8px; @@ -56,32 +67,39 @@ width: 0; height: 0; display: block; - content: " "; + content: ' '; border-color: transparent; border-style: solid solid outset; border-width: 8px 8px 8px 0; pointer-events: none; } + &:before { border-right-color: #dedede; z-index: 1; } - &:after{ + + &:after { border-right-color: #f8f8f8; margin-left: 1px; z-index: 2; } } - &__body{ + + &__body { padding: 15px; overflow: hidden; background: #fff; - font-family: Segoe UI,Lucida Grande,Helvetica,Arial,Microsoft YaHei,FreeSans,Arimo,Droid Sans,wenquanyi micro hei,Hiragino Sans GB,Hiragino Sans GB W3,FontAwesome,sans-serif;color: #333; + font-family: Segoe UI, Lucida Grande, Helvetica, Arial, Microsoft YaHei, FreeSans, Arimo, + Droid Sans, wenquanyi micro hei, Hiragino Sans GB, Hiragino Sans GB W3, FontAwesome, + sans-serif; + color: #333; font-size: 14px; } - blockquote{ - margin:0; - font-family: Georgia,Times New Roman,Times,Kai,Kaiti SC,KaiTi,BiauKai,FontAwesome,serif; + + blockquote { + margin: 0; + font-family: Georgia, Times New Roman, Times, Kai, Kaiti SC, KaiTi, BiauKai, FontAwesome, serif; padding: 1px 0 1px 15px; border-left: 4px solid #ddd; } diff --git a/src/views/mp/components/wx-music/main.vue b/src/views/mp/components/wx-music/main.vue index 52555f15..70f4c58b 100644 --- a/src/views/mp/components/wx-music/main.vue +++ b/src/views/mp/components/wx-music/main.vue @@ -56,5 +56,5 @@ defineExpose({ diff --git a/src/views/mp/components/wx-reply/components/TabImage.vue b/src/views/mp/components/wx-reply/components/TabImage.vue index 1a82c3aa..71950e04 100644 --- a/src/views/mp/components/wx-reply/components/TabImage.vue +++ b/src/views/mp/components/wx-reply/components/TabImage.vue @@ -123,7 +123,7 @@ const selectMaterial = (item) => { .select-item { width: 280px; padding: 10px; - margin: 0 auto 10px auto; + margin: 0 auto 10px; border: 1px solid #eaeaea; .material-img { @@ -131,11 +131,11 @@ const selectMaterial = (item) => { } .item-name { - font-size: 12px; overflow: hidden; + font-size: 12px; + text-align: center; text-overflow: ellipsis; white-space: nowrap; - text-align: center; .item-infos { width: 30%; @@ -149,18 +149,18 @@ const selectMaterial = (item) => { } .col-select { - border: 1px solid rgb(234, 234, 234); - padding: 50px 0px; - height: 160px; width: 49.5%; + height: 160px; + padding: 50px 0; + border: 1px solid rgb(234 234 234); } .col-add { - border: 1px solid rgb(234, 234, 234); - padding: 50px 0px; - height: 160px; - width: 49.5%; float: right; + width: 49.5%; + height: 160px; + padding: 50px 0; + border: 1px solid rgb(234 234 234); .el-upload__tip { line-height: 18px; diff --git a/src/views/mp/components/wx-reply/components/TabNews.vue b/src/views/mp/components/wx-reply/components/TabNews.vue index 88a82a53..ecb5026d 100644 --- a/src/views/mp/components/wx-reply/components/TabNews.vue +++ b/src/views/mp/components/wx-reply/components/TabNews.vue @@ -65,7 +65,7 @@ const onDelete = () => { .select-item { width: 280px; padding: 10px; - margin: 0 auto 10px auto; + margin: 0 auto 10px; border: 1px solid #eaeaea; .ope-row { diff --git a/src/views/mp/components/wx-reply/components/TabVoice.vue b/src/views/mp/components/wx-reply/components/TabVoice.vue index c4868cf8..5c9f64a7 100644 --- a/src/views/mp/components/wx-reply/components/TabVoice.vue +++ b/src/views/mp/components/wx-reply/components/TabVoice.vue @@ -120,15 +120,15 @@ const selectMaterial = (item: Reply) => { diff --git a/src/views/mp/freePublish/index.vue b/src/views/mp/freePublish/index.vue index 2fda5100..08a202c2 100644 --- a/src/views/mp/freePublish/index.vue +++ b/src/views/mp/freePublish/index.vue @@ -102,19 +102,45 @@ const handleDelete = async (item: any) => { } diff --git a/src/views/mp/menu/index.vue b/src/views/mp/menu/index.vue index c8ed0835..442e33b5 100644 --- a/src/views/mp/menu/index.vue +++ b/src/views/mp/menu/index.vue @@ -367,7 +367,6 @@ div { margin-left: 20px; background-color: #e8e7e7; box-sizing: border-box; - box-sizing: border-box; } } From d99f9e98fbfccba07f0582d2fa6eb4266c7da791 Mon Sep 17 00:00:00 2001 From: dhb52 Date: Fri, 21 Apr 2023 23:35:31 +0800 Subject: [PATCH 3/5] =?UTF-8?q?feat:=20mp/menu=20=E6=8B=96=E5=8A=A8?= =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mp/menu/components/MenuPreviewer.vue | 46 ++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/src/views/mp/menu/components/MenuPreviewer.vue b/src/views/mp/menu/components/MenuPreviewer.vue index aca1c2ae..637c8805 100644 --- a/src/views/mp/menu/components/MenuPreviewer.vue +++ b/src/views/mp/menu/components/MenuPreviewer.vue @@ -4,6 +4,9 @@