|
@@ -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 !== 2 && newCustomer && detail.AttendantType === 'no'" @click="signIn">立即注册</div>
|
|
33
|
+ <div class="sign-in" v-if="timeStatus !== 2 && detail.AttendantType === 'no' && !used" @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>
|
|
@@ -51,6 +51,7 @@ import logo from '../../../common/icon/qrCode.jpg'
|
51
|
51
|
import { mapState, createNamespacedHelpers } from 'vuex'
|
52
|
52
|
const { mapActions: actions } = createNamespacedHelpers('app')
|
53
|
53
|
const { mapState: mapRushState, mapActions: mapRushActions } = createNamespacedHelpers('rush')
|
|
54
|
+const { mapState: mapUserState } = createNamespacedHelpers('userCenter')
|
54
|
55
|
export default {
|
55
|
56
|
data () {
|
56
|
57
|
return {
|
|
@@ -70,10 +71,12 @@ export default {
|
70
|
71
|
}
|
71
|
72
|
},
|
72
|
73
|
created () {
|
|
74
|
+ console.log(1)
|
|
75
|
+ console.log(this.userInfo)
|
73
|
76
|
this.AddNewFlashBuyCustomer({ flashBuyId: this.$route.query.flashBuyId }).then(() => {
|
74
|
77
|
this.getRush({ flashBuyId: this.$route.query.flashBuyId }).then((res) => {
|
75
|
|
- this.used = res.IsAttend
|
76
|
|
- this.newCustomer = res.IsNew ? true : false
|
|
78
|
+ this.used = res.flashCustomer.IsAttend === 1 ? false : true
|
|
79
|
+ this.newCustomer = res.flashCustomer.IsNew === 1 ? true : false
|
77
|
80
|
let start = new Date(this.detail.StartDate).getTime()
|
78
|
81
|
let end = new Date(this.detail.EndDate).getTime()
|
79
|
82
|
this.timing(start, end)
|
|
@@ -83,6 +86,9 @@ export default {
|
83
|
86
|
computed: {
|
84
|
87
|
...mapRushState({
|
85
|
88
|
detail: item => item.rushDetail
|
|
89
|
+ }),
|
|
90
|
+ ...mapUserState({
|
|
91
|
+ userInfo: x => x.userInfo
|
86
|
92
|
})
|
87
|
93
|
},
|
88
|
94
|
methods: {
|
|
@@ -119,15 +125,21 @@ export default {
|
119
|
125
|
this.day = day < 10 ? '0' + day : day
|
120
|
126
|
},
|
121
|
127
|
submit () {
|
122
|
|
- if (this.newCustomer && this.detail.AttendantType !== 'no') {
|
|
128
|
+ if (this.timeStatus !== 1) {
|
|
129
|
+ this.$toast('活动未开始,敬请期待')
|
|
130
|
+ return
|
|
131
|
+ }
|
|
132
|
+ if (this.newCustomer && !this.userInfo.customer.Phone) {
|
123
|
133
|
this.signIn()
|
124
|
134
|
return
|
125
|
135
|
}
|
126
|
|
- if (this.timeStatus !== 1) {
|
|
136
|
+ if (!this.newCustomer && this.detail.AttendantType !== 'no') {
|
|
137
|
+ this.$toast('此活动仅限新用户参与')
|
127
|
138
|
return
|
128
|
139
|
}
|
129
|
140
|
this.setRush({ id: this.detail.FlashBuyId }).then(() => {
|
130
|
141
|
this.UpdateFlashBuyCustomer({ flashBuyId: this.$route.query.flashBuyId })
|
|
142
|
+ this.used = true
|
131
|
143
|
this.showDialog = true
|
132
|
144
|
})
|
133
|
145
|
},
|