Parcourir la source

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

柳香萍 il y a 5 ans
Parent
révision
34ad03b5aa

+ 2 - 3
config/index.js Voir le fichier

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

+ 26 - 2
src/api/act/submitinfo.js Voir le fichier

@@ -1,7 +1,7 @@
1 1
 import request from '@/utils/request'
2 2
 
3 3
 export function submitForm (params){
4
-    console.log("文章列表",params)
4
+    //console.log("文章列表",params)
5 5
     return request({
6 6
         url: '/api/acticle/createacticle',
7 7
         method: 'Get',
@@ -19,10 +19,34 @@ export function getArticleType(params){
19 19
 }
20 20
 
21 21
 export function GetAllArticles(params){
22
-     console.log("文章列表")
23 22
      return request({
24 23
          url:'/api/acticle/getAllArticles',
25 24
          method:'Get',
26 25
          params:params
27 26
      })
27
+}
28
+
29
+export function addCategory(data){
30
+    return request({
31
+        url:'/api/article/addCategory',
32
+        method:'Post',
33
+        data:data
34
+    })
35
+}
36
+
37
+export function GetCategorys(params){
38
+      console.log("params",params)
39
+     return request({
40
+         url:'/api/acticle/getCategorys',
41
+         method:'Get',
42
+         params:params
43
+     })
44
+}
45
+
46
+export function EditArticleCategory(MenuId,data){
47
+    return request({
48
+        url:'/api/acticle/edit?MenuId='+MenuId,
49
+        method:'put',
50
+        data,data
51
+    })
28 52
 }

+ 55 - 1
src/api/member/member.js Voir le fichier

@@ -9,6 +9,7 @@ export function GetMembers(params) {
9 9
 }
10 10
 
11 11
 export function CreateMember(data) {
12
+  console.log("data是神",data)
12 13
   return request({
13 14
     url: '/api/member/create',
14 15
     method: 'post',
@@ -56,11 +57,64 @@ export function EditMemberCard(params) {
56 57
   })
57 58
 }
58 59
 
59
-export function GetTags() {
60
+export function GetTags(params) {
60 61
   return request({
61 62
     url: '/api/members/tags',
62 63
     method: 'get',
64
+    params: params
65
+  })
66
+}
67
+
68
+export function CreateTag(data) {
69
+  return request({
70
+    url: '/api/members/tag/create',
71
+    method: 'post',
72
+    data: data
63 73
   })
64 74
 }
65 75
 
76
+export function EditTag(id,data) {
77
+  return request({
78
+    url: '/api/members/tag/edit?id='+id,
79
+    method: 'put',
80
+    data: data
81
+  })
82
+}
83
+export function DeleteTags(data) {
84
+  return request({
85
+    url: '/api/members/tags/delete',
86
+    method: 'delete',
87
+    data: data
88
+  })
89
+}
66 90
 
91
+export function GetCards() {
92
+  return request({
93
+    url: '/api/membercards',
94
+    method: 'get',
95
+  })
96
+}
97
+
98
+export function CreateMemberShipCard(data) {
99
+  return request({
100
+    url: '/api/membercard/create',
101
+    method: 'post',
102
+    data: data
103
+  })
104
+}
105
+
106
+export function EditMemberShipCard(id,data) {
107
+  return request({
108
+    url: '/api/membercard/edit?id='+id,
109
+    method: 'put',
110
+    data: data
111
+  })
112
+}
113
+
114
+export function DeleteMemberShipCard(data) {
115
+  return request({
116
+    url: '/api/membercards/delete',
117
+    method: 'delete',
118
+    data: data
119
+  })
120
+}

+ 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
 

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

@@ -24,5 +24,11 @@ export default {
24 24
       name: 'memberTaglist',
25 25
       meta: { title: '标签管理', noCache: true }
26 26
     },
27
+    {
28
+      path: '/member/cards',
29
+      component: () => import('@/scrm_pages/members/cards'),
30
+      name: 'memberCardlist',
31
+      meta: { title: '会员卡管理', noCache: true }
32
+    },
27 33
   ]
28 34
 }

+ 24 - 18
src/router/modules/system.js Voir le fichier

@@ -1,21 +1,27 @@
1 1
 import Layout from '@/views/layout/Layout'
2 2
 
3
-export default{
4
-    alwaysShow: true,
5
-    path: '/Systemsetting',
6
-    component: Layout,
7
-    redirect: 'noredirect',
8
-    name: 'Systemsetting',
9
-    meta: {
10
-        title: 'systemsetting',
11
-        icon: 'peoples'
12
-      },
13
-      children: [
14
-        {
15
-          path: '/Systemsetting/staffmanagement',
16
-          component: () => import('@/scrm_pages/Systemsetting/staffmanagement'),
17
-          name: 'memberslist',
18
-          meta: { title: 'staffmanagement', noCache: true }
19
-        },
20
-      ]  
3
+export default {
4
+  alwaysShow: true,
5
+  path: '/Systemsetting',
6
+  component: Layout,
7
+  redirect: 'noredirect',
8
+  name: 'Systemsetting',
9
+  meta: {
10
+    title: 'systemsetting',
11
+    icon: 'peoples'
12
+  },
13
+  children: [
14
+    {
15
+      path: '/weixinmp/authorization',
16
+      component: () => import('@/scrm_pages/weixinmp/authorization'),
17
+      name: 'weixinMpAuth',
18
+      meta: { title: '公众号授权', noCache: true }
19
+    },
20
+    {
21
+      path: '/Systemsetting/staffmanagement',
22
+      component: () => import('@/scrm_pages/Systemsetting/staffmanagement'),
23
+      name: 'memberslist',
24
+      meta: { title: 'staffmanagement', noCache: true }
25
+    },
26
+  ]
21 27
 }

+ 78 - 16
src/scrm_pages/article/acticleCategory.vue Voir le fichier

@@ -2,24 +2,22 @@
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">添加分类</el-button>
5
+        <el-button  style="float:right;" type="primary" size="small" icon="el-icon-circle-plus-outline" @click="openCreate()">添加分类</el-button>
6 6
       </div>
7 7
       <div class="app-container">
8 8
         <div class="filter-container" style="margin-top: 10px;margin-left: 5px">
9
-          <el-checkbox style="width: 30px" v-model="checked" @change="changeAllSelected">全选</el-checkbox>
10
-          <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
9
+          <el-checkbox style="width: 30px">全选</el-checkbox>
10
+          <el-button size="small" icon="el-icon-delete">批量删除</el-button>
11 11
 
12 12
         </div>
13 13
 
14 14
         <el-row :gutter="12" style="margin-top: 10px">
15 15
           <el-table
16
-            :data="cancelStockDate"
17
-            :class="signAndWeighBoxPatients"
18 16
             border
19 17
             highlight-current-row
20 18
             ref="multipleTable"
21
-            @selection-change="select"
22 19
             :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
20
+            :data="articsData"
23 21
           >
24 22
             <el-table-column
25 23
               type="selection"
@@ -28,19 +26,19 @@
28 26
 
29 27
             <el-table-column label="分类名称" align="center">
30 28
               <template slot-scope="scope">
31
-                123
29
+                {{scope.row.Name}}
32 30
               </template>
33 31
             </el-table-column>
34 32
 
35 33
             <el-table-column label="所属文章数量" align="center">
36 34
               <template slot-scope="scope">
37
-                456
35
+                {{scope.row.num}}
38 36
               </template>
39 37
             </el-table-column>
40 38
 
41 39
             <el-table-column label="分类排序" align="center">
42 40
               <template slot-scope="scope">
43
-                789
41
+                {{scope.row.Order}}
44 42
               </template>
45 43
             </el-table-column>
46 44
 
@@ -52,7 +50,7 @@
52 50
                     size="mini"
53 51
                     type="primary"
54 52
                     icon="el-icon-edit-outline"
55
-                    @click="handleEdit(scope.$index, scope.row)">
53
+                    @click="openEdit(scope.row,scope.$index)">
56 54
                   </el-button>
57 55
                 </el-tooltip>
58 56
                 <el-tooltip class="item" effect="dark" content="删除" placement="top">
@@ -69,17 +67,22 @@
69 67
 
70 68
           </el-table>
71 69
 
72
-          <el-pagination
70
+         <el-pagination
73 71
             @size-change="handleSizeChange"
74 72
             @current-change="handleCurrentChange"
75
-            :page-sizes="[7]"
76
-            :page-size="7"
73
+            :page-sizes="[10,20,50,100]"
74
+            :page-size="10"
77 75
             background
78
-            style="margin-top:20px;float: right"
76
+            style="margin-top:20px;"
77
+            align="right"
79 78
             layout="total, sizes, prev, pager, next, jumper"
80 79
             :total="total">
81 80
           </el-pagination>
82
-
81
+           <!-- 添加分类 -->
82
+           <create-article-form ref="createArticleForm" :articsData="articsData"></create-article-form>
83
+           <!-- 编辑分类 -->
84
+           <edit-article-form ref="editArticleForm" :artilceIndex="artilceIndex" :form="articData" :articsData="articsData" ></edit-article-form>
85
+         
83 86
         </el-row>
84 87
       </div>
85 88
     </div>
@@ -87,10 +90,15 @@
87 90
 
88 91
 <script>
89 92
   import BreadCrumb from '../components/bread-crumb'
93
+  import CreateArticleForm from "./components/CreateArticleForm";
94
+  import EditArticleForm from "./components/EditArticleForm";
95
+  import { GetCategorys } from '@/api/act/submitinfo'
90 96
   export default {
91 97
     name: 'acticleCategory',
92 98
     components:{
93
-      BreadCrumb
99
+      BreadCrumb,
100
+      CreateArticleForm,
101
+      EditArticleForm,
94 102
     },
95 103
     data(){
96 104
       return{
@@ -98,8 +106,62 @@
98 106
           { path: false, name: '文章管理' },
99 107
           { path: '/articles/acticleCategory', name: '发布文章' }
100 108
         ],
109
+        articsData:[],
110
+        articData:{
111
+          Name:'',
112
+          Summary:'',
113
+          Order:'',
114
+          MenuId:0,
115
+        },
116
+        total:0,
117
+        listQuery:{
118
+          page:1,
119
+          limit:10,
120
+          name:'',
121
+          content:'',
122
+          sort:'',
123
+        },
124
+         artilceIndex:-1,
101 125
       }
102 126
     },
127
+
128
+    methods:{
129
+      openCreate(){
130
+        this.$refs.createArticleForm.open();
131
+      },
132
+      GetCategorys(){
133
+        GetCategorys(this.listQuery).then(response=>{
134
+             console.log(response.data.state)
135
+             if(response.data.state === 1){
136
+               this.articsData = response.data.data.category 
137
+               console.log(this.articsData)
138
+               this.total = response.data.data.total
139
+             }
140
+        })
141
+      },
142
+       handleSizeChange(limit) {
143
+            this.listQuery.limit = limit;
144
+            this.GetCategorys();
145
+        },
146
+        handleCurrentChange(page) {
147
+            this.listQuery.page = page;
148
+            this.GetCategorys();
149
+        },
150
+        openEdit(row,index){          
151
+            for(const key in this.articData){
152
+               if(key in row){
153
+                 this.articData[key] = row[key]
154
+               }
155
+            }
156
+            console.log("是什么",this.articData) 
157
+            console.log("heh",this.articsData)  
158
+             this.artilceIndex = index 
159
+             this.$refs.editArticleForm.open();        
160
+        }
161
+    },
162
+     created(){
163
+         this.GetCategorys()
164
+       }
103 165
   }
104 166
 </script>
105 167
 

+ 33 - 17
src/scrm_pages/article/articleList.vue Voir le fichier

@@ -9,7 +9,7 @@
9 9
             <el-row :gutter="24">
10 10
               <el-col :span="8">
11 11
                   <el-input style="width: 300px" v-model="listQuery.search"  placeholder="请输入您需要搜索的内容"></el-input>
12
-                  <el-button type="primary"  icon="el-icon-search">搜索</el-button>
12
+                  <el-button type="primary"  icon="el-icon-search" @click="changeKey">搜索</el-button>
13 13
               </el-col>
14 14
             </el-row>
15 15
           </div>
@@ -18,7 +18,7 @@
18 18
              <div class="time">
19 19
                 <ul class="">
20 20
                   <li :class="0==schedulType?'active':''" @click="selectsign(0)">全部</li>
21
-                  <li :class="item.MenuId==schedulType?'active':''"  v-for="item in schedulArr" :key="item.MenuId">{{item.Name}}</li>
21
+                  <li :class="item.MenuId==schedulType?'active':''"  v-for="item in schedulArr" :key="item.MenuId" @click="selectsign(item.MenuId)">{{item.Name}}</li>
22 22
                 </ul>
23 23
              </div>
24 24
           </div>
@@ -37,32 +37,33 @@
37 37
           </div>
38 38
           <el-table ref="multipleTable" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" :data="ArticleData" border fit highlight-current-row  style="width: 100%;margin-top: 10px;">
39 39
               <el-table-column
40
+                align="center" 
40 41
                 type="selection"
41 42
                 width="55">
42 43
               </el-table-column> 
43 44
              <el-table-column label="文章图片" align="center">
44 45
                <template slot-scope="scope">
45
-
46
+                  <img :src="memberAvatar(scope.row)" alt="" srcset="" style="width:100px;height:100px;" >
46 47
                </template>
47 48
              </el-table-column>
48 49
             <el-table-column label="文章标题" align="center">
49 50
               <template slot-scope="scope">
50
-
51
+                  {{scope.row.title}}
51 52
               </template>
52 53
             </el-table-column>
53 54
             <el-table-column label="阅读量" align="center">
54 55
               <template slot-scope="scope">
55
-
56
+                 {{scope.row.real_read_num}}
56 57
               </template>
57 58
             </el-table-column>
58 59
             <el-table-column label="评论数" align="center">
59 60
               <template slot-scope="scope">
60
-
61
+                  {{scope.row.comment_num}}
61 62
               </template>
62 63
             </el-table-column>
63 64
             <el-table-column label="点赞数" align="center">
64 65
               <template slot-scope="scope">
65
-
66
+                  {{scope.row.num}}
66 67
               </template>
67 68
             </el-table-column>
68 69
             <el-table-column label="操作" align="center">
@@ -75,14 +76,17 @@
75 76
                     @click="handleEdit(scope.$index, scope.row)">
76 77
                   </el-button>
77 78
                 </el-tooltip>
79
+                 <el-tooltip class="item" effect="dark" content="删除" placement="top">
80
+                  <el-button size="mini" type="danger" icon="el-icon-delete" @click="openDelete(scope.row, scope.$index)" ></el-button>
81
+                </el-tooltip>
78 82
               </template>
79 83
             </el-table-column>
80 84
           </el-table>
81 85
           <el-pagination
82 86
             @size-change="handleSizeChange"
83 87
             @current-change="handleCurrentChange"
84
-            :page-sizes="[7]"
85
-            :page-size="7"
88
+            :page-sizes="[10,20,50,100]"
89
+            :page-size="10"
86 90
             background
87 91
             style="margin-top:20px;float: right"
88 92
             layout="total, sizes, prev, pager, next, jumper"
@@ -109,7 +113,7 @@
109 113
         time: '',
110 114
         active: true,
111 115
         schedulType: 0,
112
-        schedulArr:0,
116
+        schedulArr:[],
113 117
         systemType: 0,
114 118
         systemArr: [
115 119
           { value: 0, label: "全部" },
@@ -129,17 +133,23 @@
129 133
     },
130 134
     methods:{
131 135
          GetAllArticles(){
132
-              GetAllArticles(this.listQuery).then(response =>{
133
-                     if(response.data.status === 1){
134
-                       this.ArticleData = response.data.data.articles
135
-                        console.log("文章列表",this.ArticleData)
136
+              GetAllArticles(this.listQuery).then(response=>{
137
+                     if(response.data.state === 1){
138
+                        this.ArticleData = response.data.data.articles  
136 139
                         this.total = response.data.data.total
140
+                        console.log("文章列表",this.ArticleData)
141
+                        console.log("total",this.total)                                                   
142
+                     }
143
+                     if(typeof(response.data.data.category != 'undefined')){
144
+                       this.schedulArr = response.data.data.category
145
+                        console.log("分类列表",response.data.data.category)
146
+                       
137 147
                      }
138 148
               })
139 149
          },
140
-         selectsign(id){
141
-            this.listQuery.classid = id;
142
-            this.schedulArr = id;
150
+         selectsign(MenuId){
151
+            this.listQuery.classid = MenuId;
152
+            this.schedulArr = MenuId;
143 153
             this.GetAllArticles();
144 154
          },
145 155
          selectStatus(id){
@@ -154,6 +164,12 @@
154 164
          handleCurrentChange(page) {
155 165
             this.listQuery.page = page;
156 166
             this.GetAllAritcles();
167
+        },
168
+        changeKey(){
169
+           this.GetAllArticles();
170
+        },
171
+        memberAvatar(row){
172
+             return row.imgs
157 173
         }
158 174
     },
159 175
     created(){

+ 101 - 0
src/scrm_pages/article/components/CreateArticleForm.vue Voir le fichier

@@ -0,0 +1,101 @@
1
+<template>
2
+
3
+    <div id="create-article-form-box">
4
+      <el-dialog
5
+        title="添加分类"
6
+        :visible.sync="centerDialogVisible"
7
+        width="1000px"
8
+        center>
9
+        <el-form label-width="90px" class="clearfix" :model="form" ref="acticleform" :rules="rules">
10
+          <el-row :span=20>
11
+            <el-form-item label="分类名称:" required prop="name">
12
+              <el-input v-model="form.name">
13
+
14
+              </el-input>
15
+            </el-form-item>
16
+          </el-row>
17
+          <el-row :span=20>
18
+            <el-form-item label="分类描述:" required prop="content">
19
+              <keep-alive>
20
+                <neditor ref="neditor"
21
+                         id="editor"
22
+                         v-bind:r_content="form.content">
23
+                </neditor>
24
+              </keep-alive>
25
+            </el-form-item>
26
+          </el-row>
27
+          <el-row :span=20>
28
+            <el-form-item label="排序" required prop="sort">
29
+              <el-input v-model="form.sort">
30
+
31
+              </el-input>
32
+            </el-form-item>
33
+          </el-row>
34
+        </el-form>
35
+        <span slot="footer" class="dialog-footer">
36
+               <el-button type="primary" @click="addCategory('acticleform');">添加</el-button>
37
+              <el-button  @click="centerDialogVisible = false">返回列表</el-button>
38
+             </span>
39
+      </el-dialog>
40
+    </div>
41
+
42
+</template>
43
+
44
+<script>
45
+    import Neditor from '@/components/Neditor'
46
+    import { addCategory } from '@/api/act/submitinfo'
47
+    export default {
48
+        name: "CreateArticleForm",
49
+         components:{
50
+           Neditor,
51
+        },
52
+            data(){
53
+                return {
54
+                    centerDialogVisible:false,
55
+                    rules: {
56
+                    name: [{required: true, message: "请填写分类名称",},],
57
+                    content: [{required: true,message:"请填写分类描述"}],
58
+                    sort: [{required: true,message:"请填写排序"}]
59
+                },
60
+                 form:{
61
+                   name:"",
62
+                   content:"",
63
+                   sort:"",
64
+                },
65
+                acticleform:[],
66
+             }
67
+          },   
68
+           methods:{
69
+                 open:function(){
70
+                    this.centerDialogVisible = true;
71
+                  },   
72
+                 resetForm(formName) {
73
+                     if (typeof(this.$refs[formName]) !='undefined') {
74
+                     this.$refs[formName].resetFields();
75
+                   }
76
+                  },
77
+               addCategory(formName){
78
+                  this.form.content = this.$refs.neditor.content
79
+                   this.$refs[formName].validate((valid)=>{
80
+                       if(valid){
81
+                            addCategory(this.form).then(response =>{
82
+                                  console.log(response.data.state)
83
+                                  if(response.data.state==1){
84
+                                    var category = response.data.data.category
85
+                                    this.centerDialogVisible=false
86
+                                    this.resetForm("acticleform");
87
+                                    this.$message.success("添加分类成功");
88
+                                    console.log("coo",category)
89
+                                  }
90
+                            });
91
+                       }   
92
+                   });         
93
+          },  
94
+       }
95
+    }
96
+</script>
97
+
98
+<style scoped>
99
+
100
+</style>
101
+   

+ 109 - 0
src/scrm_pages/article/components/EditArticleForm.vue Voir le fichier

@@ -0,0 +1,109 @@
1
+<template>
2
+    <div id="edit-article-form-box">
3
+        <el-dialog
4
+        title="编辑分类"
5
+        :visible.sync="centerDialogVisible"
6
+        width="1000px"
7
+        center>
8
+        <el-form label-width="90px" class="clearfix" :model="form" ref="acticleform" :rules="rules">
9
+          <el-row :span=20>
10
+            <el-form-item label="分类名称:" required prop="Name">
11
+              <el-input v-model="form.Name"></el-input>
12
+            </el-form-item>
13
+          </el-row>
14
+          <el-row :span=20>
15
+            <el-form-item label="分类描述:" required prop="Summary">
16
+              <keep-alive>
17
+                <neditor ref="neditor"
18
+                         id="editor"
19
+                         v-bind:r_content="form.Summary">
20
+                </neditor>
21
+              </keep-alive>
22
+            </el-form-item>
23
+          </el-row>
24
+          <el-row :span=20>
25
+            <el-form-item label="排序" required prop="Order">
26
+              <el-input v-model="form.Order"></el-input>
27
+            </el-form-item>
28
+          </el-row>
29
+        </el-form>
30
+        <span slot="footer" class="dialog-footer">
31
+               <el-button type="primary" @click="submitForm('acticleform')">保存</el-button>
32
+              <el-button  @click="centerDialogVisible = false">取消</el-button>
33
+             </span>
34
+      </el-dialog>   
35
+    </div>
36
+</template>
37
+<script>
38
+import Neditor from '@/components/Neditor'
39
+ import { EditArticleCategory } from '@/api/act/submitinfo'
40
+export default {
41
+    name: "EditArticleForm",
42
+     components:{
43
+        Neditor,
44
+      },
45
+      props:{
46
+        form:{
47
+           Name:'',
48
+          Summary:'',
49
+          Order:'',
50
+          MenuId:0,
51
+        },
52
+      artilceIndex:{
53
+          type:Number,
54
+          default:-1,
55
+        },
56
+      articsData:{
57
+          type: Array,
58
+          default: function () {
59
+          return [];
60
+        }
61
+      }
62
+    },
63
+     data(){
64
+          return {
65
+          centerDialogVisible:false,
66
+           rules: {
67
+             Name: [{required: true, message: "请填写分类名称",},],
68
+             Summary: [{required: true,message:"请填写分类描述"}],
69
+             Order: [{required: true,message:"请填写排序"}]
70
+              },
71
+             }
72
+          }, 
73
+          methods:{
74
+                open:function(){
75
+                  this.centerDialogVisible = true;
76
+                },
77
+                resetForm(formName) {
78
+                     if (typeof(this.$refs[formName]) !='undefined') {
79
+                     this.$refs[formName].resetFields();
80
+                   }
81
+                },  
82
+              submitForm(forname){ 
83
+                alert("aaa")
84
+                this.$refs[forname].validate((valid)=>{
85
+                   if(valid){
86
+                      EditArticleCategory(this.form.MenuId,this.form).then(response=>{
87
+                            console.log("id是谁",this.form.MenuId)
88
+                            console.log(this.form)
89
+                           var res =  response.data;
90
+                           console.log(res.state)
91
+                           if(res.state ===1 ){
92
+                              var categorys = res.data.categorys; 
93
+                              console.log("categorys是什么",categorys)
94
+                              this.articsData[this.artilceIndex].name = categorys.Name;
95
+                              this.articsData[this.artilceIndex].content = categorys.Summary;
96
+                              this.articsData[this.artilceIndex].sort = categorys.Order;
97
+                              this.centerDialogVisible = false;
98
+                              this.$message.success("编辑文章分类成功");
99
+                           }
100
+                      })
101
+                   }
102
+                })
103
+              },  
104
+          }
105
+}
106
+</script>
107
+<style scoped>
108
+
109
+</style>

+ 5 - 4
src/scrm_pages/article/createArticle.vue Voir le fichier

@@ -94,7 +94,7 @@
94 94
           <el-row :span="24">
95 95
             <el-col :span="24">
96 96
                 <el-form-item>
97
-                      <el-button size="small" type="primary" style="width: 100px"  @click="submitForm;centerDialogVisible = true" :disabled="formsubmit">发布</el-button>
97
+                      <el-button size="small" type="primary" style="width: 100px"  @click="submitForm();centerDialogVisible = true">发布</el-button>
98 98
                       <el-button size="small" style="width: 100px">预览</el-button>
99 99
                       <el-button size="small" style="width: 100px">保存草稿</el-button>
100 100
                   <el-button size="small" style="width: 100px">取消</el-button>
@@ -433,6 +433,7 @@
433 433
          console.log("所属分类",this.form.act_type)
434 434
       },
435 435
       submitForm(){
436
+        console.log("提交文章")
436 437
         var params  = new Object()
437 438
         params.act_name = this.form.act_name
438 439
         params.act_content = this.$refs.neditor.content
@@ -451,12 +452,12 @@
451 452
       },
452 453
       getArticleType(){
453 454
         getArticleType().then(response =>{
454
-            console.log("好嗨我")
455
+            //console.log("好嗨我")
455 456
             if(response.data.state === 1){
456 457
             var category = response.data.data.category
457 458
             this.options = response.data.data.category
458
-             console.log("文章内容:",category)
459
-             console.log("文章",this.options)
459
+            // console.log("文章内容:",category)
460
+            // console.log("文章",this.options)
460 461
             }
461 462
         })
462 463
       },

+ 19 - 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 :activity="activity" :paragraph="activity_paragraph"></edit-form>
13 13
                 </div>
14 14
             </div>
15 15
         </div>
@@ -34,6 +34,23 @@ export default {
34 34
                 { path: false, name: "营销工具" },
35 35
                 { path: false, name: "发布活动" }
36 36
             ],
37
+
38
+            activity: {
39
+                id: 0,
40
+                poster_photo: "",
41
+                title: "",
42
+                subtitle: "",
43
+                address: "",
44
+                limit_num: 0,
45
+                sign_up_deadline: 0,
46
+                start_time: 0,
47
+                phone_number: "",
48
+                sign_up_notice: "",
49
+            },
50
+            activity_paragraph: {
51
+                title: "",
52
+                content: "",
53
+            }
37 54
         }
38 55
     },
39 56
 }

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

@@ -1,14 +1,316 @@
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;" v-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">发 布</el-button>
97
+                <el-button style="color: #409eff; border-color: #409eff; padding: 10px 30px;">保存草稿</el-button>
98
+                <el-button style="color: #409eff; border-color: #409eff; padding: 10px 30px;">预 览</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
+
6 109
 export default {
7 110
     name: "EditActivityEditForm",
111
+    components: {
112
+        Neditor,
113
+    },
114
+    props: {
115
+        activity: {
116
+            type: Object,
117
+            required: true,
118
+        },
119
+        paragraph: {
120
+            type: Object,
121
+            required: true,
122
+        },
123
+    },
124
+    data() {
125
+        return {
126
+            uploading_poster_photo: false,
127
+            qntoken: "",
128
+            poster_photo_file_key: "",
129
+            poster_photo_file_name: "",
130
+
131
+            limit_num: "",
132
+            activity_time: 0,
133
+            sign_up_deadline: 0,
134
+            paragraph_init_content: "",
135
+
136
+            pickerOptions: {
137
+                disabledDate: (time) => {
138
+                    return time.getTime() < Date.now() - 8.64e7
139
+                }
140
+            }
141
+        }
142
+    },
143
+    created() {
144
+        this.activity_time = (new Date()).getTime()
145
+        this.sign_up_deadline = (new Date()).getTime()
146
+    },
147
+    watch: {
148
+        limit_num: function(new_val) {
149
+            if (/^[1-9]+[0-9]*]*$/.test(new_val)) {
150
+                this.activity.limit_num = parseInt(new_val)
151
+            } else {
152
+                this.activity.limit_num = 0
153
+            }
154
+        },
155
+        activity_time: function(new_val) {
156
+            this.activity.start_time = new_val
157
+        },
158
+        sign_up_deadline: function(new_val) {
159
+            this.activity.sign_up_deadline = new_val  
160
+        },
161
+    },
162
+    methods: {
163
+        initParagraphContent: function(content) {
164
+            this.paragraph_init_content = this.paragraph.content
165
+        },
166
+        paragraphContentChanged: function(content) {
167
+            this.paragraph.content = content
168
+        },
169
+
170
+        posterPhotoUploadFail: function(err, file, fileList) {
171
+            this.uploading_poster_photo = false
172
+            this.$message.error(err)
173
+        },
174
+        posterPhotoUploadSuccess: function(res, file) {
175
+            console.log(res)
176
+            console.log(file)
177
+            this.poster_photo_file_name = file.name
178
+            this.uploading_poster_photo = false
179
+            this.activity.poster_photo = "https://images.shengws.com/" + res.url
180
+        },
181
+        beforePosterPhotoUpload: function(file) {
182
+            console.log(file)
183
+            var is_image = file.type.indexOf("image") > -1
184
+            var mb = file.size / 1024 / 1024
185
+
186
+            if (!is_image) {
187
+                this.$message.error("请上传图片")
188
+                return false
189
+            }
190
+            if (mb > 3) {
191
+                this.$message.error("上传主图大小不能超过3MB")
192
+                return false
193
+            }
194
+
195
+            var rand = Math.floor(Math.random() * 1000000000)
196
+            var date = new Date()
197
+            var ext = getFileExtension(file.name)
198
+            var key = "" + date.getFullYear() + (date.getMonth() + 1) + date.getDate() + "_activity_" + rand + "." + ext
199
+
200
+            this.uploading_poster_photo = true
201
+
202
+            return new Promise((resolve, reject) => {
203
+                getToken().then(rs => {
204
+                    var token = rs.data.data.uptoken
205
+                    this.qntoken = token
206
+                    this.poster_photo_file_key = key
207
+                    resolve(true)
208
+                }).catch(err => {
209
+                    this.uploading_poster_photo = false
210
+                    reject(false)
211
+                })
212
+            })
213
+        },
214
+    },
8 215
 }
9 216
 </script>
10 217
 
11 218
 <style lang="scss" scoped>
219
+.edit-form-main {
220
+    .form-title {
221
+        width: 100%;
222
+        height: 60px;
223
+        padding: 20px 0 20px 30px;
224
+        border-bottom: 1px #dee2e5 solid;
225
+
226
+        .icon {
227
+            margin-top: -4px;
228
+            vertical-align: middle;
229
+        }
230
+
231
+        span {
232
+            font-size: 18px;
233
+            font-weight: 500;
234
+            color: #485b6d;
235
+            margin-left: 10px;
236
+        }
237
+    }
12 238
 
239
+    .form-content {
240
+        width: 100%;
241
+        padding: 14px 30px 14px 30px;
242
+
243
+        .module-panel {
244
+            // padding: 0 30px;
245
+
246
+            .module-title {
247
+                font-size: 18px;
248
+                color: #a8b3ba;
249
+
250
+                img {
251
+                    float: left;
252
+                    display: block;
253
+                    padding: 2px 19px 0 0;
254
+                }
255
+            }
256
+
257
+            .module-item {
258
+                margin-top: 20px;
259
+                display: flex;
260
+                // padding: 0 30px;
261
+
262
+                .item-title {
263
+                    width: 115px;
264
+                    height: 40px;
265
+                    line-height: 40px;
266
+                    color: #485b6d;
267
+                    font-size: 13px;
268
+                    // font-weight: 100;
269
+                    text-align: right;
270
+                    padding-right: 22px;
271
+                    float: left;
272
+                }
273
+
274
+                .item-input {
275
+                    flex: 1;
276
+                    color: #485b6d;
277
+                }
278
+
279
+                .limit-text {
280
+                    line-height: 40px;
281
+                    color: #a8b3ba;
282
+                    font-size: 13px;
283
+                    // font-weight: 100;
284
+                    text-align: left;
285
+                    padding-left: 10px;
286
+                }
287
+
288
+                .poster-photo-panel {
289
+                    display: flex;
290
+                    flex: 1;
291
+                    align-items: center;
292
+
293
+                    .input {
294
+                        flex: 1;
295
+                        color: #485b6d;
296
+                        cursor: pointer;
297
+                    }
298
+                }
299
+            }
300
+
301
+            .poster-photo-hint {
302
+                font-size: 12px;
303
+                line-height: 16px;
304
+                color: #a8b3ba;
305
+                margin-left: 115px;
306
+            }
307
+        }
308
+
309
+        .submit-button-panel {
310
+            padding: 0 0 0 115px;
311
+            margin-top: 30px;
312
+        }
313
+    }
314
+}
13 315
 </style>
14 316
 

+ 121 - 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 {
@@ -173,7 +238,7 @@ export default {
173 238
             .icon {
174 239
                 img {
175 240
                     width: 20px;
176
-                    height: 20px;
241
+                    height: auto;//20px;
177 242
                     vertical-align: middle;
178 243
                 }
179 244
             }
@@ -193,6 +258,50 @@ export default {
193 258
                     vertical-align: middle;
194 259
                 }
195 260
             }
261
+
262
+            .title {
263
+                p {
264
+                    color: #485b6d;
265
+                }
266
+            }
267
+            .detail {
268
+                flex: 1;
269
+                padding-left: 23px;
270
+                color: #485b6d;
271
+
272
+                p {
273
+                    color: #485b6d;
274
+                    float: right;
275
+                    text-align: right;
276
+                }
277
+            }
278
+        }
279
+
280
+        .large-text-cell {
281
+            padding: 20px 20px;
282
+            position: relative;
283
+            -webkit-box-align: center;
284
+            align-items: center;
285
+            margin-top: 15px;
286
+
287
+            .title {
288
+                color: #485b6d;
289
+                line-height: 18px;
290
+                height: 18px;
291
+
292
+                img {
293
+                    // width: 18px;
294
+                    // height: auto;
295
+                    margin-right: 11px;
296
+                    float: left;
297
+                }
298
+            }
299
+            .content {
300
+                color: #a8b3ba;
301
+                margin: 10px 0 0 0;
302
+                font-size: 14px;
303
+                line-height: 20px;
304
+            }
196 305
         }
197 306
     }
198 307
 }

+ 207 - 0
src/scrm_pages/members/cards.vue Voir le fichier

@@ -0,0 +1,207 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
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>
6
+    </div>
7
+    <div class="app-container">
8
+        <div class="filter-container" style="margin-top: 10px;margin-left: 5px " id="member-cards-box">
9
+          <div class="col" v-for="(card, index) in cardsData" :key="index">
10
+              <div class="thumbnail">
11
+
12
+                  <div class="pic" v-if="card.background_type==1" :style="'background: '+card.background">
13
+                      <div class="ico_crow" ></div>
14
+                  </div>
15
+                  <div class="pic" v-else>
16
+                      <img :src="card.background" alt="...">
17
+                  </div>
18
+                  <h3 class="tit">{{card.card_name}}</h3>
19
+                  <div class="caption">
20
+                      <h3 class="card_edier">
21
+                        <span @click="openEdit(card, index)">编辑会员卡</span> -
22
+                        <span @click="openDelete(card, index)">删除会员卡</span>
23
+                      </h3>
24
+                  </div>
25
+              </div>
26
+          </div>
27
+        </div>
28
+        <!--create-card-form 添加会员卡-->
29
+        <create-card-form ref="createCardForm" :cardsData="cardsData" ></create-card-form>
30
+        <!--create-card-form 编辑会员卡-->
31
+        <edit-card-form ref="editCardForm" :cardsData="cardsData" :cardIndex="cardIndex" :form="editFormData"></edit-card-form>
32
+    </div>
33
+  </div>
34
+</template>
35
+
36
+<script>
37
+  import {GetCards, DeleteMemberShipCard} from "@/api/member/member";
38
+  import BreadCrumb from '../components/bread-crumb';
39
+  import CreateCardForm from "./components/CreateCardForm";
40
+  import EditCardForm from "./components/EditCardForm";
41
+
42
+  export default {
43
+    name: 'memberCardList',
44
+    components:{
45
+      BreadCrumb,
46
+      CreateCardForm,
47
+      EditCardForm,
48
+    },
49
+    data(){
50
+      return{
51
+        crumbs: [
52
+          { path: false, name: '会员管理' },
53
+          { path: false, name: '会员卡管理' }
54
+        ],
55
+        cardsData:[],
56
+        editFormData:{
57
+            background_type:1,
58
+            background:"#409EFF",
59
+            background_color:"#409EFF",
60
+            background_image:"",
61
+            card_name:'',
62
+            use_notice:'',
63
+            card_right:'',
64
+            service_phone:'',
65
+            upgrade_integral:0,
66
+            id:0,
67
+        },
68
+        cardIndex:-1,
69
+      }
70
+    },
71
+    methods:{
72
+        openCreate:function(){
73
+          this.$refs.createCardForm.open();
74
+        },
75
+        openEdit(row, index) {
76
+          for (const key in this.editFormData) {
77
+            this.editFormData[key] = row[key];
78
+          }
79
+          this.cardIndex = index;
80
+          this.$refs.editCardForm.open();
81
+        },
82
+        openDelete:function(row,index){
83
+          this.$confirm('确认要删除该会员卡吗?<br>删除后,该会员卡将无法恢复', '删除提示', {
84
+            dangerouslyUseHTMLString:true,
85
+            confirmButtonText: '确定',
86
+            cancelButtonText: '取消',
87
+            type: 'warning'
88
+          }).then(() => {
89
+            var ids = [];
90
+            ids.push(row.id);
91
+            DeleteMemberShipCard({ids:ids}).then(response=>{
92
+              var res = response.data;
93
+              if (res.state === 1) {
94
+                this.cardsData.splice(index, 1);
95
+                this.$message.success("删除会员卡成功");
96
+              }else {
97
+                this.$message.error(res.msg);
98
+              }
99
+            }).catch(e=>{});
100
+          }).catch(() => {
101
+            return false        
102
+          });
103
+        },
104
+        GetCards(){
105
+            GetCards().then(response=>{
106
+                var res = response.data;
107
+                if(res.state===1) {
108
+                    this.cardsData = res.data.cards;
109
+                }
110
+            }).catch(e=>{})
111
+        }
112
+    },
113
+    created(){
114
+        this.GetCards();
115
+    }
116
+  }
117
+</script>
118
+
119
+<style scoped>
120
+ #member-cards-box .col {
121
+    float: left;
122
+    padding: 0 6px;
123
+ }
124
+ #member-cards-box .thumbnail {
125
+    padding: 0;
126
+    position: relative;
127
+    border: none;
128
+    background: #dde1e4;
129
+    color: #58a2ec;
130
+    display: block;
131
+    padding: 4px;
132
+    margin-bottom: 20px;
133
+    line-height: 1.42857143;
134
+    background-color: #fff;
135
+    border-radius: 4px;
136
+    -webkit-transition: border .2s ease-in-out;
137
+    -o-transition: border .2s ease-in-out;
138
+    transition: border .2s ease-in-out;
139
+}
140
+ #member-cards-box .thumbnail .pic {
141
+    width: 20rem;
142
+    height: 8rem;
143
+    background: #58a2ec;
144
+    border-radius: 25px 25px 0 0;
145
+    position: relative;
146
+}
147
+ #member-cards-box .thumbnail .ico_crow {
148
+    position: absolute;
149
+    right: 18px;
150
+    top: 10px;
151
+    width: 64px;
152
+    height: 54px;
153
+    background: url("https://images.shengws.com/icos-201906141103.png") no-repeat -58px -422px;
154
+}
155
+ #member-cards-box .thumbnail .pic img {
156
+    width: 100%;
157
+    height: 100%;
158
+    object-position: top left;
159
+    object-fit: cover;
160
+    border-radius: 25px 25px 0 0;
161
+    margin: 0;
162
+    border: 0;
163
+    vertical-align: middle;
164
+}
165
+
166
+ #member-cards-box .thumbnail .tit {
167
+    position: absolute;
168
+    top: 1.5rem;
169
+    left: 1.5rem;
170
+    font-size: 1rem;
171
+    color: #fff;
172
+}
173
+ #member-cards-box .thumbnail .caption {
174
+    background: #eef6fd;
175
+    border-radius: 0 0 20px 20px;
176
+    height: 38px;
177
+    cursor: pointer;
178
+    max-width: 100%;
179
+    padding: 9px;
180
+    color: #333;
181
+}
182
+ #member-cards-box .thumbnail .caption .card_edier {
183
+    font-size: 12px;
184
+    color: #58a2ec;
185
+    padding-left: 0.8rem;
186
+}
187
+ #member-cards-box .thumbnail .caption .card_edier span {
188
+    color: #58a2ec;
189
+    text-decoration: none;
190
+}
191
+
192
+ #member-cards-box .thumbnail .caption .card_edier span:hover {
193
+    color: #58a2ec;
194
+    text-decoration: underline;
195
+}
196
+  /*.app-container .cell.clearfix .time ul li {*/
197
+    /*float: left;*/
198
+    /*list-style: none;*/
199
+    /*cursor: pointer;*/
200
+    /*padding: 6px 20px;*/
201
+    /*color: #606266;*/
202
+    /*border-radius: 4px;*/
203
+    /*margin: 0 8px 0 0;*/
204
+    /*font-size: 14px;*/
205
+    /*text-align: center;*/
206
+  /*}*/
207
+</style>

+ 385 - 0
src/scrm_pages/members/components/CreateCardForm.vue Voir le fichier

@@ -0,0 +1,385 @@
1
+<template>
2
+    <div id="create-card-form-box">
3
+        <el-dialog title="添加会员卡" :visible.sync="createCardFormVisible" width="900px" id="create-member-card-show" v-loading="submitLoading" :element-loading-text="loadingText">
4
+            <el-row>
5
+                <el-col :span="10">
6
+                    <div class="membercard-area" :style="membercardAreaBackground">
7
+                        <span class="ico_crown"></span>
8
+                        <div class="card-header clearfix">
9
+                            <h4 class="shop-name">
10
+                                <span class="shop-logo">
11
+                                    <img :src="orgLogo"> 
12
+                                </span>
13
+                                <span class="tit">{{form.card_name}}</span>
14
+                            </h4>
15
+                            <div class="qr-code"></div>
16
+                        </div>
17
+                        <h3 class="member-type"></h3>
18
+                        <div class="card-content">
19
+                            <p class="expiry-date">
20
+                                有效期:
21
+                                <span>无限期</span>
22
+                            </p>
23
+                        </div>
24
+                    </div>
25
+                </el-col>
26
+                <el-col :span="14">
27
+                    <el-form ref="cardForm" :rules="cardRules" :model="form" label-width="100px" id="create-member-card-form">
28
+                        <el-form-item label="机构Logo:" >
29
+                            <el-upload class="org-logo" action="https://upload.qiniup.com" disabled >
30
+                                <img v-if="orgLogo" :src="orgLogo" class="org-logo-image">
31
+                                <i v-else class="el-icon-plus org-logo-icon"></i>
32
+                                <div class="el-upload__tip" slot="tip">如需修改机构Logo信息,请在<em>机构中心</em>中更新。</div>
33
+                            </el-upload>
34
+                        </el-form-item>
35
+                        <el-form-item label="卡片封面:" required prop="background_type">
36
+                            <el-radio-group v-model="form.background_type">
37
+                                <el-radio :label="bgt.id" :value="bgt.id" :key="index" v-for="(bgt, index) in backgroundTypeOptions">{{bgt.name}}</el-radio>
38
+                            </el-radio-group>
39
+                        </el-form-item>
40
+                        <el-form-item label="背景色:"  prop="background_color"  v-show="form.background_type==1">
41
+                            <el-color-picker v-model="form.background_color" @change="handleChangeColor" :predefine="predefineData"></el-color-picker>
42
+                        </el-form-item>
43
+                        <el-form-item label="封面图片:"  prop="background_image"  v-show="form.background_type==2">
44
+                           <el-upload
45
+                                v-loading="uploading"
46
+                                :element-loading-text="loadingText"
47
+                                class="bg-image-uploader"
48
+                                :data="uploadData"
49
+                                action="https://upload.qiniup.com"
50
+                                :show-file-list="false"
51
+                                :on-error="handleBackImageError"
52
+                                :on-success="handleBackImageSuccess"
53
+                                :before-upload="beforeBackImageUpload"
54
+                            >
55
+                                <img v-if="form.background_image" :src="form.background_image" class="bg-image">
56
+                                <i v-else class="el-icon-plus bg-image-uploader-icon"></i>
57
+                                <div class="el-upload__tip" slot="tip">尺寸:906*498像素,小于2M,支持jpg、png、jpeg格式</div>
58
+                            </el-upload>
59
+                        </el-form-item>
60
+
61
+                        <el-form-item label="会员卡名称:" required prop="card_name" >
62
+                            <el-input v-model="form.card_name" placeholder="最多可输入9个字符" maxlength="9"></el-input>
63
+                        </el-form-item>
64
+                        <el-form-item label="使用须知:"  prop="use_notice">
65
+                            <el-input v-model="form.use_notice" type="textarea" rows='4' placeholder="会员特权会根据您上文的勾选情况系统自动生成,此处可填写其它补充信息以便会员知晓,最多可输入300个字符"  maxlength="300"></el-input>
66
+                        </el-form-item>
67
+                        <el-form-item label="会员权益:"  prop="card_right">
68
+                            <el-input v-model="form.card_right" type="textarea" rows='4' placeholder="会员特权会根据您上文的勾选情况系统自动生成,此处可填写其它补充信息以便会员知晓,最多可输入300个字符"  maxlength="300"></el-input>
69
+                        </el-form-item>
70
+                        <el-form-item label="客服电话:"  prop="service_phone" >
71
+                            <el-input v-model="form.service_phone" placeholder="请输入手机号或固定电话" ></el-input>
72
+                        </el-form-item>
73
+                        <el-form-item label="升级条件:"  prop="upgrade_integral" >
74
+                            累积积分达到
75
+                            <el-input v-model.number="form.upgrade_integral" style="width:100px;" placeholder="" ></el-input>
76
+                            分
77
+                        </el-form-item>
78
+                    </el-form>
79
+                </el-col>
80
+            </el-row>
81
+            
82
+            <div slot="footer" class="dialog-footer">
83
+                <el-button @click="createCardFormVisible = false">取消</el-button>
84
+                <el-button
85
+                type="primary"
86
+                @click="submitForm('cardForm')"
87
+                >保 存
88
+                </el-button>
89
+            </div>
90
+        </el-dialog>  
91
+    </div>
92
+</template>
93
+
94
+<script>
95
+import {CreateMemberShipCard} from "@/api/member/member";
96
+import { getFileExtension,checkHexColor,checkMobileOrPhone } from "@/utils/tools";
97
+import { getToken } from "@/api/qiniu";
98
+
99
+export default {
100
+    name:'CreateCardForm',
101
+    props:{
102
+        cardsData:{
103
+            type: Array,
104
+            default: function () {
105
+                return [];
106
+            }
107
+        },
108
+    },
109
+    data(){
110
+        var checkBgColorRule = (rule, value, callback) => {
111
+            if (this.form.background_type == 1 && !checkHexColor(value)) {
112
+                callback(new Error('请选择背景色'));
113
+            }else {
114
+               callback(); 
115
+            }
116
+        };
117
+        var checkBgImageRule = (rule, value, callback) => {
118
+            if (this.form.background_type == 2 && !value) {
119
+                callback(new Error('请上图片封面图片'));
120
+            }else {
121
+               callback(); 
122
+            }
123
+        };
124
+        var checkTelRule = (rule, value, callback) => {
125
+            if (value && !checkMobileOrPhone(value)) {
126
+                callback(new Error('请填写正确的客服电话:13888888888 或 0756-1234567'));
127
+            }else {
128
+               callback(); 
129
+            }
130
+        };
131
+        var checkIntegralRule = (rule, value, callback) => {
132
+            if(!value) {
133
+                callback(); 
134
+            }else {
135
+                if(!Number.isInteger(value)) {
136
+                    callback(new Error('必须是整数'));
137
+                }else {
138
+                    if (value<0) {
139
+                        callback(new Error('不能小于0'));
140
+                    }else {
141
+                        callback(); 
142
+                    }
143
+                }
144
+            }
145
+        };
146
+        return {
147
+            createCardFormVisible:false,
148
+            qiniuDomain: "https://images.shengws.com/",
149
+            uploading:false,
150
+            loadingText:'',
151
+            submitLoading:false,
152
+            uploadData: { token: "", key: "" },
153
+            predefineData:['#65d3e3','#82cecb','#5bd18b','#58a2ec','#9675cc','#f2ca68','#ff7979','#aed15b','#75c075','#67b192','#7b8a97','#34495e','#262626'],
154
+            backgroundTypeOptions:[
155
+                {id:1, name:'背景色'},
156
+                {id:2, name:'封面图片'},
157
+            ],
158
+            
159
+            cardRules: {
160
+                card_name: [{required: true, message: "请填写会员卡名称",},],
161
+                background_color: [{ validator: checkBgColorRule}],
162
+                background_image: [{ validator: checkBgImageRule}],
163
+                service_phone: [{ validator: checkTelRule}],
164
+                upgrade_integral: [{ validator:checkIntegralRule}],
165
+            },
166
+            form:{
167
+                background_type:1,
168
+                background:"#409EFF",
169
+                background_color:"#409EFF",
170
+                background_image:"",
171
+                card_name:'',
172
+                use_notice:'',
173
+                card_right:'',
174
+                service_phone:'',
175
+                upgrade_integral:0,
176
+            },
177
+        }
178
+    },
179
+    methods:{
180
+        open:function(){
181
+            this.resetForm("cardForm");
182
+            this.createCardFormVisible = true;
183
+        },
184
+        resetForm:function(formName) {
185
+            if (typeof(this.$refs[formName]) !='undefined') {
186
+                this.$refs[formName].resetFields();
187
+            }
188
+        },
189
+        handleChangeColor:function(color){
190
+            this.form.background = color;
191
+        },
192
+        handleBackImageError(err, file, fileList) {
193
+            this.$message.error(err);
194
+            this.uploading = false;
195
+            return false;
196
+        },
197
+        handleBackImageSuccess(res, file) {
198
+            var url = this.qiniuDomain + res.url;
199
+            this.form.background_image = url
200
+            this.form.background = url;
201
+            this.uploading = false;
202
+        },
203
+        beforeBackImageUpload(file) {
204
+            var fileType = file.type;
205
+            const isJPG = fileType.indexOf("image") > -1;
206
+            const isLt2M = file.size / 1024 / 1024 < 2;
207
+            if (!isJPG) {
208
+                this.$message.error("只能上传图片");
209
+                return false;
210
+            }
211
+            if (!isLt2M) {
212
+                this.$message.error("图片大小不能超过 2MB!");
213
+                return false;
214
+            }
215
+
216
+            var date = new Date();
217
+            var ext = getFileExtension(file.name);
218
+            var key = "" + date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours() + date.getMinutes() + date.getSeconds() + "_card_" +file.uid +"." + ext;
219
+            this.uploading = true;
220
+            this.loadingText = "图片上传中";
221
+
222
+            const _self = this;
223
+            return new Promise((resolve, reject) => {
224
+                getToken()
225
+                .then(response => {
226
+                    const token = response.data.data.uptoken;
227
+                    _self._data.uploadData.token = token;
228
+                    _self._data.uploadData.key = key;
229
+                    resolve(true);
230
+                })
231
+                .catch(err => {
232
+                    reject(false);
233
+                    this.uploading = false;
234
+                });
235
+            });
236
+        },
237
+        submitForm:function(formName){
238
+            this.$refs[formName].validate((valid) => {
239
+                if (valid) {
240
+                    this.loadingText = "正在保存...";
241
+                    this.submitLoading = true;
242
+                    CreateMemberShipCard(this.form).then(response=>{
243
+                        var res = response.data;
244
+                        if(res.state === 1) {
245
+                            var card = res.data.card;
246
+                            this.cardsData.push(card);
247
+                            this.resetForm("cardForm");
248
+                            this.createCardFormVisible = false;
249
+                            this.$message.success("添加会员卡成功");
250
+                        }else {
251
+                            this.$message.error(res.msg);
252
+                        }
253
+                        this.submitLoading = false;
254
+                    }).catch(e=>{
255
+                        this.submitLoading = false;
256
+                    });
257
+                } else {
258
+                    return false;
259
+                }
260
+            });
261
+        },
262
+    },
263
+    computed: {
264
+      orgLogo: function() {
265
+        var avatar = this.$store.getters.xt_user.org.org_logo
266
+        return avatar.length > 0
267
+          ? avatar
268
+          : require('../../../assets/home/userData.png')
269
+      },
270
+      membercardAreaBackground:function(){
271
+          if (this.form.background_type == 1) {
272
+              return 'background:' + this.form.background_color;
273
+          }else {
274
+              return 'background: url("' + this.form.background_image + '") 0% 0% / 100% 100% no-repeat;'
275
+          }
276
+      }
277
+    },
278
+}
279
+</script>
280
+
281
+<style rel="stylesheet/scss" >
282
+#create-member-card-form .org-logo .el-upload {
283
+  border: 1px dashed #d9d9d9;
284
+  border-radius: 25px;
285
+  cursor: pointer;
286
+  position: relative;
287
+  overflow: hidden;
288
+}
289
+#create-member-card-form .org-logo .el-upload:hover {
290
+  border-color: #409eff;
291
+}
292
+#create-member-card-form .org-logo-icon {
293
+  font-size: 28px;
294
+  color: #8c939d;
295
+  width: 50px;
296
+  height: 50px;
297
+  line-height: 50px;
298
+  text-align: center;
299
+}
300
+
301
+#create-member-card-form .el-upload__tip em {
302
+    color: #5599eb;
303
+}
304
+
305
+#create-member-card-form .org-logo-image {
306
+  width: 50px;
307
+  height: 50px;
308
+  display: block;
309
+}
310
+
311
+
312
+#create-member-card-form .bg-image-uploader .el-upload {
313
+  border: 1px dashed #d9d9d9;
314
+  border-radius: 10px;
315
+  cursor: pointer;
316
+  position: relative;
317
+  overflow: hidden;
318
+}
319
+#create-member-card-form .bg-image-uploader .el-upload:hover {
320
+  border-color: #409eff;
321
+}
322
+#create-member-card-form .bg-image-uploader-icon {
323
+  font-size: 28px;
324
+  color: #8c939d;
325
+  width: 278px;
326
+  height: 130px;
327
+  line-height: 130px;
328
+  text-align: center;
329
+}
330
+#create-member-card-form .bg-image {
331
+  width: 278px;
332
+  height: 130px;
333
+  display: block;
334
+}
335
+
336
+#create-member-card-show .membercard-area {
337
+    margin: 9px;
338
+    padding: 14px 18px 24px 17px;
339
+    background: #5599eb;
340
+    color: #fff;
341
+    border-radius: 20px 20px 20px 20px;
342
+    position: relative;
343
+}
344
+#create-member-card-show  .membercard-area .ico_crown {
345
+    position: absolute;
346
+    right: 18px;
347
+    width: 64px;
348
+    height: 54px;
349
+    background: url("https://images.shengws.com/icos-201906141103.png") no-repeat -58px -422px;
350
+}
351
+#create-member-card-show .clearfix {
352
+    clear: both;
353
+}
354
+#create-member-card-show .clearfix:before {
355
+    display: table;
356
+    content: " ";
357
+}
358
+#create-member-card-show .membercard-area .shop-name {
359
+    font-size: 14px;
360
+}
361
+#create-member-card-show .membercard-area .shop-name .shop-logo {
362
+    display: inline-block;
363
+    width: 40px;
364
+    height: 40px;
365
+    float: left;
366
+    margin-right: 13px;
367
+}
368
+#create-member-card-show .membercard-area .shop-name .shop-logo img {
369
+    width: 40px;
370
+    height: 40px;
371
+    border-radius: 50%;
372
+}
373
+#create-member-card-show .membercard-area .shop-name .tit {
374
+    height: 41px;
375
+    line-height: 41px;
376
+}
377
+#create-member-card-show  .member-type {
378
+    height: 70px;
379
+    line-height: 70px;
380
+}
381
+#create-member-card-show .membercard-area .card-content .expiry-date {
382
+    font-size: 12px;
383
+}
384
+</style>
385
+

+ 87 - 0
src/scrm_pages/members/components/CreateTagForm.vue Voir le fichier

@@ -0,0 +1,87 @@
1
+<template>
2
+    <div id="create-tag-form-box">
3
+        <el-dialog title="添加标签" :visible.sync="createTagFormVisible" width="700px" >
4
+            <el-form ref="tagForm" :rules="tagRules" :model="form" label-width="60px">
5
+                <el-row>
6
+                    <el-col :span="24">
7
+                        <el-form-item label="标签:" required prop="tag_name">
8
+                        <el-input v-model="form.tag_name"></el-input>
9
+                        </el-form-item>
10
+                    </el-col>
11
+                </el-row>
12
+            </el-form>
13
+            <div slot="footer" class="dialog-footer">
14
+                <el-button @click="createTagFormVisible = false">取消</el-button>
15
+                <el-button
16
+                type="primary"
17
+                @click="submitForm('tagForm')"
18
+                >保 存
19
+                </el-button>
20
+            </div>
21
+        </el-dialog>  
22
+    </div>
23
+</template>
24
+
25
+<script>
26
+import {CreateTag} from "@/api/member/member";
27
+
28
+export default {
29
+    name:'CreateTagForm',
30
+    props:{
31
+        tagsData:{
32
+            type: Array,
33
+            default: function () {
34
+                return [];
35
+            }
36
+        },
37
+    },
38
+    data(){
39
+        return {
40
+            createTagFormVisible:false,
41
+            
42
+            tagRules: {
43
+                tag_name: [{required: true, message: "请填写标签",},],
44
+                
45
+            },
46
+            form:{
47
+                tag_name:'',
48
+            },
49
+            
50
+        }
51
+    },
52
+    methods:{
53
+        open:function(){
54
+            this.resetForm("tagForm");
55
+            this.createTagFormVisible = true;
56
+        },
57
+        resetForm(formName) {
58
+            if (typeof(this.$refs[formName]) !='undefined') {
59
+                this.$refs[formName].resetFields();
60
+            }
61
+        },
62
+        submitForm(formName){
63
+            this.$refs[formName].validate((valid) => {
64
+                if (valid) {
65
+                    CreateTag(this.form).then(response=>{
66
+                        var res = response.data;
67
+                        if(res.state === 1) {
68
+                            var tag = res.data.tag;
69
+                            tag["member_count"] = 0;
70
+                            this.tagsData.unshift(tag);
71
+                            this.resetForm("tagForm");
72
+                            this.createTagFormVisible = false;
73
+                            this.$message.success("添加标签成功");
74
+                        }else {
75
+                            this.$message.error(res.msg);
76
+                        }
77
+                    }).catch(e=>{});
78
+
79
+                } else {
80
+                    return false;
81
+                }
82
+            });
83
+        },
84
+    }
85
+}
86
+</script>
87
+

+ 396 - 0
src/scrm_pages/members/components/EditCardForm.vue Voir le fichier

@@ -0,0 +1,396 @@
1
+<template>
2
+    <div id="edit-card-form-box">
3
+        <el-dialog title="编辑会员卡" :visible.sync="editCardFormVisible" width="900px" id="edit-member-card-show" v-loading="submitLoading" :element-loading-text="loadingText">
4
+            <el-row>
5
+                <el-col :span="10">
6
+                    <div class="membercard-area" :style="membercardAreaBackground">
7
+                        <span class="ico_crown"></span>
8
+                        <div class="card-header clearfix">
9
+                            <h4 class="shop-name">
10
+                                <span class="shop-logo">
11
+                                    <img :src="orgLogo"> 
12
+                                </span>
13
+                                <span class="tit">{{form.card_name}}</span>
14
+                            </h4>
15
+                            <div class="qr-code"></div>
16
+                        </div>
17
+                        <h3 class="member-type"></h3>
18
+                        <div class="card-content">
19
+                            <p class="expiry-date">
20
+                                有效期:
21
+                                <span>无限期</span>
22
+                            </p>
23
+                        </div>
24
+                    </div>
25
+                </el-col>
26
+                <el-col :span="14">
27
+                    <el-form ref="cardForm" :rules="cardRules" :model="form" label-width="100px" id="edit-member-card-form">
28
+                        <el-form-item label="机构Logo:" >
29
+                            <el-upload class="org-logo" action="https://upload.qiniup.com" disabled >
30
+                                <img v-if="orgLogo" :src="orgLogo" class="org-logo-image">
31
+                                <i v-else class="el-icon-plus org-logo-icon"></i>
32
+                                <div class="el-upload__tip" slot="tip">如需修改机构Logo信息,请在<em>机构中心</em>中更新。</div>
33
+                            </el-upload>
34
+                        </el-form-item>
35
+                        <el-form-item label="卡片封面:" required prop="background_type">
36
+                            <el-radio-group v-model="form.background_type">
37
+                                <el-radio :label="bgt.id" :value="bgt.id" :key="index" v-for="(bgt, index) in backgroundTypeOptions">{{bgt.name}}</el-radio>
38
+                            </el-radio-group>
39
+                        </el-form-item>
40
+                        <el-form-item label="背景色:"  prop="background_color"  v-show="form.background_type==1">
41
+                            <el-color-picker v-model="form.background_color" @change="handleChangeColor" :predefine="predefineData"></el-color-picker>
42
+                        </el-form-item>
43
+                        <el-form-item label="封面图片:"  prop="background_image"  v-show="form.background_type==2">
44
+                           <el-upload
45
+                                v-loading="uploading"
46
+                                :element-loading-text="loadingText"
47
+                                class="bg-image-uploader"
48
+                                :data="uploadData"
49
+                                action="https://upload.qiniup.com"
50
+                                :show-file-list="false"
51
+                                :on-error="handleBackImageError"
52
+                                :on-success="handleBackImageSuccess"
53
+                                :before-upload="beforeBackImageUpload"
54
+                            >
55
+                                <img v-if="form.background_image" :src="form.background_image" class="bg-image">
56
+                                <i v-else class="el-icon-plus bg-image-uploader-icon"></i>
57
+                                <div class="el-upload__tip" slot="tip">尺寸:906*498像素,小于2M,支持jpg、png、jpeg格式</div>
58
+                            </el-upload>
59
+                        </el-form-item>
60
+
61
+                        <el-form-item label="会员卡名称:" required prop="card_name" >
62
+                            <el-input v-model="form.card_name" placeholder="最多可输入9个字符" maxlength="9"></el-input>
63
+                        </el-form-item>
64
+                        <el-form-item label="使用须知:"  prop="use_notice">
65
+                            <el-input v-model="form.use_notice" type="textarea" rows='4' placeholder="会员特权会根据您上文的勾选情况系统自动生成,此处可填写其它补充信息以便会员知晓,最多可输入300个字符"  maxlength="300"></el-input>
66
+                        </el-form-item>
67
+                        <el-form-item label="会员权益:"  prop="card_right">
68
+                            <el-input v-model="form.card_right" type="textarea" rows='4' placeholder="会员特权会根据您上文的勾选情况系统自动生成,此处可填写其它补充信息以便会员知晓,最多可输入300个字符"  maxlength="300"></el-input>
69
+                        </el-form-item>
70
+                        <el-form-item label="客服电话:"  prop="service_phone" >
71
+                            <el-input v-model="form.service_phone" placeholder="请输入手机号或固定电话" ></el-input>
72
+                        </el-form-item>
73
+                        <el-form-item label="升级条件:"  prop="upgrade_integral" >
74
+                            累积积分达到
75
+                            <el-input v-model.number="form.upgrade_integral" style="width:100px;" placeholder="" ></el-input>
76
+                            分
77
+                        </el-form-item>
78
+                    </el-form>
79
+                </el-col>
80
+            </el-row>
81
+            
82
+            <div slot="footer" class="dialog-footer">
83
+                <el-button @click="editCardFormVisible = false">取消</el-button>
84
+                <el-button
85
+                type="primary"
86
+                @click="submitForm('cardForm')"
87
+                >保 存
88
+                </el-button>
89
+            </div>
90
+        </el-dialog>  
91
+    </div>
92
+</template>
93
+
94
+<script>
95
+import {EditMemberShipCard} from "@/api/member/member";
96
+import { getFileExtension,checkHexColor,checkMobileOrPhone } from "@/utils/tools";
97
+import { getToken } from "@/api/qiniu";
98
+
99
+export default {
100
+    name:'EditCardForm',
101
+    props:{
102
+        cardsData:{
103
+            type: Array,
104
+            default: function () {
105
+                return [];
106
+            }
107
+        },
108
+        cardIndex:{
109
+            type:Number,
110
+            default:-1.
111
+        },
112
+        form:{
113
+            background_type:1,
114
+            background:"#409EFF",
115
+            background_color:"#409EFF",
116
+            background_image:"",
117
+            card_name:'',
118
+            use_notice:'',
119
+            card_right:'',
120
+            service_phone:'',
121
+            upgrade_integral:0,
122
+            id:0,
123
+        },
124
+    },
125
+    data(){
126
+        var checkBgColorRule = (rule, value, callback) => {
127
+            if (this.form.background_type == 1 && !checkHexColor(value)) {
128
+                callback(new Error('请选择背景色'));
129
+            }else {
130
+               callback(); 
131
+            }
132
+        };
133
+        var checkBgImageRule = (rule, value, callback) => {
134
+            if (this.form.background_type == 2 && !value) {
135
+                callback(new Error('请上图片封面图片'));
136
+            }else {
137
+               callback(); 
138
+            }
139
+        };
140
+        var checkTelRule = (rule, value, callback) => {
141
+            if (value && !checkMobileOrPhone(value)) {
142
+                callback(new Error('请填写正确的客服电话:13888888888 或 0756-1234567'));
143
+            }else {
144
+               callback(); 
145
+            }
146
+        };
147
+        var checkIntegralRule = (rule, value, callback) => {
148
+            if(!value) {
149
+                callback(); 
150
+            }else {
151
+                if(!Number.isInteger(value)) {
152
+                    callback(new Error('必须是整数'));
153
+                }else {
154
+                    if (value<0) {
155
+                        callback(new Error('不能小于0'));
156
+                    }else {
157
+                        callback(); 
158
+                    }
159
+                }
160
+            }
161
+        };
162
+        return {
163
+            editCardFormVisible:false,
164
+            qiniuDomain: "https://images.shengws.com/",
165
+            uploading:false,
166
+            loadingText:'',
167
+            submitLoading:false,
168
+            uploadData: { token: "", key: "" },
169
+            predefineData:['#65d3e3','#82cecb','#5bd18b','#58a2ec','#9675cc','#f2ca68','#ff7979','#aed15b','#75c075','#67b192','#7b8a97','#34495e','#262626'],
170
+            backgroundTypeOptions:[
171
+                {id:1, name:'背景色'},
172
+                {id:2, name:'封面图片'},
173
+            ],
174
+            
175
+            cardRules: {
176
+                card_name: [{required: true, message: "请填写会员卡名称",},],
177
+                background_color: [{ validator: checkBgColorRule}],
178
+                background_image: [{ validator: checkBgImageRule}],
179
+                service_phone: [{ validator: checkTelRule}],
180
+                upgrade_integral: [{ validator:checkIntegralRule}],
181
+            },
182
+        }
183
+    },
184
+    methods:{
185
+        open:function(){
186
+            this.form.background_color = '';
187
+            this.form.background_image = '';
188
+            if (this.form.background_type == 1) {
189
+                this.form.background_color = this.form.background;
190
+            }else {
191
+                this.form.background_image = this.form.background;
192
+            }
193
+            this.editCardFormVisible = true;
194
+        },
195
+        resetForm:function(formName) {
196
+            if (typeof(this.$refs[formName]) !='undefined') {
197
+                this.$refs[formName].resetFields();
198
+            }
199
+        },
200
+        handleChangeColor:function(color){
201
+            this.form.background = color;
202
+        },
203
+        handleBackImageError(err, file, fileList) {
204
+            this.$message.error(err);
205
+            this.uploading = false;
206
+            return false;
207
+        },
208
+        handleBackImageSuccess(res, file) {
209
+            var url = this.qiniuDomain + res.url;
210
+            this.form.background_image = url
211
+            this.form.background = url;
212
+            this.uploading = false;
213
+        },
214
+        beforeBackImageUpload(file) {
215
+            var fileType = file.type;
216
+            const isJPG = fileType.indexOf("image") > -1;
217
+            const isLt2M = file.size / 1024 / 1024 < 2;
218
+            if (!isJPG) {
219
+                this.$message.error("只能上传图片");
220
+                return false;
221
+            }
222
+            if (!isLt2M) {
223
+                this.$message.error("图片大小不能超过 2MB!");
224
+                return false;
225
+            }
226
+
227
+            var date = new Date();
228
+            var ext = getFileExtension(file.name);
229
+            var key = "" + date.getFullYear() + (date.getMonth() + 1) + date.getDate() + date.getHours() + date.getMinutes() + date.getSeconds() + "_card_" +file.uid +"." + ext;
230
+            this.uploading = true;
231
+            this.loadingText = "图片上传中";
232
+
233
+            const _self = this;
234
+            return new Promise((resolve, reject) => {
235
+                getToken()
236
+                .then(response => {
237
+                    const token = response.data.data.uptoken;
238
+                    _self._data.uploadData.token = token;
239
+                    _self._data.uploadData.key = key;
240
+                    resolve(true);
241
+                })
242
+                .catch(err => {
243
+                    reject(false);
244
+                    this.uploading = false;
245
+                });
246
+            });
247
+        },
248
+        submitForm:function(formName){
249
+            this.$refs[formName].validate((valid) => {
250
+                if (valid) {
251
+                    this.loadingText = "正在保存...";
252
+                    this.submitLoading = true;
253
+                    EditMemberShipCard(this.form.id, this.form).then(response=>{
254
+                        var res = response.data;
255
+                        if(res.state === 1) {
256
+                            var card = res.data.card;
257
+                            this.cardsData.splice(this.cardIndex, 1, card);
258
+                            this.resetForm("cardForm");
259
+                            this.editCardFormVisible = false;
260
+                            this.$message.success("编辑会员卡成功");
261
+                        }else {
262
+                            this.$message.error(res.msg);
263
+                        }
264
+                        this.submitLoading = false;
265
+                    }).catch(e=>{
266
+                        this.submitLoading = false;
267
+                    });
268
+                } else {
269
+                    return false;
270
+                }
271
+            });
272
+        },
273
+    },
274
+    computed: {
275
+      orgLogo: function() {
276
+        var avatar = this.$store.getters.xt_user.org.org_logo
277
+        return avatar.length > 0
278
+          ? avatar
279
+          : require('../../../assets/home/userData.png')
280
+      },
281
+      membercardAreaBackground:function(){
282
+          if (this.form.background_type == 1) {
283
+              return 'background:' + this.form.background_color;
284
+          }else {
285
+              return 'background: url("' + this.form.background_image + '") 0% 0% / 100% 100% no-repeat;'
286
+          }
287
+      }
288
+    },
289
+}
290
+</script>
291
+
292
+<style rel="stylesheet/scss" >
293
+#edit-member-card-form .org-logo .el-upload {
294
+  border: 1px dashed #d9d9d9;
295
+  border-radius: 25px;
296
+  cursor: pointer;
297
+  position: relative;
298
+  overflow: hidden;
299
+}
300
+#edit-member-card-form .org-logo .el-upload:hover {
301
+  border-color: #409eff;
302
+}
303
+#edit-member-card-form .org-logo-icon {
304
+  font-size: 28px;
305
+  color: #8c939d;
306
+  width: 50px;
307
+  height: 50px;
308
+  line-height: 50px;
309
+  text-align: center;
310
+}
311
+
312
+#edit-member-card-form .el-upload__tip em {
313
+    color: #5599eb;
314
+}
315
+
316
+#edit-member-card-form .org-logo-image {
317
+  width: 50px;
318
+  height: 50px;
319
+  display: block;
320
+}
321
+
322
+
323
+#edit-member-card-form .bg-image-uploader .el-upload {
324
+  border: 1px dashed #d9d9d9;
325
+  border-radius: 10px;
326
+  cursor: pointer;
327
+  position: relative;
328
+  overflow: hidden;
329
+}
330
+#edit-member-card-form .bg-image-uploader .el-upload:hover {
331
+  border-color: #409eff;
332
+}
333
+#edit-member-card-form .bg-image-uploader-icon {
334
+  font-size: 28px;
335
+  color: #8c939d;
336
+  width: 278px;
337
+  height: 130px;
338
+  line-height: 130px;
339
+  text-align: center;
340
+}
341
+#edit-member-card-form .bg-image {
342
+  width: 278px;
343
+  height: 130px;
344
+  display: block;
345
+}
346
+
347
+#edit-member-card-show .membercard-area {
348
+    margin: 9px;
349
+    padding: 14px 18px 24px 17px;
350
+    background: #5599eb;
351
+    color: #fff;
352
+    border-radius: 20px 20px 20px 20px;
353
+    position: relative;
354
+}
355
+#edit-member-card-show  .membercard-area .ico_crown {
356
+    position: absolute;
357
+    right: 18px;
358
+    width: 64px;
359
+    height: 54px;
360
+    background: url("https://images.shengws.com/icos-201906141103.png") no-repeat -58px -422px;
361
+}
362
+#edit-member-card-show .clearfix {
363
+    clear: both;
364
+}
365
+#edit-member-card-show .clearfix:before {
366
+    display: table;
367
+    content: " ";
368
+}
369
+#edit-member-card-show .membercard-area .shop-name {
370
+    font-size: 14px;
371
+}
372
+#edit-member-card-show .membercard-area .shop-name .shop-logo {
373
+    display: inline-block;
374
+    width: 40px;
375
+    height: 40px;
376
+    float: left;
377
+    margin-right: 13px;
378
+}
379
+#edit-member-card-show .membercard-area .shop-name .shop-logo img {
380
+    width: 40px;
381
+    height: 40px;
382
+    border-radius: 50%;
383
+}
384
+#edit-member-card-show .membercard-area .shop-name .tit {
385
+    height: 41px;
386
+    line-height: 41px;
387
+}
388
+#edit-member-card-show  .member-type {
389
+    height: 70px;
390
+    line-height: 70px;
391
+}
392
+#edit-member-card-show .membercard-area .card-content .expiry-date {
393
+    font-size: 12px;
394
+}
395
+</style>
396
+

+ 94 - 0
src/scrm_pages/members/components/EditTagForm.vue Voir le fichier

@@ -0,0 +1,94 @@
1
+<template>
2
+    <div id="edit-tag-form-box">
3
+        <el-dialog title="编辑标签" :visible.sync="editTagFormVisible" width="700px" >
4
+            <el-form ref="tagForm" :rules="tagRules" :model="form" label-width="60px">
5
+                <el-row>
6
+                    <el-col :span="24">
7
+                        <el-form-item label="标签:" required prop="tag_name">
8
+                        <el-input v-model="form.tag_name"></el-input>
9
+                        </el-form-item>
10
+                    </el-col>
11
+                </el-row>
12
+            </el-form>
13
+            <div slot="footer" class="dialog-footer">
14
+                <el-button @click="editTagFormVisible = false">取消</el-button>
15
+                <el-button
16
+                type="primary"
17
+                @click="submitForm('tagForm')"
18
+                >保 存
19
+                </el-button>
20
+            </div>
21
+        </el-dialog>  
22
+    </div>
23
+</template>
24
+
25
+<script>
26
+import {EditTag} from "@/api/member/member";
27
+
28
+export default {
29
+    name:'EditTagForm',
30
+    props:{
31
+        tagsData:{
32
+            type: Array,
33
+            default: function () {
34
+                return [];
35
+            }
36
+        },
37
+        form:{
38
+            tag_name:'',
39
+            id:0,
40
+        },
41
+        tagIndex:{
42
+            type:Number,
43
+            default:-1,
44
+        },
45
+    },
46
+    data(){
47
+        return {
48
+            editTagFormVisible:false,
49
+            tagRules: {
50
+                tag_name: [{required: true, message: "请填写标签",},],
51
+            },
52
+            oldTagName:'',
53
+        }
54
+    },
55
+    methods:{
56
+        open:function(){
57
+            this.oldTagName = this.form.tag_name;
58
+            this.editTagFormVisible = true;
59
+        },
60
+        resetForm(formName) {
61
+            if (typeof(this.$refs[formName]) !='undefined') {
62
+                this.$refs[formName].resetFields();
63
+            }
64
+        },
65
+        submitForm(formName){
66
+            this.$refs[formName].validate((valid) => {
67
+                if (valid) {
68
+                    if(this.oldTagName == this.form.tag_name) {
69
+                        this.$message.success("标签名未变化");
70
+                        this.editTagFormVisible = false;
71
+                        return false;
72
+                    }
73
+                    EditTag(this.form.id, this.form).then(response=>{
74
+                        var res = response.data;
75
+                        if(res.state === 1) {
76
+                            var tag = res.data.tag;
77
+                            this.tagsData[this.tagIndex].tag_name = tag.tag_name;
78
+                            this.resetForm("tagForm");
79
+                            this.editTagFormVisible = false;
80
+                            this.$message.success("编辑标签成功");
81
+                        }else {
82
+                            this.$message.error(res.msg);
83
+                        }
84
+                    }).catch(e=>{});
85
+
86
+                } else {
87
+                    return false;
88
+                }
89
+            });
90
+        },
91
+    }
92
+}
93
+</script>
94
+

+ 2 - 2
src/scrm_pages/members/members.vue Voir le fichier

@@ -218,6 +218,7 @@
218 218
                 console.log("res是谁?",res)
219 219
                 if(res.state == 1) {
220 220
                     this.membersData = res.data.members;
221
+                    console.log("会员管理的数据",this.membersData)
221 222
                     this.total = res.data.total;
222 223
                     if(typeof(res.data.cards) != 'undefined') {
223 224
                         this.levelCards = res.data.cards;
@@ -367,9 +368,8 @@
367 368
                   this.memberData.ill_date = uParseTime(row.ill_date, "{y}-{m}-{d}");
368 369
               } else if (key in row) {
369 370
                   this.memberData[key] = row[key];                  
370
-              }
371
+              }            
371 372
           }
372
-          
373 373
           // this.memberData = row;
374 374
           this.memberIndex = index;
375 375
           this.$refs.editMemberForm.open();

+ 111 - 12
src/scrm_pages/members/tags.vue Voir le fichier

@@ -15,7 +15,7 @@
15 15
         </div>
16 16
         <div class="filter-container" style="margin-top: 10px;margin-left: 5px">
17 17
             <el-checkbox style="width: 30px" @change="changeCheck" v-model="checkAllStatus">全选</el-checkbox>
18
-            <el-button size="small" icon="el-icon-delete" >批量删除</el-button>
18
+            <el-button size="small" icon="el-icon-delete" @click="openDeleteTags">批量删除</el-button>
19 19
         </div>
20 20
         <el-table ref="multipleTable"  @selection-change="handleSelectionChange"  :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}" :data="tagsData" border fit highlight-current-row  style="width: 100%;margin-top: 10px;">
21 21
             <el-table-column
@@ -30,7 +30,7 @@
30 30
             </el-table-column>
31 31
             <el-table-column label="会员数" align="center">
32 32
                 <template slot-scope="scope">
33
-                <span>{{scope.row.created_time}}</span>
33
+                <span>{{scope.row.member_count}}</span>
34 34
                 </template>
35 35
             </el-table-column>
36 36
             <el-table-column label="操作" align="center">
@@ -44,24 +44,44 @@
44 44
                 </template>
45 45
             </el-table-column>
46 46
         </el-table>
47
+        <el-pagination
48
+            @size-change="handleSizeChange"
49
+            @current-change="handleCurrentChange"
50
+            :page-sizes="[10,20,50,100]"
51
+            :page-size="10"
52
+            background
53
+            style="margin-top:20px;"
54
+            align="right"
55
+            layout="total, sizes, prev, pager, next, jumper"
56
+            :total="total">
57
+        </el-pagination>
58
+
59
+        <!--create-tag-form 添加标签-->
60
+        <create-tag-form ref="createTagForm" :tagsData="tagsData" ></create-tag-form>
61
+        <!--edit-tag-form 编辑标签-->
62
+        <edit-tag-form ref="editTagForm" :tagsData="tagsData" :tagIndex="tagIndex" :form="editForm"></edit-tag-form>
47 63
     </div>
48 64
   </div>
49 65
 </template>
50 66
 
51 67
 <script>
52
-  import {GetTags} from "@/api/member/member";
68
+  import {GetTags,DeleteTags} from "@/api/member/member";
53 69
   import BreadCrumb from '../components/bread-crumb';
54
-  
70
+  import CreateTagForm from "./components/CreateTagForm";
71
+  import EditTagForm from "./components/EditTagForm";
72
+
55 73
   export default {
56 74
     name: 'memberTagList',
57 75
     components:{
58 76
       BreadCrumb,
77
+      CreateTagForm,
78
+      EditTagForm,
59 79
     },
60 80
     data(){
61 81
       return{
62 82
         crumbs: [
63 83
           { path: false, name: '会员管理' },
64
-          { path: false, name: '标签列表' }
84
+          { path: false, name: '标签管理' }
65 85
         ],
66 86
         total:0,
67 87
         listQuery:{
@@ -70,30 +90,109 @@
70 90
             search:'',
71 91
         },
72 92
         checkAllStatus:false,
73
-       
93
+        selectedTags:[],
74 94
         tagsData:[],
95
+        tagIndex:-1,
96
+        editForm:{
97
+            id:0,
98
+            tag_name:'',
99
+        },
75 100
       }
76 101
     },
77 102
     methods:{
78 103
         openCreate:function(){
79
-            this.tagsData.push({id:1,tag_name:'2'});
104
+          this.$refs.createTagForm.open();
80 105
         },
81
-        openEdit:function(row,index){},
82
-        openDelete:function(row,index){},
83
-        changeCheck:function(){
106
+        openEdit:function(row,index){
107
+            this.tagIndex = index;
108
+            this.editForm.id = row.id;
109
+            this.editForm.tag_name = row.tag_name;
110
+            this.$refs.editTagForm.open();
111
+        },
112
+        openDeleteTags:function(){
113
+          if (this.selectedTags.length==0) {
114
+            this.$message.error("请选择要删除的标签");
115
+            return false;
116
+          }
84 117
 
118
+          this.$confirm('确认要删除所选的标签吗?<br>删除后,标签将无法恢复', '删除提示', {
119
+            dangerouslyUseHTMLString:true,
120
+            confirmButtonText: '确定',
121
+            cancelButtonText: '取消',
122
+            type: 'warning'
123
+          }).then(() => {
124
+            var ids = [];
125
+            var idMap = {};
126
+            for (const index in this.selectedTags) {
127
+              ids.push(this.selectedTags[index].id);
128
+              idMap[this.selectedTags[index].id] = this.selectedTags[index].id;
129
+            }
130
+            DeleteTags({ids:ids}).then(response=>{
131
+              var res = response.data;
132
+              if (res.state === 1) {
133
+                var tagsDataLength = this.tagsData.length;
134
+                for (let index = tagsDataLength-1; index >= 0; index--) {
135
+                  if(this.tagsData[index].id in idMap) {
136
+                    this.tagsData.splice(index, 1);
137
+                  }                  
138
+                }
139
+                this.$message.success("删除标签成功");
140
+              }else {
141
+                this.$message.error(res.msg);
142
+              }
143
+            }).catch(e=>{});
144
+          }).catch(() => {
145
+            return false        
146
+          });
147
+        },
148
+        openDelete:function(row,index){
149
+          this.$confirm('确认要删除该标签吗?<br>删除后,该标签将无法恢复', '删除提示', {
150
+            dangerouslyUseHTMLString:true,
151
+            confirmButtonText: '确定',
152
+            cancelButtonText: '取消',
153
+            type: 'warning'
154
+          }).then(() => {
155
+            var ids = [];
156
+            ids.push(row.id);
157
+            DeleteTags({ids:ids}).then(response=>{
158
+              var res = response.data;
159
+              if (res.state === 1) {
160
+                this.tagsData.splice(index, 1);
161
+                this.$message.success("删除标签成功");
162
+              }else {
163
+                this.$message.error(res.msg);
164
+              }
165
+            }).catch(e=>{});
166
+          }).catch(() => {
167
+            return false        
168
+          });
169
+        },
170
+        changeCheck:function(){
171
+          this.$refs.multipleTable.clearSelection();
172
+          if (this.checkAllStatus) {
173
+            this.$refs.multipleTable.toggleAllSelection();
174
+          }
85 175
         },
86 176
         handleSelectionChange:function (val) {
87
-            
177
+          this.selectedTags = val;
178
+        },
179
+        handleSizeChange(limit) {
180
+            this.listQuery.limit = limit;
181
+            this.GetTags();
182
+        },
183
+        handleCurrentChange(page) {
184
+            this.listQuery.page = page;
185
+            this.GetTags();
88 186
         },
89 187
         changeKey(){
90 188
             this.GetTags();
91 189
         },
92 190
         GetTags(){
93
-            GetTags().then(response=>{
191
+            GetTags(this.listQuery).then(response=>{
94 192
                 var res = response.data;
95 193
                 if(res.state===1) {
96 194
                     this.tagsData = res.data.tags;
195
+                    this.total = res.data.total;
97 196
                 }
98 197
             }).catch(e=>{})
99 198
         }

+ 180 - 0
src/scrm_pages/weixinmp/authorization.vue Voir le fichier

@@ -0,0 +1,180 @@
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" id="winxin-auth-box">
7
+      <div class="filter-container" style="margin-top: 10px;margin-left: 5px ">
8
+        <div v-if="authData.authorizer_status==1">
9
+          <div class="bind-title-box">
10
+            <span class="bind-title">您已绑定公众号,如需更换绑定公众号,请点击下面按钮</span>
11
+          </div>
12
+          <el-button type="warning">更换绑定公众号</el-button>
13
+          <div class="bind-massage-box">
14
+            <span>
15
+              授权公众号:{{authData.authorizer_nick_name}},类型:{{mpTypeName}},
16
+              <!--授权方公众号类型,0代表订阅号,1代表由历史老帐号升级后的订阅号,2代表服务号-->
17
+              <!-- authorizer_service_type_info -->
18
+            </span>
19
+          </div>
20
+        </div>
21
+        <div v-else>
22
+          <div class="bind-title-box">
23
+            <span class="bind-title">您尚未绑定公众号</span>
24
+          </div>
25
+          <el-button type="warning">已有公众号,立刻绑定</el-button>
26
+          <div class="bind-massage-box">
27
+            <span>
28
+              如果还没有公众号,需要先在微信公众号平台进行申请。 去
29
+              <a href="https://mp.weixin.qq.com/" title="申请微信公众号">申请>></a>
30
+            </span>
31
+          </div>
32
+        </div>
33
+
34
+      </div>
35
+      <div style="height:20px">&nbsp;</div>
36
+      <div class="dataTitle title-15">授权公众号后可以使用什么功能?</div>
37
+      <div class="dataBody">
38
+        <p>1.微信公众号的菜单设置</p>
39
+        <p>2.微网站分享功能</p>
40
+      </div>
41
+
42
+      <div style="height:20px">&nbsp;</div>
43
+      <div class="dataTitle title-7">授权有风险吗?</div>
44
+      <div class="dataBody">
45
+        <p>没有,酷医云使用了微信平台提供的官方授权接口,是非常安全的。</p>
46
+      </div>
47
+
48
+      <div style="height:20px">&nbsp;</div>
49
+      <div class="dataTitle title-23">我的公众号已经授权了其它的第三方平台,怎么办?</div>
50
+      <div class="dataBody">
51
+        <p>没问题,秀米的授权不会影响任何第三方平台,也不影响现有的任何自定义菜单、开发模式、自定义回复等功能。</p>
52
+      </div>
53
+
54
+      <div style="height:20px">&nbsp;</div>
55
+      <div class="dataTitle title-12">如何取消给酷医云的授权?</div>
56
+      <div class="dataBody">
57
+        <p>公众号取消授权,进入微信后台,点击“+添加功能插件”,进入“授权管理”,就可以看到酷医云的授权,并且解除授权了。</p>
58
+      </div>
59
+    </div>
60
+  </div>
61
+</template>
62
+
63
+<script>
64
+import BreadCrumb from "../components/bread-crumb";
65
+
66
+export default {
67
+  name: "authorization",
68
+  components: {
69
+    BreadCrumb
70
+  },
71
+  data() {
72
+    return {
73
+      crumbs: [
74
+        { path: false, name: "系统设置" },
75
+        { path: false, name: "公众号授权" }
76
+      ],
77
+
78
+      authData: {
79
+        id: 0,
80
+        user_org_id: 0,
81
+        authorizer_appid: "",
82
+        authorizer_access_token: "",
83
+        authorizer_refresh_token: "",
84
+        authorizer_jsapi_ticket: "",
85
+        authorizer_funcscope_category: "",
86
+        authorizer_nick_name: "",
87
+        authorizer_head_img: "",
88
+        authorizer_service_type_info: 0,
89
+        authorizer_verify_type_info: 0,
90
+        authorizer_user_name: "",
91
+        authorizer_principal_name: "",
92
+        authorizer_business_info: "",
93
+        authorizer_qrcode_url: "",
94
+        created_time: "",
95
+        updated_time: "",
96
+        authorizer_status: 1
97
+      }
98
+    };
99
+  },
100
+  methods: {},
101
+  created() {},
102
+  computed:{
103
+    mpTypeName:function(){
104
+      return 'xx';
105
+    }
106
+  },
107
+};
108
+</script>
109
+
110
+<style scoped>
111
+#winxin-auth-box .bind-title-box {
112
+  margin-bottom: 20px;
113
+}
114
+
115
+#winxin-auth-box .bind-title {
116
+  color: #000;
117
+  font-size: 24px;
118
+}
119
+
120
+#winxin-auth-box .bind-massage-box {
121
+  margin-top: 10px;
122
+  color: #303133;
123
+  font-size: 14px;
124
+}
125
+#winxin-auth-box .bind-massage-box a,#winxin-auth-box .bind-massage-box a:visited,#winxin-auth-box .bind-massage-box a:active {
126
+  color: #409eff;
127
+}
128
+#winxin-auth-box .bind-massage-box a:hover {
129
+  color: #409eff;
130
+  text-decoration: underline;
131
+}
132
+
133
+#winxin-auth-box .dataTitle {
134
+  color: #303133;
135
+  font-size: 14px;
136
+  border-bottom: 1px #409eff solid;
137
+  height: 36px;
138
+  line-height: 36px;
139
+  margin: 0 0 20px 0;
140
+  position: relative;
141
+}
142
+
143
+#winxin-auth-box .dataTitle::before {
144
+  position: absolute;
145
+  left: 0;
146
+  bottom: -1px;
147
+  content: "";
148
+  height: 3px;
149
+  background: #409eff;
150
+}
151
+
152
+#winxin-auth-box .title-15::before {
153
+  width: 200px;
154
+}
155
+#winxin-auth-box .title-12::before {
156
+  width: 158px;
157
+}
158
+#winxin-auth-box .title-7::before {
159
+  width: 88px;
160
+}
161
+#winxin-auth-box .title-23::before {
162
+  width: 312px;
163
+}
164
+#winxin-auth-box .dataBody {
165
+  color: #303133;
166
+  font-size: 14px;
167
+  line-height: 18px;
168
+}
169
+/*.app-container .cell.clearfix .time ul li {*/
170
+/*float: left;*/
171
+/*list-style: none;*/
172
+/*cursor: pointer;*/
173
+/*padding: 6px 20px;*/
174
+/*color: #606266;*/
175
+/*border-radius: 4px;*/
176
+/*margin: 0 8px 0 0;*/
177
+/*font-size: 14px;*/
178
+/*text-align: center;*/
179
+/*}*/
180
+</style>

+ 12 - 0
src/utils/tools.js Voir le fichier

@@ -175,4 +175,16 @@ export function uParseTime(time, cFormat) {
175 175
         return false; 
176 176
     } 
177 177
     return true;
178
+  } 
179
+  
180
+  export function checkMobileOrPhone(tel){ 
181
+    var mobile = /^1[2-9][0-9]\d{8}$/ , phone = /^0\d{2,3}-?\d{7,8}$/;
182
+    return mobile.test(tel) || phone.test(tel);
183
+  } 
184
+
185
+  export function checkHexColor(color){ 
186
+    if(!(/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(color))){ 
187
+        return false; 
188
+    } 
189
+    return true;
178 190
   }