Explorar o código

核销优惠券

yuhao %!s(int64=2) %!d(string=hai) anos
pai
achega
3279726b8c
Modificáronse 3 ficheiros con 155 adicións e 10 borrados
  1. 147 9
      src/pages/customerMan/myOrder/index.vue
  2. 4 0
      src/server/home.js
  3. 4 1
      src/server/urls.js

+ 147 - 9
src/pages/customerMan/myOrder/index.vue

@@ -252,17 +252,12 @@ type: "全额券" -->
252 252
               <el-table-column
253 253
                 prop="name"
254 254
                 label="卡卷名称"
255
-                width="200"
256 255
               ></el-table-column>
257 256
               <el-table-column
258 257
                 prop="type"
259 258
                 label="卡卷类型"
260 259
                 show-overflow-tooltip
261
-              ></el-table-column>
262
-              <el-table-column
263
-                prop="price"
264
-                label="总价格"
265
-                show-overflow-tooltip
260
+                width="100"
266 261
               ></el-table-column>
267 262
               <el-table-column
268 263
                 prop="ex_time"
@@ -276,13 +271,28 @@ type: "全额券" -->
276 271
                 width="180"
277 272
                 show-overflow-tooltip
278 273
               ></el-table-column>
279
-              <el-table-column prop="status" label="状态" show-overflow-tooltip>
274
+              <el-table-column width="100" prop="status" label="状态" show-overflow-tooltip>
280 275
                 <template slot-scope="scope">
281 276
                   <div :class="'colorA' + scope.row.status">
282 277
                     {{ couponStatus[scope.row.status] }}
283 278
                   </div>
284 279
                 </template>
285 280
               </el-table-column>
281
+              <el-table-column
282
+                prop=""
283
+                label="操作"
284
+                width="100"
285
+                show-overflow-tooltip
286
+              >
287
+                <template slot-scope="scope" v-if="scope.row.status==0">
288
+                  <div
289
+                    class="cancleCoupon"
290
+                    @click.stop="cancleCoupon(scope.row)"
291
+                  >
292
+                    操作
293
+                  </div>
294
+                </template>
295
+              </el-table-column>
286 296
             </el-table>
287 297
 
288 298
             <div class="pagin">
@@ -318,7 +328,7 @@ type: "全额券" -->
318 328
                 :key="index"
319 329
               >
320 330
                 <div class="name-text">{{ item.project_name }}</div>
321
-                <div class="change-num" v-if="cardInfo.card_type==1">
331
+                <div class="change-num" v-if="cardInfo.card_type == 1">
322 332
                   <div class="num-content">
323 333
                     <div class="content-left" @click="reduce(index)">-</div>
324 334
                     <div class="content-num">{{ item.num || 0 }}</div>
@@ -389,6 +399,30 @@ type: "全额券" -->
389 399
         </div>
390 400
       </div>
391 401
     </mine-pupop>
402
+    <!-- 操作核销优惠券 -->
403
+    <mine-pupop :show="isCancelCoupon">
404
+      <div class="CouponPop">
405
+        <div class="image">
406
+          <img
407
+            src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
408
+            alt
409
+            @click="closeCouponPop"
410
+          />
411
+        </div>
412
+        <div class="title">核销优惠券</div>
413
+        <div class="couponName">
414
+          <div class="one">优惠券名称:</div>
415
+          <div>{{ cancelCouponInfo.name }}</div>
416
+        </div>
417
+        <div class="couponRemark">
418
+          <div class="one">备注信息:</div>
419
+          <el-input v-model.trim="couponRemark"></el-input>
420
+        </div>
421
+        <div class="radio">
422
+          <button class="affirmBtn" @click="checkCoupon">确定</button>
423
+        </div>
424
+      </div>
425
+    </mine-pupop>
392 426
   </div>
393 427
 </template>
394 428
 
@@ -453,12 +487,43 @@ export default {
453 487
       isAmend: false, //修改次卡时间弹窗
454 488
       amendCardInfo: "", // 要修改次卡的信息
455 489
       cardTime: "", //次卡修改时间(年月日)
490
+      isCancelCoupon: false, //核销优惠券界面
491
+      cancelCouponInfo: "", //核销优惠券名称
492
+      couponRemark: "", //核销优惠券备注信息
456 493
     };
457 494
   },
458 495
   computed: {},
459 496
   watch: {},
460 497
 
461 498
   methods: {
499
+    // 打开核销优惠券界面
500
+    cancleCoupon(e) {
501
+      this.isCancelCoupon = true;
502
+      this.cancelCouponInfo = e;
503
+    },
504
+    // 关闭核销优惠券页面
505
+    closeCouponPop() {
506
+      this.isCancelCoupon = false;
507
+      this.couponRemark = ''
508
+    },
509
+    // 核销优惠券
510
+    checkCoupon(){
511
+      if(this.couponRemark==''){
512
+        this.$message.error('请填写备注信息')
513
+        return
514
+      }
515
+      api.checkCoupon({
516
+        id:this.cancelCouponInfo.id,
517
+        remark:this.couponRemark
518
+      }).then(res=>{
519
+        if(res.code==200){
520
+          this.$message.success('核销成功')
521
+          this.isCancelCoupon = false;
522
+          // 刷新优惠券列表
523
+          this.getUserCoupon()
524
+        }
525
+      })
526
+    },
462 527
     // 阻止修改次卡时间时键盘弹出
463 528
     forbid() {
464 529
       //禁止软键盘弹出
@@ -526,7 +591,7 @@ export default {
526 591
       this.isPore = true;
527 592
       api.cardInfo({ id: row.id }).then((res) => {
528 593
         if (res.code == 200) {
529
-          res.data.card_type = row.card_type
594
+          res.data.card_type = row.card_type;
530 595
           this.cardInfo = res.data;
531 596
         }
532 597
       });
@@ -679,6 +744,15 @@ export default {
679 744
 .order {
680 745
   height: 100%;
681 746
   width: 100%;
747
+  .cancleCoupon {
748
+    width: 50px;
749
+    height: 25px;
750
+    background: #fa7d22;
751
+    border-radius: 2px;
752
+    line-height: 25px;
753
+    text-align: center;
754
+    color: #fff;
755
+  }
682 756
   .pagin {
683 757
     padding: 20px 0;
684 758
     .el-pagination {
@@ -914,6 +988,70 @@ export default {
914 988
     }
915 989
   }
916 990
 }
991
+// 核销优惠券
992
+.CouponPop {
993
+  width: 440px;
994
+  height: 300px;
995
+  background-color: #fff;
996
+  border-radius: 12px;
997
+  padding: 15px;
998
+  .image {
999
+    height: 30px;
1000
+    width: 30px;
1001
+    img {
1002
+      width: 100%;
1003
+    }
1004
+  }
1005
+  .title {
1006
+    text-align: center;
1007
+    font-weight: 700;
1008
+    font-size: 16px;
1009
+    margin-bottom: 40px;
1010
+  }
1011
+  .couponName {
1012
+    display: flex;
1013
+    margin-bottom: 40px;
1014
+    .one {
1015
+      font-weight: 600;
1016
+      margin-right: 20px;
1017
+      width: 90px;
1018
+    }
1019
+  }
1020
+  .couponRemark {
1021
+    display: flex;
1022
+    align-items: center;
1023
+    .one {
1024
+      margin-right: 22px;
1025
+      font-weight: 600;
1026
+      width: 90px;
1027
+    }
1028
+    .el-input {
1029
+      width: 300px;
1030
+      /deep/.el-input__inner:focus {
1031
+        // el-input输入时设置边框颜色
1032
+        border: #fa7d22 1px solid;
1033
+      }
1034
+    }
1035
+  }
1036
+    .radio {
1037
+    width: 100%;
1038
+    display: flex;
1039
+    justify-content: space-evenly;
1040
+    button {
1041
+      width: 176px;
1042
+      height: 28px;
1043
+      border-radius: 14px;
1044
+      background-color: #fff;
1045
+      border: none;
1046
+      margin-top: 50px;
1047
+    }
1048
+    .affirmBtn {
1049
+      background-color: #fa7d22;
1050
+      color: #fff;
1051
+      margin-left: 15px;
1052
+    }
1053
+  }
1054
+}
917 1055
 .expir_time {
918 1056
   color: #3115cc;
919 1057
 }

+ 4 - 0
src/server/home.js

@@ -301,4 +301,8 @@ export default class Home {
301 301
   static goodsTakeOut(params) {
302 302
     return $http.post(url.goodsTakeOut, params)
303 303
   }
304
+  // 优惠券取消
305
+  static checkCoupon(params) {
306
+    return $http.post(url.checkCoupon, params)
307
+  }
304 308
 }

+ 4 - 1
src/server/urls.js

@@ -194,5 +194,8 @@ export default {
194 194
   goodsPickUp: '/v2/pad/order/pick_up',
195 195
 
196 196
   // 美妆产品取货
197
-  goodsTakeOut: '/v2/pad/order/take_out'
197
+  goodsTakeOut: '/v2/pad/order/take_out',
198
+
199
+  // 优惠券取货
200
+  checkCoupon: '/v2/pad/coupon/check'
198 201
 }