wangfei 6 years ago
parent
commit
4f4bd2f12e

+ 1
- 1
dist/index.html View File

@@ -1 +1 @@
1
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=//at.alicdn.com/t/font_775069_c8w80pqou5c.css><title>城的空间后台管理系统</title><link href=./static/css/app.9a8721a89ee6a280033371ac1a4cd30e.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.9ceafbb898c5feb95a34.js></script><script type=text/javascript src=./static/js/app.f3f484966c7795e437dd.js></script></body></html>
1
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=//at.alicdn.com/t/font_775069_25hulf12ph6.css><title>城的空间后台管理系统</title><link href=./static/css/app.50bef55cf5218719e68b5e53c341984a.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.88cbbf5123a71bf0def0.js></script><script type=text/javascript src=./static/js/app.ce3b6b4ac1ddaa161d53.js></script></body></html>

+ 2
- 0
dist/static/css/app.50bef55cf5218719e68b5e53c341984a.css
File diff suppressed because it is too large
View File


+ 1
- 0
dist/static/css/app.50bef55cf5218719e68b5e53c341984a.css.map
File diff suppressed because it is too large
View File


BIN
dist/static/fonts/element-icons.6f0a763.ttf View File


+ 2
- 0
dist/static/js/app.ce3b6b4ac1ddaa161d53.js
File diff suppressed because it is too large
View File


+ 1
- 0
dist/static/js/app.ce3b6b4ac1ddaa161d53.js.map
File diff suppressed because it is too large
View File


+ 2
- 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js View File

@@ -0,0 +1,2 @@
1
+!function(r){var n=window.webpackJsonp;window.webpackJsonp=function(e,u,c){for(var f,i,p,a=0,l=[];a<e.length;a++)i=e[a],o[i]&&l.push(o[i][0]),o[i]=0;for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(r[f]=u[f]);for(n&&n(e,u,c);l.length;)l.shift()();if(c)for(a=0;a<c.length;a++)p=t(t.s=c[a]);return p};var e={},o={2:0};function t(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=r,t.c=e,t.d=function(r,n,e){t.o(r,n)||Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:e})},t.n=function(r){var n=r&&r.__esModule?function(){return r.default}:function(){return r};return t.d(n,"a",n),n},t.o=function(r,n){return Object.prototype.hasOwnProperty.call(r,n)},t.p="./",t.oe=function(r){throw console.error(r),r}}([]);
2
+//# sourceMappingURL=manifest.3ad1d5771e9b13dbdad2.js.map

+ 1
- 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map View File

@@ -0,0 +1 @@
1
+{"version":3,"sources":["webpack:///webpack/bootstrap 2f50910dc153de1c6765"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,KAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.3ad1d5771e9b13dbdad2.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 2f50910dc153de1c6765"],"sourceRoot":""}

+ 70
- 0
dist/static/js/vendor.88cbbf5123a71bf0def0.js
File diff suppressed because it is too large
View File


+ 1
- 0
dist/static/js/vendor.88cbbf5123a71bf0def0.js.map
File diff suppressed because it is too large
View File


+ 119
- 39
src/pages/system/cardAndCouponManager/vipManager/activateVip.vue View File

@@ -5,7 +5,7 @@
5 5
         <div>
6 6
           <el-input
7 7
             placeholder="请输入VIP卡号"
8
-            v-model="postData.CardNo"
8
+            v-model="CardNo"
9 9
             clearable>
10 10
           </el-input>
11 11
         </div>
@@ -23,7 +23,7 @@
23 23
             <span>卡号:</span>
24 24
             <div class="flex-item">
25 25
               <div>
26
-                <span>{{activateData.CardNo}}</span>
26
+                <span>{{vip.VipCardChildCode}}</span>
27 27
               </div>
28 28
             </div>
29 29
           </li>
@@ -31,52 +31,49 @@
31 31
             <span>金额:</span>
32 32
             <div class="flex-item">
33 33
               <div>
34
-                <span>{{activateData.Price}}</span>
34
+                <span>{{vip.Amount}}</span>
35 35
               </div>
36 36
             </div>
37 37
           </li>
38 38
           <li class="flex-h">
39
-            <span>销售:</span>
39
+            <span>绑定用户:</span>
40 40
             <div class="flex-item" style="margin-right:10px;">
41 41
               <div>
42 42
                 <el-input
43
-                  placeholder="请输入销售手机号"
44
-                  v-model="sellerPhone"
43
+                  placeholder="请输入手机号"
44
+                  v-model="customerPhone"
45 45
                   clearable>
46 46
                 </el-input>
47 47
               </div>
48 48
             </div>
49
-            <el-button type="success" @click='searchSeller'>查询</el-button>
49
+            <el-button type="success" @click='searchCustomer'>查询</el-button>
50 50
           </li>
51 51
           <li class="flex-h">
52
-            <span>销售姓名:</span>
52
+            <span>用户姓名:</span>
53 53
             <div class="flex-item">
54 54
               <div>
55
-                <span>{{activateData.SellerName}}</span>
55
+                <span>{{customer.CustomerName}}</span>
56 56
               </div>
57 57
             </div>
58 58
           </li>
59 59
           <li class="flex-h">
60
-            <span>绑定用户:</span>
61
-            <div class="flex-item">
60
+            <span>销售:</span>
61
+            <div class="flex-item" style="margin-right:10px;">
62 62
               <div>
63 63
                 <el-input
64
-                  placeholder="请输入手机号"
65
-                  v-model="activateData.UserPhone"
64
+                  placeholder="请输入销售手机号"
65
+                  v-model="salesPhone"
66 66
                   clearable>
67 67
                 </el-input>
68 68
               </div>
69 69
             </div>
70
+            <el-button type="success" @click='searchSeller'>查询</el-button>
70 71
           </li>
71 72
           <li class="flex-h">
72
-            <span>用户姓名:</span>
73
+            <span>销售姓名:</span>
73 74
             <div class="flex-item">
74 75
               <div>
75
-                <el-input
76
-                  placeholder="请输入真实姓名"
77
-                  v-model="activateData.UserName"
78
-                  clearable>
79
-                </el-input>
76
+                <span>{{sales.RealName}}</span>
80 77
               </div>
81 78
             </div>
82 79
           </li>
@@ -84,31 +81,26 @@
84 81
       </div>
85 82
       <span slot="footer" class="dialog-footer">
86 83
         <el-button @click="centerDialogVisible = false">取 消</el-button>
87
-        <el-button type="primary" @click="centerDialogVisible = false">激 活</el-button>
84
+        <el-button type="primary" @click="vipCharge">激 活</el-button>
88 85
       </span>
89 86
     </el-dialog>
90 87
   </div>
91 88
 </template>
92 89
 
93 90
 <script>
94
-import { mapState } from 'vuex'
91
+import { createNamespacedHelpers, mapState } from 'vuex'
92
+
93
+const { mapState: mapVipState, mapActions: mapVipActions } = createNamespacedHelpers('vip')
94
+const { mapState: mapCustomerState, mapActions: mapCustomerActions } = createNamespacedHelpers('customer')
95
+const { mapState: mapUserState, mapActions: mapUserActions } = createNamespacedHelpers('user')
95 96
 export default {
96 97
   name: '',
97 98
   data () {
98 99
     return {
99
-      centerDialogVisible: true,
100
-      postData: {
101
-        CardNo: '', // 卡号
102
-      },
103
-      activateData: {
104
-        CardNo: '111111111', // 卡号
105
-        Price: '1000', // 金额
106
-        SellerName: '', // 销售姓名
107
-        CaseName: 'xxx', // 案场名称
108
-        UserPhone: '', // 用户手机号
109
-        UserName: '', // 用户姓名
110
-      },
111
-      sellerPhone: '', // 销售手机号
100
+      centerDialogVisible: false,
101
+      CardNo: '',
102
+      salesPhone: '',
103
+      customerPhone: ''
112 104
     }
113 105
   },
114 106
   computed: {
@@ -117,6 +109,15 @@ export default {
117 109
       defaultCaseId: x => x.app.cases.default,
118 110
       OrgId: x => x.app.user.OrgId,
119 111
     }),
112
+    ...mapCustomerState({
113
+      customer: x => x.customer,
114
+    }),
115
+    ...mapVipState({
116
+      vip: x => x.vipinfo,
117
+    }),
118
+    ...mapUserState({
119
+      sales: x => x.userinfo,
120
+    }),
120 121
     CaseId: {
121 122
       get () {
122 123
         return this.postData.CaseId === '' ? this.defaultCaseId || '' : this.postData.CaseId
@@ -126,13 +127,92 @@ export default {
126 127
       }
127 128
     }
128 129
   },
129
-  created () { },
130
-  components: {},
131 130
   methods: {
132
-    searchSeller () { // 查询销售
131
+    ...mapCustomerActions([
132
+      'GetCustomerByTel',
133
+      'SetCustomerInfoNull',
134
+    ]),
135
+    ...mapVipActions([
136
+      'VipCharge',
137
+      'GetVipByCode',
138
+      'SetVipInfoNull',
139
+    ]),
140
+    ...mapUserActions([
141
+      'GetUserByTel',
142
+      'SetUserInfoNull',
143
+    ]),
144
+    searchCustomer () {
145
+      if (this.customerPhone === '') {
146
+        this.$message({
147
+          type: 'error',
148
+          message: '请先输入电话!',
149
+        })
150
+        return
151
+      }
152
+      this.GetCustomerByTel({tel: this.customerPhone})
153
+    },
154
+    searchSeller () {
155
+      if (this.salesPhone === '') {
156
+        this.$message({
157
+          type: 'error',
158
+          message: '请先输入销售电话!',
159
+        })
160
+        return
161
+      }
162
+      this.GetUserByTel({tel: this.salesPhone})
133 163
     },
134
-    activateVip () { // 激活vip
135
-      this.centerDialogVisible = true
164
+    setNull () {
165
+      this.salesPhone = ''
166
+      this.customerPhone = ''
167
+      this.SetUserInfoNull()
168
+      this.SetCustomerInfoNull()
169
+    },
170
+    activateVip () {
171
+      this.GetVipByCode({ code: this.CardNo }).then((res) => {
172
+        if (res) {
173
+          if (res.Status !== 0) {
174
+            this.$message({
175
+              type: 'error',
176
+              message: 'VIP卡已被激活!',
177
+            })
178
+            return
179
+          }
180
+          this.setNull()
181
+          this.centerDialogVisible = true
182
+        } else {
183
+          this.$message({
184
+            type: 'error',
185
+            message: '没有查询到VIP卡信息!',
186
+          })
187
+        }
188
+      })
189
+    },
190
+    vipCharge () {
191
+      if (this.vip.VipCardChildCode === '') {
192
+        this.$message({
193
+          type: 'error',
194
+          message: '没有需要激活的卡信息!',
195
+        })
196
+        return
197
+      }
198
+      if (this.customer.Phone === '') {
199
+        this.$message({
200
+          type: 'error',
201
+          message: '没有绑定的用户信息!',
202
+        })
203
+        return
204
+      }
205
+      this.VipCharge({
206
+        code: this.vip.VipCardChildCode,
207
+        tel: this.customer.Phone,
208
+        salesid: this.sales.UserId || '',
209
+        salesname: this.sales.RealName || '',
210
+      }).then(() => {
211
+        this.$message({
212
+          type: 'success',
213
+          message: '激活成功!',
214
+        })
215
+      })
136 216
     },
137 217
   },
138 218
   mounted () { }

+ 29
- 7
src/pages/system/cardAndCouponManager/vipManager/edit.vue View File

@@ -51,7 +51,10 @@
51 51
 </template>
52 52
 
53 53
 <script>
54
-import { mapState } from 'vuex'
54
+import { createNamespacedHelpers, mapState } from 'vuex'
55
+
56
+const { mapActions: mapVipActions } = createNamespacedHelpers('vip')
57
+
55 58
 export default {
56 59
   name: '',
57 60
   data () {
@@ -60,6 +63,7 @@ export default {
60 63
         TotalCount: '', // 卡数量
61 64
         CardAmount: '', // 价格
62 65
         CaseId: '', // 案场id
66
+        OrgId: '',
63 67
       }
64 68
     }
65 69
   },
@@ -83,15 +87,33 @@ export default {
83 87
   },
84 88
   components: {},
85 89
   methods: {
90
+    ...mapVipActions([
91
+      'AddVip',
92
+    ]),
86 93
     initData () { // 数据初始化
87
-      // this.$ajax(this.$api.channelManager.getChannelInfo.url, {
88
-      //   method: this.$api.channelManager.getChannelInfo.method,
89
-      //   urlData: { channelId: this.$route.query.id }
90
-      // }).then(res => {
91
-      //   this.postData = res
92
-      // })
93 94
     },
94 95
     submit () { // 提交数据
96
+      if (this.postData.TotalCount === '') {
97
+        this.$message({
98
+          type: 'error',
99
+          message: '请输入VIP卡数量!'
100
+        })
101
+        return
102
+      }
103
+      if (this.postData.CardAmount === 0) {
104
+        this.$message({
105
+          type: 'error',
106
+          message: '请输入价格!'
107
+        })
108
+        return
109
+      }
110
+      this.AddVip({...this.postData, CaseId: this.CaseId, OrgId: this.OrgId}).then(x => {
111
+        this.$message({
112
+          type: 'success',
113
+          message: '保存成功!'
114
+        })
115
+        this.$router.push({ name: 'vipList' })
116
+      })
95 117
     },
96 118
     cancel () {
97 119
       this.$router.push({ name: 'vipList' })

+ 16
- 7
src/pages/system/cardAndCouponManager/vipManager/index.vue View File

@@ -57,19 +57,22 @@
57 57
         stripe
58 58
         style="width: 100%">
59 59
         <el-table-column
60
-          prop="CardNo"
60
+          prop="VipCardChildCode"
61 61
           label="卡号">
62 62
         </el-table-column>
63 63
         <el-table-column
64
-          prop="Price"
64
+          prop="Amount"
65 65
           label="价格">
66 66
         </el-table-column>
67 67
         <el-table-column
68 68
           prop="Status"
69 69
           label="状态">
70
+          <template slot-scope="scope">
71
+            <span>{{scope.row.Status===1?'已激活':'未激活'}}</span>
72
+          </template>
70 73
         </el-table-column>
71 74
         <el-table-column
72
-          prop="SellerName"
75
+          prop="SalesName"
73 76
           label="销售">
74 77
         </el-table-column>
75 78
         <el-table-column
@@ -77,16 +80,22 @@
77 80
           label="案场">
78 81
         </el-table-column>
79 82
         <el-table-column
80
-          prop="UserName"
83
+          prop="CustomerName"
81 84
           label="用户">
82 85
         </el-table-column>
83 86
         <el-table-column
84
-          prop="ActivationTime"
87
+          prop="ActiveDate"
85 88
           label="激活时间">
89
+          <template slot-scope="scope">
90
+            <span>{{toolClass.dateFormat(scope.row.ActiveDate, 'yyyy-MM-dd')==='1-01-01'?'':toolClass.dateFormat(scope.row.ActiveDate, 'yyyy-MM-dd hh:mm')}}</span>
91
+          </template>
86 92
         </el-table-column>
87 93
         <el-table-column
88
-          prop="CreatTime"
94
+          prop="CreateDate"
89 95
           label="创建时间">
96
+          <template slot-scope="scope">
97
+            <span>{{toolClass.dateFormat(scope.row.CreateDate, 'yyyy-MM-dd hh:mm')}}</span>
98
+          </template>
90 99
         </el-table-column>
91 100
       </el-table>
92 101
     </div>
@@ -95,7 +104,7 @@
95 104
       :current-page.sync="postData.page"
96 105
       :page-size="postData.pagesize"
97 106
       layout="prev, pager, next, jumper"
98
-      :total="total">
107
+      :total="vips.pagenum">
99 108
     </el-pagination>
100 109
   </div>
101 110
 </template>

+ 35
- 0
src/store/card/vip.js View File

@@ -5,11 +5,15 @@ export default {
5 5
   namespaced: true,
6 6
   state: {
7 7
     vipList: [],
8
+    vipinfo: {},
8 9
   },
9 10
   mutations: {
10 11
     updateList (state, payload) {
11 12
       state.vipList = payload || []
12 13
     },
14
+    updateInfo (state, payload) {
15
+      state.vipinfo = payload || {}
16
+    },
13 17
   },
14 18
   actions: {
15 19
     GetVipList ({ commit }, payload) {
@@ -36,6 +40,37 @@ export default {
36 40
           resolve(res)
37 41
         }).catch(reject)
38 42
       })
43
+    },
44
+    GetVipByCode ({ commit }, { code }) {
45
+      return new Promise((resolve, reject) => {
46
+        ajax(api.cardManager.vipbycode.url, {
47
+          method: api.cardManager.vipbycode.method,
48
+          urlData: {
49
+            code,
50
+          }
51
+        }).then(res => {
52
+          commit('updateInfo', res)
53
+          resolve(res)
54
+        }).catch(reject)
55
+      })
56
+    },
57
+    VipCharge ({ commit }, payload) {
58
+      return new Promise((resolve, reject) => {
59
+        ajax(api.cardManager.vipcharge.url, {
60
+          method: api.cardManager.vipcharge.method,
61
+          urlData: {
62
+            code: payload.code
63
+          },
64
+          data: {
65
+            ...payload,
66
+          }
67
+        }).then(res => {
68
+          resolve(res)
69
+        }).catch(reject)
70
+      })
71
+    },
72
+    SetVipInfoNull ({ commit }) {
73
+      commit('updateInfo', {})
39 74
     }
40 75
   }
41 76
 }

+ 32
- 0
src/store/customer/customer.js View File

@@ -0,0 +1,32 @@
1
+import ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    customer: {},
8
+  },
9
+  mutations: {
10
+    updateInfo (state, payload) {
11
+      state.customer = payload || {}
12
+    },
13
+  },
14
+  actions: {
15
+    GetCustomerByTel ({ commit }, { tel }) {
16
+      return new Promise((resolve, reject) => {
17
+        ajax(api.customerManager.getByTel.url, {
18
+          method: api.customerManager.getByTel.method,
19
+          urlData: {
20
+            tel
21
+          }
22
+        }).then(res => {
23
+          commit('updateInfo', res)
24
+          resolve(res)
25
+        }).catch(reject)
26
+      })
27
+    },
28
+    SetCustomerInfoNull ({ commit }) {
29
+      commit('updateInfo', {})
30
+    }
31
+  }
32
+}

+ 2
- 0
src/store/index.js View File

@@ -26,6 +26,8 @@ export const modules = {
26 26
   cmscase: () => require('./cms/case').default,
27 27
   caserecord: () => require('./case/record').default,
28 28
   vip: () => require('./card/vip').default,
29
+  customer: () => require('./customer/customer').default,
30
+  user: () => require('./system/user').default,
29 31
 }
30 32
 
31 33
 Object.keys(modules).forEach((modKey) => {

+ 29
- 0
src/store/system/user.js View File

@@ -0,0 +1,29 @@
1
+import ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    userinfo: {},
8
+  },
9
+  mutations: {
10
+    updateInfo (state, payload) {
11
+      state.userinfo = payload || {}
12
+    },
13
+  },
14
+  actions: {
15
+    GetUserByTel ({ commit }, { tel }) {
16
+      ajax(api.systemSet.getUserByTel.url, {
17
+        method: api.systemSet.getUserByTel.method,
18
+        urlData: {
19
+          tel,
20
+        }
21
+      }).then(res => {
22
+        commit('updateInfo', res)
23
+      })
24
+    },
25
+    SetUserInfoNull ({ commit }) {
26
+      commit('updateInfo', {})
27
+    }
28
+  }
29
+}

+ 15
- 1
src/util/api.js View File

@@ -1,4 +1,4 @@
1
-const baseUrl = '/api-v2'
1
+const baseUrl = '/api'
2 2
 const common = '/common/:org'
3 3
 const guest = '/guest/:org'
4 4
 
@@ -56,6 +56,10 @@ const $api = {
56 56
       method: 'get',
57 57
       url: `${baseUrl}${common}/userrole`
58 58
     },
59
+    getUserByTel: {
60
+      method: 'get',
61
+      url: `${baseUrl}${common}/user/tel/:tel`
62
+    },
59 63
   },
60 64
   channelManager: {
61 65
     getChannelList: { // 渠道列表
@@ -556,6 +560,16 @@ const $api = {
556 560
       method: 'put',
557 561
       url: `${baseUrl}${common}/vipcard/:code`
558 562
     },
563
+    vipbycode: {
564
+      method: 'get',
565
+      url: `${baseUrl}${common}/vipcard/:code`
566
+    }
567
+  },
568
+  customerManager: {
569
+    getByTel: {
570
+      method: 'get',
571
+      url: `${baseUrl}${common}/customer/tel/:tel`
572
+    }
559 573
   },
560 574
 }
561 575
 export default $api