소스 검색

fix 分发优惠券

ChengYuXuan 5 년 전
부모
커밋
6c43363163
1개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 4
      src/views/admin/CouponList.vue

+ 6 - 4
src/views/admin/CouponList.vue

@@ -116,7 +116,7 @@ export default {
   },
   mounted() {
     getCouponList().then((res) => {
-      this.couponList = res || [];
+      this.couponList = res.data || [];
     });
   },
   methods: {
@@ -133,16 +133,18 @@ export default {
       };
       const payload = {
         couponId: this.couponId,
-        deliver: this.deliverList[this.deliverList_.indexOf(this.deliver)],
+        deliver: this.deliverList_[this.deliverList.indexOf(this.deliver)],
         canDuplicate: this.canDuplicate,
-        nums: this.nums,
-        extra: JSON.stringify(extra),
+        nums: Number.parseInt(this.nums),
+        extra: extra,
       };
       console.log(payload);
       deliverCoupon(payload).then((res) => {
         console.log(res);
         if (res.code === 1) {
           this.showSuccessDialog = true;
+          this.showDeliverDialog = false;
+
           setTimeout(() => {
             this.showSuccessDialog = false;
           }, 1000);