listKer пре 2 година
родитељ
комит
da41440b1a
3 измењених фајлова са 144 додато и 151 уклоњено
  1. 89 116
      src/pages/testSkin/details/index.vue
  2. 46 35
      src/server/home.js
  3. 9 0
      src/server/urls.js

+ 89 - 116
src/pages/testSkin/details/index.vue

@@ -149,7 +149,7 @@
149 149
             v-for="item,index in skinTag"
150 150
             :key="index"
151 151
             @click="selectSkingTag(index)"
152
-          >{{item.title}}</div>
152
+          >{{item.name}}</div>
153 153
         </div>
154 154
 
155 155
         <div class="submit-frequency" @click="submitFrequency(1)">下一步</div>
@@ -168,14 +168,14 @@
168 168
 
169 169
         <div class="faceTag">
170 170
           <div class="faceTagContent" v-for="item,index in faceTagData" :key="index">
171
-            <div class="faceTagTitle">{{item.title}}</div>
171
+            <div class="faceTagTitle">{{item.name}}</div>
172 172
             <div class="faceTagHor">
173 173
               <div
174 174
                 :class="tag.select?'faceTagItem':'faceTagItem-not'"
175
-                v-for="tag,index1 in item.item"
175
+                v-for="tag,index1 in item.dataS"
176 176
                 :key="index1"
177 177
                 @click="selectfaceTag(index,index1)"
178
-              >{{tag.title}}</div>
178
+              >{{tag.name}}</div>
179 179
             </div>
180 180
           </div>
181 181
         </div>
@@ -194,7 +194,7 @@
194 194
         </div>
195 195
         <div class="pupop-title">备注</div>
196 196
 
197
-        <textarea type="text" class="noticeInput" placeholder="备注"></textarea>
197
+        <textarea type="text" class="noticeInput" placeholder="备注" v-model="noticeInput"></textarea>
198 198
 
199 199
         <div class="noticeSubmit">
200 200
           <div class="submit-back" @click="backSubmit(3)">返回</div>
@@ -274,6 +274,7 @@ export default {
274 274
       ],
275 275
       //后台默认的标签
276 276
       tags: [],
277
+      noticeInput: "",
277 278
       notice: false,
278 279
       //执行方案
279 280
       programmeList: [
@@ -291,110 +292,9 @@ export default {
291 292
         }
292 293
       ],
293 294
       faceTag: false,
294
-      faceTagData: [
295
-        {
296
-          title: "额头",
297
-          item: [
298
-            { title: "title", select: false },
299
-            { title: "title", select: false },
300
-            { title: "title", select: false }
301
-          ]
302
-        },
303
-        {
304
-          title: "额头",
305
-          item: [
306
-            { title: "title", select: false },
307
-            { title: "title", select: false },
308
-            { title: "title", select: false },
309
-            { title: "title", select: false }
310
-          ]
311
-        },
312
-        {
313
-          title: "额头",
314
-          item: [
315
-            { title: "title", select: false },
316
-            { title: "title", select: false },
317
-            { title: "title", select: false },
318
-            { title: "title", select: false },
319
-            { title: "title", select: false },
320
-            { title: "title", select: false }
321
-          ]
322
-        },
323
-        {
324
-          title: "额头",
325
-          item: [
326
-            { title: "title", select: false },
327
-            { title: "title", select: false },
328
-            { title: "title", select: false }
329
-          ]
330
-        },
331
-        {
332
-          title: "额头",
333
-          item: [
334
-            { title: "title", select: false },
335
-            { title: "title", select: false }
336
-          ]
337
-        },
338
-        {
339
-          title: "额头",
340
-          item: [
341
-            { title: "title", select: false },
342
-            { title: "title", select: false }
343
-          ]
344
-        },
345
-        {
346
-          title: "额头",
347
-          item: [
348
-            { title: "title", select: false },
349
-            { title: "title", select: false },
350
-            { title: "title", select: false },
351
-            { title: "title", select: false }
352
-          ]
353
-        }
354
-      ],
295
+      faceTagData: [],
355 296
       selectWeek: 0,
356
-      skinTag: [
357
-        {
358
-          title: "啥子标签",
359
-          id: "1",
360
-          select: true
361
-        },
362
-        {
363
-          title: "啥子标签",
364
-          id: "1",
365
-          select: false
366
-        },
367
-        {
368
-          title: "啥子标签",
369
-          id: "1",
370
-          select: false
371
-        },
372
-        {
373
-          title: "啥子标签",
374
-          id: "1",
375
-          select: false
376
-        },
377
-        {
378
-          title: "啥子标签",
379
-          id: "1",
380
-          select: false
381
-        },
382
-        {
383
-          title: "啥子标签",
384
-          id: "1",
385
-          select: false
386
-        },
387
-        {
388
-          title: "啥子标签",
389
-          id: "1",
390
-          select: false
391
-        },
392
-        {
393
-          title: "啥子标签",
394
-          id: "1",
395
-          select: false
396
-        }
397
-      ],
297
+      skinTag: [],
398 298
 
399 299
       //项目列表
400 300
       projectList: [
@@ -465,6 +365,41 @@ export default {
465 365
         // this.remarks = res.data.remark
466 366
       });
467 367
     },
368
+
369
+    // 获取问题标签
370
+    skinFace_tags() {
371
+      api.skinFace_tags().then(res => {
372
+        let doSkin = [];
373
+        for (let i = 0; i < res.data.list.length; i++) {
374
+          let skinItem = res.data.list[i];
375
+          skinItem.dataS = [];
376
+          for (let j = 0; j < skinItem.question_name.length; j++) {
377
+            let doNow = {
378
+              name: skinItem.question_name[j],
379
+              select: false
380
+            };
381
+            skinItem.dataS.push(doNow);
382
+          }
383
+          doSkin.push(skinItem);
384
+        }
385
+        console.log(doSkin);
386
+        this.faceTagData = doSkin;
387
+      });
388
+    },
389
+
390
+    // 获取皮肤问题标签
391
+    skinSkin_tags() {
392
+      api.skinSkin_tags().then(res => {
393
+        let doSkin = [];
394
+        for (let i = 0; i < res.data.list.length; i++) {
395
+          let skinItem = res.data.list[i];
396
+          skinItem.select = false;
397
+          doSkin.push(skinItem);
398
+        }
399
+        this.skinTag = doSkin;
400
+      });
401
+    },
402
+
468 403
     getSkinTags() {
469 404
       api.getSkinTags().then(res => {
470 405
         this.tags = res.data.tags;
@@ -476,8 +411,8 @@ export default {
476 411
     },
477 412
 
478 413
     selectfaceTag(index, index1) {
479
-      this.faceTagData[index].item[index1].select = !this.faceTagData[index]
480
-        .item[index1].select;
414
+      this.faceTagData[index].dataS[index1].select = !this.faceTagData[index]
415
+        .dataS[index1].select;
481 416
     },
482 417
 
483 418
     getProject() {
@@ -513,7 +448,7 @@ export default {
513 448
       this.getSkinUpdate();
514 449
     },
515 450
     submitFrequency(e) {
516
-      console.log(e);
451
+      console.log(this.noticeInput);
517 452
       if (e == 1) {
518 453
         this.isSkin = false;
519 454
         this.faceTag = true;
@@ -525,14 +460,50 @@ export default {
525 460
       }
526 461
 
527 462
       if (e == 4) {
528
-        this.$router.push({
529
-          path: "/testSkin/updates",
530
-          query: {
531
-            id: e
463
+        this.schemeSave();
464
+      }
465
+    },
466
+
467
+    // 面部标签值,如:额头:颜色,横纹;眼部:下垂;
468
+    schemeSave() {
469
+      let skinTags = "";
470
+      let FaceTags = "";
471
+      for (let i = 0; i < this.skinTag.length; i++) {
472
+        if (this.skinTag[i].select) {
473
+          skinTags = this.skinTag[i].id;
474
+        }
475
+      }
476
+
477
+      for (let i = 0; i < this.faceTagData.length; i++) {
478
+        for (let j = 0; j < this.faceTagData[i].dataS.length; j++) {
479
+          if (this.faceTagData[i].dataS[j].select) {
480
+            FaceTags =
481
+              FaceTags +
482
+              "," +
483
+              this.faceTagData[i].name +
484
+              ":" +
485
+              this.faceTagData[i].dataS[j].name;
532 486
           }
533
-        });
487
+        }
534 488
       }
489
+
490
+      api
491
+        .schemeSave({
492
+          user_id: this.id,
493
+          skin_id: skinTags,
494
+          face_names: FaceTags.substring(1,FaceTags.length),
495
+          remark: this.noticeInput
496
+        })
497
+        .then(res => {
498
+          this.$router.push({
499
+            path: "/testSkin/updates",
500
+            query: {
501
+              id: 1
502
+            }
503
+          });
504
+        });
535 505
     },
506
+
536 507
     randomColor(type) {
537 508
       let arr = [
538 509
         {
@@ -572,6 +543,8 @@ export default {
572 543
   created() {
573 544
     let id = this.$route.query.id;
574 545
     this.id = id;
546
+    this.skinFace_tags();
547
+    this.skinSkin_tags();
575 548
     this.getSkinInfo();
576 549
     this.getProject();
577 550
     this.getSkinTags();

+ 46 - 35
src/server/home.js

@@ -6,85 +6,85 @@ export default class Home {
6 6
   /**
7 7
    * @描述  1.1	获取用户信息
8 8
    */
9
-  static getToken (parms) {
9
+  static getToken(parms) {
10 10
     return $http.post(url.getToken, parms);
11 11
   }
12 12
 
13
-  static getTotal (parms) {
13
+  static getTotal(parms) {
14 14
     return $http.get(url.getTotal, parms);
15 15
   }
16 16
 
17
-  static getToday (parms) {
17
+  static getToday(parms) {
18 18
     return $http.get(url.getToday, parms);
19 19
   }
20 20
 
21
-  static getSkinList (parms) {
21
+  static getSkinList(parms) {
22 22
     return $http.get(url.getSkinList, parms);
23 23
   }
24
-  static getSkinInfo (parms) {
24
+  static getSkinInfo(parms) {
25 25
     return $http.get(url.getSkinInfo, parms);
26 26
   }
27
-  static getProject (parms) {
27
+  static getProject(parms) {
28 28
     return $http.get(url.getProject, parms);
29 29
   }
30
-  static getUserInfo (parms) {
30
+  static getUserInfo(parms) {
31 31
     return $http.get(url.getUserInfo, parms);
32 32
   }
33
-  static getSkinTags (parms) {
33
+  static getSkinTags(parms) {
34 34
     return $http.get(url.getSkinTags, parms);
35 35
   }
36
-  static getSkinUpdate (parms) {
36
+  static getSkinUpdate(parms) {
37 37
     return $http.post(url.getSkinUpdate, parms);
38 38
   }
39
-  static getProjectList (parms) {
39
+  static getProjectList(parms) {
40 40
     return $http.get(url.getProjectList, parms);
41 41
   }
42
-  static getProducts (parms) {
42
+  static getProducts(parms) {
43 43
     return $http.get(url.getProducts, parms);
44 44
   }
45
-  static getOrderTime (parms) {
45
+  static getOrderTime(parms) {
46 46
     return $http.get(url.getOrderTime, parms);
47 47
   }
48
-  static setOrderUpdate (parms) {
48
+  static setOrderUpdate(parms) {
49 49
     return $http.post(url.setOrderUpdate, parms);
50 50
   }
51
-  static getOrderCoupon (parms) {
51
+  static getOrderCoupon(parms) {
52 52
     return $http.get(url.getOrderCoupon, parms);
53 53
   }
54
-  static getAuthCode (parms) {
54
+  static getAuthCode(parms) {
55 55
     return $http.get(url.getAuthCode, parms);
56 56
   }
57
-  static checkCode (parms) {
57
+  static checkCode(parms) {
58 58
     return $http.get(url.checkCode, parms);
59 59
   }
60
-  static getOrderByCode (parms) {
60
+  static getOrderByCode(parms) {
61 61
     return $http.get(url.getOrderByCode, parms);
62 62
   }
63
-  static orderPay (parms) {
63
+  static orderPay(parms) {
64 64
     return $http.post(url.orderPay, parms);
65 65
   }
66
-  static payStatus (parms) {
66
+  static payStatus(parms) {
67 67
     return $http.get(url.payStatus, parms);
68 68
   }
69
-  static getOrderDiscount (parms) {
69
+  static getOrderDiscount(parms) {
70 70
     return $http.get(url.getOrderDiscount, parms);
71 71
   }
72
-  static projectClassify (parms) {
72
+  static projectClassify(parms) {
73 73
     return $http.get(url.projectClassify, parms);
74 74
   }
75 75
 
76 76
   // 获取历史订单
77
-  static getOrderList (parms) {
77
+  static getOrderList(parms) {
78 78
     return $http.get(url.getOrderList, parms);
79 79
   }
80 80
 
81 81
   // 获取订单详情
82
-  static getOrderInfo (parms) {
82
+  static getOrderInfo(parms) {
83 83
     return $http.get(url.getOrderInfo, parms);
84 84
   }
85 85
 
86 86
   // 获取用户列表
87
-  static getUserList (parms) {
87
+  static getUserList(parms) {
88 88
     return $http.get(url.getUserList, parms);
89 89
   }
90 90
 
@@ -94,42 +94,53 @@ export default class Home {
94 94
   // }
95 95
 
96 96
   // 获取优惠券列表
97
-  static getCouponInfo (parms) {
97
+  static getCouponInfo(parms) {
98 98
     return $http.get(url.getCouponInfo, parms);
99 99
   }
100 100
 
101 101
   // 发送优惠券接口
102
-  static sendCoupon (parms) {
102
+  static sendCoupon(parms) {
103 103
     return $http.post(url.sendCoupon, parms);
104 104
   }
105 105
 
106 106
   // 获取用户详情接口
107
-  static getPadUserInfo (parms) {
107
+  static getPadUserInfo(parms) {
108 108
     return $http.get(url.getPadUserInfo, parms);
109 109
   }
110 110
 
111 111
   // 获取优惠券订单
112
-  static getUserCoupon (parms) {
112
+  static getUserCoupon(parms) {
113 113
     return $http.get(url.getUserCoupon, parms);
114 114
   }
115 115
 
116 116
   // 获取商品订单
117
-  static getUserGoods (parms) {
117
+  static getUserGoods(parms) {
118 118
     return $http.get(url.getUserGoods, parms);
119 119
   }
120 120
 
121 121
   // 获取项目订单
122
-  static getUserProject (parms) {
122
+  static getUserProject(parms) {
123 123
     return $http.get(url.getUserProject, parms);
124 124
   }
125 125
 
126 126
   // 新增项目订单
127
-  static padOrderAdd (parms) {
127
+  static padOrderAdd(parms) {
128 128
     return $http.post(url.padOrderAdd, parms);
129 129
   }
130 130
 
131
-}
132
-
133
-
134
-
131
+  // 面部问题标签
132
+  static skinFace_tags(parms) {
133
+    return $http.get(url.skinFace_tags, parms);
134
+  }
135 135
 
136
+  // 皮肤问题标签
137
+  static skinSkin_tags(parms) {
138
+    return $http.get(url.skinSkin_tags, parms);
139
+  }
140
+  
141
+  // 新增项目订单
142
+  static schemeSave(parms) {
143
+    return $http.post(url.schemeSave, parms);
144
+  }
145
+  
146
+}

+ 9 - 0
src/server/urls.js

@@ -79,4 +79,13 @@ export default {
79 79
   // 获取优惠券订单
80 80
   padOrderAdd: '/v2/pad/order/add',
81 81
 
82
+  // 面部问题标签
83
+  skinFace_tags: '/v2/pad/skin/face_tags',
84
+
85
+  // 皮肤问题标签
86
+  skinSkin_tags: '/v2/pad/skin/skin_tags',
87
+
88
+  // 创建标签
89
+  schemeSave: '/v2/pad/scheme/save',
90
+
82 91
 }