diff --git a/src/views/mp/menu/components/MenuEditor.vue b/src/views/mp/menu/components/MenuEditor.vue new file mode 100644 index 00000000..b83fcddf --- /dev/null +++ b/src/views/mp/menu/components/MenuEditor.vue @@ -0,0 +1,243 @@ + + + + + diff --git a/src/views/mp/menu/components/MenuPreviewer.vue b/src/views/mp/menu/components/MenuPreviewer.vue new file mode 100644 index 00000000..9fb45008 --- /dev/null +++ b/src/views/mp/menu/components/MenuPreviewer.vue @@ -0,0 +1,158 @@ + + + + + diff --git a/src/views/mp/menu/menuOptions.ts b/src/views/mp/menu/components/menuOptions.ts similarity index 100% rename from src/views/mp/menu/menuOptions.ts rename to src/views/mp/menu/components/menuOptions.ts diff --git a/src/views/mp/menu/components/types.ts b/src/views/mp/menu/components/types.ts new file mode 100644 index 00000000..b9f76597 --- /dev/null +++ b/src/views/mp/menu/components/types.ts @@ -0,0 +1,73 @@ +export interface Replay { + title: string + description: string + picUrl: string + url: string +} + +export type MenuType = + | '' + | 'click' + | 'view' + | 'scancode_waitmsg' + | 'scancode_push' + | 'pic_sysphoto' + | 'pic_photo_or_album' + | 'pic_weixin' + | 'location_select' + | 'article_view_limited' + +interface _RawMenu { + // db + id: number + parentId: number + accountId: number + appId: string + createTime: number + + // mp-native + name: string + menuKey: string + type: MenuType + url: string + miniProgramAppId: string + miniProgramPagePath: string + articleId: string + replyMessageType: string + replyContent: string + replyMediaId: string + replyMediaUrl: string + replyThumbMediaId: string + replyThumbMediaUrl: string + replyTitle: string + replyDescription: string + replyArticles: Replay + replyMusicUrl: string + replyHqMusicUrl: string +} + +export type RawMenu = Partial<_RawMenu> + +interface _Reply { + type: string + accountId: number + content: string + mediaId: string + url: string + thumbMediaId: string + thumbMediaUrl: string + title: string + description: string + articles: null | Replay[] + musicUrl: string + hqMusicUrl: string +} + +export type Reply = Partial<_Reply> + +interface _Menu extends RawMenu { + children: _Menu[] + reply: Reply +} + +export type Menu = Partial<_Menu> diff --git a/src/views/mp/menu/index.vue b/src/views/mp/menu/index.vue index 3d428f06..994bb694 100644 --- a/src/views/mp/menu/index.vue +++ b/src/views/mp/menu/index.vue @@ -9,7 +9,6 @@ -
@@ -17,169 +16,33 @@
{{ accountName }}
- -
-
-
- - 删除当前菜单 - -
-
- 菜单名称: - -
-
- - -
- 跳转链接: - -
-
-
- 小程序的 appid : - -
-
- 小程序的页面路径: - -
-
- 小程序的备用网页: - -
-

tips:需要和公众号进行关联才可以把小程序绑定带微信菜单上哟!

-
-
- -
- - - - - - -
-
- - - - 素材库选择 - - - -
- - - -
-
-
- -
-
-
+
+
@@ -188,37 +51,55 @@
+ @@ -513,9 +294,9 @@ const deleteMaterial = () => { } .clearfix::after { - content: ''; display: table; clear: both; + content: ''; } div { @@ -523,116 +304,50 @@ div { } .weixin-hd { - color: #fff; - text-align: center; position: relative; bottom: 426px; - left: 0px; + left: 0; width: 300px; height: 64px; + color: #fff; + text-align: center; background: transparent url('./assets/menu_head.png') no-repeat 0 0; background-position: 0 0; background-size: 100%; } .weixin-title { - color: #fff; - font-size: 14px; - width: 100%; - text-align: center; position: absolute; top: 33px; - left: 0px; + left: 0; + width: 100%; + font-size: 14px; + color: #fff; + text-align: center; } .weixin-menu { - background: transparent url('./assets/menu_foot.png') no-repeat 0 0; padding-left: 43px; font-size: 12px; -} - -.menu_option { - width: 40% !important; + background: transparent url('./assets/menu_foot.png') no-repeat 0 0; } .public-account-management { - min-width: 1200px; - width: 1200px; + // width: 1200px; + // min-width: 1200px; margin: 0 auto; .left { - float: left; + position: relative; display: inline-block; + float: left; width: 350px; height: 715px; + padding: 518px 25px 88px; background: url('./assets/iphone_backImg.png') no-repeat; background-size: 100% auto; - padding: 518px 25px 88px; - position: relative; box-sizing: border-box; - /*第一级菜单*/ - .menu_main { - .menu_bottom { - position: relative; - float: left; - display: inline-block; - box-sizing: border-box; - width: 85.5px; - text-align: center; - border: 1px solid #ebedee; - background-color: #fff; - cursor: pointer; - - &.menu_addicon { - height: 46px; - line-height: 46px; - } - - .menu_item { - height: 44px; - line-height: 44px; - // text-align: center; - box-sizing: border-box; - width: 100%; - display: flex; - align-items: center; - justify-content: center; - - &.active { - border: 1px solid #2bb673; - } - } - - .menu_subItem { - height: 44px; - line-height: 44px; - text-align: center; - box-sizing: border-box; - - &.active { - border: 1px solid #2bb673; - } - } - } - - i { - color: #2bb673; - } - - /*第二级菜单*/ - .submenu { - position: absolute; - width: 85.5px; - bottom: 45px; - - .subtitle { - background-color: #fff; - box-sizing: border-box; - } - } - } - .save_div { margin-top: 15px; text-align: center; @@ -644,85 +359,29 @@ div { } } - /*右边菜单内容*/ + /* 右边菜单内容 */ .right { float: left; width: 63%; - background-color: #e8e7e7; padding: 20px; margin-left: 20px; - -webkit-box-sizing: border-box; + background-color: #e8e7e7; + box-sizing: border-box; box-sizing: border-box; - - .configure_page { - .delete_btn { - text-align: right; - margin-bottom: 15px; - } - - .menu_content { - margin-top: 20px; - } - - .configur_content { - margin-top: 20px; - background-color: #fff; - padding: 20px 10px; - border-radius: 5px; - } - - .blue { - color: #29b6f6; - margin-top: 10px; - } - - .applet { - margin-bottom: 20px; - - span { - width: 20%; - } - } - - .input_width { - width: 40%; - } - - .material { - .input_width { - width: 30%; - } - - .el-textarea { - width: 80%; - } - } - } - } - - .el-input { - width: 70%; - margin-right: 2%; } }