Selaa lähdekoodia

会员卡权益设置,微信公众号授权,微信公众号菜单页面基本布局

zhengchengwu 5 vuotta sitten
vanhempi
commit
ab71fabab0

+ 11 - 30
package-lock.json Näytä tiedosto

@@ -4706,8 +4706,7 @@
4706 4706
         "ansi-regex": {
4707 4707
           "version": "2.1.1",
4708 4708
           "bundled": true,
4709
-          "dev": true,
4710
-          "optional": true
4709
+          "dev": true
4711 4710
         },
4712 4711
         "aproba": {
4713 4712
           "version": "1.2.0",
@@ -4728,14 +4727,12 @@
4728 4727
         "balanced-match": {
4729 4728
           "version": "1.0.0",
4730 4729
           "bundled": true,
4731
-          "dev": true,
4732
-          "optional": true
4730
+          "dev": true
4733 4731
         },
4734 4732
         "brace-expansion": {
4735 4733
           "version": "1.1.11",
4736 4734
           "bundled": true,
4737 4735
           "dev": true,
4738
-          "optional": true,
4739 4736
           "requires": {
4740 4737
             "balanced-match": "^1.0.0",
4741 4738
             "concat-map": "0.0.1"
@@ -4750,20 +4747,17 @@
4750 4747
         "code-point-at": {
4751 4748
           "version": "1.1.0",
4752 4749
           "bundled": true,
4753
-          "dev": true,
4754
-          "optional": true
4750
+          "dev": true
4755 4751
         },
4756 4752
         "concat-map": {
4757 4753
           "version": "0.0.1",
4758 4754
           "bundled": true,
4759
-          "dev": true,
4760
-          "optional": true
4755
+          "dev": true
4761 4756
         },
4762 4757
         "console-control-strings": {
4763 4758
           "version": "1.1.0",
4764 4759
           "bundled": true,
4765
-          "dev": true,
4766
-          "optional": true
4760
+          "dev": true
4767 4761
         },
4768 4762
         "core-util-is": {
4769 4763
           "version": "1.0.2",
@@ -4880,8 +4874,7 @@
4880 4874
         "inherits": {
4881 4875
           "version": "2.0.3",
4882 4876
           "bundled": true,
4883
-          "dev": true,
4884
-          "optional": true
4877
+          "dev": true
4885 4878
         },
4886 4879
         "ini": {
4887 4880
           "version": "1.3.5",
@@ -4893,7 +4886,6 @@
4893 4886
           "version": "1.0.0",
4894 4887
           "bundled": true,
4895 4888
           "dev": true,
4896
-          "optional": true,
4897 4889
           "requires": {
4898 4890
             "number-is-nan": "^1.0.0"
4899 4891
           }
@@ -4908,7 +4900,6 @@
4908 4900
           "version": "3.0.4",
4909 4901
           "bundled": true,
4910 4902
           "dev": true,
4911
-          "optional": true,
4912 4903
           "requires": {
4913 4904
             "brace-expansion": "^1.1.7"
4914 4905
           }
@@ -4916,14 +4907,12 @@
4916 4907
         "minimist": {
4917 4908
           "version": "0.0.8",
4918 4909
           "bundled": true,
4919
-          "dev": true,
4920
-          "optional": true
4910
+          "dev": true
4921 4911
         },
4922 4912
         "minipass": {
4923 4913
           "version": "2.3.5",
4924 4914
           "bundled": true,
4925 4915
           "dev": true,
4926
-          "optional": true,
4927 4916
           "requires": {
4928 4917
             "safe-buffer": "^5.1.2",
4929 4918
             "yallist": "^3.0.0"
@@ -4942,7 +4931,6 @@
4942 4931
           "version": "0.5.1",
4943 4932
           "bundled": true,
4944 4933
           "dev": true,
4945
-          "optional": true,
4946 4934
           "requires": {
4947 4935
             "minimist": "0.0.8"
4948 4936
           }
@@ -5023,8 +5011,7 @@
5023 5011
         "number-is-nan": {
5024 5012
           "version": "1.0.1",
5025 5013
           "bundled": true,
5026
-          "dev": true,
5027
-          "optional": true
5014
+          "dev": true
5028 5015
         },
5029 5016
         "object-assign": {
5030 5017
           "version": "4.1.1",
@@ -5036,7 +5023,6 @@
5036 5023
           "version": "1.4.0",
5037 5024
           "bundled": true,
5038 5025
           "dev": true,
5039
-          "optional": true,
5040 5026
           "requires": {
5041 5027
             "wrappy": "1"
5042 5028
           }
@@ -5122,8 +5108,7 @@
5122 5108
         "safe-buffer": {
5123 5109
           "version": "5.1.2",
5124 5110
           "bundled": true,
5125
-          "dev": true,
5126
-          "optional": true
5111
+          "dev": true
5127 5112
         },
5128 5113
         "safer-buffer": {
5129 5114
           "version": "2.1.2",
@@ -5159,7 +5144,6 @@
5159 5144
           "version": "1.0.2",
5160 5145
           "bundled": true,
5161 5146
           "dev": true,
5162
-          "optional": true,
5163 5147
           "requires": {
5164 5148
             "code-point-at": "^1.0.0",
5165 5149
             "is-fullwidth-code-point": "^1.0.0",
@@ -5179,7 +5163,6 @@
5179 5163
           "version": "3.0.1",
5180 5164
           "bundled": true,
5181 5165
           "dev": true,
5182
-          "optional": true,
5183 5166
           "requires": {
5184 5167
             "ansi-regex": "^2.0.0"
5185 5168
           }
@@ -5223,14 +5206,12 @@
5223 5206
         "wrappy": {
5224 5207
           "version": "1.0.2",
5225 5208
           "bundled": true,
5226
-          "dev": true,
5227
-          "optional": true
5209
+          "dev": true
5228 5210
         },
5229 5211
         "yallist": {
5230 5212
           "version": "3.0.3",
5231 5213
           "bundled": true,
5232
-          "dev": true,
5233
-          "optional": true
5214
+          "dev": true
5234 5215
         }
5235 5216
       }
5236 5217
     },

+ 9 - 0
src/api/member/member.js Näytä tiedosto

@@ -118,3 +118,12 @@ export function DeleteMemberShipCard(data) {
118 118
     data: data
119 119
   })
120 120
 }
121
+
122
+
123
+export function EditRight(data) {
124
+  return request({
125
+    url: '/api/membercard/right/edit',
126
+    method: 'put',
127
+    data: data
128
+  })
129
+}

+ 23 - 0
src/api/mpwechat/mpwechat.js Näytä tiedosto

@@ -0,0 +1,23 @@
1
+import request from '@/utils/request'
2
+
3
+export function GetAuthorizationInfo() {
4
+  return request({
5
+    url: '/api/mpwechat/authorization',
6
+    method: 'get',
7
+  })
8
+}
9
+
10
+export function GetAuthUrl() {
11
+  return request({
12
+    url: '/api/mpwechat/authurl',
13
+    method: 'get',
14
+  })
15
+}
16
+  
17
+export function GetMenus() {
18
+  return request({
19
+    url: '/api/mpwechat/menus',
20
+    method: 'get',
21
+  })
22
+}
23
+  

+ 6 - 0
src/router/modules/system.js Näytä tiedosto

@@ -17,6 +17,12 @@ export default {
17 17
       name: 'weixinMpAuth',
18 18
       meta: { title: '公众号授权', noCache: true }
19 19
     },
20
+    {
21
+      path: '/weixinmp/menus',
22
+      component: () => import('@/scrm_pages/weixinmp/menus'),
23
+      name: 'weixinMpMenus',
24
+      meta: { title: '公众号菜单', noCache: true }
25
+    },
20 26
     {
21 27
       path: '/Systemsetting/staffmanagement',
22 28
       component: () => import('@/scrm_pages/Systemsetting/staffmanagement'),

+ 21 - 1
src/scrm_pages/members/cards.vue Näytä tiedosto

@@ -2,7 +2,11 @@
2 2
   <div class="main-contain">
3 3
     <div class="position">
4 4
       <bread-crumb :crumbs='crumbs'></bread-crumb>
5
-      <el-button  style="float:right;" type="primary" size="small" icon="el-icon-circle-plus-outline" @click="openCreate">添加会员卡</el-button>
5
+      <el-col :span="5" style="text-align: right;">
6
+        <el-button type="primary" size="small" icon="el-icon-circle-plus-outline" @click="openCreate">添加会员卡</el-button>
7
+        <el-button  type="primary" size="small" icon="el-icon-setting" @click="openRight">会员权益配置</el-button>
8
+      </el-col>
9
+      
6 10
     </div>
7 11
     <div class="app-container">
8 12
         <div class="filter-container" style="margin-top: 10px;margin-left: 5px " id="member-cards-box">
@@ -29,6 +33,8 @@
29 33
         <create-card-form ref="createCardForm" :cardsData="cardsData" ></create-card-form>
30 34
         <!--create-card-form 编辑会员卡-->
31 35
         <edit-card-form ref="editCardForm" :cardsData="cardsData" :cardIndex="cardIndex" :form="editFormData"></edit-card-form>
36
+        <!--create-right-form 编辑权益-->
37
+        <edit-card-right-form ref="editCardRightForm"  :form="rightData" ></edit-card-right-form>
32 38
     </div>
33 39
   </div>
34 40
 </template>
@@ -38,6 +44,7 @@
38 44
   import BreadCrumb from '../components/bread-crumb';
39 45
   import CreateCardForm from "./components/CreateCardForm";
40 46
   import EditCardForm from "./components/EditCardForm";
47
+  import EditCardRightForm from "./components/EditCardRightForm";
41 48
 
42 49
   export default {
43 50
     name: 'memberCardList',
@@ -45,6 +52,7 @@
45 52
       BreadCrumb,
46 53
       CreateCardForm,
47 54
       EditCardForm,
55
+      EditCardRightForm
48 56
     },
49 57
     data(){
50 58
       return{
@@ -53,6 +61,9 @@
53 61
           { path: false, name: '会员卡管理' }
54 62
         ],
55 63
         cardsData:[],
64
+        rightData:{
65
+          rights: "",
66
+        },
56 67
         editFormData:{
57 68
             background_type:1,
58 69
             background:"#409EFF",
@@ -72,6 +83,12 @@
72 83
         openCreate:function(){
73 84
           this.$refs.createCardForm.open();
74 85
         },
86
+        // updateRightData(right){
87
+        //   this.rightData.rights = right;
88
+        // },
89
+        openRight(){
90
+          this.$refs.editCardRightForm.open();
91
+        },
75 92
         openEdit(row, index) {
76 93
           for (const key in this.editFormData) {
77 94
             this.editFormData[key] = row[key];
@@ -106,6 +123,9 @@
106 123
                 var res = response.data;
107 124
                 if(res.state===1) {
108 125
                     this.cardsData = res.data.cards;
126
+                    if (res.data.right) {
127
+                      this.rightData.rights = res.data.right.rights;
128
+                    }
109 129
                 }
110 130
             }).catch(e=>{})
111 131
         }

+ 77 - 0
src/scrm_pages/members/components/EditCardRightForm.vue Näytä tiedosto

@@ -0,0 +1,77 @@
1
+<template>
2
+    <div id="edit-card-form-box">
3
+        <el-dialog title="会员协议配置" :visible.sync="editRightFormVisible" width="900px" id="edit-member-right-show" v-loading="submitLoading" :element-loading-text="loadingText">
4
+            <el-form ref="rightForm" :model="form" label-width="100px" id="edit-member-right-form">
5
+                <el-form-item label="会员权益:"  prop="rights">
6
+                    <el-input v-model="form.rights" type="textarea" rows='6' placeholder="" ></el-input>
7
+                </el-form-item>
8
+            </el-form>
9
+            
10
+            <div slot="footer" class="dialog-footer">
11
+                <el-button @click="editRightFormVisible = false">取消</el-button>
12
+                <el-button
13
+                type="primary"
14
+                @click="submitForm('rightForm')"
15
+                >保 存
16
+                </el-button>
17
+            </div>
18
+        </el-dialog>  
19
+    </div>
20
+</template>
21
+
22
+<script>
23
+import {EditRight} from "@/api/member/member";
24
+
25
+export default {
26
+    name:'EditCardRightForm',
27
+    props:{
28
+        form:{
29
+            rights:'',
30
+        },
31
+    },
32
+    data(){
33
+        return {
34
+            editRightFormVisible:false,
35
+            loadingText:'',
36
+            submitLoading:false,
37
+            
38
+        }
39
+    },
40
+    methods:{
41
+        open:function(){
42
+            this.editRightFormVisible = true;
43
+        },
44
+        resetForm:function(formName) {
45
+            if (typeof(this.$refs[formName]) !='undefined') {
46
+                this.$refs[formName].resetFields();
47
+            }
48
+        },
49
+        submitForm:function(formName){
50
+            this.$refs[formName].validate((valid) => {
51
+                if (valid) {
52
+                    this.loadingText = "正在保存...";
53
+                    this.submitLoading = true;
54
+                    EditRight(this.form).then(response=>{
55
+                        var res = response.data;
56
+                        if(res.state === 1) {
57
+                            // this.$emit('update-right', res.data.right.rights);
58
+                            this.editRightFormVisible = false;
59
+                            this.$message.success("编辑成功");
60
+                        }else {
61
+                            this.$message.error(res.msg);
62
+                        }
63
+                        this.submitLoading = false;
64
+                    }).catch(e=>{
65
+                        this.submitLoading = false;
66
+                    });
67
+                } else {
68
+                    return false;
69
+                }
70
+            });
71
+        },
72
+    },
73
+    computed: {
74
+    
75
+    },
76
+}
77
+</script>

+ 76 - 9
src/scrm_pages/weixinmp/authorization.vue Näytä tiedosto

@@ -2,6 +2,7 @@
2 2
   <div class="main-contain">
3 3
     <div class="position">
4 4
       <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+      <el-button  style="float:right;" type="primary" size="small" :disabled="resetSubmit" icon="el-icon-refresh" @click="resetPage">刷新</el-button>
5 6
     </div>
6 7
     <div class="app-container" id="winxin-auth-box">
7 8
       <div class="filter-container" style="margin-top: 10px;margin-left: 5px ">
@@ -9,10 +10,10 @@
9 10
           <div class="bind-title-box">
10 11
             <span class="bind-title">您已绑定公众号,如需更换绑定公众号,请点击下面按钮</span>
11 12
           </div>
12
-          <el-button type="warning">更换绑定公众号</el-button>
13
+          <el-button type="warning" @click="getAuthUrl" >更换绑定公众号</el-button>
13 14
           <div class="bind-massage-box">
14 15
             <span>
15
-              授权公众号:{{authData.authorizer_nick_name}},类型:{{mpTypeName}},
16
+              授权公众号:{{authData.authorizer_nick_name}}
16 17
               <!--授权方公众号类型,0代表订阅号,1代表由历史老帐号升级后的订阅号,2代表服务号-->
17 18
               <!-- authorizer_service_type_info -->
18 19
             </span>
@@ -22,7 +23,7 @@
22 23
           <div class="bind-title-box">
23 24
             <span class="bind-title">您尚未绑定公众号</span>
24 25
           </div>
25
-          <el-button type="warning">已有公众号,立刻绑定</el-button>
26
+          <el-button type="warning" @click="getAuthUrl" >已有公众号,立刻绑定</el-button>
26 27
           <div class="bind-massage-box">
27 28
             <span>
28 29
               如果还没有公众号,需要先在微信公众号平台进行申请。 去
@@ -54,19 +55,33 @@
54 55
       <div style="height:20px">&nbsp;</div>
55 56
       <div class="dataTitle title-12">如何取消给酷医云的授权?</div>
56 57
       <div class="dataBody">
57
-        <p>公众号取消授权,进入微信后台,点击“+添加功能插件”,进入“授权管理”,就可以看到酷医云的授权,并且解除授权了。</p>
58
+        <p>公众号取消授权,进入微信后台,点击“设置-公众号设置-授权管理”,就可以看到酷医云的授权,并且解除授权了。</p>
58 59
       </div>
59 60
     </div>
61
+    <el-dialog
62
+      title="授权二维码"
63
+      :visible.sync="centerDialogVisible"
64
+      width="30%"
65
+      center>
66
+      <div style="text-align:center;">
67
+        <div><span>请用微信扫描下方二维码</span></div>
68
+        <div id="mpwechat-auth-qrcode" ref="qrcode" ></div>
69
+        <div><span>在手机完成授权后,点击右上角的刷新按钮</span></div>
70
+      </div>
71
+    </el-dialog>
72
+
60 73
   </div>
61 74
 </template>
62 75
 
63 76
 <script>
64 77
 import BreadCrumb from "../components/bread-crumb";
65
-
78
+import QRCode from 'qrcodejs2'  // 引入qrcode
79
+import {GetAuthorizationInfo,GetAuthUrl} from "@/api/mpwechat/mpwechat";
66 80
 export default {
67 81
   name: "authorization",
68 82
   components: {
69
-    BreadCrumb
83
+    BreadCrumb,
84
+    QRCode,
70 85
   },
71 86
   data() {
72 87
     return {
@@ -74,7 +89,9 @@ export default {
74 89
         { path: false, name: "系统设置" },
75 90
         { path: false, name: "公众号授权" }
76 91
       ],
77
-
92
+      showAuthButton:true,
93
+      centerDialogVisible:false,
94
+      resetSubmit:false,
78 95
       authData: {
79 96
         id: 0,
80 97
         user_org_id: 0,
@@ -97,8 +114,54 @@ export default {
97 114
       }
98 115
     };
99 116
   },
100
-  methods: {},
101
-  created() {},
117
+  methods: {
118
+    getAuthUrl:function(){
119
+      // this.showAuthButton = false;
120
+      GetAuthUrl().then(response=>{
121
+        var res =  response.data;
122
+        if (res.state===1) {
123
+          var url = res.data.url;
124
+          this.centerDialogVisible = true;
125
+          this.$nextTick (function () {
126
+            this.qrcode(url);
127
+          })
128
+        }else {
129
+          this.$message.error(res.msg);
130
+        }
131
+      }).catch(e=>{
132
+        
133
+        // this.showAuthButton = true;
134
+      });
135
+    },
136
+    qrcode(url) {
137
+      document.getElementById('mpwechat-auth-qrcode').innerHTML = ''
138
+      let qrcode = new QRCode('mpwechat-auth-qrcode', {
139
+        width: 150,  
140
+        height: 150,
141
+        text: url,
142
+        colorDark : "#000",
143
+        colorLight : "#fff",
144
+      })
145
+    },
146
+    resetPage(){
147
+      this.GetAuthorizationInfo();
148
+    },
149
+    GetAuthorizationInfo:function(){
150
+      GetAuthorizationInfo().then(response=>{
151
+        var res =  response.data;
152
+        if(res.state===1) {
153
+          if(res.data.authorization) {
154
+            this.authData = res.data.authorization;
155
+          }
156
+        }else {
157
+          this.$message.error(res.msg);
158
+        }
159
+      }).catch(e=>{});
160
+    },
161
+  },
162
+  created() {
163
+    this.GetAuthorizationInfo();
164
+  },
102 165
   computed:{
103 166
     mpTypeName:function(){
104 167
       return 'xx';
@@ -166,6 +229,10 @@ export default {
166 229
   font-size: 14px;
167 230
   line-height: 18px;
168 231
 }
232
+#mpwechat-auth-qrcode{
233
+  width: 150px;
234
+  margin: 5px auto;
235
+}
169 236
 /*.app-container .cell.clearfix .time ul li {*/
170 237
 /*float: left;*/
171 238
 /*list-style: none;*/

+ 687 - 0
src/scrm_pages/weixinmp/menus.vue Näytä tiedosto

@@ -0,0 +1,687 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+      <el-col :span="5" style="text-align: right;">
6
+        <el-button type="primary" size="small" icon="el-icon-upload">保存并发布</el-button>
7
+        <el-button  type="danger" size="small" icon="el-icon-delete" >停用菜单</el-button>
8
+      </el-col>
9
+    </div>
10
+    <div class="app-container" id="winxin-menus-box">
11
+      <div class="menu_tips clearfix">
12
+          <span class="ico_menu_tips fl"></span>  
13
+          <div class="menu_tips_txt fl">
14
+              <p>菜单编辑中</p>
15
+              <p>菜单不会即时发布,请确定菜单编辑完成后点击“保存并发布”同步到手机,若停用菜单,点击“停用菜单”</p>
16
+          </div>
17
+      </div>
18
+      <div class="menu_setting_area clearfix">
19
+          <div class="menu_preview_area fl">
20
+              <div class="mobile_menu_preview">
21
+                  <div class="mobile_hd">{{authData.authorizer_nick_name}}</div>
22
+                  <div class="mobile_bd">
23
+                      <ul class="pre_menu_list">
24
+                        <li class="jsMenu pre_menu_li"  :id="'menu_'+mi" v-for="(menu, mi) in menus.button" :key="mi" :class="mi==currentPatient&&currentChild==-1?'menu-active':''">
25
+                            <a href="javascript:void(0);" class="pre_menu_link jsMenuB" @click="selectItem(mi, -1, menu)"> <i class="icon_menu_dot "></i> <span class="js_l1Title_">{{menu.name}}</span> </a>
26
+                            <div class="sub_pre_menu_box" v-show="mi==currentPatient">
27
+                              <ul class="sub_pre_menu_list">
28
+                                <li class="jslevel2 jsSubMenu"   :id="'subMenu_menu_'+ mi + '_'+ni" v-for="(node, ni) in childrenNode(menu.sub_button)" :key="ni" :class="mi==currentPatient&&currentChild==ni?'menu-active':''"> 
29
+                                  <a href="javascript:void(0);" class="jsSubView jsSubMenuBtn" @click="selectItem(mi, ni, node)" > <span class="sub_pre_menu_inner "> <i class="icon20_common"></i> <span class="js_l2Title">{{node.name}}</span> </span> </a> 
30
+                                </li> 
31
+
32
+                                <li class="jslevel2 jsAddSubMenu" v-show="childrenNode(menu.sub_button).length<5"> 
33
+                                  <a href="javascript:void(0);" class="jsSubView"> <span class="sub_pre_menu_inner "> <i class="icon14_menu_add">+</i> </span> </a> 
34
+                                </li>
35
+                              </ul>
36
+                                <i class="arrow arrow_out"></i> 
37
+                                <i class="arrow arrow_in"></i> 
38
+                            </div> 
39
+                        </li>
40
+
41
+                          <li class="jsAddMenu pre_menu_li" v-show="menus.button.length<3">
42
+                              <a href="javascript:void(0);" class="pre_menu_link">
43
+                                  <i class="icon_menu_dot "></i>
44
+                                  <span class="js_l1Title_">
45
+                                      <i class="icon14_menu_add">+</i>
46
+                                  </span>
47
+                              </a>
48
+                              <div class="sub_pre_menu_box">
49
+                                  <ul class="sub_pre_menu_list">
50
+                                      <li class="jslevel2 jsAddSubMenu">
51
+                                          <a href="javascript:void(0);" class="jsSubView">
52
+                                              <span class="sub_pre_menu_inner ">
53
+                                                  <i class="icon14_menu_add">+</i>
54
+                                              </span>
55
+                                          </a>
56
+                                      </li>
57
+                                  </ul>
58
+                                  <i class="arrow arrow_out"></i>
59
+                                  <i class="arrow arrow_in"></i>
60
+                              </div>
61
+                          </li>
62
+
63
+                      </ul>
64
+                  </div>
65
+              </div>
66
+              <div class="sort_btn_wrp">
67
+              </div>
68
+          </div>
69
+          <div class="menu_form_area fl" v-show="currentPatient>=0&&currentMenu">
70
+              <div class="menu_form_inner">
71
+                  <h2 class="menu_form_tit clearfix">
72
+                      <span class="delate fr delete_menu">{{deleteButtonName()}}</span>
73
+                      <span class="global_info">{{showMenuName()}}</span>
74
+                  </h2>
75
+                  <div class="menu_form_item">
76
+                      <label for="" class="tit">菜单名称</label>
77
+                      <input type="text" class="name clearfix js_menu_name" id="menu_name_input" v-model="currentMenu.name" placeholder="请输入菜单名称" />
78
+                      <span class="tips" id="tips" v-show="!menuNameError">{{menuNameTip()}}</span>
79
+                      <span class="tips" id="errinfo" v-show="menuNameError" style="color: #f00;">{{menuNameTip()}}</span>
80
+                  </div>
81
+                  <div class="menu_form_item menu_more_info" v-show="currentMenu&&!currentMenu.sub_button">
82
+                      <div class="menu_form__nav clearfix">
83
+                          <label for="" class="tit">菜单内容</label>
84
+                          <el-radio-group v-model="menuType" class="radio_item">
85
+                            <el-radio v-for="(menu, index) in menuTypeOptions" :key="index" :label="menu.id" :value="menu.id">{{menu.name}}</el-radio>
86
+                          </el-radio-group>
87
+                      </div>
88
+                      <div class="menu_form__con">
89
+                        <div class="inner send_message " v-show="menuType==1">
90
+                            <div class="send_message_tit">
91
+                                <div class="send_nav">
92
+                                    <i class="ico_size"></i>
93
+                                    文字
94
+                                </div>
95
+                            </div>
96
+                            <textarea class="send_message_edit" id="click_menu_act" v-model="currentMenu.message" placeholder="请输入你需要的文字"></textarea>
97
+                            <span class="tips" id="acterrinfo" v-if="!messageError" >&nbsp;&nbsp;{{menuMessageTip}}</span>
98
+                            <span class="tips" id="acterrinfo" v-if="messageError"  style="color: #f00;">&nbsp;&nbsp;{{menuMessageTip}}</span>
99
+                        </div>
100
+                        <div class="inner jump_page " v-show="menuType==2">
101
+                            <span class="tips_size">订阅者点击该子菜单会跳到以下链接</span>
102
+                            <div>
103
+                              <label for="" class="address">页面地址:</label>
104
+                              <input type="text" id="view_menu_url" class="address_input " v-model="currentMenu.url" :title="currentMenu.url"/>
105
+                              <el-button type="primary" size="small" icon="el-icon-menu">选择地址</el-button>
106
+                            </div>
107
+                        </div>
108
+                        
109
+                        <div class="inner miniprogram " v-show="menuType==3">
110
+                            <span class="tips_size">订阅者点击该子菜单会跳到以下小程序</span>
111
+                            <div class="miniprogram-item">
112
+                              <label for="" class="address">APPID:</label>
113
+                              <input type="text" id="view_menu_url" class="address_input " v-model="currentMenu.appid" :title="currentMenu.appid"/>
114
+                              选择地址
115
+                            </div>
116
+                            <div class="miniprogram-item">
117
+                              <label for="" class="address">页面:</label>
118
+                              <input type="text" id="view_menu_url" class="address_input " v-model="currentMenu.pagepath" :title="currentMenu.pagepath"/>
119
+                              选择地址
120
+                            </div>
121
+                            <div class="miniprogram-item">
122
+                              <label for="" class="address">备用页面:</label>
123
+                              <input type="text" id="view_menu_url" class="address_input " v-model="currentMenu.url" :title="currentMenu.url"/>
124
+                              <span style="display:block;left:84px;position:relative;margin-top:10px;">旧版微信客户端不支持小程序,用户点击菜单时会打开该网页</span>
125
+                            </div>
126
+                        </div>
127
+                      </div>
128
+                  </div>
129
+              </div>
130
+          </div>
131
+      </div>
132
+    </div>
133
+  </div>
134
+</template>
135
+
136
+<script>
137
+import BreadCrumb from "../components/bread-crumb";
138
+import {GetAuthorizationInfo,GetMenus} from "@/api/mpwechat/mpwechat";
139
+export default {
140
+  name: "menus",
141
+  components: {
142
+    BreadCrumb,
143
+  },
144
+  data() {
145
+    return {
146
+      crumbs: [
147
+        { path: false, name: "系统设置" },
148
+        { path: false, name: "公众号菜单" }
149
+      ],
150
+      menuTypeOptions:[
151
+        {id:1, name:' 发送内容'},
152
+        {id:2, name:' 跳转网页'},
153
+        {id:3, name:' 跳转小程序'},
154
+      ],
155
+      initButtons:false,
156
+      menus:{button:[]},
157
+      currentMenu:{
158
+        type:'',
159
+        name:'',
160
+        url:'',
161
+        appid:'',
162
+        pagepath:'',
163
+        key:'',
164
+        message:'',
165
+        sub_button:[],
166
+        media_id:'',
167
+      },
168
+      menuType:0,
169
+      currentPatient:-1,
170
+      currentChild:-1,
171
+      menuNameError:false,
172
+      messageError:false,
173
+      menuMessageTip:'还可以输入 600 字',
174
+      authData: {
175
+        id: 0,
176
+        user_org_id: 0,
177
+        authorizer_appid: "",
178
+        authorizer_access_token: "",
179
+        authorizer_refresh_token: "",
180
+        authorizer_jsapi_ticket: "",
181
+        authorizer_funcscope_category: "",
182
+        authorizer_nick_name: "",
183
+        authorizer_head_img: "",
184
+        authorizer_service_type_info: 0,
185
+        authorizer_verify_type_info: 0,
186
+        authorizer_user_name: "",
187
+        authorizer_principal_name: "",
188
+        authorizer_business_info: "",
189
+        authorizer_qrcode_url: "",
190
+        created_time: "",
191
+        updated_time: "",
192
+        authorizer_status: 1
193
+      }
194
+    };
195
+  },
196
+  methods: {
197
+    GetAuthorizationInfo:function(){
198
+      GetAuthorizationInfo().then(response=>{
199
+        var res =  response.data;
200
+        if(res.state===1) {
201
+          if(res.data.authorization) {
202
+            this.authData = res.data.authorization;
203
+            if (this.authData.authorizer_status != 1) {
204
+              this.$message.error("公众号未授权给平台");
205
+              this.$router.push({path:"/weixinmp/authorization"})
206
+              return false;
207
+            }else {
208
+              this.initButtons = true;
209
+            }
210
+          }
211
+        }else {
212
+          this.$message.error(res.msg);
213
+        }
214
+      }).catch(e=>{});
215
+    },
216
+    GetMenus:function(){
217
+      GetMenus().then(response=>{
218
+        var res = response.data;
219
+        if (res.state == 1) {
220
+          if (res.data.menus){
221
+            this.menus = res.data.menus;
222
+          }
223
+        }else {
224
+          this.$message.error(res.msg);
225
+        }
226
+      }).catch(e=>{});
227
+    },
228
+    SetMenuType:function(){
229
+      switch (this.currentMenu.type) {
230
+        case 'media_id':
231
+        case 'click':
232
+          this.menuType = 1;
233
+          break;
234
+        case 'view':
235
+          this.menuType = 2;
236
+          break;
237
+        case 'miniprogram':
238
+          this.menuType = 3;
239
+          break;
240
+      
241
+        default:
242
+          this.menuType = 0;
243
+          break;
244
+      }
245
+    },
246
+    selectItem:function(mi, ni, node){
247
+      this.currentPatient = mi;
248
+      this.currentChild = ni;
249
+      for (const key in node) {
250
+        this.currentMenu[key] = node[key]; 
251
+      }
252
+      this.SetMenuType();
253
+    },
254
+    childrenNode:function(buttons) {
255
+      if (buttons) {
256
+        return buttons;
257
+      }else {
258
+        return [];
259
+      }
260
+    },
261
+    deleteButtonName:function() {
262
+      if(this.currentPatient>=0&&this.currentChild>=0) {
263
+        return '删除子菜单';
264
+      }
265
+      return '删除菜单';
266
+    },
267
+    showMenuName:function(){
268
+      if(this.currentMenu) {
269
+        return this.currentMenu.name;
270
+      }
271
+      return '菜单名称';
272
+    },
273
+    menuNameTip:function(){
274
+      if(this.currentPatient>=0&&this.currentChild>=0) {
275
+        return '字数不超过8个汉字或16个字母';
276
+      }else if (this.currentPatient>=0){
277
+        return '字数不超过4个汉字或8个字母';
278
+      }else {
279
+        return '';
280
+      }
281
+    },
282
+    
283
+    ChcekMenuNameError:function(){
284
+      if (this.currentPatient>=0&&this.currentChild>=0) {
285
+        var res = /^[a-zA-Z0-9]{1,16}$/.test((this.currentMenu.name  + '').replace(/[\u4e00-\u9fa5]/g, 'aa'));
286
+        this.menuNameError = !res;
287
+      } else if (this.currentPatient>=0){
288
+        var res = /^[a-zA-Z0-9]{1,8}$/.test((this.currentMenu.name + '').replace(/[\u4e00-\u9fa5]/g, 'aa'));
289
+        this.menuNameError = !res;
290
+      } else {
291
+        this.menuNameError = false;
292
+      }
293
+    }
294
+  },
295
+  created() {
296
+    this.GetAuthorizationInfo();
297
+  },
298
+  computed:{
299
+  },
300
+  watch:{
301
+    'initButtons':function(){
302
+      if (this.initButtons) {
303
+        this.GetMenus();
304
+      }
305
+    },
306
+    'currentMenu.name':function(){
307
+      this.ChcekMenuNameError();
308
+    },  
309
+    'currentMenu.message':function(){
310
+      var len = $.trim(this.currentMenu.message+'').length; 
311
+      var mt = 600-len;
312
+      if ( mt < 0) {
313
+        mt = len-600;
314
+        this.messageError = true;
315
+        this.menuMessageTip = '已超出 ' + mt + ' 字,内容将不会保存。';
316
+      }else {
317
+        this.messageError = false;
318
+        this.menuMessageTip = '还可以输入 ' + mt + ' 字';
319
+      }
320
+    },  
321
+  },
322
+};
323
+</script>
324
+
325
+<style scoped>
326
+#winxin-menus-box {
327
+  font-size: 14px;
328
+  color: #485b6d;
329
+}
330
+#winxin-menus-box .menu-active{
331
+  border: 1px solid rgb(68, 181, 73) !important;
332
+}
333
+#winxin-menus-box .menu_tips{
334
+  padding: 20px 0 18px 32px;
335
+    background: #f4f7fa;
336
+}
337
+#winxin-menus-box .clearfix {
338
+    clear: both;
339
+}
340
+#winxin-menus-box .clearfix:before {
341
+    display: table;
342
+    content: " ";
343
+}
344
+#winxin-menus-box .menu_tips .ico_menu_tips {
345
+    width: 36px;
346
+    height: 36px;
347
+    background: url('https://images.shengws.com/icos-201906141103.png') no-repeat -691px -548px;
348
+    display: block;
349
+    margin-right: 11px;
350
+}
351
+#winxin-menus-box .fl {
352
+    float: left;
353
+}
354
+#winxin-menus-box .menu_setting_area {
355
+    padding: 42px 0 0 50px;
356
+    display: flex;
357
+}
358
+#winxin-menus-box .menu_preview_area {
359
+    width: 284px;
360
+    border: 1px solid #e7e7eb;
361
+    position: relative;
362
+}
363
+
364
+#winxin-menus-box .mobile_menu_preview {
365
+    position: relative;
366
+    width: 284px;
367
+    height: 580px;
368
+    background: transparent url("https://images.shengws.com/bg_mobile_head_default3a7b38.png") no-repeat 0 0;
369
+    background-position: 0 0;
370
+    background-size:100%;
371
+}
372
+#winxin-menus-box .mobile_menu_preview .mobile_hd {
373
+    padding: 30px 0 0 20px;
374
+    text-align: center;
375
+    color: #fff;
376
+}
377
+#winxin-menus-box .menu_preview_area .pre_menu_list {
378
+    position: absolute;
379
+    bottom: 0;
380
+    left: 0;
381
+    right: 0;
382
+    border-top: 1px solid #e7e7eb;
383
+    background: transparent url("https://images.shengws.com/bg_mobile_foot_default3a7b38.png") no-repeat 0 0;
384
+    background-position: 0 0;
385
+    background-repeat: no-repeat;
386
+    padding-left: 43px;
387
+}
388
+#winxin-menus-box ul, #winxin-menus-boxol {
389
+    list-style: none;
390
+}
391
+#winxin-menus-box .radio_item {
392
+  margin: 13px 0;
393
+}
394
+#winxin-menus-box .mobile_bd .pre_menu_list .pre_menu_li {
395
+    border-right: 1px #e5e8ea solid;
396
+    height: 50px;
397
+    line-height: 50px;
398
+    float: left;
399
+    text-align: center;
400
+    width: 33%;
401
+    position: relative;
402
+}
403
+#winxin-menus-box .mobile_bd .pre_menu_list li a {
404
+    display: block;
405
+    width: auto;
406
+    overflow: hidden;
407
+    text-overflow: ellipsis;
408
+    word-wrap: normal;
409
+    text-decoration: none;
410
+    color: #54657e;
411
+    white-space: nowrap;
412
+}
413
+#winxin-menus-box .menu_preview_area .sub_pre_menu_box {
414
+    bottom: 60px;
415
+    border-top-width: 0;
416
+    position: absolute;
417
+    left: 0;
418
+    width: 100%;
419
+    border: 1px solid #d0d0d0;
420
+    background-color: #fff;
421
+}
422
+#winxin-menus-box  ul ul {
423
+    margin-bottom: 0;
424
+}
425
+#winxin-menus-box .sub_pre_menu_box .jslevel2 {
426
+    line-height: 44px;
427
+    border: 1px solid transparent;
428
+    margin: 0 -1px -1px;
429
+}
430
+#winxin-menus-box .sub_pre_menu_box .jslevel2 .jsSubView {
431
+    padding: 0 .5em;
432
+    display: block;
433
+    overflow: hidden;
434
+    text-overflow: ellipsis;
435
+    white-space: nowrap;
436
+    word-wrap: normal;
437
+    color: #616161;
438
+    text-decoration: none;
439
+}
440
+#winxin-menus-box .mobile_bd .pre_menu_list li a {
441
+    display: block;
442
+    width: auto;
443
+    overflow: hidden;
444
+    text-overflow: ellipsis;
445
+    word-wrap: normal;
446
+    text-decoration: none;
447
+    color: #54657e;
448
+    white-space: nowrap;
449
+}
450
+#winxin-menus-box .menu_preview_area .sub_pre_menu_inner {
451
+    display: block;
452
+    border-top: 1px solid #e7e7eb;
453
+    width: auto;
454
+    overflow: hidden;
455
+    text-overflow: ellipsis;
456
+    white-space: nowrap;
457
+    word-wrap: normal;
458
+    cursor: pointer;
459
+}
460
+#winxin-menus-box .menu_preview_area .icon14_menu_add {
461
+    font-size: 26px;
462
+    color: #d0d4d7;
463
+    font-weight: 700;
464
+}
465
+#winxin-menus-box .sub_pre_menu_box .arrow_out {
466
+    bottom: -6px;
467
+    display: inline-block;
468
+    width: 0;
469
+    height: 0;
470
+    border-width: 6px;
471
+    border-style: dashed;
472
+    border-color: transparent;
473
+    border-bottom-width: 0;
474
+    border-top-color: #d0d0d0;
475
+    border-top-style: solid;
476
+    position: absolute;
477
+    left: 50%;
478
+    margin-left: -6px;
479
+}
480
+#winxin-menus-box .sub_pre_menu_box .arrow_in {
481
+    bottom: -5px;
482
+    display: inline-block;
483
+    width: 0;
484
+    height: 0;
485
+    border-width: 6px;
486
+    border-style: dashed;
487
+    border-color: transparent;
488
+    border-bottom-width: 0;
489
+    border-top-color: #fafafa;
490
+    border-top-style: solid;
491
+    position: absolute;
492
+    left: 50%;
493
+    margin-left: -6px;
494
+}
495
+#winxin-menus-box .arrow {
496
+    float: right;
497
+    margin-top: 9px;
498
+    margin-right: 8px;
499
+    color: #909399;
500
+}
501
+
502
+#winxin-menus-box .menu_form_area {
503
+    margin-left: 26px;
504
+    border: 1px #dee2e5 solid;
505
+    background: #f4f7fa;
506
+    flex: 1;
507
+}
508
+#winxin-menus-box .menu_form_inner {
509
+    padding: 0 16px 30px 18px;
510
+}
511
+#winxin-menus-box .menu_setting_area .menu_form_tit {
512
+    height: 38px;
513
+    line-height: 38px;
514
+    border-bottom: 1px #e5e8ea solid;
515
+    color: #485b6d;
516
+    font-size: 14px;
517
+    margin-bottom: 29px;
518
+}
519
+#winxin-menus-box .menu_form_tit .delate {
520
+    color: #485b6d;
521
+    font-size: 13px;
522
+    cursor: pointer;
523
+}
524
+#winxin-menus-box .fr {
525
+    float: right;
526
+}
527
+#winxin-menus-box .menu_form_inner .menu_form_item {
528
+    padding-bottom: 20px;
529
+}
530
+#winxin-menus-box .menu_form_inner .menu_form_item .tit {
531
+    font-size: 13px;
532
+    color: #485b6d;
533
+    margin-right: 15px;
534
+    font-weight: normal;
535
+    display: block;
536
+    float: left;
537
+    height: 40px;
538
+    line-height: 40px;
539
+    width: 68px;
540
+    text-align: right;
541
+}
542
+#winxin-menus-box label {
543
+    display: inline-block;
544
+    max-width: 100%;
545
+    margin-bottom: 0;
546
+    font-weight: normal;
547
+}
548
+#winxin-menus-box .menu_form_inner .menu_form_item .name {
549
+    width: 377px;
550
+    height: 38px;
551
+    border: 1px #dee2e5 solid;
552
+    padding-left: 18px;
553
+    font-size: 12px;
554
+    color: #c1c9d3;
555
+    border-radius: 4px;
556
+    color: #485b6d;
557
+}
558
+#winxin-menus-box input {
559
+    outline: none;
560
+}
561
+#winxin-menus-box input, #winxin-menus-box select, #winxin-menus-box textarea {
562
+    outline: none;
563
+    font-family: "Microsoft YaHei";
564
+    filter: chroma(color=#FFF);
565
+    padding: 0px;
566
+}
567
+#winxin-menus-box input, #winxin-menus-box select {
568
+    vertical-align: middle;
569
+}
570
+#winxin-menus-box .menu_form_inner .menu_form_item .tips {
571
+    display: block;
572
+    font-size: 13px;
573
+    color: #c0c8d4;
574
+    height: 30px;
575
+    line-height: 30px;
576
+}
577
+#winxin-menus-box .menu_form_inner .menu_form_item {
578
+    padding-bottom: 20px;
579
+}
580
+#winxin-menus-box .radio_item li {
581
+    float: left;
582
+    margin-right: 25px;
583
+    color: #2c3e50;
584
+    cursor: pointer;
585
+    line-height: 36px;
586
+    height: 36px;
587
+    position: relative;
588
+}
589
+#winxin-menus-box .menu_form__nav .radio_item li .type_radio {
590
+    width: 20px;
591
+    height: 20px;
592
+    margin-right: 10px;
593
+}
594
+#winxin-menus-box .radio_item li .type_radio {
595
+    appearance: none;
596
+    -moz-appearance: none;
597
+    -webkit-appearance: none;
598
+}
599
+#winxin-menus-box input[type=radio] {
600
+    margin: 0 0 0;
601
+}
602
+#winxin-menus-box .radio_item li.active .radio_name {
603
+    color: #58a2ec;
604
+}
605
+#winxin-menus-box .radio_item li.active .ico_radio {
606
+    background: url('https://images.shengws.com/icos-201906141103.png') no-repeat -171px -348px;
607
+}
608
+#winxin-menus-box .menu_form_item .menu_form__con {
609
+    background: #fff;
610
+    border: 1px #dee2e5 solid;
611
+    border-radius: 4px;
612
+}
613
+#winxin-menus-box .menu_form__con .active {
614
+    display: block;
615
+}
616
+#winxin-menus-box .menu_form_item .menu_form__con .send_message_tit {
617
+    font-size: 13px;
618
+    color: #485b6d;
619
+    padding: 10px 38px;
620
+    border-bottom: 1px #e5e8ea solid;
621
+}
622
+#winxin-menus-box .menu_form_item .send_message_tit .send_nav {
623
+    width: 80px;
624
+}
625
+#winxin-menus-box .menu_form_item .send_message_tit .ico_size {
626
+    width: 14px;
627
+    height: 18px;
628
+    background: url('https://images.shengws.com/icos-201906141103.png') -716px -310px;
629
+    display: block;
630
+    float: left;
631
+    margin-right: 10px;
632
+}
633
+#winxin-menus-box .menu_form__con .send_message_edit {
634
+    padding: 15px;
635
+    width: 100%;
636
+    height: 100%;
637
+    display: block;
638
+    border: 1px #fff solid;
639
+    height: 160px;
640
+}
641
+#winxin-menus-box .menu_form_inner .menu_form_item .tips {
642
+    display: block;
643
+    font-size: 13px;
644
+    color: #c0c8d4;
645
+    height: 30px;
646
+    line-height: 30px;
647
+}
648
+#winxin-menus-box .menu_form__con .jump_page, #winxin-menus-box .menu_form__con .miniprogram {
649
+    padding: 22px 0 50px 20px;
650
+}
651
+
652
+#winxin-menus-box .menu_form__con .miniprogram .miniprogram-item  {
653
+  margin: 10px 0; 
654
+}
655
+#winxin-menus-box .menu_form__con .jump_page .tips_size, #winxin-menus-box .menu_form__con .miniprogram .tips_size {
656
+    color: #7b8a97;
657
+    display: block;
658
+    margin-bottom: 14px;
659
+}
660
+#winxin-menus-box .menu_form__con .jump_page .address, #winxin-menus-box .menu_form__con .miniprogram .address {
661
+    font-weight: normal;
662
+    margin-right: 10px;
663
+    width: 70px;
664
+}
665
+#winxin-menus-box .menu_form__con .jump_page .address_input,#winxin-menus-box .menu_form__con .miniprogram .address_input {
666
+    width: 377px;
667
+    height: 38px;
668
+    border: 1px #dee2e5 solid;
669
+    padding-left: 18px;
670
+    font-size: 12px;
671
+    color: #c1c9d3;
672
+    border-radius: 4px;
673
+    color: #485b6d;
674
+    vertical-align: middle;
675
+}
676
+/*.app-container .cell.clearfix .time ul li {*/
677
+/*float: left;*/
678
+/*list-style: none;*/
679
+/*cursor: pointer;*/
680
+/*padding: 6px 20px;*/
681
+/*color: #606266;*/
682
+/*border-radius: 4px;*/
683
+/*margin: 0 8px 0 0;*/
684
+/*font-size: 14px;*/
685
+/*text-align: center;*/
686
+/*}*/
687
+</style>