Parcourir la source

Merge branch 'master' of http://git.shengws.com/zhangbj/scrm-vue

xiaoming_global il y a 5 ans
Parent
révision
bfbaeee208

+ 1 - 1
config/index.js Voir le fichier

@@ -18,8 +18,8 @@ module.exports = {
18 18
     // if you want dev by ip, please set host: '0.0.0.0'
19 19
 
20 20
     host: 'test1.sgjyun.com',
21
-    // host: 'jk.kuyicloud.com',
22 21
     port: 8090, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
22
+    host: 'test1.sgjyun.com',
23 23
     autoOpenBrowser: true,
24 24
     errorOverlay: true,
25 25
     notifyOnErrors: false,

+ 14 - 33
package-lock.json Voir le fichier

@@ -3495,9 +3495,9 @@
3495 3495
       "dev": true
3496 3496
     },
3497 3497
     "element-ui": {
3498
-      "version": "2.7.2",
3499
-      "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.7.2.tgz",
3500
-      "integrity": "sha512-Exh9QTkm9gwMMPzg1TyaTlBKyr3k4K9XcC5vl0A/mneDvJX//RsURGuOWsCNDVQMdhh5h9e+W5icosh+pKfbCg==",
3498
+      "version": "2.9.1",
3499
+      "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.9.1.tgz",
3500
+      "integrity": "sha512-w8vrCW5Q+2gfDzs19MUrFdnCy5IjF98rs7DBsKnJQKFfZJZiZ2O+YAsSp/EuPrCm3P/2o/N3MtvZ34VANel13g==",
3501 3501
       "requires": {
3502 3502
         "async-validator": "~1.8.1",
3503 3503
         "babel-helper-vue-jsx-merge-props": "^2.0.0",
@@ -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
     },

+ 1 - 1
package.json Voir le fichier

@@ -44,7 +44,7 @@
44 44
     "driver.js": "0.5.2",
45 45
     "dropzone": "5.2.0",
46 46
     "echarts": "3.8.5",
47
-    "element-ui": "^2.7.2",
47
+    "element-ui": "^2.9.1",
48 48
     "file-saver": "1.3.3",
49 49
     "font-awesome": "4.7.0",
50 50
     "js-cookie": "2.2.0",

+ 21 - 0
src/api/activity/activity.js Voir le fichier

@@ -11,4 +11,25 @@ export function fetchActivities(page, keyword, status) {
11 11
     method: 'get',
12 12
     params: params,
13 13
   })
14
+}
15
+
16
+export function fetchActivity(id) {
17
+  return request({
18
+    url: "/api/activity",
19
+    method: "get",
20
+    params: {
21
+      id: id,
22
+    }
23
+  })
24
+}
25
+
26
+export function submitActivity(publish, activity) {
27
+  return request({
28
+    url: "/api/activity/submit",
29
+    method: "post",
30
+    params: {
31
+      publish: publish,
32
+    },
33
+    data: activity,
34
+  })
14 35
 }

+ 9 - 0
src/api/member/member.js Voir le fichier

@@ -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
+}

+ 30 - 0
src/api/mpwechat/mpwechat.js Voir le fichier

@@ -0,0 +1,30 @@
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
+
24
+export function SaveMenus(data) {
25
+  return request({
26
+    url: '/api/mpwechat/savemenus',
27
+    method: 'put',
28
+    data:data,
29
+  })
30
+}

BIN
src/assets/home/wei.jpg Voir le fichier


BIN
src/assets/preview/new-1.png Voir le fichier


+ 1 - 0
src/components/Neditor/index.vue Voir le fichier

@@ -39,6 +39,7 @@
39 39
       selectionchange() {
40 40
         this.ue.addListener('selectionchange', () => {
41 41
           this.content = this.ue.getContent()
42
+          this.$emit("content_changed", this.content)
42 43
         })
43 44
       },
44 45
 

+ 1 - 1
src/icons/svg/dashboard.svg Voir le fichier

@@ -1 +1 @@
1
-<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1559132638469" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1438" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M563.197497 0 460.802503 0 0.012259 486.388227c0 0 0.901006 102.396016 51.200051 102.396016s76.797012 0 76.797012 0 0 232.496449 0 332.816677c0 100.300818 102.397038 102.399081 102.397038 102.399081l204.79714 0c0 0 0-272.419617 0-358.416702 0-25.647017 25.600026-25.600026 25.600026-25.600026l102.394994 0c0 0 25.601047 0.851972 25.601047 25.600026 0 92.198911 0 358.416702 0 358.416702s99.647027 0 204.795097 0c105.147048 0 102.398059-102.399081 102.398059-102.399081L895.992721 563.185239c0 0 27.19875 0 76.799055 0 49.59724 0 51.195965-76.79599 51.195965-76.79599L563.197497 0z" p-id="1439" fill="#bfcbd9"></path></svg>
1
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1559805368038" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2337" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M405.923568 101.722776C279.295566 206.825532 205.614449 276.459472 95.310228 397.352867c-27.430746 35.963073-22.976294 102.870926 0 102.870926 71.362304 0 102.870926 0 102.870926 0s0 128.160915 0 257.177314c0 37.830607 5.390777 102.869902 45.196365 102.869902 65.173348 0 160.544463 0 160.544463 0L403.921981 603.088578l205.741851 0 0 257.18243c0 0 83.145675 0 148.308791 0 29.956266 0 57.43306-27.219945 57.43306-102.869902 0-132.344191 0-257.177314 0-257.177314s40.329521 0 102.869902 0c30.588669 0 35.552727-72.79084 0-102.870926C817.308009 294.65795 703.651436 195.340967 593.641927 105.117083 506.79393 37.305651 459.622584 46.296419 405.923568 101.722776z" p-id="2338"></path></svg>

+ 2 - 1
src/lang/en.js Voir le fichier

@@ -114,7 +114,8 @@ export default {
114 114
     marketingTool: "marketing tools",
115 115
     activityList: "activity list",
116 116
     activityPublish: "publish activity",
117
-    systemsetting:'Systemsetting'
117
+    activityModify: "edit activity",
118
+    systemsetting:'Systemsetting',
118 119
   },
119 120
   navbar: {
120 121
     logOut: 'Log Out',

+ 2 - 1
src/lang/zh.js Voir le fichier

@@ -162,8 +162,9 @@ export default {
162 162
     marketingTool: "营销工具",
163 163
     activityList: "活动列表",
164 164
     activityPublish: "发布活动",
165
+    activityModify: "编辑活动",
165 166
     systemsetting:'系统设置',
166
-    staffmanagement:'员工管理'
167
+    staffmanagement:'员工管理',
167 168
   },
168 169
   navbar: {
169 170
     logOut: '退出登录',

+ 3 - 1
src/router/index.js Voir le fichier

@@ -12,6 +12,7 @@ import member from './modules/member'
12 12
 import org from './modules/org'
13 13
 import marketing_tool from './modules/marketing_tool'
14 14
 import system from './modules/system'
15
+import site from './modules/site'
15 16
 
16 17
 /** note: submenu only apppear when children.length>=1
17 18
  *   detail see  https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
@@ -77,7 +78,8 @@ var _asy_router_map = [
77 78
   marketing_tool,
78 79
   org,
79 80
   role,
80
-  system
81
+  system,
82
+  site
81 83
 ]
82 84
 
83 85
 var is_asy_router = process.env.NODE_ENV === 'production' // true; 设置为 true 强制进行路由验证

+ 11 - 0
src/router/modules/marketing_tool.js Voir le fichier

@@ -28,5 +28,16 @@ export default {
28 28
         noCache: true
29 29
       }
30 30
     },
31
+    {
32
+      path: '/activity/modify',
33
+      hidden: true,
34
+      is_menu: false,
35
+      component: () => import('@/scrm_pages/marketing_tool/activity_publish'),
36
+      name: 'activityModify',
37
+      meta: {
38
+        title: 'activityModify',
39
+        noCache: true
40
+      }
41
+    },
31 42
   ]
32 43
 }

+ 20 - 0
src/router/modules/site.js Voir le fichier

@@ -0,0 +1,20 @@
1
+import Layout from '@/views/layout/Layout'
2
+
3
+export default {
4
+  path: '',
5
+  component: Layout,
6
+  redirect: '/site',
7
+  children: [{
8
+    path: '/site',
9
+    component: () => import('@/scrm_pages/site/index'),
10
+    name: 'site',
11
+    meta: {
12
+      title: '微网站',
13
+      icon: 'dashboard',
14
+      noCache: true
15
+    }
16
+  },
17
+  { path: '/site/preview', component: () => import('@/scrm_pages/site/preview'), name: '预览', meta: { title: 'preview' }, hidden: true, is_menu: false }
18
+
19
+  ]
20
+}

+ 6 - 0
src/router/modules/system.js Voir le fichier

@@ -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'),

+ 54 - 2
src/scrm_pages/marketing_tool/activity_publish.vue Voir le fichier

@@ -6,10 +6,10 @@
6 6
         <div class="app-container" style="padding: 0 20px; background-color: #f6f8f9;">
7 7
             <div class="edit-main">
8 8
                 <div class="preview-panel">
9
-                    <preview-form></preview-form>
9
+                    <preview-form :activity="activity" :paragraph="activity_paragraph"></preview-form>
10 10
                 </div>
11 11
                 <div class="edit-panel">
12
-                    <edit-form></edit-form>
12
+                    <edit-form ref="edit_form" :activity="activity" :paragraph="activity_paragraph"></edit-form>
13 13
                 </div>
14 14
             </div>
15 15
         </div>
@@ -20,6 +20,7 @@
20 20
 import BreadCrumb from "@/scrm_pages/components/bread-crumb";
21 21
 import PreviewForm from "@/scrm_pages/marketing_tool/components/edit_activity_preview_form"
22 22
 import EditForm from "@/scrm_pages/marketing_tool/components/edit_activity_edit_form"
23
+import { fetchActivity } from "@/api/activity/activity"
23 24
 
24 25
 export default {
25 26
     name: "ActivityPublish",
@@ -34,6 +35,57 @@ export default {
34 35
                 { path: false, name: "营销工具" },
35 36
                 { path: false, name: "发布活动" }
36 37
             ],
38
+
39
+            activity: {
40
+                id: 0,
41
+                poster_photo: "",
42
+                title: "",
43
+                subtitle: "",
44
+                address: "",
45
+                limit_num: 0,
46
+                sign_up_deadline: 0,
47
+                start_time: 0,
48
+                phone_number: "",
49
+                sign_up_notice: "",
50
+            },
51
+            activity_paragraph: {
52
+                title: "",
53
+                content: "",
54
+            }
55
+        }
56
+    },
57
+    created() {
58
+        var id = this.$route.query.id
59
+        if (id != undefined) {
60
+            fetchActivity(id).then(rs => {
61
+                var resp = rs.data
62
+                if (resp.state == 1) {
63
+                    // console.log(resp.data)
64
+                    var activity = resp.data.activity
65
+                    this.activity.id = activity.id
66
+                    this.activity.poster_photo = activity.poster_photo
67
+                    this.activity.title = activity.title
68
+                    this.activity.subtitle = activity.subtitle
69
+                    this.activity.address = activity.address
70
+                    this.activity.limit_num = activity.limit_num
71
+                    this.activity.sign_up_deadline = activity.sign_up_deadline * 1000
72
+                    this.activity.start_time = activity.start_time * 1000
73
+                    this.activity.phone_number = activity.phone_number
74
+                    this.activity.sign_up_notice = activity.sign_up_notice
75
+
76
+                    var paragraph = resp.data.paragraph
77
+                    this.activity_paragraph.title = paragraph.title
78
+                    this.activity_paragraph.content = paragraph.content
79
+
80
+                    this.$refs.edit_form.initForms()
81
+
82
+                } else {
83
+                    this.$message.error(resp.msg)
84
+                }
85
+
86
+            }).catch(err => {
87
+                this.$message.error(err)
88
+            })
37 89
         }
38 90
     },
39 91
 }

+ 1 - 1
src/scrm_pages/marketing_tool/components/drafts_cell.vue Voir le fichier

@@ -10,7 +10,7 @@
10 10
                 <a href="/">{{ activity.title }}</a>
11 11
             </h3>
12 12
             <div class="operation">
13
-                <el-button type="primary" size="small" icon="el-icon-edit-outline">编辑</el-button>
13
+                <el-button type="primary" size="small" icon="el-icon-edit-outline" @click="$router.push({ path: '/activity/modify', query: {id: activity.id} })">编辑</el-button>
14 14
                 <el-button type="danger" size="small" icon="el-icon-delete">删除</el-button>
15 15
             </div>
16 16
         </div>

+ 403 - 1
src/scrm_pages/marketing_tool/components/edit_activity_edit_form.vue Voir le fichier

@@ -1,14 +1,416 @@
1 1
 <template>
2
-    <div></div>
2
+    <div class="edit-form-main">
3
+        <div class="form-title">
4
+            <img class="icon" src="@/assets/img/sa_7.png" />
5
+            <span>活动编辑</span>
6
+        </div>
7
+        <div class="form-content">
8
+            <div class="module-panel">
9
+                <p class="module-title">
10
+                    <img src="@/assets/img/sa_13.png" />
11
+                    基本信息
12
+                </p>
13
+                <div class="module-item">
14
+                    <label class="item-title">海报</label>
15
+                    <div class="poster-photo-panel">
16
+                        <el-input v-model="poster_photo_file_name" :readonly="true" class="input"></el-input>
17
+                        <el-upload 
18
+                        action="https://upload.qiniup.com" 
19
+                        :data="{ token: qntoken, key: poster_photo_file_key }"
20
+                        :show-file-list="false"
21
+                        :on-error="posterPhotoUploadFail"
22
+                        :on-success="posterPhotoUploadSuccess"
23
+                        :before-upload="beforePosterPhotoUpload"
24
+                        >
25
+                            <el-button type="primary" style="margin-left: 10px;" :loading="uploading_poster_photo">上传图片</el-button>
26
+                        </el-upload>
27
+                    </div>
28
+                </div>
29
+                <div class="poster-photo-hint">图片建议尺寸828*430,大小不超过3M</div>
30
+                <div class="module-item">
31
+                    <label class="item-title">标题</label>
32
+                    <el-input v-model="activity.title" class="item-input"></el-input>
33
+                </div>
34
+                <div class="module-item">
35
+                    <label class="item-title">名称</label>
36
+                    <el-input v-model="activity.subtitle" class="item-input"></el-input>
37
+                </div>
38
+                <div class="module-item">
39
+                    <label class="item-title">商户简称</label>
40
+                    <el-input v-model="$store.getters.xt_user.org.org_name" class="item-input" readonly></el-input>
41
+                </div>
42
+                <div class="module-item">
43
+                    <label class="item-title">报名时间</label>
44
+                    <el-date-picker v-model="sign_up_deadline" :picker-options="pickerOptions" value-format="timestamp" type="datetime" format="yyyy-MM-dd HH:mm" class="item-input"></el-date-picker>
45
+                </div>
46
+                <div class="module-item">
47
+                    <label class="item-title">活动时间</label>
48
+                    <el-date-picker v-model="activity_time" :picker-options="pickerOptions" value-format="timestamp" type="datetime" format="yyyy-MM-dd HH:mm" class="item-input"></el-date-picker>
49
+                </div>
50
+                <div class="module-item">
51
+                    <label class="item-title">活动地址</label>
52
+                    <el-input v-model="activity.address" class="item-input"></el-input>
53
+                </div>
54
+                <div class="module-item">
55
+                    <label class="item-title">限定人数</label>
56
+                    <el-input v-model="limit_num" class="item-input" :maxlength="9" @keyup.native="limit_num=limit_num.replace(/\D/g,'')" @afterpaste.native="limit_num=limit_num.replace(/\D/g,'')"></el-input>
57
+                    <span class="limit-text">不填写默认为无限制</span>
58
+                </div>
59
+                <div class="module-item">
60
+                    <label class="item-title">联系方式</label>
61
+                    <el-input v-model="activity.phone_number" class="item-input"></el-input>
62
+                </div>
63
+            </div>
64
+
65
+            <div class="module-panel" style="margin-top: 30px;">
66
+                <p class="module-title">
67
+                    <img src="@/assets/img/sa_13.png" />
68
+                    报名须知
69
+                </p>
70
+                <div class="module-item">
71
+                    <label class="item-title">报名须知</label>
72
+                    <el-input v-model="activity.sign_up_notice" class="item-input" type="textarea" :rows="4" resize="none"></el-input>
73
+                </div>
74
+            </div>
75
+
76
+            <div class="module-panel" style="margin-top: 30px;">
77
+                <p class="module-title">
78
+                    <img src="@/assets/img/sa_13.png" />
79
+                    详细说明
80
+                </p>
81
+                <div class="module-item">
82
+                    <label class="item-title">标题</label>
83
+                    <el-input v-model="paragraph.title" class="item-input"></el-input>
84
+                </div>
85
+                <div class="module-item">
86
+                    <label class="item-title">详情</label>
87
+                    <div class="item-input">
88
+                        <keep-alive>
89
+                            <neditor ref="neditor" id="editor" :r_content="paragraph_init_content" @content_changed="paragraphContentChanged"></neditor>
90
+                        </keep-alive>
91
+                    </div>
92
+                </div>
93
+            </div>
94
+
95
+            <div class="submit-button-panel">
96
+                <el-button style="padding: 10px 30px;" type="primary" @click="publishAction" :loading="publishing_activity" :disabled="saving_activity || saving_before_preview_activity">发 布</el-button>
97
+                <el-button style="color: #409eff; border-color: #409eff; padding: 10px 30px;" @click="saveAction" :loading="saving_activity" :disabled="publishing_activity || saving_before_preview_activity">保存草稿</el-button>
98
+                <el-button style="color: #409eff; border-color: #409eff; padding: 10px 30px;" :loading="saving_before_preview_activity" :disabled="publishing_activity || saving_activity">预 览</el-button>
99
+            </div>
100
+        </div>
101
+    </div>
3 102
 </template>
4 103
 
5 104
 <script>
105
+import Neditor from '@/components/Neditor'
106
+import { getToken } from "@/api/qiniu"
107
+import { getFileExtension } from "@/utils/tools"
108
+import { parseTime } from "@/utils"
109
+import { submitActivity } from "@/api/activity/activity"
110
+
6 111
 export default {
7 112
     name: "EditActivityEditForm",
113
+    components: {
114
+        Neditor,
115
+    },
116
+    props: {
117
+        activity: {
118
+            type: Object,
119
+            required: true,
120
+        },
121
+        paragraph: {
122
+            type: Object,
123
+            required: true,
124
+        },
125
+    },
126
+    data() {
127
+        return {
128
+            saving_activity: false,
129
+            publishing_activity: false,
130
+            saving_before_preview_activity: false,
131
+
132
+            uploading_poster_photo: false,
133
+            qntoken: "",
134
+            poster_photo_file_key: "",
135
+            poster_photo_file_name: "",
136
+
137
+            limit_num: "",
138
+            activity_time: 0,
139
+            sign_up_deadline: 0,
140
+            paragraph_init_content: "",
141
+
142
+            pickerOptions: {
143
+                disabledDate: (time) => {
144
+                    return time.getTime() < Date.now() - 8.64e7
145
+                }
146
+            }
147
+        }
148
+    },
149
+    created() {
150
+        this.activity_time = (new Date()).getTime()
151
+        this.sign_up_deadline = (new Date()).getTime()
152
+    },
153
+    watch: {
154
+        limit_num: function(new_val) {
155
+            if (/^[1-9]+[0-9]*]*$/.test(new_val)) {
156
+                this.activity.limit_num = parseInt(new_val)
157
+            } else {
158
+                this.activity.limit_num = 0
159
+            }
160
+        },
161
+        activity_time: function(new_val) {
162
+            this.activity.start_time = parseInt(new_val / 1000)
163
+        },
164
+        sign_up_deadline: function(new_val) {
165
+            this.activity.sign_up_deadline = parseInt(new_val / 1000)
166
+        },
167
+    },
168
+    methods: {
169
+        initForms: function() {
170
+            this.poster_photo_file_name = this.activity.poster_photo
171
+            this.limit_num = this.activity.limit_num > 0 ? this.activity.limit_num : ""
172
+            this.activity_time = this.activity.start_time
173
+            this.sign_up_deadline = this.activity.sign_up_deadline
174
+
175
+            this.paragraph_init_content = this.paragraph.content
176
+        },
177
+        paragraphContentChanged: function(content) {
178
+            this.paragraph.content = content
179
+        },
180
+
181
+        posterPhotoUploadFail: function(err, file, fileList) {
182
+            this.uploading_poster_photo = false
183
+            this.$message.error(err)
184
+        },
185
+        posterPhotoUploadSuccess: function(res, file) {
186
+            this.poster_photo_file_name = file.name
187
+            this.uploading_poster_photo = false
188
+            this.activity.poster_photo = "https://images.shengws.com/" + res.url
189
+        },
190
+        beforePosterPhotoUpload: function(file) {
191
+            var is_image = file.type.indexOf("image") > -1
192
+            var mb = file.size / 1024 / 1024
193
+
194
+            if (!is_image) {
195
+                this.$message.error("请上传图片")
196
+                return false
197
+            }
198
+            if (mb > 3) {
199
+                this.$message.error("上传主图大小不能超过3MB")
200
+                return false
201
+            }
202
+
203
+            var rand = Math.floor(Math.random() * 1000000000)
204
+            var date = new Date()
205
+            var ext = getFileExtension(file.name)
206
+            var key = "" + date.getFullYear() + (date.getMonth() + 1) + date.getDate() + "_activity_" + rand + "." + ext
207
+
208
+            this.uploading_poster_photo = true
209
+
210
+            return new Promise((resolve, reject) => {
211
+                getToken().then(rs => {
212
+                    var token = rs.data.data.uptoken
213
+                    this.qntoken = token
214
+                    this.poster_photo_file_key = key
215
+                    resolve(true)
216
+                }).catch(err => {
217
+                    this.uploading_poster_photo = false
218
+                    reject(false)
219
+                })
220
+            })
221
+        },
222
+
223
+        saveAction: function() {
224
+            this.saving_activity = true
225
+            this.submitActivity(false)
226
+        },
227
+        publishAction: function() {
228
+            this.publishing_activity = true
229
+            this.submitActivity(true, function() {
230
+                // 前往活动详情页
231
+            })
232
+        },
233
+        previewAction: function() {
234
+            this.saving_before_preview_activity = true
235
+            this.submitActivity(false, function() {
236
+                // 前往活动预览页
237
+            })
238
+        },
239
+        submitActivity: function(is_publish, successCallBack) {
240
+            this.validActivityInfo().then(() => {
241
+                var activity = {
242
+                    id: this.activity.id,
243
+                    poster_photo: this.activity.poster_photo,
244
+                    title: this.activity.title,
245
+                    subtitle: this.activity.subtitle,
246
+                    address: this.activity.address,
247
+                    limit_num: this.activity.limit_num,
248
+                    sign_up_deadline: parseTime(this.activity.sign_up_deadline, "{y}-{m}-{d} {h}:{i}"),
249
+                    start_time: parseTime(this.activity.start_time, "{y}-{m}-{d} {h}:{i}"),
250
+                    phone_number: this.activity.phone_number,
251
+                    sign_up_notice: this.activity.sign_up_notice,
252
+
253
+                    paragraph: {
254
+                        title: this.paragraph.title,
255
+                        content: this.paragraph.content,
256
+                    }
257
+                }
258
+                submitActivity(is_publish, activity).then(rs => {
259
+                    var resp = rs.data
260
+                    if (resp.state == 1) {
261
+                        this.activity.id = resp.data.activity_id
262
+                    } else {
263
+                        this.$message.error(resp.msg)
264
+                    }
265
+
266
+                    if (successCallBack != null || successCallBack != undefined) {
267
+                        successCallBack()
268
+                    }
269
+
270
+                    this.saving_activity = false
271
+                    this.publishing_activity = false
272
+                    this.saving_before_preview_activity = false
273
+
274
+                }).catch(err => {
275
+                    this.$message.error(err)
276
+                    this.saving_activity = false
277
+                    this.publishing_activity = false
278
+                    this.saving_before_preview_activity = false
279
+                })
280
+
281
+            }).catch(err => {
282
+                this.$message.error(err)
283
+                this.saving_activity = false
284
+                this.publishing_activity = false
285
+                this.saving_before_preview_activity = false
286
+            })
287
+            
288
+        },
289
+        validActivityInfo: function() {
290
+            return new Promise((resolve, reject) => {
291
+                if (this.activity.poster_photo.length == 0) {
292
+                    reject("海报不能为空")
293
+                } else if (this.activity.title.length == 0) {
294
+                    reject("标题不能为空")
295
+                } else if (this.activity.subtitle.length == 0) {
296
+                    reject("副标题不能为空")
297
+                } else if (this.activity.address.length == 0) {
298
+                    reject("活动地址不能为空")
299
+                } else if (this.activity.sign_up_deadline == 0) {
300
+                    reject("活动报名时间不能为空")
301
+                } else if (this.activity.start == 0) {
302
+                    reject("活动时间不能为空")
303
+                } else {
304
+                    if (this.activity.phone_number.length > 0) {
305
+                        if (/^1\d{10}$/.test(this.activity.phone_number) == false && /^(0\d{2,3}-?\d{7,8}$)/.test(this.activity.phone_number) == false) {
306
+                            reject("联系方式格式错误")
307
+                            return
308
+                        }
309
+                    }
310
+                }
311
+                resolve()
312
+            })
313
+        },
314
+    },
8 315
 }
9 316
 </script>
10 317
 
11 318
 <style lang="scss" scoped>
319
+.edit-form-main {
320
+    .form-title {
321
+        width: 100%;
322
+        height: 60px;
323
+        padding: 20px 0 20px 30px;
324
+        border-bottom: 1px #dee2e5 solid;
325
+
326
+        .icon {
327
+            margin-top: -4px;
328
+            vertical-align: middle;
329
+        }
330
+
331
+        span {
332
+            font-size: 18px;
333
+            font-weight: 500;
334
+            color: #485b6d;
335
+            margin-left: 10px;
336
+        }
337
+    }
338
+
339
+    .form-content {
340
+        width: 100%;
341
+        padding: 14px 30px 14px 30px;
342
+
343
+        .module-panel {
344
+            // padding: 0 30px;
345
+
346
+            .module-title {
347
+                font-size: 18px;
348
+                color: #a8b3ba;
349
+
350
+                img {
351
+                    float: left;
352
+                    display: block;
353
+                    padding: 2px 19px 0 0;
354
+                }
355
+            }
12 356
 
357
+            .module-item {
358
+                margin-top: 20px;
359
+                display: flex;
360
+                // padding: 0 30px;
361
+
362
+                .item-title {
363
+                    width: 115px;
364
+                    height: 40px;
365
+                    line-height: 40px;
366
+                    color: #485b6d;
367
+                    font-size: 13px;
368
+                    // font-weight: 100;
369
+                    text-align: right;
370
+                    padding-right: 22px;
371
+                    float: left;
372
+                }
373
+
374
+                .item-input {
375
+                    flex: 1;
376
+                    color: #485b6d;
377
+                }
378
+
379
+                .limit-text {
380
+                    line-height: 40px;
381
+                    color: #a8b3ba;
382
+                    font-size: 13px;
383
+                    // font-weight: 100;
384
+                    text-align: left;
385
+                    padding-left: 10px;
386
+                }
387
+
388
+                .poster-photo-panel {
389
+                    display: flex;
390
+                    flex: 1;
391
+                    align-items: center;
392
+
393
+                    .input {
394
+                        flex: 1;
395
+                        color: #485b6d;
396
+                        cursor: pointer;
397
+                    }
398
+                }
399
+            }
400
+
401
+            .poster-photo-hint {
402
+                font-size: 12px;
403
+                line-height: 16px;
404
+                color: #a8b3ba;
405
+                margin-left: 115px;
406
+            }
407
+        }
408
+
409
+        .submit-button-panel {
410
+            padding: 0 0 0 115px;
411
+            margin-top: 30px;
412
+        }
413
+    }
414
+}
13 415
 </style>
14 416
 

+ 123 - 12
src/scrm_pages/marketing_tool/components/edit_activity_preview_form.vue Voir le fichier

@@ -1,5 +1,5 @@
1 1
 <template>
2
-    <div class="preview-main">
2
+    <div class="preview-form-main">
3 3
         <div class="form-title">
4 4
             <img class="icon" src="@/assets/img/sa_06.png" />
5 5
             <span>预览</span>
@@ -14,11 +14,11 @@
14 14
             </div>
15 15
             <div class="org-info-cell border">
16 16
                 <div class="logo">
17
-                    <img :src="poster_photo" />
17
+                    <img :src="$store.getters.xt_user.org.org_logo" />
18 18
                 </div>
19 19
                 <div class="text-info">
20
-                    <p class="name">测试机构</p>
21
-                    <p class="address">地址地址地址地址地址地址地址地址地址地址地址地址地址地址地址地址</p>
20
+                    <p class="name">{{ $store.getters.xt_user.org.org_name }}</p>
21
+                    <p class="address">{{ address }}</p>
22 22
                 </div>
23 23
                 <div class="arrow-panel">
24 24
                     <img src="@/assets/img/sa_52.png" />
@@ -29,7 +29,7 @@
29 29
                     <img src="@/assets/img/sa_21.png" />
30 30
                 </div>
31 31
                 <div class="text">
32
-                    <p>2019-01-01</p>
32
+                    <p>{{ activity_time }}</p>
33 33
                 </div>
34 34
                 <div class="arrow-panel">
35 35
                     <img src="@/assets/img/sa_52.png" />
@@ -40,19 +40,55 @@
40 40
                     <img src="@/assets/img/sa_24.png" />
41 41
                 </div>
42 42
                 <div class="text">
43
-                    <p>0755-86879866</p>
43
+                    <p>{{ phone_number }}</p>
44 44
                 </div>
45 45
                 <div class="arrow-panel">
46 46
                     <img src="@/assets/img/sa_52.png" />
47 47
                 </div>
48 48
             </div>
49
+            <div class="simple-cell border">
50
+                <div class="title">
51
+                    <p>活动名额</p>
52
+                </div>
53
+                <div class="detail">
54
+                    <p>{{ limit_num }}</p>
55
+                </div>
56
+            </div>
57
+            <div class="large-text-cell border">
58
+                <div class="title">
59
+                    <img src="@/assets/img/sa_25.png" />
60
+                    <span>报名须知</span>
61
+                </div>
62
+                <p class="content" v-html="sign_up_notice">
63
+                </p>
64
+            </div>
65
+            <div class="large-text-cell border">
66
+                <div class="title">
67
+                    <img src="@/assets/img/sa_26.png" />
68
+                    <span>{{ paragraph_title }}</span>
69
+                </div>
70
+                <p class="content" v-html="paragraph_content">
71
+                </p>
72
+            </div>
49 73
         </div>
50 74
     </div>
51 75
 </template>
52 76
 
53 77
 <script>
78
+import { parseTime } from "@/utils"
79
+
54 80
 export default {
55 81
     name: "EditActivityPreviewForm",
82
+    props: {
83
+        activity: {
84
+            type: Object,
85
+            required: true,
86
+        },
87
+        paragraph: {
88
+            type: Object,
89
+            required: true,
90
+        },
91
+    },
56 92
     data() {
57 93
         return {
58 94
             
@@ -60,22 +96,51 @@ export default {
60 96
     },
61 97
     computed: {
62 98
         poster_photo: function() {
63
-            return require("@/assets/img/activity_poster_photo_default.png")
99
+            return this.activity.poster_photo.length > 0 ? this.activity.poster_photo : require("@/assets/img/activity_poster_photo_default.png")
64 100
         },
65 101
         title: function() {
66
-            return "与孩子一起挑选采摘新鲜有机马陆葡萄,体验采摘乐趣"
102
+            return this.activity.title.length > 0 ? this.activity.title : "与孩子一起挑选采摘新鲜有机马陆葡萄,体验采摘乐趣"
67 103
         },
68 104
         subtitle: function() {
69
-            return "亲子采摘活动"
105
+            return this.activity.subtitle.length > 0 ? this.activity.subtitle : "亲子采摘活动"
106
+        },
107
+        address: function() {
108
+            return this.activity.address.length > 0 ? this.activity.address : "深圳市南山区高新园"
109
+        },
110
+        activity_time: function() {
111
+            if (this.activity.start_time > 0) {
112
+                return parseTime(this.activity.start_time, "{y}-{m}-{d} {h}:{i}")
113
+            } else {
114
+                return "2019-01-01 09:00:00"
115
+            }
116
+        },
117
+        phone_number: function() {
118
+            return this.activity.phone_number.length > 0 ? this.activity.phone_number : "0755-86879866"
119
+        },
120
+        limit_num: function() {
121
+            return this.activity.limit_num > 0 ? (this.activity.limit_num + "人") : "无限制"
122
+        },
123
+        sign_up_notice: function() {
124
+            var notice = this.activity.sign_up_notice.length > 0 ? this.activity.sign_up_notice : "1.活动费用88元(2斤葡萄 1只手绘风筝 车费 包含1个大人 1个小孩)。\n2.多加1个大人另收30元/人。\n3.葡萄采摘时在园内可以适当品尝。"
125
+            return notice.replace(/\n/g, "<br/>")
126
+        },
127
+
128
+        paragraph_title: function() {
129
+            return this.paragraph.title.length > 0 ? this.paragraph.title : "商家介绍"
130
+        },
131
+        paragraph_content: function() {
132
+            var content = this.paragraph.content.length > 0 ? this.paragraph.content : "1.活动费用88元(2斤葡萄 1只手绘风筝 车费 包含1个大人 1个小孩)。<br/>2.多加1个大人另收30元/人。<br/>3.葡萄采摘时在园内可以适当品尝。"
133
+            return content
70 134
         },
71 135
     },
72 136
 }
73 137
 </script>
74 138
 
75 139
 <style lang="scss" scoped>
76
-.preview-main {
140
+.preview-form-main {
77 141
     .form-title {
78 142
         width: 100%;
143
+        height: 60px;
79 144
         padding: 20px 0 20px 30px;
80 145
         border-bottom: 1px #dee2e5 solid;
81 146
 
@@ -94,7 +159,7 @@ export default {
94 159
 
95 160
     .form-content {
96 161
         width: 100%;
97
-        padding: 14px 30px 0 30px;
162
+        padding: 14px 30px 14px 30px;
98 163
 
99 164
         .preview-cell-poster-photo {
100 165
             .poster-photo {
@@ -132,6 +197,8 @@ export default {
132 197
                     width: 40px;
133 198
                     height: 40px;
134 199
                     border-radius: 20px;
200
+                    object-fit: cover;
201
+                    object-position: center;
135 202
                 }
136 203
             }
137 204
             .text-info {
@@ -173,7 +240,7 @@ export default {
173 240
             .icon {
174 241
                 img {
175 242
                     width: 20px;
176
-                    height: 20px;
243
+                    height: auto;//20px;
177 244
                     vertical-align: middle;
178 245
                 }
179 246
             }
@@ -193,6 +260,50 @@ export default {
193 260
                     vertical-align: middle;
194 261
                 }
195 262
             }
263
+
264
+            .title {
265
+                p {
266
+                    color: #485b6d;
267
+                }
268
+            }
269
+            .detail {
270
+                flex: 1;
271
+                padding-left: 23px;
272
+                color: #485b6d;
273
+
274
+                p {
275
+                    color: #485b6d;
276
+                    float: right;
277
+                    text-align: right;
278
+                }
279
+            }
280
+        }
281
+
282
+        .large-text-cell {
283
+            padding: 20px 20px;
284
+            position: relative;
285
+            -webkit-box-align: center;
286
+            align-items: center;
287
+            margin-top: 15px;
288
+
289
+            .title {
290
+                color: #485b6d;
291
+                line-height: 18px;
292
+                height: 18px;
293
+
294
+                img {
295
+                    // width: 18px;
296
+                    // height: auto;
297
+                    margin-right: 11px;
298
+                    float: left;
299
+                }
300
+            }
301
+            .content {
302
+                color: #a8b3ba;
303
+                margin: 10px 0 0 0;
304
+                font-size: 14px;
305
+                line-height: 20px;
306
+            }
196 307
         }
197 308
     }
198 309
 }

+ 1 - 1
src/scrm_pages/marketing_tool/components/unapproved_cell.vue Voir le fichier

@@ -13,7 +13,7 @@
13 13
                 审核未通过:{{ activity.reason }}
14 14
             </div>
15 15
             <div class="operation">
16
-                <el-button type="primary" size="small" icon="el-icon-edit-outline">编辑</el-button>
16
+                <el-button type="primary" size="small" icon="el-icon-edit-outline" @click="$router.push({ path: '/activity/modify', query: {id: activity.id} })">编辑</el-button>
17 17
                 <el-button type="danger" size="small" icon="el-icon-delete">删除</el-button>
18 18
             </div>
19 19
         </div>

+ 21 - 1
src/scrm_pages/members/cards.vue Voir le fichier

@@ -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 Voir le fichier

@@ -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>

+ 107 - 0
src/scrm_pages/site/components/new-feature.vue Voir le fichier

@@ -0,0 +1,107 @@
1
+<template>
2
+<div class="feature">
3
+    <ul >
4
+        <li>
5
+            <span>
6
+              <img :src="new1" alt="">
7
+              <p>轮播图</p>  
8
+            </span>
9
+        </li>
10
+         <li>
11
+           <span>
12
+              <img :src="new1" alt="">
13
+              <p>轮播图</p>  
14
+            </span>  
15
+        </li>
16
+         <li>
17
+           <span>
18
+              <img :src="new1" alt="">
19
+              <p>轮播图</p>  
20
+            </span>  
21
+        </li>
22
+         <li>
23
+           <span>
24
+              <img :src="new1" alt="">
25
+              <p>轮播图</p>  
26
+            </span>  
27
+        </li>
28
+         <li>
29
+           <span>
30
+              <img :src="new1" alt="">
31
+              <p class="title">轮播图</p>  
32
+            </span>  
33
+        </li>
34
+    </ul>
35
+    <!-- <el-row :gutter="21" type="flex"  justify="space-around">
36
+        <el-col :span="5"><div class="grid-content "><img :src="new1" alt=""><p>轮播图</p></div></el-col>
37
+        <el-col :span="5"><div class="grid-content "><img :src="new1" alt=""><p>医院介绍</p></div></el-col>
38
+        <el-col :span="5"><div class="grid-content "><img :src="new1" alt=""><p>科室介绍</p></div></el-col>
39
+    </el-row>
40
+    <el-row :gutter="21" type="flex"  justify="space-around">
41
+        <el-col :span="5"><div class="grid-content "><img :src="new1" alt=""><p>轮播图</p></div></el-col>
42
+        <el-col :span="5"><div class="grid-content "><img :src="new1" alt=""><p>医院介绍</p></div></el-col>
43
+        <el-col :span="5"><div class="grid-content "><img :src="new1" alt=""><p>科室介绍</p></div></el-col>
44
+    </el-row>
45
+    <el-row :gutter="21" type="flex"  justify="space-around">
46
+        <el-col :span="5"><div class="grid-content "><img :src="new1" alt=""><p>轮播图</p></div></el-col>
47
+        <el-col :span="5"><div class="grid-content "><img :src="new1" alt=""><p>医院介绍</p></div></el-col>
48
+        <el-col :span="5"><div class="grid-content "><img :src="new1" alt=""><p>科室介绍</p></div></el-col>
49
+    </el-row> -->
50
+</div>    
51
+</template>
52
+
53
+
54
+<script>
55
+export default {
56
+  name: "newfeature",
57
+  data() {
58
+    return {
59
+      new1: require("../../../assets/preview/new-1.png")
60
+    };
61
+  }
62
+};
63
+</script>
64
+
65
+<style rel="stylesheet/scss" lang="scss" scoped>
66
+.feature {
67
+  ul {
68
+    border: 1px solid #eaeefb;
69
+    float: left;
70
+    width: 100%;
71
+    li {
72
+      width: 33.3%;
73
+      float: left;
74
+      text-align: center;
75
+      height: 120px;
76
+      color: #666;
77
+      font-size: 13px;
78
+      border-right: 1px solid #eee;
79
+      border-bottom: 1px solid #eee;
80
+      margin-right: -1px;
81
+      margin-bottom: -1px;
82
+      span {
83
+        vertical-align: middle;
84
+        display: flex;
85
+        flex-direction: column;
86
+        align-items: center;
87
+        justify-content: center;
88
+        height: 120px;
89
+        img {
90
+          display: inline-block;
91
+          font-size: 32px;
92
+          margin-bottom: 15px;
93
+          color: #606266;
94
+          transition: color 0.15s linear;
95
+          vertical-align: middle;
96
+        }
97
+        .title {
98
+          display: inline-block;
99
+          padding: 0 3px;
100
+          height: 30px;
101
+          vertical-align: middle;
102
+        }
103
+      }
104
+    }
105
+  }
106
+}
107
+</style>

+ 67 - 0
src/scrm_pages/site/index.vue Voir le fichier

@@ -0,0 +1,67 @@
1
+<template>
2
+   <div class="main-contain">
3
+      <div class="position">
4
+        <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+      </div>
6
+      <div class="app-container">
7
+         <el-row :gutter="20">
8
+            <el-col :span="12">
9
+              <div class="success">
10
+                <h1 class="name">欢迎来到微官网主页</h1>
11
+                <div class="tips">您可以手机扫码访问或在右侧预览</div>
12
+                <div class="site-code"><img :src="codeImg" alt=""></div>
13
+                <router-link to="/site/preview">
14
+                  <el-button type="primary">进入微官网后台</el-button>
15
+                </router-link>
16
+              </div>
17
+            </el-col>
18
+            <el-col :span="12">
19
+
20
+            </el-col>
21
+          </el-row>
22
+      </div>
23
+   </div>
24
+</template>
25
+
26
+<script>
27
+import BreadCrumb from "../components/bread-crumb";
28
+export default {
29
+  name: "site",
30
+  components: {
31
+    BreadCrumb
32
+  },
33
+  data() {
34
+    return {
35
+      crumbs: [{ path: false, name: "微网站" }],
36
+      codeImg: require("../../assets/home/wei.jpg")
37
+    };
38
+  }
39
+};
40
+</script>
41
+
42
+<style rel="stylesheet/scss" lang="scss" scoped>
43
+.success {
44
+  text-align: center;
45
+  align-items: center;
46
+  display: flex;
47
+  flex-direction: column;
48
+  .name {
49
+    font-size: 30px;
50
+    font-weight: bold;
51
+    color: #333;
52
+    margin: 0;
53
+    padding-bottom: 10px;
54
+  }
55
+  .tips{
56
+    line-height: 30px;
57
+    padding-bottom: 10px;
58
+  }
59
+  .site-code {
60
+    width: 200px;
61
+    padding-bottom: 10px;
62
+    img{
63
+      width: 100%;
64
+    }
65
+  }
66
+}
67
+</style>

+ 57 - 0
src/scrm_pages/site/preview.vue Voir le fichier

@@ -0,0 +1,57 @@
1
+<template>
2
+   <div class="main-contain">
3
+      <div class="position">
4
+        <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+      </div>
6
+      <div class="app-container">
7
+            <!-- 新增 -->
8
+                <el-tabs type="border-card" style="width:450px;">
9
+                    <el-tab-pane label="首页">
10
+                        <el-tabs v-model="activeName" @tab-click="handleClick"  >
11
+                            <el-tab-pane label="新增模块" name="first">
12
+                                 <new-feature> </new-feature>
13
+                            </el-tab-pane>
14
+                            <el-tab-pane label="已使用" name="second">
15
+
16
+                            </el-tab-pane>
17
+                        </el-tabs>
18
+                    </el-tab-pane>
19
+                    <el-tab-pane label="联系我们">
20
+                        <el-tabs v-model="activeName" @tab-click="handleClick">
21
+                            <el-tab-pane label="新增模块" name="three">
22
+
23
+                            </el-tab-pane>
24
+                            <el-tab-pane label="已使用" name="four">
25
+                                
26
+                            </el-tab-pane>
27
+                        </el-tabs>                        
28
+                    </el-tab-pane>
29
+                </el-tabs>
30
+            <!-- 已使用 -->
31
+           
32
+      </div>
33
+   </div>
34
+</template>
35
+
36
+<script> 
37
+import BreadCrumb from "../components/bread-crumb";
38
+import NewFeature from "./components/new-feature";
39
+export default {
40
+  name: "preview",
41
+  components: {
42
+    BreadCrumb,
43
+    NewFeature
44
+  },
45
+  data() {
46
+    return {
47
+      crumbs: [{ path: false, name: "预览" }],
48
+      activeName: 'first'
49
+    };
50
+  }
51
+};
52
+</script>
53
+
54
+<style rel="stylesheet/scss" lang="scss" scoped>
55
+</style>
56
+
57
+

+ 77 - 10
src/scrm_pages/weixinmp/authorization.vue Voir le fichier

@@ -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,
@@ -93,12 +110,58 @@ export default {
93 110
         authorizer_qrcode_url: "",
94 111
         created_time: "",
95 112
         updated_time: "",
96
-        authorizer_status: 1
113
+        authorizer_status: 0
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;*/

Fichier diff supprimé car celui-ci est trop grand
+ 998 - 0
src/scrm_pages/weixinmp/menus.vue