yuantianjiao 6 år sedan
förälder
incheckning
369ed121d1

+ 5
- 0
src/components/customerCard/customerCard.vue Visa fil

@@ -123,8 +123,13 @@ export default {
123 123
     display: flex;
124 124
     padding: 0.15rem;
125 125
     justify-content: space-between;
126
+    align-items: center;
126 127
     span:nth-of-type(1) {
127 128
       color: #323645;
129
+      width: 2.3rem;
130
+      white-space: nowrap;
131
+      overflow: hidden;
132
+      text-overflow: ellipsis;
128 133
     }
129 134
     span:nth-of-type(2) {
130 135
       color: #909090;

+ 2
- 1
src/pages/sales/cardAndCouponNum/index.vue Visa fil

@@ -6,7 +6,8 @@
6 6
         <div>
7 7
           <span>{{data.CardName}}</span>
8 8
           <span>卡券描述卡券描述卡券描述卡券描述卡券描述</span>
9
-          <span>{{toolClass.dateFormat(data.StartDate)}} - {{toolClass.dateFormat(data.EndDate)}}</span>
9
+          <span v-if="data.ValidDays>0">领取后{{data.ValidDays}}天有效</span>
10
+          <span v-else>{{toolClass.dateFormat(data.StartDate)}} - {{toolClass.dateFormat(data.EndDate)}}</span>
10 11
         </div>
11 12
       </div>
12 13
     </div>

+ 1
- 0
src/pages/sales/customerSearch/index.vue Visa fil

@@ -123,6 +123,7 @@ export default {
123 123
           isrecommend: false,
124 124
           key: this.key,
125 125
         }).then((res) => {
126
+          this.message = null
126 127
           this.cardList = []
127 128
           if (res) {
128 129
             for (var n = 0; n < res.length; n++) {

+ 5
- 2
src/pages/sales/history/index.vue Visa fil

@@ -3,11 +3,11 @@
3 3
     <div class="top">
4 4
       <topCaseInfo :data="topCaseInfoData" :userName="userInfo.customer.RealName ? userInfo.customer.RealName : userInfo.customer.CustomerName"></topCaseInfo>
5 5
     </div>
6
-    <div class="info">
6
+    <div class="info" v-if="list.length > 0">
7 7
       <span><em>姓名</em>:{{list[0].CustomerName}}</span>
8 8
       <span><em>手机号</em>:{{list[0].Phone}}</span>
9 9
     </div>
10
-    <div class="list-content">
10
+    <div class="list-content" v-if="list.length > 0">
11 11
       <div class="list-year">备注记录</div>
12 12
       <div class="list-card" v-for="(item,index) in list" :key="index">
13 13
         <div class="point-top"></div>
@@ -16,11 +16,13 @@
16 16
         <div class="card-content">{{item.Remark}}</div>
17 17
       </div>
18 18
     </div>
19
+    <noMore v-if="list.length <= 0"></noMore>
19 20
   </div>
20 21
 </template>
21 22
 
22 23
 <script>
23 24
 import topCaseInfo from '../../../components/topCaseInfo/index'
25
+import noMore from '../../../components/noMore/noMore'
24 26
 import { mapState, createNamespacedHelpers } from 'vuex'
25 27
 const { mapActions: actions } = createNamespacedHelpers('app')
26 28
 const { mapState: mapRemarkState, mapActions: mapRemarkActions } = createNamespacedHelpers('remark')
@@ -37,6 +39,7 @@ export default {
37 39
   },
38 40
   components: {
39 41
     topCaseInfo,
42
+    noMore
40 43
   },
41 44
   computed: {
42 45
     ...mapState({

+ 49
- 30
src/pages/user/bindMobile/bindMobile.vue Visa fil

@@ -70,7 +70,6 @@
70 70
 import logo from '../../../common/icon/logo.png'
71 71
 import { mapState, createNamespacedHelpers } from 'vuex'
72 72
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
73
-let canSubmit
74 73
 export default {
75 74
   data () {
76 75
     return {
@@ -88,7 +87,8 @@ export default {
88 87
         // sales: '',
89 88
         recommendCode: '',
90 89
         captcha: ''
91
-      }
90
+      },
91
+      canSubmit: true
92 92
     }
93 93
   },
94 94
   computed: {
@@ -97,10 +97,10 @@ export default {
97 97
     })
98 98
   },
99 99
   created () {
100
-    canSubmit = true
101 100
     this.getCaseInfo(1).then(() => {
102 101
       this.columns = this.caseInfo.cases
103 102
     })
103
+    console.log(1123)
104 104
   },
105 105
   methods: {
106 106
     ...actions(['getCaseInfo']),
@@ -187,39 +187,58 @@ export default {
187 187
       }, 1000)
188 188
     },
189 189
     submit () {
190
-      if (!canSubmit) {
190
+      if (!this.canSubmit) {
191 191
         return
192 192
       }
193
-      canSubmit = false
193
+      this.canSubmit = false
194 194
       if (!this.postData.captcha) {
195 195
         this.$toast('请填写验证码')
196
-        canSubmit = true
196
+        this.canSubmit = true
197 197
         return
198 198
       }
199
-      // if (!this.postData.case) {
200
-      //   this.$toast('请选择案场')
201
-      //   return
202
-      // }
203
-      // if (!this.postData.sales) {
204
-      //   this.$toast('请选择销售')
205
-      //   return
206
-      // }
207
-      this.submitData(this.postData).then((res) => {
208
-        if (this.$route.query.isLottery) {
209
-          setTimeout(() => {
210
-            const from = this.$route.query.luckshare ? `#/from/${this.$route.query.luckshare}` : ''
211
-            window.location.href = `${window.location.origin}/game/luckdraw/${from}`
212
-          }, 2000)
213
-        } else {
214
-          setTimeout(() => {
215
-            // this.$router.push({name: 'userCenter'})
216
-            window.history.go(-1)
217
-          }, 2000)
218
-        }
219
-      }).catch(() => {
220
-        console.log(111)
221
-        canSubmit = true
222
-      })
199
+      if (this.postData.recommendCode) {
200
+        this.recommendCode({ recommendCode: this.postData.recommendCode }).then((res) => {
201
+          if (res) {
202
+            this.submitData(this.postData).then((res) => {
203
+              if (this.$route.query.isLottery) {
204
+                setTimeout(() => {
205
+                  const from = this.$route.query.luckshare ? `#/from/${this.$route.query.luckshare}?lotteryId=${this.$route.query.lotteryId}&isnew=1` : `?lotteryId=${this.$route.query.lotteryId}&isnew=1`
206
+                  window.location.href = `${window.location.origin}/game/luckdraw/${from}`
207
+                }, 2000)
208
+              } else {
209
+                setTimeout(() => {
210
+                  // this.$router.push({name: 'userCenter'})
211
+                  window.history.go(-1)
212
+                }, 2000)
213
+              }
214
+            }).catch(() => {
215
+              console.log(111)
216
+              this.canSubmit = true
217
+            })
218
+          } else {
219
+            this.$toast('推荐码不正确,请与案场人员核对')
220
+            this.canSubmit = true
221
+            return
222
+          }
223
+        })
224
+      } else {
225
+        this.submitData(this.postData).then((res) => {
226
+          if (this.$route.query.isLottery) {
227
+            setTimeout(() => {
228
+              const from = this.$route.query.luckshare ? `#/from/${this.$route.query.luckshare}?lotteryId=${this.$route.query.lotteryId}&isnew=1` : `?lotteryId=${this.$route.query.lotteryId}&isnew=1`
229
+              window.location.href = `${window.location.origin}/game/luckdraw/${from}`
230
+            }, 2000)
231
+          } else {
232
+            setTimeout(() => {
233
+              // this.$router.push({name: 'userCenter'})
234
+              window.history.go(-1)
235
+            }, 2000)
236
+          }
237
+        }).catch(() => {
238
+          console.log(111)
239
+          this.canSubmit = true
240
+        })
241
+      }
223 242
     }
224 243
   }
225 244
 }

+ 3
- 1
src/pages/user/mainPage/coffeeIndex/index.vue Visa fil

@@ -399,8 +399,9 @@ export default {
399 399
       }
400 400
     },
401 401
     returnInvalid (item, type) {
402
+      console.log(item)
402 403
       if (item.ValidDays && item.ValidDays > 0) {
403
-        return true
404
+        return false
404 405
       }
405 406
       for (var n = 0; n < this.forbidList.length; n++) {
406 407
         if (this.forbidList[n].UserId === this.userInfo.customer.CustomerId && this.forbidList[n].ForbidType === type) {
@@ -573,6 +574,7 @@ export default {
573 574
           this.getCustomerList({
574 575
             ...this.postCustomerData
575 576
           }).then((res) => {
577
+            this.message = null
576 578
             this.data[3].list = []
577 579
             if (res) {
578 580
               for (var n = 0; n < res.length; n++) {

+ 2
- 1
src/pages/user/receive/index.vue Visa fil

@@ -29,7 +29,8 @@
29 29
           <i class="icon-kaquan iconfont"></i>
30 30
           <span>卡券有效期</span>
31 31
         </div>
32
-        <pre>有效期至{{toolClass.dateFormat(data.EndDate,'yyyy-MM-dd')}},请在有效期结束前使用, 过期作废;</pre>
32
+        <pre v-if="data.ValidDays>0">领取后{{data.ValidDays}}天有效,请在有效期结束前使用, 过期作废;</pre>
33
+        <pre v-else>有效期至{{toolClass.dateFormat(data.EndDate,'yyyy-MM-dd')}},请在有效期结束前使用, 过期作废;</pre>
33 34
       </div>
34 35
       <div class="text">
35 36
         <div>

+ 19
- 11
src/pages/user/rush/index.vue Visa fil

@@ -30,7 +30,7 @@
30 30
         <div>{{toolClass.dateFormat(detail.StartDate)}} ~ {{toolClass.dateFormat(detail.EndDate)}}</div>
31 31
       </div>
32 32
     </div>
33
-    <div class="sign-in" v-if="timeStatus !== 1 && !used" @click="signIn">立即注册</div>
33
+    <div class="sign-in" v-if="timeStatus !== 2 && newCustomer && detail.AttendantType === 'no'" @click="signIn">立即注册</div>
34 34
     <div class="submit">
35 35
       <div :class="{light:timeStatus === 1}" @click="submit()" v-if="!used">{{btnText[timeStatus]}}</div>
36 36
       <div v-else>已抢购</div>
@@ -65,19 +65,22 @@ export default {
65 65
       Interval: null,
66 66
       showDialog: false,
67 67
       used: false,
68
-      showPage: false
68
+      showPage: false,
69
+      newCustomer: false
69 70
     }
70 71
   },
71 72
   created () {
72
-    this.getRush({ flashBuyId: this.$route.query.flashBuyId }).then((res) => {
73
-      if (res.userInfo) {
74
-        this.used = true
75
-      }
76
-      let start = new Date(this.detail.StartDate).getTime()
77
-      let end = new Date(this.detail.EndDate).getTime()
78
-      this.timing(start, end)
73
+    this.AddNewFlashBuyCustomer({ flashBuyId: this.$route.query.flashBuyId }).then(() => {
74
+      this.getRush({ flashBuyId: this.$route.query.flashBuyId }).then((res) => {
75
+        if (res.userInfo) {
76
+          this.used = true
77
+          this.newCustomer = res
78
+        }
79
+        let start = new Date(this.detail.StartDate).getTime()
80
+        let end = new Date(this.detail.EndDate).getTime()
81
+        this.timing(start, end)
82
+      })
79 83
     })
80
-
81 84
   },
82 85
   computed: {
83 86
     ...mapRushState({
@@ -85,7 +88,7 @@ export default {
85 88
     })
86 89
   },
87 90
   methods: {
88
-    ...mapRushActions(['setRush', 'getRush']),
91
+    ...mapRushActions(['setRush', 'getRush', 'AddNewFlashBuyCustomer', 'IsNewCustomer', 'UpdateFlashBuyCustomer']),
89 92
     timing (startTime, endTime) {
90 93
       this.Interval = setInterval(() => {
91 94
         let nowTime = new Date().getTime()
@@ -118,10 +121,15 @@ export default {
118 121
       this.day = day < 10 ? '0' + day : day
119 122
     },
120 123
     submit () {
124
+      if (this.newCustomer && this.detail.AttendantType !== 'no') {
125
+        this.signIn()
126
+        return
127
+      }
121 128
       if (this.timeStatus !== 1) {
122 129
         return
123 130
       }
124 131
       this.setRush({ id: this.detail.FlashBuyId }).then(() => {
132
+        this.UpdateFlashBuyCustomer({ flashBuyId: this.$route.query.flashBuyId })
125 133
         this.showDialog = true
126 134
       })
127 135
     },

+ 3
- 3
src/pages/user/vipDetail/index.vue Visa fil

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <div class="mainPage">
3
-    <swiper :options="swiperOption" ref="mySwiper" class="inner" v-if="detail">
3
+    <swiper :options="swiperOption" ref="mySwiper" class="inner" v-if="detail.length > 0">
4 4
       <swiper-slide class="swiper-slide" v-for="(item,index) in detail" :key="index">
5 5
         <div class="vip-box">
6 6
           <div class="vip-header">
@@ -23,8 +23,8 @@
23 23
         </div>
24 24
       </swiper-slide>
25 25
     </swiper>
26
-    <div class="swiper-pagination" v-if="detail"></div>
27
-    <noMore v-if='!detail'></noMore>
26
+    <div class="swiper-pagination" v-if="detail.length > 0"></div>
27
+    <noMore v-if='detail.length <= 0'></noMore>
28 28
   </div>
29 29
 </template>
30 30
 

+ 35
- 0
src/store/rush/index.js Visa fil

@@ -37,6 +37,41 @@ export default {
37 37
           reject(err)
38 38
         })
39 39
       })
40
+    },
41
+    IsNewCustomer (context) {
42
+      return new Promise((resolve, reject) => {
43
+        Ajax({
44
+          ...api.rush.IsNewCustomer
45
+        }).then(res => {
46
+          resolve(res)
47
+        }).catch((err) => {
48
+          reject(err)
49
+        })
50
+      })
51
+    },
52
+    AddNewFlashBuyCustomer (context, data) {
53
+      return new Promise((resolve, reject) => {
54
+        Ajax({
55
+          ...api.rush.AddNewFlashBuyCustomer,
56
+          urlData: { ...data }
57
+        }).then(res => {
58
+          resolve(res)
59
+        }).catch((err) => {
60
+          reject(err)
61
+        })
62
+      })
63
+    },
64
+    UpdateFlashBuyCustomer (context, data) {
65
+      return new Promise((resolve, reject) => {
66
+        Ajax({
67
+          ...api.rush.UpdateFlashBuyCustomer,
68
+          urlData: { ...data }
69
+        }).then(res => {
70
+          resolve(res)
71
+        }).catch((err) => {
72
+          reject(err)
73
+        })
74
+      })
40 75
     }
41 76
   }
42 77
 }

+ 12
- 0
src/util/api.js Visa fil

@@ -286,6 +286,18 @@ const $api = {
286 286
     getRush: {
287 287
       method: 'get',
288 288
       url: `${baseUrl}${wechat}/flashbuy/flash/:flashBuyId`
289
+    },
290
+    IsNewCustomer: { // 是否为新用户
291
+      method: 'get',
292
+      url: `${baseUrl}${wechat}/flashbuy/newcustomer`
293
+    },
294
+    AddNewFlashBuyCustomer: { 
295
+      method: 'post',
296
+      url: `${baseUrl}${wechat}/flashbuy/customer/:flashBuyId`
297
+    },
298
+    UpdateFlashBuyCustomer: { 
299
+      method: 'put',
300
+      url: `${baseUrl}${wechat}/flashbuy/customer/:flashBuyId`
289 301
     }
290 302
   }
291 303
 }