Browse Source

发送优惠券备注信息

yuhao 1 year ago
parent
commit
fda0ac190e
1 changed files with 103 additions and 50 deletions
  1. 103 50
      src/pages/coupon/index.vue

+ 103 - 50
src/pages/coupon/index.vue

@@ -10,19 +10,8 @@
10 10
       ></el-input>
11 11
       <div class="search-button" @click="getUserList">搜索</div>
12 12
       <div class="coupon">选择优惠券</div>
13
-      <el-select
14
-        class="coupon-select"
15
-        v-model="coupon"
16
-        size="mini"
17
-        filterable
18
-        placeholder="选择优惠券"
19
-      >
20
-        <el-option
21
-          v-for="item in couponList"
22
-          :key="item.id"
23
-          :label="item.name"
24
-          :value="item.id"
25
-        ></el-option>
13
+      <el-select class="coupon-select" v-model="coupon" size="mini" filterable placeholder="选择优惠券">
14
+        <el-option v-for="item in couponList" :key="item.id" :label="item.name" :value="item.id"></el-option>
26 15
       </el-select>
27 16
       <div class="num-tips">数量</div>
28 17
       <div class="coupon-num">
@@ -30,9 +19,7 @@
30 19
         <div class="num">{{ couponNum }}</div>
31 20
         <div class="add" @click="couponNum++">+</div>
32 21
       </div>
33
-      <div class="send-coupon" style="margin-left: 39px" @click="sendCoupon">
34
-        发送
35
-      </div>
22
+      <div class="send-coupon" style="margin-left: 39px" @click="sendCoupon">发送</div>
36 23
     </div>
37 24
     <div class="user-list">
38 25
       <el-table
@@ -52,26 +39,10 @@
52 39
             </div>
53 40
           </template>
54 41
         </el-table-column>
55
-        <el-table-column
56
-          prop="id"
57
-          label="用户ID"
58
-          width="120"
59
-        ></el-table-column>
60
-        <el-table-column
61
-          prop="nickname"
62
-          label="昵称"
63
-          width="120"
64
-        ></el-table-column>
65
-        <el-table-column
66
-          prop="mobile"
67
-          label="联系电话"
68
-          show-overflow-tooltip
69
-        ></el-table-column>
70
-        <el-table-column
71
-          prop="create_time"
72
-          label="注册时间"
73
-          show-overflow-tooltip
74
-        ></el-table-column>
42
+        <el-table-column prop="id" label="用户ID" width="120"></el-table-column>
43
+        <el-table-column prop="nickname" label="昵称" width="120"></el-table-column>
44
+        <el-table-column prop="mobile" label="联系电话" show-overflow-tooltip></el-table-column>
45
+        <el-table-column prop="create_time" label="注册时间" show-overflow-tooltip></el-table-column>
75 46
       </el-table>
76 47
 
77 48
       <div class="pagin">
@@ -85,14 +56,33 @@
85 56
         ></el-pagination>
86 57
       </div>
87 58
     </div>
59
+    <!-- 发送优惠券 -->
60
+    <minePop :show="isCouponPop">
61
+      <div class="CouponPop">
62
+        <div class="image" @click="isCouponPop=false">
63
+          <img
64
+            src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
65
+            alt
66
+          />
67
+        </div>
68
+        <div class="title">发送优惠券</div>
69
+        <div class="couponRemark">
70
+          <div class="one">备注信息:</div>
71
+          <el-input v-model.trim="couponRemark"></el-input>
72
+        </div>
73
+        <div class="radio">
74
+          <button class="affirmBtn" @click="checkCoupon">确定</button>
75
+        </div>
76
+      </div>
77
+    </minePop>
88 78
   </div>
89 79
 </template>
90 80
 
91 81
 <script>
92 82
 import api from "../../server/home";
93
-
83
+import minePop from "../../components/minePupop/index.vue";
94 84
 export default {
95
-  components: {},
85
+  components: { minePop },
96 86
   data() {
97 87
     return {
98 88
       searckItem: "",
@@ -104,6 +94,8 @@ export default {
104 94
       currentPage1: 1,
105 95
       total: 0,
106 96
       limit: 10,
97
+      isCouponPop: false, //发送优惠券开关
98
+      couponRemark: "" //发送优惠券备注信息
107 99
     };
108 100
   },
109 101
   computed: {},
@@ -115,8 +107,8 @@ export default {
115 107
       this.$router.push({
116 108
         path: "/customerMan/details",
117 109
         query: {
118
-          id: row.id,
119
-        },
110
+          id: row.id
111
+        }
120 112
       });
121 113
     },
122 114
     reduceNum() {
@@ -127,6 +119,10 @@ export default {
127 119
     },
128 120
     // 发送优惠券
129 121
     sendCoupon() {
122
+      this.isCouponPop = true;
123
+    },
124
+    // 确认发送优惠券
125
+    checkCoupon() {
130 126
       let selectIds = "";
131 127
       for (let i = 0; i < this.multipleSelection.length; i++) {
132 128
         selectIds = selectIds + "," + this.multipleSelection[i].id;
@@ -135,28 +131,29 @@ export default {
135 131
         id: this.coupon,
136 132
         user_ids: selectIds.substring(1, selectIds.length),
137 133
         num: this.couponNum,
134
+        remark:this.couponRemark
138 135
       };
139
-      api.sendCoupon(params).then((res) => {
136
+      api.sendCoupon(params).then(res => {
140 137
         if (res.code == 200) {
138
+          this.isCouponPop = false
141 139
           this.$message({
142 140
             message: "发送成功",
143
-            type: "success",
141
+            type: "success"
144 142
           });
145 143
         }
146 144
       });
147 145
     },
148
-
149 146
     // 获取订单列表
150 147
     getUserList() {
151 148
       let params = {
152 149
         page: this.currentPage1,
153 150
         limit: this.limit,
154
-        keywords: this.searckItem,
151
+        keywords: this.searckItem
155 152
       };
156
-      api.getUserList(params).then((res) => {
153
+      api.getUserList(params).then(res => {
157 154
         if (res.code == 200) {
158 155
           // 将用户手机号中间四位变成****
159
-          res.data.list.map((item) => {
156
+          res.data.list.map(item => {
160 157
             item.mobile =
161 158
               item.mobile.substring(0, 3) + "****" + item.mobile.substring(7);
162 159
           });
@@ -170,9 +167,9 @@ export default {
170 167
     getCouponInfo() {
171 168
       let params = {
172 169
         page: this.currentPage1,
173
-        limit: 100,
170
+        limit: 100
174 171
       };
175
-      api.getCouponInfo(params).then((res) => {
172
+      api.getCouponInfo(params).then(res => {
176 173
         if (res.code == 200) {
177 174
           this.couponList = res.data.list;
178 175
         }
@@ -184,7 +181,7 @@ export default {
184 181
       this.getUserList();
185 182
     },
186 183
 
187
-    handleSizeChange(val) {},
184
+    handleSizeChange(val) {}
188 185
   },
189 186
 
190 187
   created() {
@@ -192,7 +189,7 @@ export default {
192 189
     this.getCouponInfo();
193 190
   },
194 191
 
195
-  mounted() {},
192
+  mounted() {}
196 193
 };
197 194
 </script>
198 195
 
@@ -290,5 +287,61 @@ export default {
290 287
       border-bottom: none;
291 288
     }
292 289
   }
290
+  // 发送优惠券弹窗
291
+  // 核销优惠券
292
+  .CouponPop {
293
+    width: 440px;
294
+    height: 230px;
295
+    background-color: #fff;
296
+    border-radius: 12px;
297
+    padding: 15px;
298
+    .image {
299
+      height: 30px;
300
+      width: 30px;
301
+      img {
302
+        width: 100%;
303
+      }
304
+    }
305
+    .title {
306
+      text-align: center;
307
+      font-weight: 700;
308
+      font-size: 16px;
309
+      margin-bottom: 30px;
310
+    }
311
+    .couponRemark {
312
+      display: flex;
313
+      align-items: center;
314
+      .one {
315
+        margin-right: 22px;
316
+        font-weight: 600;
317
+        width: 90px;
318
+      }
319
+      .el-input {
320
+        width: 300px;
321
+        /deep/.el-input__inner:focus {
322
+          // el-input输入时设置边框颜色
323
+          border: #fa7d22 1px solid;
324
+        }
325
+      }
326
+    }
327
+    .radio {
328
+      width: 100%;
329
+      display: flex;
330
+      justify-content: space-evenly;
331
+      button {
332
+        width: 176px;
333
+        height: 28px;
334
+        border-radius: 14px;
335
+        background-color: #fff;
336
+        border: none;
337
+        margin-top: 50px;
338
+      }
339
+      .affirmBtn {
340
+        background-color: #fa7d22;
341
+        color: #fff;
342
+        margin-left: 15px;
343
+      }
344
+    }
345
+  }
293 346
 }
294 347
 </style>