yuantianjiao 6 years ago
parent
commit
369ed121d1

+ 5
- 0
src/components/customerCard/customerCard.vue View File

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

+ 2
- 1
src/pages/sales/cardAndCouponNum/index.vue View File

6
         <div>
6
         <div>
7
           <span>{{data.CardName}}</span>
7
           <span>{{data.CardName}}</span>
8
           <span>卡券描述卡券描述卡券描述卡券描述卡券描述</span>
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
         </div>
11
         </div>
11
       </div>
12
       </div>
12
     </div>
13
     </div>

+ 1
- 0
src/pages/sales/customerSearch/index.vue View File

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

+ 5
- 2
src/pages/sales/history/index.vue View File

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

+ 49
- 30
src/pages/user/bindMobile/bindMobile.vue View File

70
 import logo from '../../../common/icon/logo.png'
70
 import logo from '../../../common/icon/logo.png'
71
 import { mapState, createNamespacedHelpers } from 'vuex'
71
 import { mapState, createNamespacedHelpers } from 'vuex'
72
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
72
 const { mapActions: actions } = createNamespacedHelpers('userCenter')
73
-let canSubmit
74
 export default {
73
 export default {
75
   data () {
74
   data () {
76
     return {
75
     return {
88
         // sales: '',
87
         // sales: '',
89
         recommendCode: '',
88
         recommendCode: '',
90
         captcha: ''
89
         captcha: ''
91
-      }
90
+      },
91
+      canSubmit: true
92
     }
92
     }
93
   },
93
   },
94
   computed: {
94
   computed: {
97
     })
97
     })
98
   },
98
   },
99
   created () {
99
   created () {
100
-    canSubmit = true
101
     this.getCaseInfo(1).then(() => {
100
     this.getCaseInfo(1).then(() => {
102
       this.columns = this.caseInfo.cases
101
       this.columns = this.caseInfo.cases
103
     })
102
     })
103
+    console.log(1123)
104
   },
104
   },
105
   methods: {
105
   methods: {
106
     ...actions(['getCaseInfo']),
106
     ...actions(['getCaseInfo']),
187
       }, 1000)
187
       }, 1000)
188
     },
188
     },
189
     submit () {
189
     submit () {
190
-      if (!canSubmit) {
190
+      if (!this.canSubmit) {
191
         return
191
         return
192
       }
192
       }
193
-      canSubmit = false
193
+      this.canSubmit = false
194
       if (!this.postData.captcha) {
194
       if (!this.postData.captcha) {
195
         this.$toast('请填写验证码')
195
         this.$toast('请填写验证码')
196
-        canSubmit = true
196
+        this.canSubmit = true
197
         return
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 View File

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

+ 2
- 1
src/pages/user/receive/index.vue View File

29
           <i class="icon-kaquan iconfont"></i>
29
           <i class="icon-kaquan iconfont"></i>
30
           <span>卡券有效期</span>
30
           <span>卡券有效期</span>
31
         </div>
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
       </div>
34
       </div>
34
       <div class="text">
35
       <div class="text">
35
         <div>
36
         <div>

+ 19
- 11
src/pages/user/rush/index.vue View File

30
         <div>{{toolClass.dateFormat(detail.StartDate)}} ~ {{toolClass.dateFormat(detail.EndDate)}}</div>
30
         <div>{{toolClass.dateFormat(detail.StartDate)}} ~ {{toolClass.dateFormat(detail.EndDate)}}</div>
31
       </div>
31
       </div>
32
     </div>
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
     <div class="submit">
34
     <div class="submit">
35
       <div :class="{light:timeStatus === 1}" @click="submit()" v-if="!used">{{btnText[timeStatus]}}</div>
35
       <div :class="{light:timeStatus === 1}" @click="submit()" v-if="!used">{{btnText[timeStatus]}}</div>
36
       <div v-else>已抢购</div>
36
       <div v-else>已抢购</div>
65
       Interval: null,
65
       Interval: null,
66
       showDialog: false,
66
       showDialog: false,
67
       used: false,
67
       used: false,
68
-      showPage: false
68
+      showPage: false,
69
+      newCustomer: false
69
     }
70
     }
70
   },
71
   },
71
   created () {
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
   computed: {
85
   computed: {
83
     ...mapRushState({
86
     ...mapRushState({
85
     })
88
     })
86
   },
89
   },
87
   methods: {
90
   methods: {
88
-    ...mapRushActions(['setRush', 'getRush']),
91
+    ...mapRushActions(['setRush', 'getRush', 'AddNewFlashBuyCustomer', 'IsNewCustomer', 'UpdateFlashBuyCustomer']),
89
     timing (startTime, endTime) {
92
     timing (startTime, endTime) {
90
       this.Interval = setInterval(() => {
93
       this.Interval = setInterval(() => {
91
         let nowTime = new Date().getTime()
94
         let nowTime = new Date().getTime()
118
       this.day = day < 10 ? '0' + day : day
121
       this.day = day < 10 ? '0' + day : day
119
     },
122
     },
120
     submit () {
123
     submit () {
124
+      if (this.newCustomer && this.detail.AttendantType !== 'no') {
125
+        this.signIn()
126
+        return
127
+      }
121
       if (this.timeStatus !== 1) {
128
       if (this.timeStatus !== 1) {
122
         return
129
         return
123
       }
130
       }
124
       this.setRush({ id: this.detail.FlashBuyId }).then(() => {
131
       this.setRush({ id: this.detail.FlashBuyId }).then(() => {
132
+        this.UpdateFlashBuyCustomer({ flashBuyId: this.$route.query.flashBuyId })
125
         this.showDialog = true
133
         this.showDialog = true
126
       })
134
       })
127
     },
135
     },

+ 3
- 3
src/pages/user/vipDetail/index.vue View File

1
 <template>
1
 <template>
2
   <div class="mainPage">
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
       <swiper-slide class="swiper-slide" v-for="(item,index) in detail" :key="index">
4
       <swiper-slide class="swiper-slide" v-for="(item,index) in detail" :key="index">
5
         <div class="vip-box">
5
         <div class="vip-box">
6
           <div class="vip-header">
6
           <div class="vip-header">
23
         </div>
23
         </div>
24
       </swiper-slide>
24
       </swiper-slide>
25
     </swiper>
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
   </div>
28
   </div>
29
 </template>
29
 </template>
30
 
30
 

+ 35
- 0
src/store/rush/index.js View File

37
           reject(err)
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 View File

286
     getRush: {
286
     getRush: {
287
       method: 'get',
287
       method: 'get',
288
       url: `${baseUrl}${wechat}/flashbuy/flash/:flashBuyId`
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
 }