Parcourir la source

Merge branch 'yuhao' of http://code.qutaovip.com/lihai/pad_spa into lihai

# Conflicts:
#	src/pages/customerMan/details/index.vue
黎海 il y a 2 ans
Parent
commit
7bd672ce83

Fichier diff supprimé car celui-ci est trop grand
+ 11223 - 29616
package-lock.json


+ 3 - 1
package.json

@@ -31,7 +31,7 @@
31 31
     "@vue/cli-service": "^3.5.0",
32 32
     "@vue/test-utils": "1.0.0-beta.29",
33 33
     "babel-core": "7.0.0-bridge.0",
34
-    "babel-eslint": "^10.0.1",
34
+    "babel-eslint": "^8.2.2",
35 35
     "babel-jest": "^23.6.0",
36 36
     "cross-env": "^5.2.1",
37 37
     "eslint": "^5.8.0",
@@ -39,6 +39,8 @@
39 39
     "husky": "^4.3.0",
40 40
     "less": "^3.0.4",
41 41
     "less-loader": "^4.1.0",
42
+    "postcss-px-to-viewport": "^1.1.1",
43
+    "postcss-pxtorem": "^5.1.1",
42 44
     "vue-template-compiler": "^2.5.21"
43 45
   },
44 46
   "eslintConfig": {

+ 18 - 17
src/App.vue

@@ -1,27 +1,28 @@
1 1
 <template>
2
-    <div id="app">
3
-        <router-view></router-view>
4
-    </div>
2
+  <div id="app">
3
+    <keep-alive>
4
+      <router-view v-if="$route.meta.keepAlive"></router-view>
5
+    </keep-alive>
6
+    <router-view v-if="!$route.meta.keepAlive"></router-view>
7
+  </div>
5 8
 </template>
6 9
 
7 10
 <script>
8 11
 export default {
9
-    data() {
10
-        return {
11
-            list:[]
12
-        }
13
-    },
14
-    mounted: function () {
15
-        
16
-    },
17
-    created: function () {
18
-        
19
-    },
20
-    methods: {
21
-        
12
+  data () {
13
+    return {
14
+      list: []
22 15
     }
16
+  },
17
+  mounted: function () {
18
+
19
+  },
20
+  created: function () {
21
+
22
+  },
23
+  methods: {
24
+  }
23 25
 }
24 26
 </script>
25 27
 <style scoped>
26
-	
27 28
 </style>

BIN
src/assets/audio/order_ready.mp3


BIN
src/assets/audio/order_ready_15.mp3


BIN
src/assets/audio/order_ready_5.mp3


BIN
src/assets/audio/order_success.mp3


+ 621 - 9
src/components/common/layout/layout.vue

@@ -7,22 +7,27 @@
7 7
     </div>
8 8
     <div class="content">
9 9
       <header>
10
-
11 10
         <div class="back-icon"
12 11
              v-if="isback"
13 12
              @click="goBack"><img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/back.png"
14 13
                alt=""></div>
15 14
         <div>
16 15
           <div class="left"
17
-              v-if="menuIndex==0 && $route.path === '/home'">
16
+               v-if="menuIndex==0 && $route.path === '/home'">
18 17
             <div class="address">{{userInfo.store_name}}</div>
19 18
           </div>
20 19
         </div>
21
-        <div class="center" v-if="$route.name">
20
+        <div class="center"
21
+             v-if="$route.name">
22 22
           {{$route.name}}
23 23
         </div>
24 24
         <div class="right">
25
-          <div class="news"><img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/news.png"></div>
25
+          <div @click="onAppMessage"
26
+               class="news">
27
+            <span class="dot"
28
+                  v-show="hasUnreadMessage"></span>
29
+            <img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/news.png" />
30
+          </div>
26 31
           <div class="head-img"><img :src="userInfo.avatar_url"></div>
27 32
           <el-dropdown trigger="click"
28 33
                        placement="top"
@@ -41,11 +46,184 @@
41 46
         <router-view></router-view>
42 47
       </div>
43 48
     </div>
49
+    <minePupop :show="msgPupopVisible">
50
+      <div class="block">
51
+        <div class="title">
52
+          <div @click="clearUnreadMsgsByType(0)"
53
+               class="clear">
54
+            <img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/clearMsg.png"
55
+                 alt="">
56
+            <div class="">清除未读</div>
57
+          </div>
58
+          <div class="txt">消息</div>
59
+          <div class="delete-pupop"
60
+               @click="closeMsgPanel">
61
+            <img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
62
+                 alt />
63
+          </div>
64
+        </div>
65
+        <div class="msg-con">
66
+          <van-list v-model="mainPanelMsgListLoading"
67
+                    :finished="mainPanelMsgListFinished"
68
+                    finished-text="没有更多了"
69
+                    @load="getMainPanelMessageList"
70
+                    :immediate-check="false">
71
+            <div class="order-msg">
72
+              <div class="success">
73
+                <div class="flex justify-between"
74
+                     @click="toMsgDetail(1)">
75
+                  <div class="desc flex items-center">
76
+                    <img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/make.png"
77
+                         alt="" />
78
+                    <div class="title">预约成功信息</div>
79
+                  </div>
80
+                  <div class="count flex flex-column justify-center items-center">
81
+                    <!-- <div class="time">10:23</div> -->
82
+                    <div class="num"
83
+                         v-if="orderSuccessUnreadNum">{{orderSuccessUnreadNum}}</div>
84
+                  </div>
85
+                </div>
86
+              </div>
87
+              <div class="cancel">
88
+                <div class="flex justify-between"
89
+                     @click="toMsgDetail(2)">
90
+                  <div class="desc flex items-center">
91
+                    <img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/cancelOrder.png"
92
+                         alt="" />
93
+                    <div class="title">预约取消信息</div>
94
+                  </div>
95
+                  <div class="count flex flex-column justify-center items-center">
96
+                    <!-- <div class="time">10:23</div> -->
97
+                    <div class="num"
98
+                         v-if="orderCancelUnreadNum">{{orderCancelUnreadNum}}</div>
99
+                  </div>
100
+                </div>
101
+              </div>
102
+            </div>
103
+            <div class="ready-msg flex justify-between items-center"
104
+                 v-for="(item, index) in msgPanelList"
105
+                 :key="index"
106
+                 @click="readMsgToOrderDetails(item)">
107
+              <div class="content-bar flex flex-column">
108
+                <div class="desc-info">{{item.project_name}}</div>
109
+                <div class="desc-time">{{`${item.device_name} (${item.room}) 还有${item.minute}分钟开始` | ellipsis(80)}}</div>
110
+              </div>
111
+              <div class="count flex flex-column items-center">
112
+                <div class="time">{{item.create_time}}</div>
113
+                <div class="dot"
114
+                     v-if="!item.is_read && allUnread"></div>
115
+              </div>
116
+            </div>
117
+          </van-list>
118
+        </div>
119
+      </div>
120
+    </minePupop>
121
+    <minePupop :show="msgSuccessDetailPupopVisible">
122
+      <div class="block detail">
123
+        <div class="title">
124
+          <div @click="backMsgPanel"
125
+               class="back flex items-center">
126
+            <img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/back.png"
127
+                 alt="" />
128
+          </div>
129
+          <div class="txt">消息</div>
130
+          <div class="delete-msg flex items-center"
131
+               @click="clearUnreadMsgsByType(1)">
132
+            <img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/clearMsg.png"
133
+                 alt />
134
+            <div class="">清除未读</div>
135
+          </div>
136
+        </div>
137
+        <div class="detail-msg-con">
138
+          <van-list v-model="detailSuccessMsgListLoading"
139
+                    :finished="detailSuccessMsgListFinished"
140
+                    finished-text="没有更多了"
141
+                    @load="getMessageByType(orderMsgType)"
142
+                    :immediate-check="false">
143
+            <div class="msg-bar flex justify-between items-center"
144
+                 v-for="(item, index) in msgSuccessDetailList"
145
+                 :key="index"
146
+                 @click="readMsgToOrderDetails(item)">
147
+              <div class="info flex">
148
+                <div class="name">{{item.nickname}}</div>
149
+                <div class="project">成功预约{{item.order_time}}</div>
150
+                <!-- {{item.nickname | ellipsis(50)}} -->
151
+              </div>
152
+              <div class="flex flex-column items-center">
153
+                <div class="time">{{item.create_time}}</div>
154
+                <div class="dot"
155
+                     v-if="!item.is_read && successUnread"></div>
156
+              </div>
157
+            </div>
158
+          </van-list>
159
+        </div>
160
+      </div>
161
+    </minePupop>
162
+    <minePupop :show="msgCancelDetailPupopVisible">
163
+      <div class="block detail">
164
+        <div class="title">
165
+          <div @click="backMsgPanel"
166
+               class="back flex items-center">
167
+            <img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/back.png"
168
+                 alt="" />
169
+          </div>
170
+          <div class="txt">消息</div>
171
+          <div class="delete-msg flex items-center"
172
+               @click="clearUnreadMsgsByType(2)">
173
+            <img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/clearMsg.png"
174
+                 alt />
175
+            <div class="">清除未读</div>
176
+          </div>
177
+        </div>
178
+        <div class="detail-msg-con">
179
+          <van-list v-model="detailCancelMsgListLoading"
180
+                    :finished="detailCancelMsgListFinished"
181
+                    finished-text="没有更多了"
182
+                    @load="getMessageByType(orderMsgType)"
183
+                    :immediate-check="false">
184
+            <div class="msg-bar flex justify-between items-center"
185
+                 v-for="(item, index) in msgCancelDetailList"
186
+                 :key="index"
187
+                 @click="readMsgToOrderDetails(item)">
188
+              <div class="info flex">
189
+                <div class="name">{{item.nickname}}</div>
190
+                <div class="project">取消预约{{item.order_time}}</div>
191
+                <!-- {{item.msg | ellipsis(50)}} -->
192
+              </div>
193
+              <div class="flex flex-column items-center">
194
+                <div class="time">{{item.create_time}}</div>
195
+                <div class="dot"
196
+                     v-if="!item.is_read"></div>
197
+              </div>
198
+            </div>
199
+          </van-list>
200
+        </div>
201
+      </div>
202
+    </minePupop>
203
+    <audio ref="orderSuccessMp3"
204
+           id="orderSuccessMp3"
205
+           muted>
206
+      <source src="@/assets/audio/order_success.mp3" />
207
+    </audio>
208
+    <audio ref="orderReadyMp3_15"
209
+           id="orderReadyMp3_15"
210
+           muted>
211
+      <source src="@/assets/audio/order_ready_15.mp3" />
212
+    </audio>
213
+    <audio ref="orderReadyMp3_5"
214
+           id="orderReadyMp3_5"
215
+           muted>
216
+      <source src="@/assets/audio/order_ready_5.mp3" />
217
+    </audio>
44 218
   </div>
45 219
 </template>
46 220
 
47 221
 <script type="text/javascript">
222
+import { mapMutations } from 'vuex'
223
+import vanList from 'vant/lib/list';
224
+import 'vant/lib/list/style';
48 225
 import leftMenu from './leftMenu'
226
+import minePupop from "../../../components/minePupop/index.vue";
49 227
 import api from '@/server/home'
50 228
 
51 229
 
@@ -58,27 +236,120 @@ export default {
58 236
       isback: false,
59 237
       userInfo: {
60 238
         name: '333'
61
-      }
239
+      },
240
+      msgPupopVisible: false,
241
+      msgSuccessDetailPupopVisible: false,
242
+      msgCancelDetailPupopVisible: false,
243
+      timer: null,
244
+      timer1: null,
245
+      wsInstance: null,
246
+      hasUnreadMessage: null,
247
+      msgPanelList: [],
248
+      mainPanelMsgListLoading: false,
249
+      mainPanelMsgListFinished: false,
250
+      mainPanelMessagePage: 1,
251
+      mainPanelMessageLimit: 5,
252
+      type: 0,
253
+      orderSuccessUnreadNum: null,
254
+      orderCancelUnreadNum: null,
255
+      detailMessageLimit: 10,
256
+      detailSuccessMessagePage: 1,
257
+      msgSuccessDetailList: [],
258
+      detailSuccessMsgListLoading: false,
259
+      detailSuccessMsgListFinished: false,
260
+      detailCancelMessagePage: 1,
261
+      msgCancelDetailList: [],
262
+      detailCancelMsgListLoading: false,
263
+      detailCancelMsgListFinished: false,
264
+      MsgType: null,
265
+      successUnread: true,
266
+      cancelUnread: true,
267
+      allUnread: true,
62 268
     }
63 269
   },
64
-  created () {
270
+  async created () {
65 271
     this.getUserInfo()
272
+    console.log('开始连接...')
273
+    let token = this.$store.state.comVal.token || localStorage.getItem('token')
274
+    //申请一个WebSocket对象,参数是服务端地址,同http协议使用http://开头一样,WebSocket协议的url使用ws://开头,另外安全的WebSocket协议使用wss://开头
275
+    this.wsInstance = new WebSocket(`wss://ws.ijolijoli.com?access_token=${token}`);
276
+    this.wsInstance.onopen = () => {
277
+      //当WebSocket创建成功时,触发onopen事件
278
+      console.log("连接成功");
279
+      this.timer = setInterval(() => {
280
+        this.wsInstance.send(JSON.stringify({ type: 'ping' }));
281
+      }, 30000);
282
+    }
283
+    this.wsInstance.onmessage = (e) => {
284
+      //当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据
285
+      console.log('收到消息', e.data)
286
+      let data = JSON.parse(e.data);
287
+      if (data.data.type === 'order_success') {
288
+        console.log('预约成功信息播报')
289
+        this.$refs.orderSuccessMp3.play()
290
+      } else if (data.data.type === 'order_ready') {
291
+        // TODO: 播报动态语音还是固定的语音有待产品商榷
292
+        console.log('项目即将开始信息播报')
293
+        if (data.data.minute == 15) {
294
+          this.$refs.orderReadyMp3_15.play()
295
+        } else if (data.data.minute == 5) {
296
+          this.$refs.orderReadyMp3_5.play()
297
+        }
298
+      }
299
+      console.log(data)
300
+    }
301
+    this.wsInstance.onclose = (e) => {
302
+      //当客户端收到服务端发送的关闭连接请求时,触发onclose事件
303
+      console.log("连接已关闭");
304
+    }
305
+    this.wsInstance.onerror = (e) => {
306
+      //如果出现连接、处理、接收、发送数据失败的时候触发onerror事件
307
+      console.log(e);
308
+    }
309
+
310
+    await this.queryHasUnreadMessage()
311
+    this.timer1 = setInterval(async () => {
312
+      await this.queryHasUnreadMessage()
313
+    }, 20000)
314
+  },
315
+  mounted () { },
316
+  beforeDestroy () {
317
+    // 关闭WebSocket连接并清除定时器
318
+    this.wsInstance.close()
319
+    clearInterval(this.timer)
320
+    clearInterval(this.timer1)
66 321
   },
67 322
   components: {
68 323
     leftMenu,
324
+    minePupop,
325
+    vanList
69 326
   },
70 327
   methods: {
328
+    ...mapMutations(['SAVE_COMMON_VALUE']),
71 329
     getUserInfo () {
72 330
       let that = this
73 331
       api.getUserInfo().then(res => {
74 332
         if (res.code == 200) {
75 333
           this.userInfo = res.data
76
-
77 334
         }
78 335
       })
79 336
     },
80 337
     loginOut () {
338
+      this.SAVE_COMMON_VALUE({
339
+        'key': 'token',
340
+        'value': null
341
+      })
342
+      this.SAVE_COMMON_VALUE({
343
+        'key': 'isLogin',
344
+        'value': false
345
+      })
81 346
       localStorage.removeItem('token');
347
+
348
+      // 关闭WebSocket连接并清除定时器
349
+      this.wsInstance.close()
350
+      clearInterval(this.timer)
351
+      clearInterval(this.timer1)
352
+
82 353
       this.$router.replace('/login')
83 354
     },
84 355
     changeMenu (index) {
@@ -89,7 +360,167 @@ export default {
89 360
     },
90 361
     goBack () {
91 362
       this.$router.back()
92
-    }
363
+    },
364
+    async queryHasUnreadMessage () {
365
+      let resp = await api.hasUnreadMessage()
366
+      if (resp.code === 200) {
367
+        this.hasUnreadMessage = resp.data ? true : false
368
+      }
369
+    },
370
+    async getMainPanelMessageList (page = this.mainPanelMessagePage) {
371
+      // setTimeout(async() => {
372
+      let resp = await api.getMessageList({ page: page, limit: this.mainPanelMessageLimit })
373
+      if (resp.code = 200) {
374
+        this.orderSuccessUnreadNum = resp.data.reserved
375
+        this.orderCancelUnreadNum = resp.data.cancel
376
+
377
+        if (this.mainPanelMessagePage === 1) {
378
+          this.msgPanelList = resp.data.list
379
+        } else {
380
+          this.msgPanelList = [...this.msgPanelList, ...resp.data.list]
381
+        }
382
+
383
+        this.mainPanelMessagePage++
384
+        this.mainPanelMsgListLoading = false;
385
+        if (this.msgPanelList.length >= resp.data.total) {
386
+          this.mainPanelMsgListFinished = true;
387
+        }
388
+      }
389
+      // }, 1000);
390
+    },
391
+    async getMessageByType (type, page = this.detailSuccessMessagePage) {
392
+      if (type === 1) {
393
+        let resp = await api.getMessageByType({ type: type, page: page, limit: this.detailMessageLimit })
394
+        if (resp.code = 200) {
395
+
396
+          if (this.detailSuccessMessagePage === 1) {
397
+            this.msgSuccessDetailList = resp.data.list
398
+          } else {
399
+            this.msgSuccessDetailList = [...this.msgSuccessDetailList, ...resp.data.list]
400
+          }
401
+
402
+          this.detailSuccessMessagePage++
403
+          this.detailSuccessMsgListLoading = false;
404
+          if (this.msgSuccessDetailList.length >= resp.data.total) {
405
+            this.detailSuccessMsgListFinished = true;
406
+          }
407
+        }
408
+      } else if (type === 2) {
409
+        let resp = await api.getMessageByType({ type: type, page: page, limit: this.detailMessageLimit })
410
+        if (resp.code = 200) {
411
+          this.msgCancelDetailList = [...this.msgCancelDetailList, ...resp.data.list]
412
+
413
+          if (this.detailSuccessMessagePage === 1) {
414
+            this.msgCancelDetailList = resp.data.list
415
+          } else {
416
+            this.msgCancelDetailList = [...this.msgCancelDetailList, ...resp.data.list]
417
+          }
418
+
419
+          this.detailCancelMessagePage++
420
+          this.detailCancelMsgListLoading = false;
421
+          if (this.msgCancelDetailList.length >= resp.data.total) {
422
+            this.detailCancelMsgListFinished = true;
423
+          }
424
+        }
425
+      }
426
+    },
427
+    onAppMessage () {
428
+      this.msgPanelList = []
429
+      this.mainPanelMessagePage = 1
430
+      this.mainPanelMsgListLoading = false
431
+      this.mainPanelMsgListFinished = false
432
+      this.getMainPanelMessageList(1)
433
+      this.msgPupopVisible = true
434
+    },
435
+    closeMsgPanel () {
436
+      this.msgPupopVisible = false
437
+    },
438
+    toMsgDetail (param) {
439
+      this.msgPupopVisible = false
440
+      // this.getMessageByType(param)
441
+      if (param === 1) {
442
+        this.msgSuccessDetailList = []
443
+        this.detailSuccessMessagePage = 1
444
+        this.detailSuccessMsgListLoading = false
445
+        this.detailSuccessMsgListFinished = false
446
+        this.getMessageByType(param, 1)
447
+
448
+        this.msgSuccessDetailPupopVisible = true
449
+      } else {
450
+        this.msgCancelDetailList = []
451
+        this.detailCancelMessagePage = 1
452
+        this.detailCancelMsgListLoading = false
453
+        this.detailCancelMsgListFinished = false
454
+
455
+        this.getMessageByType(param, 1)
456
+
457
+        this.msgCancelDetailPupopVisible = true
458
+      }
459
+      this.orderMsgType = param
460
+      console.log(this.orderMsgType)
461
+    },
462
+    backMsgPanel () {
463
+      this.msgSuccessDetailPupopVisible = false
464
+      this.msgCancelDetailPupopVisible = false
465
+
466
+      this.getMainPanelMessageList()
467
+      this.msgPupopVisible = true
468
+    },
469
+    async clearUnreadMsgsByType (type) {
470
+      let resp = await api.clearMessage({ type: type })
471
+      if (resp.code === 200) {
472
+        if (type === 1) {
473
+          this.getMessageByType(this.orderMsgType)
474
+          this.successUnread = false
475
+        } else if (type === 2) {
476
+          this.getMessageByType(this.orderMsgType)
477
+          this.cancelUnread = false
478
+        } else if (type === 0) {
479
+          this.getMainPanelMessageList()
480
+          this.allUnread = false
481
+        }
482
+      }
483
+    },
484
+    async readMsgToOrderDetails (source) {
485
+      // console.log(source)
486
+      if (!source.is_read) {
487
+        let clearMsgByIdResp = await api.clearMessageById({ id: source.id })
488
+        if (clearMsgByIdResp.code === 200) {
489
+          this.getMainPanelMessageList()
490
+        }
491
+      }
492
+      if (source.type === 'BUY' || source.type === 'BUY_CARD') return
493
+      // return
494
+      let orderInfoResp = await api.getOrderInfo({ id: source.order_id })
495
+      if (orderInfoResp.code === 200) {
496
+        if (orderInfoResp.data.order_data.status == 0) {
497
+          // 跳转前关闭所有弹窗
498
+          this.msgPupopVisible = false
499
+          this.msgSuccessDetailPupopVisible = false
500
+          this.msgCancelDetailPupopVisible = false
501
+
502
+          this.$router.push({
503
+            path: '/confirmOrder/details',
504
+            query: {
505
+              id: source.order_id
506
+            }
507
+          })
508
+        } else {
509
+          this.msgPupopVisible = false
510
+          this.msgSuccessDetailPupopVisible = false
511
+          this.msgCancelDetailPupopVisible = false
512
+
513
+          this.$router.push({
514
+            path: "/historicalOrder/details",
515
+            query: {
516
+              id: source.order_id
517
+            }
518
+          });
519
+        }
520
+      } else {
521
+        this.$message.error("未查到此订单")
522
+      }
523
+    },
93 524
   },
94 525
   computed: {
95 526
     routerItems () {
@@ -109,6 +540,14 @@ export default {
109 540
         }
110 541
       }
111 542
       return resultArr;
543
+    },
544
+    orderMsgType: {
545
+      get () {
546
+        return this.MsgType
547
+      },
548
+      set (val) {
549
+        this.MsgType = val
550
+      }
112 551
     }
113 552
   },
114 553
 }
@@ -118,6 +557,25 @@ export default {
118 557
 <style lang="less" scoped>
119 558
 @import url(../../../style/root.less);
120 559
 
560
+.flex {
561
+  display: flex;
562
+}
563
+.flex-column {
564
+  flex-direction: column;
565
+}
566
+.justify-center {
567
+  justify-content: center;
568
+}
569
+.justify-between {
570
+  justify-content: space-between;
571
+}
572
+.justify-around {
573
+  justify-content: space-around;
574
+}
575
+.items-center {
576
+  align-items: center;
577
+}
578
+
121 579
 .layout {
122 580
   height: 100vh;
123 581
   display: flex;
@@ -126,7 +584,8 @@ export default {
126 584
 .menu-wrapper {
127 585
   height: 100%;
128 586
   text-align: center;
129
-  overflow: auto;
587
+  overflow-y: auto;
588
+  overflow-x: hidden;
130 589
   background-color: #fa7d22;
131 590
 
132 591
   .el-menu {
@@ -181,6 +640,16 @@ export default {
181 640
       .news {
182 641
         width: 24px;
183 642
         height: 24px;
643
+        position: relative;
644
+        .dot {
645
+          width: 8px;
646
+          height: 8px;
647
+          border-radius: 50%;
648
+          background-color: #e54635;
649
+          position: absolute;
650
+          right: 2px;
651
+          top: 2px;
652
+        }
184 653
 
185 654
         img {
186 655
           width: 100%;
@@ -217,4 +686,147 @@ export default {
217 686
     background-color: #f7f8fa;
218 687
   }
219 688
 }
689
+.dot {
690
+  width: 9px;
691
+  height: 9px;
692
+  border-radius: 50%;
693
+  background-color: #ff6945;
694
+  margin-top: 10px;
695
+}
696
+.dot-activated {
697
+  background-color: #fff;
698
+}
699
+.block {
700
+  width: 540px;
701
+  height: 400px;
702
+  padding: 20px;
703
+  box-sizing: border-box;
704
+  background: #ffffff;
705
+  border-radius: 8px;
706
+  position: relative;
707
+  .title {
708
+    display: flex;
709
+    justify-content: space-between;
710
+    font-size: 14px;
711
+    .clear {
712
+      display: flex;
713
+      align-items: center;
714
+      color: #999999;
715
+      img {
716
+        width: 32px;
717
+        height: 32px;
718
+      }
719
+    }
720
+    .txt {
721
+      display: flex;
722
+      align-items: center;
723
+    }
724
+    .delete-pupop {
725
+      width: 32px;
726
+      height: 32px;
727
+      img {
728
+        width: 100%;
729
+        height: 100%;
730
+        display: block;
731
+      }
732
+    }
733
+  }
734
+  .msg-con {
735
+    height: 290px;
736
+    overflow: auto;
737
+    margin-top: 21px;
738
+    .order-msg {
739
+      .success,
740
+      .cancel {
741
+        .desc {
742
+          img {
743
+            width: 36px;
744
+            height: 36px;
745
+          }
746
+          .title {
747
+            margin-left: 17px;
748
+          }
749
+        }
750
+        .count {
751
+          .time {
752
+            color: #999999;
753
+            margin-bottom: 4px;
754
+          }
755
+          .num {
756
+            width: 25px;
757
+            height: 25px;
758
+            // line-height: 21px;
759
+            // text-align: center;
760
+            display: flex;
761
+            justify-content: center;
762
+            align-items: center;
763
+            padding: 8px;
764
+            box-sizing: border-box;
765
+            color: #ffffff;
766
+            border-radius: 50%;
767
+            background-color: #ff6945;
768
+          }
769
+        }
770
+      }
771
+      .cancel {
772
+        margin-top: 23px;
773
+      }
774
+    }
775
+    .ready-msg {
776
+      margin-top: 20px;
777
+      .content-bar {
778
+        .desc-info {
779
+          color: #666666;
780
+          font-weight: 400;
781
+        }
782
+        .desc-time {
783
+          width: 400px;
784
+          margin-top: 5px;
785
+          font-weight: 500;
786
+          line-height: 18px;
787
+        }
788
+      }
789
+      .count {
790
+        .time {
791
+          color: #999999;
792
+        }
793
+      }
794
+    }
795
+  }
796
+}
797
+.detail {
798
+  .title {
799
+    .back {
800
+      img {
801
+        width: 24px;
802
+        height: 24px;
803
+      }
804
+    }
805
+    .delete-msg {
806
+      img {
807
+        width: 32px;
808
+        height: 32px;
809
+      }
810
+    }
811
+  }
812
+  .msg-bar {
813
+    // margin-top: 18px;
814
+    height: 55px;
815
+    .info {
816
+      width: 400px;
817
+      line-height: 18px;
818
+      .name {
819
+        font-weight: 600;
820
+        margin-right: 5px;
821
+      }
822
+      .project {
823
+        color: #666666;
824
+      }
825
+    }
826
+  }
827
+}
828
+.detail-msg-con {
829
+  height: 330px;
830
+  overflow: auto;
831
+}
220 832
 </style>

+ 2 - 1
src/components/common/layout/leftMenu.vue

@@ -90,9 +90,9 @@ export default {
90 90
   },
91 91
   watch: {
92 92
     $route (to, from) {
93
+      console.log(to, 'tootototo');
93 94
       let patname = `/${to.path.split('/')[1]}`
94 95
       console.log(window.location, 'window.location.pathname', to);
95
-
96 96
       this.$emit('changeIsBack', to.meta.isback)
97 97
       this.menu.forEach((item, index) => {
98 98
         if (patname == item.path) {
@@ -139,6 +139,7 @@ export default {
139 139
   line-height: 46px !important;
140 140
   background: url("https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/select_icon.png")
141 141
     no-repeat;
142
+  margin-right: -2px;
142 143
   background-size: 100% 100%;
143 144
   background-color: #fa7d22 !important;
144 145
   color: #fa7d22 !important;

Fichier diff supprimé car celui-ci est trop grand
+ 458 - 243
src/pages/confirmOrder/addOrder/index.vue


Fichier diff supprimé car celui-ci est trop grand
+ 698 - 150
src/pages/confirmOrder/details/index.vue


+ 1 - 2
src/pages/confirmOrder/index.vue

@@ -55,8 +55,7 @@ export default {
55 55
             this.$router.push({
56 56
               path: "/confirmOrder/addOrder",
57 57
               query: {   //user_id
58
-                data: JSON.stringify(res.data),
59
-                // user_id:res.data.user.user_id
58
+                data: JSON.stringify(res.data)
60 59
               }
61 60
             });
62 61
           return

+ 95 - 70
src/pages/coupon/index.vue

@@ -1,71 +1,82 @@
1 1
 <template>
2 2
   <div class="mine">
3 3
     <div class="table">
4
-      <el-input class="search-input"
5
-                placeholder="请输入内容"
6
-                prefix-icon="el-icon-search"
7
-                size="mini"
8
-                v-model="searckItem"></el-input>
9
-      <div class="search-button"
10
-           @click="getUserList">搜索</div>
4
+      <el-input
5
+        class="search-input"
6
+        placeholder="请输入内容"
7
+        prefix-icon="el-icon-search"
8
+        size="mini"
9
+        v-model="searckItem"
10
+      ></el-input>
11
+      <div class="search-button" @click="getUserList">搜索</div>
11 12
       <div class="coupon">选择优惠券</div>
12
-      <el-select class="coupon-select"
13
-                 v-model="coupon"
14
-                 size="mini"
15
-                 placeholder="选择优惠券">
16
-        <el-option v-for="item in couponList"
17
-                   :key="item.id"
18
-                   :label="item.name"
19
-                   :value="item.id"></el-option>
13
+      <el-select
14
+        class="coupon-select"
15
+        v-model="coupon"
16
+        size="mini"
17
+        placeholder="选择优惠券"
18
+      >
19
+        <el-option
20
+          v-for="item in couponList"
21
+          :key="item.id"
22
+          :label="item.name"
23
+          :value="item.id"
24
+        ></el-option>
20 25
       </el-select>
21 26
       <div class="num-tips">数量</div>
22 27
       <div class="coupon-num">
23
-        <div class="reduce"
24
-             @click="reduceNum">-</div>
25
-        <div class="num">{{couponNum}}</div>
26
-        <div class="add"
27
-             @click="couponNum++">+</div>
28
+        <div class="reduce" @click="reduceNum">-</div>
29
+        <div class="num">{{ couponNum }}</div>
30
+        <div class="add" @click="couponNum++">+</div>
31
+      </div>
32
+      <div class="send-coupon" style="margin-left: 39px" @click="sendCoupon">
33
+        发送
28 34
       </div>
29
-      <div class="send-coupon"
30
-           style="margin-left: 39px;"
31
-           @click="sendCoupon">发送</div>
32 35
     </div>
33 36
     <div class="user-list">
34
-      <el-table ref="multipleTable"
35
-                :data="tableData"
36
-                tooltip-effect="dark"
37
-                height="500"
38
-                style="width: 100%;border-radius: 8px;"
39
-                @selection-change="handleSelectionChange">
40
-        <el-table-column type="selection"
41
-                         width="55"></el-table-column>
42
-        <el-table-column label="头像"
43
-                         width="120">
37
+      <el-table
38
+        ref="multipleTable"
39
+        :data="tableData"
40
+        tooltip-effect="dark"
41
+        height="500"
42
+        style="width: 100%; border-radius: 8px"
43
+        @selection-change="handleSelectionChange"
44
+        @row-click="goDetail"
45
+      >
46
+        <el-table-column type="selection" width="55"></el-table-column>
47
+        <el-table-column label="头像" width="120">
44 48
           <template slot-scope="scope">
45 49
             <div class="head-img">
46
-              <img :src="scope.row.avatar_url"
47
-                   alt />
50
+              <img :src="scope.row.avatar_url" alt />
48 51
             </div>
49 52
           </template>
50 53
         </el-table-column>
51
-        <el-table-column prop="nickname"
52
-                         label="昵称"
53
-                         width="120"></el-table-column>
54
-        <el-table-column prop="mobile"
55
-                         label="联系电话"
56
-                         show-overflow-tooltip></el-table-column>
57
-        <el-table-column prop="create_time"
58
-                         label="注册时间"
59
-                         show-overflow-tooltip></el-table-column>
54
+        <el-table-column
55
+          prop="nickname"
56
+          label="昵称"
57
+          width="120"
58
+        ></el-table-column>
59
+        <el-table-column
60
+          prop="mobile"
61
+          label="联系电话"
62
+          show-overflow-tooltip
63
+        ></el-table-column>
64
+        <el-table-column
65
+          prop="create_time"
66
+          label="注册时间"
67
+          show-overflow-tooltip
68
+        ></el-table-column>
60 69
       </el-table>
61 70
 
62 71
       <div class="pagin">
63
-        <el-pagination background
64
-                       layout="prev, pager, next"
65
-                       @size-change="handleSizeChange"
66
-                       @current-change="handleCurrentChange"
67
-                       :current-page.sync="currentPage1"
68
-                       :total="total"></el-pagination>
72
+        <el-pagination
73
+          background
74
+          layout="prev, pager, next"
75
+          @size-change="handleSizeChange"
76
+          @current-change="handleCurrentChange"
77
+          :current-page.sync="currentPage1"
78
+          :total="total"
79
+        ></el-pagination>
69 80
       </div>
70 81
     </div>
71 82
   </div>
@@ -75,8 +86,8 @@
75 86
 import api from "../../server/home";
76 87
 
77 88
 export default {
78
-  components: {},
79
-  data () {
89
+    components: {},
90
+  data() {
80 91
     return {
81 92
       searckItem: "",
82 93
       couponList: [],
@@ -93,14 +104,24 @@ export default {
93 104
   watch: {},
94 105
 
95 106
   methods: {
96
-    reduceNum () {
107
+    // 发券中心点击用户跳转到用户详情
108
+    goDetail(row, column, event) {
109
+      console.log(1);
110
+      this.$router.push({
111
+        path: "/customerMan/details",
112
+        query: {
113
+          id: row.id,
114
+        },
115
+      });
116
+    },
117
+    reduceNum() {
97 118
       this.couponNum > 1 ? this.couponNum-- : (this.couponNum = 1);
98 119
     },
99
-    handleSelectionChange (val) {
120
+    handleSelectionChange(val) {
100 121
       this.multipleSelection = val;
101 122
     },
102 123
     // 发送优惠券
103
-    sendCoupon () {
124
+    sendCoupon() {
104 125
       let selectIds = "";
105 126
       for (let i = 0; i < this.multipleSelection.length; i++) {
106 127
         selectIds = selectIds + "," + this.multipleSelection[i].id;
@@ -108,27 +129,32 @@ export default {
108 129
       let params = {
109 130
         id: this.coupon,
110 131
         user_ids: selectIds.substring(1, selectIds.length),
111
-        num: this.couponNum
132
+        num: this.couponNum,
112 133
       };
113
-      api.sendCoupon(params).then(res => {
134
+      api.sendCoupon(params).then((res) => {
114 135
         if (res.code == 200) {
115 136
           this.$message({
116
-            message: '发送成功',
117
-            type: 'success'
137
+            message: "发送成功",
138
+            type: "success",
118 139
           });
119 140
         }
120 141
       });
121 142
     },
122 143
 
123 144
     // 获取订单列表
124
-    getUserList () {
145
+    getUserList() {
125 146
       let params = {
126 147
         page: this.currentPage1,
127 148
         limit: this.limit,
128
-        keywords: this.searckItem
149
+        keywords: this.searckItem,
129 150
       };
130
-      api.getUserList(params).then(res => {
151
+      api.getUserList(params).then((res) => {
131 152
         if (res.code == 200) {
153
+          // 将用户手机号中间四位变成****
154
+          res.data.list.map((item) => {
155
+            item.mobile =
156
+              item.mobile.substring(0, 3) + "****" + item.mobile.substring(7);
157
+          });
132 158
           this.tableData = res.data.list;
133 159
           this.total = res.data.total;
134 160
         }
@@ -136,33 +162,32 @@ export default {
136 162
     },
137 163
 
138 164
     // 获取优惠券列表
139
-    getCouponInfo () {
165
+    getCouponInfo() {
140 166
       let params = {
141 167
         page: this.currentPage1,
142
-        limit: 100
168
+        limit: 100,
143 169
       };
144
-      api.getCouponInfo(params).then(res => {
170
+      api.getCouponInfo(params).then((res) => {
145 171
         if (res.code == 200) {
146 172
           this.couponList = res.data.list;
147 173
         }
148 174
       });
149 175
     },
150 176
 
151
-    handleCurrentChange (e) {
177
+    handleCurrentChange(e) {
152 178
       this.currentPage1 = e;
153 179
       this.getUserList();
154 180
     },
155 181
 
156
-    handleSizeChange (val) {
157
-    }
182
+    handleSizeChange(val) {},
158 183
   },
159 184
 
160
-  created () {
185
+  created() {
161 186
     this.getUserList();
162 187
     this.getCouponInfo();
163 188
   },
164 189
 
165
-  mounted () { }
190
+  mounted() {},
166 191
 };
167 192
 </script>
168 193
 

+ 384 - 150
src/pages/customerMan/details/index.vue

@@ -2,61 +2,112 @@
2 2
   <div class="mine">
3 3
     <div class="left">
4 4
       <div class="user-info">
5
-        <div class="user-img"><img :src="userInfo.avatar_url"
6
-               alt=""></div>
7
-        <div class="user-span">
8
-          <div class="info">
9
-            <div class="name"><span>{{userInfo.nickname}}</span></div>
10
-            <div class="sex"><img :src="gender"
11
-                   alt=""></div>
12
-            <div class="age"><span>{{userInfo.skin_age}}</span><span>肤龄</span></div>
5
+        <div class="title">
6
+          <div class="txt">个人信息</div>
7
+          <div
8
+            class="test-record"
9
+            @click="toTestRecord"
10
+            v-if="userInfo.analysis_id"
11
+          >
12
+            测肤记录
13
+          </div>
14
+        </div>
15
+        <div class="detail-info">
16
+          <div class="user-img">
17
+            <img :src="userInfo.avatar_url" alt="" />
18
+          </div>
19
+          <div class="user-span">
20
+            <div class="info">
21
+              <div class="name">
22
+                <span>{{ userInfo.nickname | ellipsis(3) }}</span>
23
+              </div>
24
+              <div class="sex"><img :src="gender" alt="" /></div>
25
+              <!-- <div class="age">
26
+                <span>{{ userInfo.skin_age }}</span
27
+                ><span class="min-size">肤龄</span>
28
+              </div> -->
29
+            </div>
30
+            <div class="real-name">
31
+              姓名:
32
+              <span v-show="!nameInpVisible">{{ userInfo.real_name }}</span>
33
+              <el-input
34
+                size="mini"
35
+                ref="realNameInp"
36
+                v-show="nameInpVisible"
37
+                @change="updateRealName"
38
+                v-model="userInfo.real_name"
39
+                type="text"
40
+              ></el-input>
41
+              <img
42
+                class="edit-name"
43
+                @click="editName"
44
+                src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/coupon/eidt.png"
45
+                alt=""
46
+                srcset=""
47
+              />
48
+            </div>
49
+            <div class="skin-type">
50
+              肤质:<span>{{ userInfo.skin_type }}</span>
51
+            </div>
52
+            <div class="skin-type">
53
+              肤龄:<span>{{ userInfo.age }}</span>
54
+            </div>
55
+            <div class="skin-color">
56
+              肤色:<span>{{ userInfo.skin_color }}</span>
57
+            </div>
13 58
           </div>
14
-          <div class="skin-type">肤质:<span>{{userInfo.skin_type}}</span></div>
15
-          <div class="skin-color">肤色:<span>{{userInfo.skin_color}}</span></div>
16
-          <div class="skin-color">上传报告时间:<span>{{userInfo.check_time}}</span></div>
17 59
         </div>
18 60
       </div>
19 61
 
20 62
       <div class="personage-data">
21 63
         <div class="myDataList">
64
+          检测时间:
65
+          <span>{{ userInfo.check_time }}</span>
66
+        </div>
67
+        <div class="myDataList">
22 68
           出生日期:
23
-          <span>{{userInfo.birthday}}</span>
69
+          <span>{{ userInfo.birthday }}</span>
24 70
         </div>
25 71
         <div class="myDataList">
26
-          联系电话:
27
-          <span>{{userInfo.mobile}}</span>
72
+          手机号
73
+          <span>{{ userInfo.mobile }}</span>
28 74
         </div>
29 75
 
30 76
         <div class="myDataList">
31 77
           所在地:
32
-          <span>{{userInfo.city}}</span>
78
+          <span>{{ userInfo.city }}</span>
33 79
         </div>
34 80
 
35 81
         <div class="myDataList">
36 82
           开卡店铺:
37
-          <span>{{userInfo.store_name}}</span>
83
+          <span>{{ userInfo.store_name }}</span>
38 84
         </div>
39 85
 
40
-        <div class="myDataList">
41
-          卡卷数量:
42
-          <span>{{userInfo.card_num}}</span>
86
+        <div class="myDataList coupon-num">
87
+          次卡数量:
88
+          <span>{{ order_total.card_order }}</span>
89
+        </div>
90
+
91
+        <div class="myDataList coupon-num">
92
+          优惠券数量:
93
+          <span>{{ userInfo.card_num }}</span>
43 94
         </div>
44 95
 
45 96
         <div class="myDataList">
46 97
           储值金额:
47 98
           <span class="JEcolor">
48 99
49
-            <span class="bigSixe">{{userInfo.amount}}</span>
100
+            <span class="bigSixe">{{ userInfo.amount }}</span>
50 101
             <!-- .00 -->
51 102
           </span>
52 103
         </div>
53 104
         <div class="myDataList">
54 105
           积分:
55
-          <span>{{userInfo.coin}}</span>
106
+          <span>{{ userInfo.coin }}</span>
56 107
         </div>
57
-        <div class="myDataList">
58
-          备注:
59
-          <span>{{remarks | ellipsis(20)}}</span>
108
+        <div class="myDataList" @click="remarkPupopVisible = true">
109
+          备注信息
110
+          <span>{{ userInfo.remark | ellipsis(20) }}</span>
60 111
         </div>
61 112
       </div>
62 113
     </div>
@@ -67,43 +118,55 @@
67 118
             <div class="lable-title">面诊标签</div>
68 119
             <div class="problem">
69 120
               <div class="problem-title">问题标签</div>
70
-              <div class="problem-lable-top">
71
-                <div class="lable-text problem-text">{{problem}}</div>
121
+              <div class="problem-lable">
122
+                <div class="lable-text problem-text">{{ problem }}</div>
72 123
               </div>
73 124
             </div>
74 125
             <div class="problem">
75 126
               <div class="problem-title">面部标签</div>
76 127
               <div class="problem-lable">
77
-                <div class="lable-text"
78
-                     v-for="item,index in lableList"
79
-                     :key="index"
80
-                     :style="{background:item.bgcolor,borderColor:item.bdcolor}">{{item.text}}</div>
128
+                <div
129
+                  class="lable-text"
130
+                  v-for="(item, index) in lableList"
131
+                  :key="index"
132
+                  :style="{
133
+                    background: item.bgcolor,
134
+                    borderColor: item.bdcolor,
135
+                  }"
136
+                >
137
+                  {{ item.text }}
138
+                </div>
81 139
               </div>
82 140
             </div>
83 141
           </div>
84 142
         </div>
85 143
         <div class="right-top-list">
86
-          <div class="dataList"
87
-               @click="toOrder(1)">
88
-            <div class="data-list-left"><img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/coupon/project_icon.png" />
89
-              <p>项目订单</p>
144
+          <div class="dataList" @click="toOrder(1)">
145
+            <div class="">
146
+              <img
147
+                src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/coupon/project_icon.png"
148
+              />
149
+              <div>项目订单</div>
90 150
             </div>
91
-            <div><span>{{order_total.project}}</span></div>
151
+            <span>{{ order_total.project }}</span>
92 152
           </div>
93
-          <div class="dataList"
94
-               style="margin:18px 0px"
95
-               @click="toOrder(2)">
96
-            <div class="data-list-left"><img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/coupon/coupon_icon.png" />
97
-              <p>优惠券</p>
153
+          <div class="dataList" style="margin: 18px 0px" @click="toOrder(2)">
154
+            <div class="">
155
+              <img
156
+                src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/coupon/coupon_icon.png"
157
+              />
158
+              <div>次卡数量</div>
98 159
             </div>
99
-            <div><span>{{order_total.coupon}}</span></div>
160
+            <span>{{ order_total.card_num }}</span>
100 161
           </div>
101
-          <div class="dataList"
102
-               @click="toOrder(3)">
103
-            <div class="data-list-left"><img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/coupon/order_total_icon.png" />
104
-              <p>商品订单</p>
162
+          <div class="dataList" @click="toOrder(3)">
163
+            <div class="">
164
+              <img
165
+                src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/coupon/order_total_icon.png"
166
+              />
167
+              <div>商品订单</div>
105 168
             </div>
106
-            <div><span>{{order_total.goods}}</span></div>
169
+            <span>{{ order_total.goods }}</span>
107 170
           </div>
108 171
         </div>
109 172
       </div>
@@ -112,40 +175,50 @@
112 175
           <div class="tab">
113 176
             <div class="tab-title">执行方案</div>
114 177
           </div>
115
-          <div class="programmeList"
116
-               v-if="programmeList.length>0">
178
+          <div class="programmeList" v-if="programmeList.length > 0">
117 179
             <div class="programmeWeek">
118
-              <div class="programmeItem"
119
-                   v-for="item,index in programmeList"
120
-                   :key="index">
121
-                <div :class="selectWeek==index?'weekItemSelect':'weekItem'"
122
-                     @click="weekSelect(index)">{{item.name}}</div>
123
-                <div class="weekLine"
124
-                     v-if="index==3?false:true"></div>
180
+              <div
181
+                class="programmeItem"
182
+                v-for="(item, index) in programmeList"
183
+                :key="index"
184
+              >
185
+                <div
186
+                  :class="selectWeek == index ? 'weekItemSelect' : 'weekItem'"
187
+                  @click="weekSelect(index)"
188
+                >
189
+                  {{ item.name }}
190
+                </div>
191
+                <div class="weekLine" v-if="index == 3 ? false : true"></div>
125 192
               </div>
126 193
             </div>
127
-            <div class="doTime">{{programmeList[selectWeek].time}}</div>
128
-            <div class="weekDetails"
129
-                 v-if="programmeList.length>0">
130
-              <div class="contentItem"
131
-                   v-for="item,index1 in programmeList[selectWeek].list"
132
-                   :key="index1">
194
+            <div class="doTime">{{ programmeList[selectWeek].time }}</div>
195
+            <div class="weekDetails" v-if="programmeList.length > 0">
196
+              <div
197
+                class="contentItem"
198
+                v-for="(item, index1) in programmeList[selectWeek].list"
199
+                :key="index1"
200
+              >
133 201
                 <div class="itemTitle">
134
-                  <div>{{item.name}}</div>
135
-                  <div>{{item.classify_name}}</div>
202
+                  <div>{{ item.name }}</div>
203
+                  <div>{{ item.classify_name }}</div>
136 204
                   <!-- <div>{{item.time}}</div> -->
137 205
                 </div>
138
-                <div class="itemContent"
139
-                     v-for="items,index2 in item.list"
140
-                     :key="index2">
141
-                  <img class="itemContent-img"
142
-                       :src="items.cover_url" />
206
+                <div
207
+                  class="itemContent"
208
+                  v-for="(items, index2) in item.list"
209
+                  :key="index2"
210
+                >
211
+                  <img class="itemContent-img" :src="items.cover_url" />
143 212
                   <div class="itemContent-right">
144 213
                     <div class="right-content">
145
-                      <div class="right-name">{{items.name |ellipsis(14)}}</div>
146
-                      <div class="right-price">{{items.price |doubleNum(2)}}</div>
214
+                      <div class="right-name">
215
+                        {{ items.name | ellipsis(14) }}
216
+                      </div>
217
+                      <div class="right-price">
218
+                        {{ items.price | doubleNum(2) }}
219
+                      </div>
147 220
                     </div>
148
-                    <div class="right-project">{{items.product_name}}</div>
221
+                    <div class="right-project">{{ items.product_name }}</div>
149 222
                   </div>
150 223
                 </div>
151 224
               </div>
@@ -154,14 +227,36 @@
154 227
         </div>
155 228
       </div>
156 229
     </div>
230
+    <!-- 备注 -->
231
+    <mine-pupop :show="remarkPupopVisible">
232
+      <div class="block">
233
+        <div class="delete-pupop" @click="remarkPupopVisible = false">
234
+          <img
235
+            src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
236
+            alt
237
+          />
238
+        </div>
239
+        <div class="pupop-title">备注</div>
240
+        <textarea
241
+          type="text"
242
+          class="noticeInput"
243
+          placeholder="备注"
244
+          v-model="userInfo.remark"
245
+        ></textarea>
246
+        <div class="noticeSubmit">
247
+          <div class="submit-notice" @click="submitRemark">确定</div>
248
+        </div>
249
+      </div>
250
+    </mine-pupop>
157 251
   </div>
158 252
 </template>
159 253
 
160 254
 <script>
161 255
 import api from "../../../server/home";
256
+import minePupop from "../../../components/minePupop/index.vue";
162 257
 
163 258
 export default {
164
-  data () {
259
+  data() {
165 260
     return {
166 261
       userInfo: {
167 262
         image:
@@ -169,16 +264,17 @@ export default {
169 264
         name: "张三",
170 265
         sex: "女",
171 266
         age: "23",
172
-        skinType: "中性皮肤"
267
+        skinType: "中性皮肤",
268
+        real_name: "",
269
+        remark: "",
173 270
       },
174 271
       problem: "",
175 272
       //面部标签
176
-      lableList: [
177
-      ],
273
+      lableList: [],
178 274
       //执行方案
179 275
       programmeList: [],
180 276
 
181
-      remarks: {},
277
+      // remarks: {},
182 278
       //项目列表
183 279
       projectList: [],
184 280
 
@@ -188,35 +284,42 @@ export default {
188 284
       projectInfo: "",
189 285
       weekInfo: "",
190 286
       programmeIndex: "",
191
-      remarks: "",
192
-      isPupop: false
287
+      isPupop: false,
288
+      nameInpVisible: false,
289
+      remarkPupopVisible: false,
193 290
     };
194 291
   },
292
+  components: { minePupop },
195 293
   computed: {
196
-    gender () {
294
+    gender() {
197 295
       // 性别,1男,2女,0保密
198
-      return this.userInfo.sex == 1 ?
199
-        'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxapp/20220610/male.png' :
200
-        'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxapp/20220610/female.png'
201
-    }
296
+      return this.userInfo.sex == 1
297
+        ? "https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxapp/20220610/male.png"
298
+        : "https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxapp/20220610/female.png";
299
+    },
202 300
   },
203 301
   watch: {},
204 302
 
205 303
   methods: {
206
-    getPadUserInfo () {
207
-      api.getPadUserInfo({ id: this.id }).then(res => {
304
+    getPadUserInfo() {
305
+      api.getPadUserInfo({ id: this.id }).then((res) => {
306
+        console.log(res, "aaaaaaaa");
307
+        // 将用户手机号中间四位变成****
308
+        res.data.user.mobile =
309
+          res.data.user.mobile.substring(0, 3) +
310
+          "****" +
311
+          res.data.user.mobile.substring(7);
208 312
         this.userInfo = res.data.user;
209
-        this.remarks = res.data.remark;
313
+        // this.userInfo.remarks = res.data.remark;
210 314
         this.problem = res.data.skin_name;
211
-        let _problem = []
212
-        res.data.face_names.forEach(item => {
213
-          let info = {}
214
-          info['text'] = item
215
-          _problem.push(info)
216
-          console.log(_problem, '_problem');
217
-        })
218
-        this.lableList = _problem
219
-        this.remarks = res.data.remark
315
+        let _problem = [];
316
+        res.data.face_names.forEach((item) => {
317
+          let info = {};
318
+          info["text"] = item;
319
+          _problem.push(info);
320
+          console.log(_problem, "_problem");
321
+        });
322
+        this.lableList = _problem;
220 323
         this.randomColor();
221 324
         this.order_total = res.data.order_total;
222 325
         this.programmeList = res.data.scheme_list;
@@ -224,40 +327,40 @@ export default {
224 327
         // this.coupon_list = res.data.order_data.coupon_list;
225 328
       });
226 329
     },
227
-    randomColor (type) {
330
+    randomColor(type) {
228 331
       let arr = [
229 332
         {
230 333
           background: "rgba(244, 247, 255, 1)",
231
-          border: "rgba(85, 124, 255, 1)"
334
+          border: "rgba(85, 124, 255, 1)",
232 335
         },
233 336
         {
234 337
           background: "rgba(245, 252, 245, 1)",
235
-          border: "rgba(66, 211, 81, 1)"
338
+          border: "rgba(66, 211, 81, 1)",
236 339
         },
237 340
         {
238 341
           background: "rgba(254, 244, 237, 1)",
239
-          border: "rgba(250, 125, 34, 1)"
342
+          border: "rgba(250, 125, 34, 1)",
240 343
         },
241 344
         {
242 345
           background: "rgba(249, 245, 255, 1)",
243
-          border: "rgba(136, 50, 255, 1)"
346
+          border: "rgba(136, 50, 255, 1)",
244 347
         },
245 348
         {
246 349
           background: "rgba(255, 252, 245, 1)",
247
-          border: "rgba(204, 116, 42, 1)"
248
-        }
350
+          border: "rgba(204, 116, 42, 1)",
351
+        },
249 352
       ];
250
-      this.lableList.forEach(res => {
353
+      this.lableList.forEach((res) => {
251 354
         let color = Math.floor(Math.random() * arr.length);
252 355
         this.$set(res, "bgcolor", arr[color].background);
253 356
         this.$set(res, "bdcolor", arr[color].border);
254 357
       });
255 358
     },
256
-    weekSelect (index) {
359
+    weekSelect(index) {
257 360
       console.log("xxxx");
258 361
       this.selectWeek = index;
259 362
     },
260
-    onOperation (index) {
363
+    onOperation(index) {
261 364
       if (this.programmeList[index].onSelect) {
262 365
         this.$set(
263 366
           this.programmeList[index],
@@ -268,30 +371,62 @@ export default {
268 371
         this.$set(this.programmeList[index], "onSelect", true);
269 372
       }
270 373
     },
271
-    toOrder (index) {
272
-      let activeName = 'first'
374
+    toOrder(index) {
375
+      let activeName = "first";
273 376
       if (index == 3) {
274
-        activeName = 'third'
377
+        activeName = "third";
275 378
       } else if (index == 2) {
276
-        activeName = 'second'
379
+        activeName = "second";
277 380
       }
278 381
       this.$router.push({
279 382
         path: "/customerMan/projectOrder",
280 383
         query: {
281 384
           id: this.id,
282
-          activeName: activeName
283
-        }
385
+          activeName: activeName,
386
+        },
387
+      });
388
+    },
389
+    toTestRecord() {
390
+      this.$router.push({
391
+        path: "/testSkin/details",
392
+        query: {
393
+          id: this.userInfo.analysis_id,
394
+        },
284 395
       });
285 396
     },
397
+    editName() {
398
+      this.nameInpVisible = true;
399
+      this.$refs.realNameInp.focus();
400
+    },
401
+    async updateRealName() {
402
+      let resp = await api.updateUserProfile({
403
+        id: this.id,
404
+        real_name: this.userInfo.real_name,
405
+      });
406
+      if (resp.code === 200) {
407
+        this.$message.success("保存成功!");
408
+      }
409
+      this.nameInpVisible = false;
410
+    },
411
+    async submitRemark() {
412
+      let resp = await api.updateUserProfile({
413
+        id: this.id,
414
+        remark: this.userInfo.remark,
415
+      });
416
+      if (resp.code === 200) {
417
+        this.$message.success("保存成功!");
418
+      }
419
+      this.remarkPupopVisible = false;
420
+    },
286 421
   },
287 422
 
288
-  created () {
423
+  created() {
289 424
     let id = this.$route.query.id;
290 425
     this.id = id;
291 426
     this.getPadUserInfo();
292 427
   },
293 428
 
294
-  mounted () { }
429
+  mounted() {},
295 430
 };
296 431
 </script>
297 432
 
@@ -314,53 +449,85 @@ export default {
314 449
     height: 100%;
315 450
     .user-info {
316 451
       display: flex;
452
+      flex-direction: column;
317 453
       align-items: center;
318
-      .user-img {
319
-        width: 96px;
320
-        img {
321
-          width: 100%;
322
-          display: block;
323
-          border-radius: 6px;
454
+      .title {
455
+        width: 100%;
456
+        display: flex;
457
+        justify-content: space-between;
458
+        align-items: center;
459
+        margin-bottom: 10px;
460
+        .txt {
461
+          color: #333333;
462
+        }
463
+        .test-record {
464
+          font-size: 12px;
465
+          color: #fa7d22;
324 466
         }
325 467
       }
326
-      .user-span {
327
-        margin-left: 12px;
328
-
329
-        span {
330
-          color: #333333;
468
+      .detail-info {
469
+        display: flex;
470
+        .user-img {
471
+          width: 96px;
472
+          img {
473
+            width: 100%;
474
+            display: block;
475
+            border-radius: 6px;
476
+          }
331 477
         }
332
-        .info {
333
-          display: flex;
334
-          justify-content: space-between;
478
+        .user-span {
479
+          flex: 1;
480
+          margin-left: 12px;
335 481
 
336
-          .name {
337
-            font-size: 16px;
482
+          span {
483
+            color: #333333;
338 484
           }
339
-          .sex {
340
-            img {
341
-              width: 24px;
342
-              height: 24px;
485
+          .info {
486
+            display: flex;
487
+            justify-content: space-between;
488
+
489
+            .name {
490
+              font-size: 14px;
343 491
             }
344
-          }
345
-          .age {
346
-            margin-left: 13px;
347
-            span:nth-child(1) {
348
-              font-size: 22px;
492
+            .sex {
493
+              img {
494
+                width: 24px;
495
+                height: 24px;
496
+              }
349 497
             }
350
-            span:nth-child(2) {
498
+            .age {
351 499
               margin-left: 4px;
352
-              color: #999999;
500
+              span:nth-child(1) {
501
+                font-size: 14px;
502
+              }
503
+              span:nth-child(2) {
504
+                margin-left: 4px;
505
+                color: #999999;
506
+              }
353 507
             }
354 508
           }
355
-        }
356
-        div:nth-child(2),
357
-        div:nth-child(3) {
358
-          margin-bottom: 8px;
509
+          .real-name {
510
+            display: flex;
511
+            justify-content: space-between;
512
+            align-items: center;
513
+            .real-name-inp {
514
+              width: 35px !important;
515
+              height: 25px !important;
516
+            }
517
+            .edit-name {
518
+              width: 20px;
519
+              height: 20px;
520
+            }
521
+          }
522
+          div:nth-child(2),
523
+          div:nth-child(3) {
524
+            margin-bottom: 8px;
525
+          }
359 526
         }
360 527
       }
361 528
     }
362 529
     .personage-data {
363
-      margin-top: 30px;
530
+      margin-top: 14px;
364 531
       .myDataList {
365 532
         margin-top: 15px;
366 533
         .bigSixe {
@@ -374,6 +541,13 @@ export default {
374 541
           color: #fa7d22;
375 542
         }
376 543
       }
544
+      .coupon-num {
545
+        span {
546
+          color: #fa7d22;
547
+          font-size: 16px;
548
+          font-weight: 500;
549
+        }
550
+      }
377 551
     }
378 552
   }
379 553
 
@@ -392,17 +566,20 @@ export default {
392 566
         flex-direction: column;
393 567
         .dataList {
394 568
           height: 56px;
395
-          // width: 239ppx;
569
+          width: 193px;
396 570
           background: #ffffff;
397 571
           box-shadow: 0px 2px 4px 0px rgba(184, 191, 198, 0.2);
398 572
           border-radius: 8px;
399
-          padding: 16px 12px 12px 12px;
573
+          padding: 12px 20px 12px 14px;
400 574
           display: flex;
401 575
           justify-content: space-between;
402 576
           align-items: center;
403
-          .data-list-left {
577
+          div:nth-child(1) {
404 578
             display: flex;
405 579
             align-items: center;
580
+            img {
581
+              margin-right: 14px;
582
+            }
406 583
           }
407 584
           img {
408 585
             width: 33px;
@@ -414,7 +591,7 @@ export default {
414 591
           }
415 592
           span {
416 593
             font-size: 16px;
417
-            margin-right: 20px;
594
+            // margin-right: 20px;
418 595
           }
419 596
         }
420 597
       }
@@ -423,7 +600,7 @@ export default {
423 600
         box-shadow: 0px 2px 4px 0px rgba(184, 191, 198, 0.2);
424 601
         border-radius: 8px;
425 602
         padding: 16px 12px 12px 12px;
426
-        width: calc(100% - 239px);
603
+        width: 358px;
427 604
         height: 100%;
428 605
         .lable {
429 606
           //   margin-top: 23px;
@@ -783,5 +960,62 @@ export default {
783 960
       }
784 961
     }
785 962
   }
963
+  .block {
964
+    width: 540px;
965
+    background: #ffffff;
966
+    border-radius: 8px;
967
+    position: relative;
968
+    padding: 42px;
969
+    .delete-pupop {
970
+      position: absolute;
971
+      width: 32px;
972
+      height: 32px;
973
+      top: 5px;
974
+      right: 5px;
975
+      img {
976
+        width: 100%;
977
+        height: 100%;
978
+        display: block;
979
+      }
980
+    }
981
+    .pupop-title {
982
+      font-size: 14px;
983
+      font-family: PingFangSC-Medium, PingFang SC;
984
+      font-weight: 500;
985
+      color: #333333;
986
+      line-height: 20px;
987
+      text-align: center;
988
+    }
989
+
990
+    .noticeInput {
991
+      margin-top: 50px;
992
+      margin-left: 80px;
993
+      padding: 10px;
994
+      width: 307px;
995
+      height: 184px;
996
+      border: 1px solid #f5f5f5;
997
+    }
998
+
999
+    .noticeSubmit {
1000
+      margin-top: 20px;
1001
+      width: 100%;
1002
+      display: flex;
1003
+      align-items: center;
1004
+      justify-content: center;
1005
+    }
1006
+
1007
+    .submit-notice {
1008
+      width: 100px;
1009
+      height: 29px;
1010
+      border-radius: 14px;
1011
+      font-size: 14px;
1012
+      font-weight: 500;
1013
+      background: #fa7d22;
1014
+      color: white;
1015
+      line-height: 29px;
1016
+      text-align: center;
1017
+      margin-left: 22px;
1018
+    }
1019
+  }
786 1020
 }
787 1021
 </style>

+ 62 - 64
src/pages/customerMan/index.vue

@@ -1,52 +1,51 @@
1 1
 <template>
2 2
   <div class="mine">
3 3
     <div class="condition">
4
-      <el-input placeholder="请输入内容"
5
-                class="search"
6
-                v-model="searchText">
7
-        <i slot="prefix"
8
-           class="el-input__icon el-icon-search"></i>
4
+      <el-input placeholder="请输入内容" class="search" v-model="searchText">
5
+        <i slot="prefix" class="el-input__icon el-icon-search"></i>
9 6
       </el-input>
10
-      <el-button type="primary"
11
-                 class="searchButton"
12
-                 @click="getUserList()">搜索</el-button>
7
+      <el-button type="primary" class="searchButton" @click="getUserList()"
8
+        >搜索</el-button
9
+      >
13 10
     </div>
14 11
 
15 12
     <div class="user-list">
16
-      <el-table ref="multipleTable"
17
-                :data="tableData"
18
-                tooltip-effect="dark"
19
-                height="500"
20
-                style="width: 100%;border-radius: 8px;"
21
-                @row-click="handleSelectionChange">
22
-        <el-table-column label="头像"
23
-                         width="120">
13
+      <el-table
14
+        ref="multipleTable"
15
+        :data="tableData"
16
+        tooltip-effect="dark"
17
+        height="500"
18
+        style="width: 100%; border-radius: 8px"
19
+        @row-click="handleSelectionChange"
20
+      >
21
+        <el-table-column label="头像" width="120">
24 22
           <template slot-scope="scope">
25
-            <div class="head-img"><img :src="scope.row.avatar_url"
26
-                   alt=""></div>
23
+            <div class="head-img">
24
+              <img :src="scope.row.avatar_url" alt="" />
25
+            </div>
27 26
           </template>
28 27
         </el-table-column>
29
-        <el-table-column prop="nickname"
30
-                         label="昵称"
31
-                         width="120">
28
+        <el-table-column prop="nickname" label="昵称" width="120">
32 29
         </el-table-column>
33
-        <el-table-column prop="mobile"
34
-                         label="联系电话"
35
-                         show-overflow-tooltip>
30
+        <el-table-column prop="mobile" label="联系电话" show-overflow-tooltip>
36 31
         </el-table-column>
37
-        <el-table-column prop="create_time"
38
-                         label="注册时间"
39
-                         show-overflow-tooltip>
32
+        <el-table-column
33
+          prop="create_time"
34
+          label="注册时间"
35
+          show-overflow-tooltip
36
+        >
40 37
         </el-table-column>
41 38
       </el-table>
42 39
 
43 40
       <div class="pagin">
44
-        <el-pagination background
45
-                       layout="prev, pager, next"
46
-                       @size-change="handleSizeChange"
47
-                       @current-change="handleCurrentChange"
48
-                       :current-page.sync="currentPage1"
49
-                       :total="total">
41
+        <el-pagination
42
+          background
43
+          layout="prev, pager, next"
44
+          @size-change="handleSizeChange"
45
+          @current-change="handleCurrentChange"
46
+          :current-page.sync="currentPage1"
47
+          :total="total"
48
+        >
50 49
         </el-pagination>
51 50
       </div>
52 51
     </div>
@@ -57,74 +56,73 @@
57 56
 import api from "../../server/home";
58 57
 export default {
59 58
   components: {},
60
-  data () {
59
+  data() {
61 60
     return {
62
-      searchText: '',
63
-      dates: '',
64
-      coupon: '',
61
+      searchText: "",
62
+      dates: "",
63
+      coupon: "",
65 64
       couponList: [
66 65
         {
67
-          value: '选项1',
68
-          label: '黄金糕'
69
-        }, {
70
-          value: '选项2',
71
-          label: '双皮奶'
72
-        }
66
+          value: "选项1",
67
+          label: "黄金糕",
68
+        },
69
+        {
70
+          value: "选项2",
71
+          label: "双皮奶",
72
+        },
73 73
       ],
74 74
       tableData: [],
75 75
       currentPage1: 1,
76
-      multipleSelection: '',
77
-      total: 0
78
-
76
+      multipleSelection: "",
77
+      total: 0,
79 78
     };
80 79
   },
81 80
   computed: {},
82 81
   watch: {},
83 82
 
84 83
   methods: {
85
-
86 84
     // 获取订单列表
87
-    getUserList () {
85
+    getUserList() {
88 86
       let params = {
89 87
         page: this.currentPage1,
90 88
         limit: this.limit,
91 89
         keywords: this.searchText,
92 90
       };
93
-      api.getUserList(params).then(res => {
91
+      api.getUserList(params).then((res) => {
94 92
         if (res.code == 200) {
93
+          // 将用户手机号中间四位变成****
94
+          res.data.list.map((item) => {
95
+            item.mobile =
96
+              item.mobile.substring(0, 3) + "****" + item.mobile.substring(7);
97
+          });
95 98
           this.tableData = res.data.list;
96 99
           this.total = res.data.total;
97 100
         }
98 101
       });
99 102
     },
100 103
 
101
-    handleCurrentChange (e) {
104
+    handleCurrentChange(e) {
102 105
       this.currentPage1 = e;
103 106
       this.getUserList();
104 107
     },
105 108
 
106
-    handleSizeChange (val) {
107
-    },
108
-    handleSelectionChange (row, column, event) {
109
+    handleSizeChange(val) {},
110
+    handleSelectionChange(row, column, event) {
109 111
       this.$router.push({
110
-        path: '/customerMan/details',
112
+        path: "/customerMan/details",
111 113
         query: {
112
-          id: row.id
113
-        }
114
+          id: row.id,
115
+        },
114 116
       });
115
-    }
117
+    },
116 118
   },
117 119
 
118
-  created () {
120
+  created() {
119 121
     this.getUserList();
120 122
   },
121 123
 
122
-
123
-  mounted () {
124
-
125
-  },
126
-}
127
-
124
+  mounted() {},
125
+};
128 126
 </script>
129 127
 
130 128
 <style lang='less' scoped>

+ 531 - 173
src/pages/customerMan/myOrder/index.vue

@@ -1,192 +1,345 @@
1 1
 <template>
2 2
   <div class="order">
3 3
     <div class="warp">
4
-      <el-tabs type="border-card"
5
-               @tab-click="changeTab"
6
-               v-model="activeName">
7
-        <el-tab-pane label="项目订单"
8
-                     name="first">
4
+      <el-tabs type="border-card" @tab-click="changeTab" v-model="activeName">
5
+        <el-tab-pane label="项目订单" name="first">
9 6
           <div class="user-list">
10
-            <el-table ref="multipleTable"
11
-                      :data="projectData"
12
-                      tooltip-effect="dark"
13
-                      height="354"
14
-                      style="width: 100%;border-radius: 8px;"
15
-                      @row-click="handleSelectionChange">
16
-              <el-table-column prop="goods"
17
-                               label="项目名称"
18
-                               width="200">
7
+            <el-table
8
+              ref="multipleTable"
9
+              :data="projectData"
10
+              tooltip-effect="dark"
11
+              height="354"
12
+              style="width: 100%; border-radius: 8px"
13
+              @row-click="handleSelectionChange"
14
+            >
15
+              <el-table-column prop="goods" label="项目名称" width="200">
19 16
                 <template slot-scope="scope">
20
-                  <div v-for="(val,index) in scope.row.goods"
21
-                       :key="index">
22
-                    <div>{{val.name}}</div>
17
+                  <div v-for="(val, index) in scope.row.goods" :key="index">
18
+                    <div>{{ val.name }}</div>
23 19
                   </div>
24 20
                 </template>
25 21
               </el-table-column>
26
-              <el-table-column prop="goods"
27
-                               label="数量"
28
-                               show-overflow-tooltip>
22
+              <el-table-column prop="goods" label="数量" show-overflow-tooltip>
29 23
                 <template slot-scope="scope">
30
-                  <div>{{scope.row.goods.length}}</div>
24
+                  <div>{{ scope.row.goods.length }}</div>
31 25
                 </template>
32 26
               </el-table-column>
33
-              <el-table-column prop="price"
34
-                               label="总价格"
35
-                               show-overflow-tooltip></el-table-column>
36
-              <el-table-column prop="order_time"
37
-                               label="预约时间"
38
-                               width="180"
39
-                               show-overflow-tooltip></el-table-column>
40
-              <el-table-column prop="store_name"
41
-                               label="预约店铺"
42
-                               show-overflow-tooltip></el-table-column>
43
-              <el-table-column prop="status"
44
-                               label="状态"
45
-                               show-overflow-tooltip>
27
+              <el-table-column
28
+                prop="price"
29
+                label="总价格"
30
+                show-overflow-tooltip
31
+              ></el-table-column>
32
+              <el-table-column
33
+                prop="order_time"
34
+                label="预约时间"
35
+                width="180"
36
+                show-overflow-tooltip
37
+              ></el-table-column>
38
+              <el-table-column
39
+                prop="store_name"
40
+                label="预约店铺"
41
+                show-overflow-tooltip
42
+              ></el-table-column>
43
+              <el-table-column prop="status" label="状态" show-overflow-tooltip>
46 44
                 <template slot-scope="scope">
47
-                  <div :class="'color'+scope.row.status">{{scope.row.status!=5?statusStr[scope.row.status]:statusStr[statusStr.length-1]}}</div>
45
+                  <div :class="'color' + scope.row.status">
46
+                    {{
47
+                      scope.row.status != 5
48
+                        ? statusStr[scope.row.status]
49
+                        : statusStr[statusStr.length - 1]
50
+                    }}
51
+                  </div>
48 52
                 </template>
49 53
               </el-table-column>
50 54
             </el-table>
51 55
 
52 56
             <div class="pagin">
53
-              <el-pagination background
54
-                             layout="prev, pager, next"
55
-                             @current-change="handleCurrentChange"
56
-                             :current-page.sync="currentPage1"
57
-                             :total="total"></el-pagination>
57
+              <el-pagination
58
+                background
59
+                layout="prev, pager, next"
60
+                @current-change="handleCurrentChange"
61
+                :current-page.sync="currentPage1"
62
+                :total="total"
63
+              ></el-pagination>
58 64
             </div>
59 65
           </div>
60 66
         </el-tab-pane>
61
-        <el-tab-pane label="卡卷订单"
62
-                     name="second">
67
+        <el-tab-pane label="次卡订单" name="second">
63 68
           <div class="user-list">
64
-            <el-table ref="multipleTable"
65
-                      :data="couponData"
66
-                      tooltip-effect="dark"
67
-                      height="354"
68
-                      style="width: 100%;border-radius: 8px;">
69
-
70
-              <!-- create_time: "2022-03-10 10:39:19"
71
-ex_time: "2022.03.17 23:59"
72
-id: 2517
73
-name: "新人体验券"
74
-status: 2
75
-type: "全额券" -->
76
-
77
-              <el-table-column prop="name"
78
-                               label="卡卷名称"
79
-                               width="200"></el-table-column>
80
-              <el-table-column prop="type"
81
-                               label="卡卷类型"
82
-                               show-overflow-tooltip></el-table-column>
83
-              <el-table-column prop="price"
84
-                               label="总价格"
85
-                               show-overflow-tooltip></el-table-column>
86
-              <el-table-column prop="create_time"
87
-                               label="到期时间"
88
-                               width="180"
89
-                               show-overflow-tooltip></el-table-column>
90
-              <el-table-column prop="create_time"
91
-                               label="创建时间"
92
-                               width="180"
93
-                               show-overflow-tooltip></el-table-column>
94
-              <el-table-column prop="status"
95
-                               label="状态"
96
-                               show-overflow-tooltip>
69
+            <el-table
70
+              ref="multipleTable"
71
+              :data="cardListData"
72
+              tooltip-effect="dark"
73
+              height="354"
74
+              @row-click="openDetail"
75
+              style="width: 100%; border-radius: 8px"
76
+            >
77
+              <el-table-column prop="card_name" label="卡券名称" width="200">
78
+                <template slot-scope="scope">
79
+                  <div>{{ scope.row.card_name | ellipsis(8) }}</div>
80
+                </template>
81
+              </el-table-column>
82
+              <el-table-column prop="total_num" label="总次数" show-overflow-tooltip align="center">
83
+              </el-table-column>
84
+              <el-table-column
85
+                prop="num"
86
+                label="剩余次数"
87
+                show-overflow-tooltip
88
+                align="center"
89
+              ></el-table-column>
90
+              <el-table-column
91
+                prop="used_num"
92
+                label="已用次数"
93
+                width="180"
94
+                show-overflow-tooltip
95
+                align="center"
96
+              ></el-table-column>
97
+              <el-table-column
98
+                prop="expir_time"
99
+                label="过期时间"
100
+                width="180"
101
+                show-overflow-tooltip
102
+              ></el-table-column>
103
+              <el-table-column
104
+                prop="create_time"
105
+                label="创建时间"
106
+                width="180"
107
+                show-overflow-tooltip
108
+              ></el-table-column>
109
+              <el-table-column prop="status" label="状态" show-overflow-tooltip>
97 110
                 <template slot-scope="scope">
98
-                  <div :class="'color'+scope.row.status">{{couponStatus[scope.row.status]}}</div>
111
+                  <div :class="'color' + scope.row.status">
112
+                    {{
113
+                      scope.row.status == -1
114
+                        ? "已过期"
115
+                        : scope.row.status == -0
116
+                        ? "已使用"
117
+                        : "待使用"
118
+                    }}
119
+                  </div>
99 120
                 </template>
100 121
               </el-table-column>
101 122
             </el-table>
102 123
 
103 124
             <div class="pagin">
104
-              <el-pagination background
105
-                             layout="prev, pager, next"
106
-                             @current-change="handleCurrentChange"
107
-                             :current-page.sync="currentPage1"
108
-                             :total="total"></el-pagination>
125
+              <el-pagination
126
+                background
127
+                layout="prev, pager, next"
128
+                @current-change="handleCurrentChange"
129
+                :current-page.sync="currentPage1"
130
+                :total="total"
131
+              ></el-pagination>
109 132
             </div>
110 133
           </div>
111 134
         </el-tab-pane>
112 135
 
113
-        <el-tab-pane label="商品订单"
114
-                     name="third">
136
+        <el-tab-pane label="商品订单" name="third">
115 137
           <div class="user-list">
116
-            <el-table ref="multipleTable"
117
-                      :data="goodData"
118
-                      tooltip-effect="dark"
119
-                      height="354"
120
-                      style="width: 100%;border-radius: 8px;">
121
-
138
+            <el-table
139
+              ref="multipleTable"
140
+              :data="goodData"
141
+              tooltip-effect="dark"
142
+              height="354"
143
+              style="width: 100%; border-radius: 8px"
144
+            >
122 145
               <!-- create_time: "2022-03-19 22:53:40"
123 146
 goods: [{order_id: 47, name: "润百颜玻尿酸屏障调理面膜", num: 1}]
124 147
 id: 47
125 148
 price: "0.01"
126 149
 status: 5 -->
127 150
 
128
-              <el-table-column prop="goods"
129
-                               label="商品名称"
130
-                               width="200">
151
+              <el-table-column prop="goods" label="商品名称" width="200">
131 152
                 <template slot-scope="scope">
132
-                  <div v-for="(val,index) in scope.row.goods"
133
-                       :key="index">
134
-                    <div>{{val.name}}</div>
153
+                  <div v-for="(val, index) in scope.row.goods" :key="index">
154
+                    <div>{{ val.name }}</div>
135 155
                   </div>
136 156
                 </template>
137 157
               </el-table-column>
138
-              <el-table-column prop="goods"
139
-                               label="数量"
140
-                               show-overflow-tooltip>
158
+              <el-table-column prop="goods" label="数量" show-overflow-tooltip>
141 159
                 <template slot-scope="scope">
142
-                  <div>{{scope.row.goods.length}}</div>
160
+                  <div>{{ scope.row.goods.length }}</div>
143 161
                 </template>
144 162
               </el-table-column>
145
-              <el-table-column prop="price"
146
-                               label="实付款"
147
-                               show-overflow-tooltip></el-table-column>
148
-              <el-table-column prop="create_time"
149
-                               label="下单时间"
150
-                               width="180"
151
-                               show-overflow-tooltip></el-table-column>
152
-              <el-table-column prop="status"
153
-                               label="状态"
154
-                               show-overflow-tooltip>
163
+              <el-table-column
164
+                prop="price"
165
+                label="实付款"
166
+                show-overflow-tooltip
167
+              ></el-table-column>
168
+              <el-table-column
169
+                prop="create_time"
170
+                label="下单时间"
171
+                width="180"
172
+                show-overflow-tooltip
173
+              ></el-table-column>
174
+              <el-table-column prop="status" label="状态" show-overflow-tooltip>
155 175
                 <template slot-scope="scope">
156
-                  <div :class="'classShow'+scope.$index">{{scope.row.status==1||scope.row.status==2?goodStatus[scope.row.status]:goodStatus[goodStatus.length-1]}}</div>
176
+                  <div :class="'classShow' + scope.$index">
177
+                    {{
178
+                      scope.row.status == 1 || scope.row.status == 2
179
+                        ? goodStatus[scope.row.status]
180
+                        : goodStatus[goodStatus.length - 1]
181
+                    }}
182
+                  </div>
157 183
                 </template>
158 184
               </el-table-column>
159 185
             </el-table>
160 186
 
161 187
             <div class="pagin">
162
-              <el-pagination background
163
-                             layout="prev, pager, next"
164
-                             @current-change="handleCurrentChange"
165
-                             :current-page.sync="currentPage1"
166
-                             :total="total"></el-pagination>
188
+              <el-pagination
189
+                background
190
+                layout="prev, pager, next"
191
+                @current-change="handleCurrentChange"
192
+                :current-page.sync="currentPage1"
193
+                :total="total"
194
+              ></el-pagination>
195
+            </div>
196
+          </div>
197
+        </el-tab-pane>
198
+        <el-tab-pane label="优惠券" name="fourth">
199
+          <div class="user-list">
200
+            <el-table
201
+              ref="multipleTable"
202
+              :data="couponData"
203
+              tooltip-effect="dark"
204
+              height="354"
205
+              style="width: 100%; border-radius: 8px"
206
+            >
207
+              <!-- create_time: "2022-03-10 10:39:19"
208
+ex_time: "2022.03.17 23:59"
209
+id: 2517
210
+name: "新人体验券"
211
+status: 2
212
+type: "全额券" -->
213
+
214
+              <el-table-column
215
+                prop="name"
216
+                label="卡卷名称"
217
+                width="200"
218
+              ></el-table-column>
219
+              <el-table-column
220
+                prop="type"
221
+                label="卡卷类型"
222
+                show-overflow-tooltip
223
+              ></el-table-column>
224
+              <el-table-column
225
+                prop="price"
226
+                label="总价格"
227
+                show-overflow-tooltip
228
+              ></el-table-column>
229
+              <el-table-column
230
+                prop="create_time"
231
+                label="到期时间"
232
+                width="180"
233
+                show-overflow-tooltip
234
+              ></el-table-column>
235
+              <el-table-column
236
+                prop="create_time"
237
+                label="创建时间"
238
+                width="180"
239
+                show-overflow-tooltip
240
+              ></el-table-column>
241
+              <el-table-column prop="status" label="状态" show-overflow-tooltip>
242
+                <template slot-scope="scope">
243
+                  <div :class="'color' + scope.row.status">
244
+                    {{ couponStatus[scope.row.status] }}
245
+                  </div>
246
+                </template>
247
+              </el-table-column>
248
+            </el-table>
249
+
250
+            <div class="pagin">
251
+              <el-pagination
252
+                background
253
+                layout="prev, pager, next"
254
+                @current-change="handleCurrentChange"
255
+                :current-page.sync="currentPage1"
256
+                :total="total"
257
+              ></el-pagination>
167 258
             </div>
168 259
           </div>
169 260
         </el-tab-pane>
170 261
       </el-tabs>
171 262
     </div>
263
+    <!-- 次卡详情 -->
264
+    <mine-pupop :show="isPore">
265
+      <div class="pore-block">
266
+        <div class="delete-pupop" @click="isPore = false">
267
+          <img
268
+            src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
269
+            alt
270
+          />
271
+        </div>
272
+        <div class="pore-content">
273
+          <div class="card-title">订单详情</div>
274
+          <div class="project">
275
+            <div class="project-title">项目名称:</div>
276
+            <div class="project-list">
277
+              <div
278
+                class="project-info"
279
+                v-for="(item, index) in cardInfo.project_list"
280
+                :key="index"
281
+              >
282
+                <div class="name-text">{{ item.project_name }}</div>
283
+                <div class="change-num">
284
+                  <div class="num-content">
285
+                    <div class="content-left" @click="reduce(index)">-</div>
286
+                    <div class="content-num">{{ item.num || 0 }}</div>
287
+                    <div class="content-right" @click="item.num++">+</div>
288
+                  </div>
289
+                </div>
290
+              </div>
291
+            </div>
292
+          </div>
293
+          <div class="common">
294
+            <span class="common-title">支付方式:</span
295
+            ><span>{{ cardInfo.pay_way }}</span>
296
+          </div>
297
+          <div class="common">
298
+            <span class="common-title">有效期限:</span
299
+            ><span>{{ cardInfo.ex_time }}</span>
300
+          </div>
301
+          <div class="common">
302
+            <span class="common-title">实付金额:</span
303
+            ><span>¥{{ cardInfo.price }}</span>
304
+          </div>
305
+          <div class="consume-list">
306
+            <div class="consume-title">消耗信息:</div>
307
+            <div
308
+              class="consume-info min-size"
309
+              v-for="(item, index) in cardLogList"
310
+              :key="index"
311
+            >
312
+              <div class="shop">{{ item.store_name }}</div>
313
+              <div class="project-tips">{{ item.remark }}</div>
314
+              <div class="project-ts">{{ item.create_time }}</div>
315
+            </div>
316
+          </div>
317
+        </div>
318
+        <div class="confirm" @click="confirm">确定</div>
319
+      </div>
320
+    </mine-pupop>
172 321
   </div>
173 322
 </template>
174 323
 
175 324
 <script>
176 325
 import api from "../../../server/home";
326
+import minePupop from "../../../components/minePupop/index.vue";
177 327
 
178 328
 export default {
179
-  data () {
329
+  components: {
330
+    minePupop,
331
+  },
332
+  data() {
180 333
     return {
181 334
       couponList: [
182 335
         {
183 336
           value: "选项1",
184
-          label: "黄金糕"
337
+          label: "黄金糕",
185 338
         },
186 339
         {
187 340
           value: "选项2",
188
-          label: "双皮奶"
189
-        }
341
+          label: "双皮奶",
342
+        },
190 343
       ],
191 344
       tableData: [
192 345
         {
@@ -198,7 +351,7 @@ export default {
198 351
           numberList: 2,
199 352
           price: 100,
200 353
           shop: "运用店",
201
-          status: 2
354
+          status: 2,
202 355
         },
203 356
         {
204 357
           date: "2022.04.25  14:30",
@@ -209,33 +362,24 @@ export default {
209 362
           numberList: 5,
210 363
           price: 800,
211 364
           shop: "武昌店",
212
-          status: 1
213
-        }
214
-      ],
215
-      statusStr: [
216
-        "未支付",
217
-        "待使用",
218
-        "正在使用",
219
-        "已结算",
220
-        "已取消"
221
-      ],
222
-      couponStatus: [
223
-        '待使用',
224
-        '已使用',
225
-        '已过期'
226
-      ],
227
-      goodStatus: [
228
-        '未支付',
229
-        '已支付',
230
-        '已取货'
365
+          status: 1,
366
+        },
231 367
       ],
232
-      activeName: 'first',
368
+      statusStr: ["未支付", "待使用", "正在使用", "已结算", "已取消"],
369
+      couponStatus: ["待使用", "已使用", "已过期"],
370
+      goodStatus: ["未支付", "已支付", "已取货"],
371
+      activeName: "first",
233 372
       currentPage1: 1,
234 373
       couponData: [],
235 374
       goodData: [],
236 375
       projectData: [],
376
+      cardOrderData: [],
237 377
       total: 100,
238
-      limit: 10
378
+      limit: 10,
379
+      isPore: false,
380
+      cardInfo: {}, //订单详情
381
+      cardLogList: [], //次卡消耗记录
382
+      cardListData: [], //用户次卡列表
239 383
     };
240 384
   },
241 385
   computed: {},
@@ -243,90 +387,169 @@ export default {
243 387
 
244 388
   methods: {
245 389
     // 获取优惠券订单
246
-    getUserCoupon () {
390
+    getUserCoupon() {
247 391
       let params = {
248 392
         page: this.currentPage1,
249 393
         limit: this.limit,
250
-        id: this.id
394
+        id: this.id,
251 395
       };
252
-      api.getUserCoupon(params).then(res => {
396
+      api.getUserCoupon(params).then((res) => {
253 397
         this.couponData = res.data.list;
254 398
         this.total = res.data.total;
255 399
       });
256 400
     },
401
+    reduce(index) {
402
+      this.cardInfo.project_list[index].num--;
403
+      if (this.cardInfo.project_list[index].num < 0) {
404
+        this.cardInfo.project_list[index].num = 0;
405
+      }
406
+    },
407
+    //次卡订单详情
408
+    openDetail(row, column, event) {
409
+      this.isPore = true;
410
+      api.cardInfo({ id: row.id }).then((res) => {
411
+        if (res.code == 200) {
412
+          this.cardInfo = res.data;
413
+        }
414
+      });
415
+      api.cardLog({ id: row.id }).then((res) => {
416
+        if (res.code == 200) {
417
+          this.cardLogList = res.data.list;
418
+        }
419
+      });
420
+    },
421
+    confirm() {
422
+      // 项目ID,json字符,格式如:[{"project_id":"10","num":5}],project_id:适用项目ID,num:剩余次数
423
+      let project_data = [],
424
+        project_info = {};
425
+      this.cardInfo.project_list.forEach((res) => {
426
+        project_info = {
427
+          project_id: res.id,
428
+          num: res.num,
429
+        };
430
+        project_data.push(project_info);
431
+      });
432
+      api
433
+        .cardUpdate({
434
+          id: this.cardInfo.id,
435
+          project_data: JSON.stringify(project_data),
436
+        })
437
+        .then((res) => {
438
+          if (res.code == 200) {
439
+            this.$message.success("更改成功!");
440
+            this.isPore = false;
441
+          }
442
+        });
443
+    },
257 444
 
258 445
     // 获取商品订单
259
-    getUserGoods () {
446
+    getUserGoods() {
260 447
       let params = {
261 448
         page: this.currentPage1,
262 449
         limit: this.limit,
263
-        id: this.id
450
+        id: this.id,
264 451
       };
265
-      api.getUserGoods(params).then(res => {
452
+      api.getUserGoods(params).then((res) => {
266 453
         this.goodData = res.data.list;
267 454
         this.total = res.data.total;
268 455
       });
269 456
     },
270 457
 
271 458
     // 获取获取项目订单
272
-    getUserProject () {
459
+    getUserProject() {
273 460
       let params = {
274 461
         page: this.currentPage1,
275 462
         limit: this.limit,
276
-        id: this.id
463
+        id: this.id,
277 464
       };
278
-      api.getUserProject(params).then(res => {
465
+      api.getUserProject(params).then((res) => {
279 466
         this.projectData = res.data.list;
280 467
         this.total = res.data.total;
281 468
       });
282 469
     },
283
-    handleCurrentChange (val) {
284
-      this.currentPage1 = val
285
-      if (this.activeName == 'first') {
470
+
471
+    // 获取卡券订单
472
+    // async getCardOrders() {
473
+    //   let params = {
474
+    //     page: this.currentPage1,
475
+    //     limit: this.limit,
476
+    //     id: this.id,
477
+    //   };
478
+    //   let resp = await api.getCardOrders(params);
479
+    //   if (resp.code === 200) {
480
+    //     console.log(resp, "adadasdasdadsadsadasd");
481
+    //     this.cardOrderData = resp.data.list;
482
+    //     this.total = resp.data.total;
483
+    //   }
484
+    // },
485
+    //获取用户次卡列表
486
+    async getCardList() {
487
+      let params = {
488
+        page: this.currentPage1,
489
+        limit: this.limit,
490
+        id: this.id,
491
+      };
492
+      let resp = await api.getCardList(params);
493
+      if (resp.code === 200) {
494
+        console.log(resp, "asdasdasd");
495
+        this.cardListData = resp.data.list;
496
+        this.total = resp.data.total;
497
+      }
498
+    },
499
+    handleCurrentChange(val) {
500
+      this.currentPage1 = val;
501
+      if (this.activeName == "first") {
286 502
         this.getUserProject();
287
-      } else if (this.activeName == 'second') {
288
-        this.getUserCoupon();
289
-      } else if (this.activeName == 'third') {
503
+      } else if (this.activeName == "second") {
504
+        // this.getCardOrders();
505
+        this.getCardList();
506
+      } else if (this.activeName == "third") {
290 507
         this.getUserGoods();
508
+      } else if (this.activeName == "fourth") {
509
+        this.getUserCoupon();
291 510
       }
292 511
     },
293
-    handleSelectionChange (row, column, event) {
512
+    handleSelectionChange(row, column, event) {
294 513
       this.$router.push({
295 514
         path: "/historicalOrder/details",
296 515
         query: {
297
-          id: row.id
298
-        }
516
+          id: row.id,
517
+        },
299 518
       });
300 519
     },
301
-    onSubmit () { },
302
-    submitFrequency () { },
303
-    changeTab (e) {
304
-      this.currentPage1 = 1
520
+    onSubmit() {},
521
+    submitFrequency() {},
522
+    changeTab(e) {
523
+      this.currentPage1 = 1;
305 524
       if (e.index == 0) {
306 525
         this.getUserProject();
307 526
       } else if (e.index == 1) {
308
-        this.getUserCoupon();
527
+        // this.getCardOrders();
528
+        this.getCardList();
309 529
       } else if (e.index == 2) {
310 530
         this.getUserGoods();
531
+      } else if (e.index == 3) {
532
+        this.getUserCoupon();
311 533
       }
312
-    }
534
+    },
313 535
   },
314 536
 
315
-  created () {
537
+  created() {
316 538
     let id = this.$route.query.id;
317
-    let activeName = this.$route.query.activeName
318
-    this.activeName = activeName
539
+    let activeName = this.$route.query.activeName;
540
+    this.activeName = activeName;
319 541
     this.id = id;
320
-    if (this.activeName == 'first') {
542
+    if (this.activeName == "first") {
321 543
       this.getUserProject();
322
-    } else if (this.activeName == 'second') {
323
-      this.getUserCoupon();
324
-    } else if (this.activeName == 'third') {
544
+    } else if (this.activeName == "second") {
545
+      // this.getCardOrders();
546
+      this.getCardList();
547
+    } else if (this.activeName == "third") {
325 548
       this.getUserGoods();
326 549
     }
327 550
   },
328 551
 
329
-  mounted () { }
552
+  mounted() {},
330 553
 };
331 554
 </script>
332 555
 
@@ -369,4 +592,139 @@ export default {
369 592
 .priceColor {
370 593
   color: #ff3007;
371 594
 }
595
+.pore-block {
596
+  width: 540px;
597
+  height: 400px;
598
+  background: #ffffff;
599
+  border-radius: 8px;
600
+  position: relative;
601
+  padding: 26px 72px 80px 30px;
602
+  .delete-pupop {
603
+    width: 32px;
604
+    position: absolute;
605
+    right: 5px;
606
+    top: 5px;
607
+    img {
608
+      width: 100%;
609
+    }
610
+  }
611
+  .pore-content {
612
+    overflow: scroll;
613
+    height: 310px;
614
+    .card-title {
615
+      font-size: 14px;
616
+      font-family: PingFangSC-Medium, PingFang SC;
617
+      font-weight: 500;
618
+      color: #333333;
619
+      line-height: 20px;
620
+      text-align: center;
621
+    }
622
+    .project {
623
+      display: flex;
624
+      font-size: 13px;
625
+      font-family: PingFangSC-Regular, PingFang SC;
626
+      font-weight: 400;
627
+      color: #333333;
628
+      line-height: 18px;
629
+      .project-title {
630
+        color: #999999;
631
+      }
632
+      .project-list {
633
+        flex: 1;
634
+        .project-info {
635
+          flex: 1;
636
+          .change-num {
637
+            margin-top: 6px;
638
+            width: 100%;
639
+            display: flex;
640
+            justify-content: end;
641
+            .num-content {
642
+              width: 104px;
643
+              height: 28px;
644
+              background: #ffffff;
645
+              border-radius: 2px;
646
+              border: 1px solid #fa7d22;
647
+              display: flex;
648
+              align-items: center;
649
+
650
+              .content-left,
651
+              .content-right {
652
+                width: 28px;
653
+                height: 100%;
654
+                background: #fa7d22;
655
+                font-size: 20px;
656
+                line-height: 24px;
657
+                color: #ffffff;
658
+                text-align: center;
659
+              }
660
+              .content-num {
661
+                flex: 1;
662
+                font-size: 12px;
663
+                font-family: PingFangSC-Regular, PingFang SC;
664
+                font-weight: 400;
665
+                color: rgba(0, 0, 0, 0.65);
666
+                text-align: center;
667
+              }
668
+            }
669
+          }
670
+        }
671
+      }
672
+    }
673
+    .common {
674
+      margin-top: 6px;
675
+      font-size: 13px;
676
+      font-family: PingFangSC-Regular, PingFang SC;
677
+      font-weight: 400;
678
+      color: #333333;
679
+      line-height: 18px;
680
+      .common-title {
681
+        color: #999999;
682
+      }
683
+    }
684
+    .consume-list {
685
+      margin-top: 6px;
686
+      .consume-title {
687
+        font-size: 13px;
688
+        font-family: PingFangSC-Regular, PingFang SC;
689
+        font-weight: 400;
690
+        color: #999999;
691
+        line-height: 18px;
692
+      }
693
+      .consume-info {
694
+        margin-top: 6px;
695
+        font-size: 10px;
696
+        font-family: PingFangSC-Regular, PingFang SC;
697
+        font-weight: 400;
698
+        color: #333333;
699
+        line-height: 14px;
700
+        display: flex;
701
+        justify-content: space-between;
702
+        .shop {
703
+        }
704
+        .project-tips {
705
+          flex: 1;
706
+          margin: 0 10px;
707
+        }
708
+        .project-ts {
709
+        }
710
+      }
711
+    }
712
+  }
713
+  .confirm {
714
+    background: #fa7d22;
715
+    border-radius: 14px;
716
+    position: absolute;
717
+    bottom: 42px;
718
+    left: 50%;
719
+    transform: translateX(-50%);
720
+    width: 176px;
721
+    height: 28px;
722
+    font-size: 14px;
723
+    font-family: PingFangSC-Medium, PingFang SC;
724
+    font-weight: 500;
725
+    color: #ffffff;
726
+    line-height: 28px;
727
+    text-align: center;
728
+  }
729
+}
372 730
 </style>

+ 89 - 5
src/pages/historicalOrder/details/index.vue

@@ -73,14 +73,29 @@
73 73
             </div>
74 74
             <div class="project-content">
75 75
               <div class="title-price">
76
-                <div class="project-tit">{{item.name | ellipsis(14)}}</div>
76
+                <div class="project-tit">{{item.name}}</div>
77 77
                 <div class="project-price">
78 78
                   <span class="min-size">¥</span>
79 79
                   {{item.price}}
80 80
                 </div>
81 81
               </div>
82 82
               <div class="project-tips">{{item.product_names}}</div>
83
-              <div class="project-zoom">{{item.room}}{{item.use_time}}分钟</div>
83
+              <div class="project-zoom">
84
+                <el-select v-model="item.tot_name"
85
+                           v-if="order_data.status<3"
86
+                           @visible-change="openList($event,item,index)"
87
+                           @change="changeRoom($event,item,index)"
88
+                           size="mini"
89
+                           style="min-width: 150px;"
90
+                           :placeholder="item.tot_name">
91
+                  <el-option v-for="i in roomList"
92
+                             :key="i.id"
93
+                             :label="i.tot_name"
94
+                             :value="i.tot_name">
95
+                  </el-option>
96
+                </el-select>
97
+                <div v-else>{{item.tot_name}}</div>
98
+              </div>
84 99
             </div>
85 100
           </div>
86 101
         </div>
@@ -91,6 +106,26 @@
91 106
           <div>¥{{order_data.original_price}}</div>
92 107
         </div>
93 108
         <div class="cost-coupon-list">
109
+          <!-- 次卡 -->
110
+          <div class="coupon">
111
+            <div class="coupon-tips">
112
+              <div class="coupon-icon">
113
+                <img src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/couponIcon.png"
114
+                     alt />
115
+              </div>
116
+              <div class="coupon-title">次卡</div>
117
+              <div class="coupon-tip"
118
+                   v-if="coupon_list.length>0">已选择次卡</div>
119
+            </div>
120
+            <div class="on-icon">></div>
121
+          </div>
122
+          <div class="coupon-ps"
123
+               v-for="(item,index) in coupon_list"
124
+               :key="index">
125
+            <div>{{item.coupon_name}}</div>
126
+            <div class="cou-price">-¥{{item.price}}</div>
127
+          </div>
128
+          <!-- 优惠券 -->
94 129
           <div class="coupon">
95 130
             <div class="coupon-tips">
96 131
               <div class="coupon-icon">
@@ -98,7 +133,8 @@
98 133
                      alt />
99 134
               </div>
100 135
               <div class="coupon-title">优惠卷</div>
101
-              <div class="coupon-tip">已选推荐优惠</div>
136
+              <div class="coupon-tip"
137
+                   v-if="coupon_list.length>0">已选推荐优惠</div>
102 138
             </div>
103 139
             <div class="on-icon">></div>
104 140
           </div>
@@ -120,7 +156,6 @@
120 156
     </div>
121 157
   </div>
122 158
 </template>
123
-
124 159
 <script>
125 160
 import api from "../../../server/home";
126 161
 export default {
@@ -141,6 +176,7 @@ export default {
141 176
       isPupop: false,
142 177
       id: "",
143 178
       problem: '',
179
+      roomList: [],//设备房间列表
144 180
     };
145 181
   },
146 182
   computed: {
@@ -157,6 +193,9 @@ export default {
157 193
     getOrderInfo () {
158 194
       api.getOrderInfo({ id: this.id }).then(res => {
159 195
         this.userInfo = res.data.user;
196
+        res.data.order_data.project_list.forEach(e => {
197
+          e["tot_name"] = `${e.device_name}(${e.room})`
198
+        })
160 199
         this.order_data = res.data.order_data;
161 200
         this.problem = res.data.skin_name
162 201
         let _problem = []
@@ -174,6 +213,48 @@ export default {
174 213
       });
175 214
     },
176 215
 
216
+    openList (e, item, index) {
217
+      console.log(e, item, index, 'e,item,index');
218
+      if (e) {
219
+        this.value = ''
220
+        this.roomList = []
221
+        let params = {
222
+          id: this.id,
223
+          project_id: item.id
224
+        }
225
+        api.getDevice_list(params).then(res => {
226
+          if (res.code == 200) {
227
+            res.data.list.forEach(item => {
228
+              item['tot_name'] = `${item.name}(${item.room})`
229
+            })
230
+            this.roomList = res.data.list
231
+          }
232
+        })
233
+      }
234
+    },
235
+    changeRoom (e, item, index) {
236
+      let _id = 0
237
+      this.roomList.forEach(res => {
238
+        if (res.tot_name == e) {
239
+          _id = res.id
240
+        }
241
+      })
242
+      console.log(e, item, index, 'e,item,index');
243
+      let params = {
244
+        id: this.id,
245
+        project_id: item.id,
246
+        device_id: _id
247
+      }
248
+      api.device_change(params).then(res => {
249
+        if (res.code == 200) {
250
+          this.$message({
251
+            message: `${res.msg}`,
252
+            type: "success"
253
+          });
254
+          this.getOrderInfo()
255
+        }
256
+      })
257
+    },
177 258
     onOperation (index) {
178 259
       if (this.programmeList[index].onSelect) {
179 260
         this.$set(
@@ -555,11 +636,14 @@ export default {
555 636
               line-height: 18px;
556 637
             }
557 638
             .project-zoom {
558
-              font-size: 12px;
639
+              font-size: 14px;
559 640
               font-family: PingFangSC-Regular, PingFang SC;
560 641
               font-weight: 400;
561 642
               color: #fa7d22;
562 643
               line-height: 18px;
644
+              /deep/ .el-input__inner {
645
+                color: #fa7d22;
646
+              }
563 647
             }
564 648
           }
565 649
         }

+ 97 - 72
src/pages/historicalOrder/index.vue

@@ -1,78 +1,99 @@
1 1
 <template>
2 2
   <div class="mine">
3 3
     <div class="condition">
4
-      <el-date-picker v-model="dates"
5
-                      type="daterange"
6
-                      range-separator="->"
7
-                      start-placeholder="开始日期"
8
-                      end-placeholder="结束日期"></el-date-picker>
4
+      <el-date-picker
5
+        v-model="dates"
6
+        type="daterange"
7
+        range-separator="->"
8
+        start-placeholder="开始日期"
9
+        end-placeholder="结束日期"
10
+      ></el-date-picker>
9 11
 
10
-      <el-input placeholder="请输入项目"
11
-                class="search"
12
-                v-model="product">
13
-        <i slot="prefix"
14
-           class="el-input__icon el-icon-search"></i>
12
+      <el-input placeholder="请输入项目" class="search" v-model="product">
13
+        <i slot="prefix" class="el-input__icon el-icon-search"></i>
15 14
       </el-input>
16 15
 
17
-      <el-input placeholder="请输入优惠券"
18
-                class="search"
19
-                v-model="coupon">
20
-        <i slot="prefix"
21
-           class="el-input__icon el-icon-search"></i>
16
+      <el-input placeholder="请输入优惠券" class="search" v-model="coupon">
17
+        <i slot="prefix" class="el-input__icon el-icon-search"></i>
22 18
       </el-input>
23 19
 
24
-      <el-input placeholder="请输入内容"
25
-                class="search"
26
-                v-model="searchText">
27
-        <i slot="prefix"
28
-           class="el-input__icon el-icon-search"></i>
20
+      <el-input placeholder="请输入内容" class="search" v-model="searchText">
21
+        <i slot="prefix" class="el-input__icon el-icon-search"></i>
29 22
       </el-input>
30
-      <el-button type="primary"
31
-                 class="searchButton"
32
-                 @click="getOrderList()">搜索</el-button>
23
+      <el-button type="primary" class="searchButton" @click="getOrderList()"
24
+        >搜索</el-button
25
+      >
33 26
     </div>
34 27
 
35 28
     <div class="user-list">
36
-      <el-table ref="multipleTable"
37
-                :data="tableData"
38
-                tooltip-effect="dark"
39
-                height="500"
40
-                style="width: 100%;border-radius: 8px;"
41
-                @row-click="handleSelectionChange">
42
-        <el-table-column label="头像"
43
-                         width="120">
29
+      <el-table
30
+        ref="multipleTable"
31
+        :data="tableData"
32
+        tooltip-effect="dark"
33
+        height="500"
34
+        style="width: 100%; border-radius: 8px"
35
+        @row-click="handleSelectionChange"
36
+      >
37
+        <el-table-column label="头像" width="120">
44 38
           <template slot-scope="scope">
45 39
             <div class="head-img">
46
-              <img :src="scope.row.avatar_url"
47
-                   alt />
40
+              <img :src="scope.row.avatar_url" alt />
48 41
             </div>
49 42
           </template>
50 43
         </el-table-column>
51
-        <el-table-column prop="nickname"
52
-                         label="昵称"
53
-                         width="120"></el-table-column>
54
-        <el-table-column prop="mobile"
55
-                         label="联系电话"
56
-                         show-overflow-tooltip></el-table-column>
57
-        <el-table-column prop="order_time"
58
-                         label="预约时间"
59
-                         show-overflow-tooltip></el-table-column>
60
-        <el-table-column prop="date"
61
-                         label="状态"
62
-                         show-overflow-tooltip>
44
+        <el-table-column
45
+          prop="nickname"
46
+          label="昵称"
47
+          width="120"
48
+        ></el-table-column>
49
+        <el-table-column
50
+          prop="mobile"
51
+          label="联系电话"
52
+          show-overflow-tooltip
53
+        ></el-table-column>
54
+        <el-table-column
55
+          prop="order_time"
56
+          label="预约时间"
57
+          show-overflow-tooltip
58
+        ></el-table-column>
59
+        <el-table-column prop="date" label="状态" show-overflow-tooltip>
63 60
           <template slot-scope="scope">
64
-            <div :style="scope.row.status==0?'color: #FC3019':scope.row.status==5?'color: #A999EA':'color: #61D09D;'">{{ scope.row.status==0?'未支付':scope.row.status==5?'已取消':scope.row.status==1?'待使用':scope.row.status==2?'正在使用':scope.row.status==3?'已结算':'' }}</div>
61
+            <div
62
+              :style="
63
+                scope.row.status == 0
64
+                  ? 'color: #FC3019'
65
+                  : scope.row.status == 5
66
+                  ? 'color: #A999EA'
67
+                  : 'color: #61D09D;'
68
+              "
69
+            >
70
+              {{
71
+                scope.row.status == 0
72
+                  ? "未支付"
73
+                  : scope.row.status == 5
74
+                  ? "已取消"
75
+                  : scope.row.status == 1
76
+                  ? "待使用"
77
+                  : scope.row.status == 2
78
+                  ? "正在使用"
79
+                  : scope.row.status == 3
80
+                  ? "已结算"
81
+                  : ""
82
+              }}
83
+            </div>
65 84
           </template>
66 85
         </el-table-column>
67 86
       </el-table>
68 87
 
69 88
       <div class="pagin">
70
-        <el-pagination background
71
-                       layout="prev, pager, next"
72
-                       @size-change="handleSizeChange"
73
-                       @current-change="handleCurrentChange"
74
-                       :current-page.sync="currentPage1"
75
-                       :total="total"></el-pagination>
89
+        <el-pagination
90
+          background
91
+          layout="prev, pager, next"
92
+          @size-change="handleSizeChange"
93
+          @current-change="handleCurrentChange"
94
+          :current-page.sync="currentPage1"
95
+          :total="total"
96
+        ></el-pagination>
76 97
       </div>
77 98
     </div>
78 99
   </div>
@@ -83,7 +104,7 @@ import api from "../../server/home";
83 104
 
84 105
 export default {
85 106
   components: {},
86
-  data () {
107
+  data() {
87 108
     return {
88 109
       searchText: "",
89 110
       dates: "",
@@ -95,12 +116,12 @@ export default {
95 116
       couponList: [
96 117
         {
97 118
           value: "选项1",
98
-          label: "黄金糕"
119
+          label: "黄金糕",
99 120
         },
100 121
         {
101 122
           value: "选项2",
102
-          label: "双皮奶"
103
-        }
123
+          label: "双皮奶",
124
+        },
104 125
       ],
105 126
       tableData: [
106 127
         {
@@ -109,7 +130,7 @@ export default {
109 130
           headImg:
110 131
             "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/unpaid.png",
111 132
           phone: "13346783645",
112
-          status: "已完成"
133
+          status: "已完成",
113 134
         },
114 135
         {
115 136
           date: "2022.04.25  14:30",
@@ -117,11 +138,11 @@ export default {
117 138
           headImg:
118 139
             "https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/home/unpaid.png",
119 140
           phone: "13346783645",
120
-          status: "已完成"
121
-        }
141
+          status: "已完成",
142
+        },
122 143
       ],
123 144
       currentPage1: 1,
124
-      multipleSelection: ""
145
+      multipleSelection: "",
125 146
     };
126 147
   },
127 148
   computed: {},
@@ -129,7 +150,7 @@ export default {
129 150
 
130 151
   methods: {
131 152
     // 获取订单列表
132
-    getOrderList () {
153
+    getOrderList() {
133 154
       let start_date = "",
134 155
         end_date = "";
135 156
       if (this.dates && this.dates.length > 0) {
@@ -143,38 +164,42 @@ export default {
143 164
         project_name: this.product,
144 165
         coupon_name: this.coupon,
145 166
         start_date: start_date,
146
-        end_date: end_date
167
+        end_date: end_date,
147 168
       };
148
-      api.getOrderList(params).then(res => {
169
+      api.getOrderList(params).then((res) => {
149 170
         if (res.code == 200) {
171
+          // 将用户手机号中间四位变成****
172
+          res.data.list.map((item) => {
173
+            item.mobile =
174
+              item.mobile.substring(0, 3) + "****" + item.mobile.substring(7);
175
+          });
150 176
           this.tableData = res.data.list;
151 177
           this.total = res.data.total;
152 178
         }
153 179
       });
154 180
     },
155 181
 
156
-    handleCurrentChange (e) {
182
+    handleCurrentChange(e) {
157 183
       this.currentPage1 = e;
158 184
       this.getOrderList();
159 185
     },
160 186
 
161
-    handleSizeChange (val) {
162
-    },
163
-    handleSelectionChange (row, column, event) {
187
+    handleSizeChange(val) {},
188
+    handleSelectionChange(row, column, event) {
164 189
       this.$router.push({
165 190
         path: "/historicalOrder/details",
166 191
         query: {
167
-          id: row.id
168
-        }
192
+          id: row.id,
193
+        },
169 194
       });
170
-    }
195
+    },
171 196
   },
172 197
 
173
-  created () {
198
+  created() {
174 199
     this.getOrderList();
175 200
   },
176 201
 
177
-  mounted () { }
202
+  mounted() {},
178 203
 };
179 204
 </script>
180 205
 

+ 1 - 0
src/pages/home/detailList/index.vue

@@ -138,6 +138,7 @@ export default {
138 138
         border-bottom: 2px #f5f5f5 solid;
139 139
       }
140 140
       .project-wrapper {
141
+        flex: 1;
141 142
         display: flex;
142 143
         flex-wrap: wrap;
143 144
         .project {

+ 10 - 0
src/pages/login/login.vue

@@ -30,6 +30,7 @@
30 30
 </template>
31 31
 
32 32
 <script>
33
+import { mapMutations } from 'vuex'
33 34
 import api from '../../server/home'
34 35
 import axios from 'axios';
35 36
 // import Cookies from "js-cookie"
@@ -46,6 +47,7 @@ export default {
46 47
   watch: {},
47 48
 
48 49
   methods: {
50
+    ...mapMutations(['SAVE_COMMON_VALUE']),
49 51
     onLogin () {
50 52
       let params = {
51 53
         username: this.account,
@@ -54,6 +56,14 @@ export default {
54 56
       api.getToken(params).then(res => {
55 57
         if (res.code == 200) {
56 58
           localStorage.setItem("token", res.data.token)
59
+          this.SAVE_COMMON_VALUE({
60
+            'key': 'token',
61
+            'value': res.data.token
62
+          })
63
+          this.SAVE_COMMON_VALUE({
64
+            'key': 'isLogin',
65
+            'value': true
66
+          })
57 67
           axios.defaults.headers.token = res.data.token
58 68
           this.$router.push({
59 69
             path: '/home'

+ 65 - 53
src/pages/testSkin/index.vue

@@ -1,51 +1,57 @@
1 1
 <template>
2 2
   <div class="mine">
3 3
     <div class="condition">
4
-      <el-date-picker v-model="dates"
5
-                      type="daterange"
6
-                      range-separator="->"
7
-                      start-placeholder="开始日期"
8
-                      end-placeholder="结束日期">
4
+      <el-date-picker
5
+        v-model="dates"
6
+        type="daterange"
7
+        range-separator="->"
8
+        start-placeholder="开始日期"
9
+        end-placeholder="结束日期"
10
+      >
9 11
       </el-date-picker>
10 12
 
11
-      <el-input placeholder="请输入内容"
12
-                class="search"
13
-                v-model="searchText">
14
-        <i slot="prefix"
15
-           class="el-input__icon el-icon-search"></i>
13
+      <el-input placeholder="请输入内容" class="search" v-model="searchText">
14
+        <i slot="prefix" class="el-input__icon el-icon-search"></i>
16 15
       </el-input>
17
-      <el-button type="primary"
18
-                 class="searchButton"
19
-                 @click="getSkinList">搜索</el-button>
16
+      <el-button type="primary" class="searchButton" @click="getSkinList"
17
+        >搜索</el-button
18
+      >
20 19
     </div>
21 20
     <div class="list">
22 21
       <div class="tab">
23 22
         <div class="head-img">头像</div>
24 23
         <div class="head-name">昵称</div>
25 24
         <div class="head-phone">联系电话</div>
26
-        <div class="head-ts">预约时间</div>
25
+        <div class="head-ts">检测时间</div>
27 26
         <div class="head-status">状态</div>
28 27
       </div>
29 28
       <div class="content">
30
-        <div class="tab user-info"
31
-             v-for="(item,index) in userList"
32
-             :key="index"
33
-             @click="onDetails(item.id)">
34
-          <div class="head-img"><img :src="item.avatar_url"
35
-                 alt=""></div>
29
+        <div
30
+          class="tab user-info"
31
+          v-for="(item, index) in userList"
32
+          :key="index"
33
+          @click="onDetails(item.id)"
34
+        >
35
+          <div class="head-img"><img :src="item.avatar_url" alt="" /></div>
36 36
           <div class="head-name">{{ item.nickname }}</div>
37 37
           <div class="head-phone">{{ item.mobile }}</div>
38 38
           <div class="head-ts">{{ item.check_time }}</div>
39
-          <div class="head-status"
40
-               :style="item.status==1?'color: #61D09D;':'color: #FC3019;'">{{ item.status==1?'已面诊':'未面诊'}}</div>
39
+          <div
40
+            class="head-status"
41
+            :style="item.status == 1 ? 'color: #61D09D;' : 'color: #FC3019;'"
42
+          >
43
+            {{ item.status == 1 ? "已面诊" : "未面诊" }}
44
+          </div>
41 45
         </div>
42 46
       </div>
43 47
       <div class="pagin">
44
-        <el-pagination background
45
-                       layout="prev, pager, next"
46
-                       @current-change="handleCurrentChange"
47
-                       :current-page.sync="currentPage1"
48
-                       :total="total">
48
+        <el-pagination
49
+          background
50
+          layout="prev, pager, next"
51
+          @current-change="handleCurrentChange"
52
+          :current-page.sync="currentPage1"
53
+          :total="total"
54
+        >
49 55
         </el-pagination>
50 56
       </div>
51 57
     </div>
@@ -53,28 +59,29 @@
53 59
 </template>
54 60
 
55 61
 <script>
56
-import api from '../../server/home'
62
+import api from "../../server/home";
57 63
 export default {
58 64
   components: {},
59
-  data () {
65
+  data() {
60 66
     return {
61 67
       dates: [],
62
-      searchText: '',
68
+      searchText: "",
63 69
       userList: [],
64 70
       currentPage1: 1,
65 71
       limit: 10,
66 72
       total: 0,
67
-    }
73
+    };
68 74
   },
69 75
   computed: {},
70 76
   watch: {},
71 77
 
72 78
   methods: {
73
-    getSkinList () {
74
-      let start_date = '', end_date = ''
79
+    getSkinList() {
80
+      let start_date = "",
81
+        end_date = "";
75 82
       if (this.dates && this.dates.length > 0) {
76
-        start_date = utils.formatTime(this.dates[0], 'yyyy-MM-dd')
77
-        end_date = utils.formatTime(this.dates[1], 'yyyy-MM-dd')
83
+        start_date = utils.formatTime(this.dates[0], "yyyy-MM-dd");
84
+        end_date = utils.formatTime(this.dates[1], "yyyy-MM-dd");
78 85
       }
79 86
       let params = {
80 87
         page: this.currentPage1,
@@ -82,34 +89,39 @@ export default {
82 89
         keywords: this.searchText,
83 90
         start_date: start_date,
84 91
         end_date: end_date,
85
-      }
86
-      api.getSkinList(params).then(res => {
92
+      };
93
+      api.getSkinList(params).then((res) => {
87 94
         if (res.code == 200) {
88
-          this.userList = res.data.list
89
-          this.total = res.data.total
95
+          // 将用户手机号中间四位变成****
96
+          res.data.list.map((item) => {
97
+            item.mobile =
98
+              item.mobile.substring(0, 3) + "****" + item.mobile.substring(7);
99
+          });
100
+          this.userList = res.data.list;
101
+          this.total = res.data.total;
90 102
         }
91
-      })
103
+      });
92 104
     },
93
-    onDetails (e) {
105
+    onDetails(e) {
94 106
       this.$router.push({
95
-        path: '/testSkin/details',
107
+        path: "/testSkin/details",
96 108
         query: {
97
-          id: e
98
-        }
99
-      })
109
+          id: e,
110
+        },
111
+      });
112
+    },
113
+    handleCurrentChange(e) {
114
+      this.currentPage1 = e;
115
+      this.getSkinList();
100 116
     },
101
-    handleCurrentChange (e) {
102
-      this.currentPage1 = e
103
-      this.getSkinList()
104
-    }
105 117
   },
106 118
 
107
-  created () {
108
-    this.getSkinList()
119
+  created() {
120
+    this.getSkinList();
109 121
   },
110 122
 
111
-  mounted () { }
112
-}
123
+  mounted() {},
124
+};
113 125
 </script>
114 126
 
115 127
 <style lang='less' scoped>

+ 1 - 1
src/router/index.js

@@ -6,7 +6,7 @@ import login from "./map/login";
6 6
 
7 7
 Vue.use(Router)
8 8
 
9
-export default new Router({
9
+export default  new Router({
10 10
   mode: 'hash',
11 11
   base: process.env.BASE_URL,
12 12
   routes: [

+ 76 - 76
src/router/map/home.js

@@ -23,91 +23,91 @@ export default {
23 23
   name: '首页',
24 24
   component: layout,
25 25
   children: [{
26
-      path: '/home',
27
-      component: Home
26
+    path: '/home',
27
+    component: Home
28
+  },
29
+  {
30
+    name: '客户预约表',
31
+    path: '/home/detailList',
32
+    meta: {
33
+      isback: true,
28 34
     },
29
-    {
30
-      name: '客户预约表',
31
-      path: '/home/detailList',
32
-      meta: {
33
-        isback: true,
34
-      },
35
-      component: HomeDetailList
35
+    component: HomeDetailList
36
+  },
37
+  {
38
+    path: '/testSkin',
39
+    component: TestSkin
40
+  },
41
+  {
42
+    path: '/testSkin/details',
43
+    meta: {
44
+      isback: true,
36 45
     },
37
-    {
38
-      path: '/testSkin',
39
-      component: TestSkin
46
+    component: TestSkinDetails
47
+  },
48
+  {
49
+    path: '/testSkin/updates',
50
+    meta: {
51
+      isback: true,
40 52
     },
41
-    {
42
-      path: '/testSkin/details',
43
-      meta: {
44
-        isback: true,
45
-      },
46
-      component: TestSkinDetails
53
+    component: TestSkinUpdate
54
+  },
55
+  {
56
+    path: '/customerMan',
57
+    component: CustomerMan
58
+  },
59
+  {
60
+    path: '/customerMan/details',
61
+    meta: {
62
+      isback: true,
47 63
     },
48
-    {
49
-      path: '/testSkin/updates',
50
-      meta: {
51
-        isback: true,
52
-      },
53
-      component: TestSkinUpdate
64
+    component: CustomerManDetails
65
+  },
66
+  {
67
+    path: '/customerMan/projectOrder',
68
+    meta: {
69
+      isback: true,
54 70
     },
55
-    {
56
-      path: '/customerMan',
57
-      component: CustomerMan
71
+    component: projectOrder
72
+  },
73
+  {
74
+    path: '/historicalOrder',
75
+    component: HistoricalOrder
76
+  },
77
+  {
78
+    path: '/historicalOrder/details',
79
+    meta: {
80
+      isback: true,
58 81
     },
59
-    {
60
-      path: '/customerMan/details',
61
-      meta: {
62
-        isback: true,
63
-      },
64
-      component: CustomerManDetails
82
+    component: HistoricalOrderDetails
83
+  },
84
+  {
85
+    path: '/confirmOrder',
86
+    component: ConfirmOrder
87
+  },
88
+  {
89
+    path: '/confirmOrder/details',
90
+    meta: {
91
+      isback: true,
65 92
     },
66
-    {
67
-      path: '/customerMan/projectOrder',
68
-      meta: {
69
-        isback: true,
70
-      },
71
-      component: projectOrder
72
-    },
73
-    {
74
-      path: '/historicalOrder',
75
-      component: HistoricalOrder
76
-    },
77
-    {
78
-      path: '/historicalOrder/details',
79
-      meta: {
80
-        isback: true,
81
-      },
82
-      component: HistoricalOrderDetails
83
-    },
84
-    {
85
-      path: '/confirmOrder',
86
-      component: ConfirmOrder
87
-    },
88
-    {
89
-      path: '/confirmOrder/details',
90
-      meta: {
91
-        isback: true,
92
-      },
93
-      component: ConfirmOrderDetails
94
-    },
95
-    {
96
-      path: '/confirmOrder/addOrder',
97
-      meta: {
98
-        isback: true,
99
-      },
100
-      component: ConfirmOrderAddOrder
93
+    component: ConfirmOrderDetails
94
+  },
95
+  {
96
+    path: '/confirmOrder/addOrder',
97
+    meta: {
98
+      isback: true,
101 99
     },
100
+    component: ConfirmOrderAddOrder
101
+  },
102 102
 
103
-    {
104
-      path: '/storeDetection',
105
-      component: StoreDetection
106
-    },
107
-    {
108
-      path: '/coupon',
109
-      component: Coupon
110
-    },
103
+  {
104
+    path: '/storeDetection',
105
+    component: StoreDetection
106
+  },
107
+  {
108
+    path: '/coupon',
109
+    component: Coupon
110
+  },
111 111
 
112 112
   ]
113 113
 }

+ 60 - 0
src/server/home.js

@@ -81,6 +81,12 @@ export default class Home {
81 81
   static addUpdate (parms) {
82 82
     return $http.post(url.addUpdate, parms);
83 83
   }
84
+  static getDevice_list (parms) {
85
+    return $http.get(url.getDevice_list, parms);
86
+  }
87
+  static device_change (parms) {
88
+    return $http.post(url.device_change, parms);
89
+  }
84 90
 
85 91
   // 获取历史订单
86 92
   static getOrderList (parms) {
@@ -157,4 +163,58 @@ export default class Home {
157 163
     return $http.get(url.reservedRecords, params)
158 164
   }
159 165
 
166
+  // 清除未读消息  0清除所有 1清除预约成功 2清除取消
167
+  static clearMessage (type) {
168
+    return $http.get(url.clearMessage, type)
169
+  }
170
+
171
+  // 根据Id清除未读消息  消息记录id
172
+  static clearMessageById (id) {
173
+    return $http.get(url.clearMessageById, id)
174
+  }
175
+
176
+  // 获取消息列表 (成功/失败)  1预约成功 2取消预约
177
+  static getMessageByType ({ type, page, limit }) {
178
+    return $http.get(url.getMessageByType, { type, page, limit })
179
+  }
180
+
181
+  // 获取消息列表
182
+  static getMessageList ({ page, limit }) {
183
+    return $http.get(url.getMessageList, { page, limit })
184
+  }
185
+
186
+  // 获取是否有未读消息
187
+  static hasUnreadMessage () {
188
+    return $http.get(url.hasUnreadMessage)
189
+  }
190
+
191
+  // 更新用户信息
192
+  static updateUserProfile (params) {
193
+    return $http.post(url.updateUserProfile, params)
194
+  }
195
+
196
+  // 获取用户卡券订单
197
+  static getCardOrders (params) {
198
+    return $http.get(url.getCardOrders, params)
199
+  }
200
+  // 获取用户次卡列表
201
+  static getCardList (params) {
202
+    return $http.get(url.getCardList, params)
203
+  }
204
+  // 次卡订单详情
205
+  static cardInfo (params) {
206
+    return $http.get(url.cardInfo, params)
207
+  }
208
+  // 次卡消耗详情
209
+  static cardLog (params) {
210
+    return $http.get(url.cardLog, params)
211
+  }
212
+  // 修改次数
213
+  static cardUpdate (params) {
214
+    return $http.post(url.cardUpdate, params)
215
+  }
216
+  // 获取项目可用的次卡
217
+  static getOrderCard (params) {
218
+    return $http.get(url.getOrderCard, params)
219
+  }
160 220
 }

+ 38 - 3
src/server/urls.js

@@ -38,7 +38,7 @@ export default {
38 38
   //支付状态
39 39
   payStatus: '/v2/pad/order/pay_status',
40 40
   //活动折扣
41
-  getOrderDiscount: '/v2/pad/order/discount',
41
+  getOrderDiscount: '/v3/pad/order/discount',
42 42
   //获取项目分类
43 43
   projectClassify: '/v2/pad/project/classify',
44 44
   //删除项目和耗材
@@ -47,6 +47,18 @@ export default {
47 47
   timesAdd: '/v2/pad/scheme/times_add',
48 48
   //新增项目
49 49
   addUpdate: '/v2/pad/scheme/update',
50
+  //次卡订单详情
51
+  cardInfo:'/v2/pad/card/info',
52
+  //消耗详情
53
+  cardLog:'/v2/pad/card/log',
54
+  //修改次数
55
+  cardUpdate:'/v2/pad/card/update',
56
+  //获取项目可用的次卡
57
+  getOrderCard:'/v2/pad/order/card',
58
+  //获取可更换的设备
59
+  getDevice_list:'/v2/pad/order/device_list',
60
+  //更改设备
61
+  device_change:'/v2/pad/order/device_change',
50 62
 
51 63
   /**
52 64
    *  by ListKer
@@ -94,7 +106,30 @@ export default {
94 106
   // 创建标签
95 107
   schemeSave: '/v2/pad/scheme/save',
96 108
 
97
-    // 用户预约记录
98
-    reservedRecords: '/v2/pad/reserved/index'
109
+  // 用户预约记录
110
+  reservedRecords: '/v2/pad/reserved/index',
99 111
 
112
+  // 清除未读消息
113
+  clearMessage: '/v2/pad/message/batch_read',
114
+
115
+  // 根据Id清除未读消息
116
+  clearMessageById: '/v2/pad/message/read',
117
+
118
+  // 获取消息列表 (成功/失败)
119
+  getMessageByType: '/v2/pad/message/type_list',
120
+
121
+  // 获取消息列表
122
+  getMessageList: '/v2/pad/message/get_list',
123
+
124
+  // 获取是否有未读消息
125
+  hasUnreadMessage: '/v2/pad/message/get_message',
126
+
127
+  // 更新用户信息
128
+  updateUserProfile: '/v2/pad/user/update',
129
+
130
+  // 获取用户卡券订单
131
+  getCardOrders: '/v2/pad/user/card',
132
+
133
+  //获取用户次卡列表
134
+  getCardList:'/v2/pad/user/card_list'
100 135
 }

+ 2 - 1
src/store/modules/comVal.js

@@ -1,6 +1,7 @@
1 1
 const state = {
2 2
   name: 666,
3
-  token: null
3
+  token: null,
4
+  isLogin: false
4 5
 }
5 6
 
6 7
 const actions = {

+ 30 - 4
vue.config.js

@@ -3,8 +3,12 @@
3 3
 const MiniCssExtractPlugin = require('mini-css-extract-plugin');
4 4
 
5 5
 module.exports = {
6
-  publicPath: process.env.env_config === 'prod' ? 'https://h5-cms-vue.ijolijoli.com/dist' :
6
+  // 测试
7
+  publicPath: process.env.env_config === 'prod' ? 'https://h5-cms-vue.ijolijoli.com/test_pad/dist' :
7 8
     process.env.env_config === 'test' ? '/vapps/calory/' : '/dist/',
9
+  // 正式
10
+  // publicPath: process.env.env_config === 'prod' ? 'https://h5-cms-vue.ijolijoli.com/dist' :
11
+  //   process.env.env_config === 'test' ? '/vapps/calory/' : '/dist/',
8 12
   // 设置跨域
9 13
   crossorigin: 'anonymous',
10 14
   /**
@@ -17,10 +21,10 @@ module.exports = {
17 21
 
18 22
   // 它支持webPack-dev-server的所有选项
19 23
   devServer: {
20
-    host: "0.0.0.0",
24
+    host: "0.0.0.0",//ip本地
21 25
     port: 8083, // 端口号
22
-    https: false, // https:{type:Boolean}
23
-    open: true, //配置自动启动浏览器
26
+    https: false, // https:{type:Boolean}配置前缀
27
+    open: false, //配置自动启动浏览器
24 28
     proxy: '' // 配置跨域处理
25 29
   },
26 30
   configureWebpack: {
@@ -38,5 +42,27 @@ module.exports = {
38 42
     //         chunkFilename: `css/[name].[hash:6].css`
39 43
     //     })
40 44
     // ]
45
+  },
46
+  css: {
47
+    loaderOptions: {
48
+      postcss: {
49
+        plugins: [
50
+          require("postcss-px-to-viewport")({
51
+            unitToConvert: "px", // 把什么单位转换成vw
52
+            viewportWidth: 1000, // 视口宽度,设计稿宽度
53
+            viewportHeight: 600, // 视口高度,设计稿高度
54
+            unitPrecision: 5, // 转换成vw单位的小数点后的保留位数
55
+            propList: ["*"], // 属性列表,表示你要把哪些css属性的px转换成vw
56
+            viewportUnit: "vw", // 使用的单位,目前可选单位有vw,vh。
57
+            fontViewportUnit: "vw", // 字体使用的单位
58
+            selectorBlackList: ['van', 'el-'], // 匹配不被转换为vw的选择器
59
+            minPixelValue: 1,
60
+            mediaQuery: false,
61
+            replace: true, // 是否直接更换属性值,而不添加备用属性
62
+            exclude: /(\/|\\)(node_modules)(\/|\\)/,
63
+          })
64
+        ]
65
+      }
66
+    }
41 67
   }
42 68
 }