zhengjinyi 2 rokov pred
rodič
commit
af616d4665
1 zmenil súbory, kde vykonal 19 pridanie a 7 odobranie
  1. 19 7
      src/views/member/coupon/edit.vue

+ 19 - 7
src/views/member/coupon/edit.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="app-container">
+  <div ref="scrollDiv" class="app-container">
     <div v-if="editType === 'add'" class="filter-container">
       <div class="filter-control">
         <span style="color: red;">在本页面,对每三个月给超级会员自动发放的优惠券进行配置,配置完成后下一阶段才生效(最少配置1个,最多5个)。</span>
@@ -369,15 +369,27 @@ export default {
     },
     handleDelete(item, index) {
       // 删除单挑优惠券
-      if (this.delFlag) {
-        this.delCoupon(item.id, index)
-      } else {
-        this.form.formList.splice(index, 1)
-      }
+      this.$confirm('确定删除此优惠券吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        if (this.delFlag) {
+          this.delCoupon(item.id, index)
+        } else {
+          this.form.formList.splice(index, 1)
+        }
+      })
     },
     async delCoupon(id, index) {
       // 保存超级会员优惠券
-      await delCoupon(id)
+      if (id) {
+        try {
+          await delCoupon(id)
+        } catch (error) {
+          console.log(error)
+        }
+      }
       this.form.formList.splice(index, 1)
     },
     handleOnInputBlur(formItem) {