|
@@ -1,20 +1,20 @@
|
1
|
1
|
<template>
|
2
|
|
- <div class="pageContent">
|
|
2
|
+ <div class="pageContent" v-if="showPage">
|
3
|
3
|
<div class="mainPage">
|
4
|
4
|
<div class="top">
|
5
|
5
|
<img :src="topImg">
|
6
|
6
|
<div class="top-div" v-if="status<4">
|
7
|
|
- <div class="countdown" :class="{'on':status ===1,'off':status===2}" v-html="countdown()"></div>
|
|
7
|
+ <div class="countdown" :class="{'on':status < 3,'off':status == 3}" v-html="countdown"></div>
|
8
|
8
|
<div class="userInfo">
|
9
|
9
|
<div class="avatars">
|
10
|
|
- <img class="cover" src>
|
|
10
|
+ <img class="cover" :src="userInfo.HeadImg">
|
11
|
11
|
</div>
|
12
|
12
|
<div class="info">
|
13
|
|
- <p> 匿名</p>
|
|
13
|
+ <p> {{userInfo.Name}}</p>
|
14
|
14
|
<p>
|
15
|
15
|
已有
|
16
|
|
- <span class="marked">0</span> 位好友帮TA砍价了,共砍掉
|
17
|
|
- <span class="marked">¥0</span> 元
|
|
16
|
+ <span class="marked">{{list.length}}</span> 位好友帮TA砍价了,共砍掉
|
|
17
|
+ <span class="marked">¥{{list.length*29.6}}</span> 元
|
18
|
18
|
</p>
|
19
|
19
|
</div>
|
20
|
20
|
</div>
|
|
@@ -33,12 +33,12 @@
|
33
|
33
|
<div class="active" v-if="status<4">
|
34
|
34
|
<h2>悦见山全家福拍摄助力砍价活动</h2>
|
35
|
35
|
<div class="price">
|
36
|
|
- <span class="price">砍后价:¥260</span>
|
|
36
|
+ <span :class="{'off':status == 3}">砍后价:¥{{888-list.length*29.6}}</span>
|
37
|
37
|
<span>最多砍至0元</span>
|
38
|
38
|
</div>
|
39
|
39
|
<div class="desc">
|
40
|
40
|
<span>原价2888元, 悦见山亲情价¥888</span>
|
41
|
|
- <span>仅剩0个名额</span>
|
|
41
|
+ <span>仅剩{{game.note.LeftNum}}个名额</span>
|
42
|
42
|
</div>
|
43
|
43
|
</div>
|
44
|
44
|
<div class="list">
|
|
@@ -61,7 +61,8 @@
|
61
|
61
|
</div>
|
62
|
62
|
</div>
|
63
|
63
|
</div>
|
64
|
|
- <div class="dailog" v-if="showDailog" @click="showDailog = false">
|
|
64
|
+ <!-- <div class="dailog" v-if="showDailog" @click="showDailog = false"> -->
|
|
65
|
+ <div class="dailog" v-if="showDailog">
|
65
|
66
|
<div class="dailog-box" @click.stop="1+1">
|
66
|
67
|
<img :src="popBg">
|
67
|
68
|
<div class="log1">
|
|
@@ -70,31 +71,31 @@
|
70
|
71
|
29.6
|
71
|
72
|
<span>元</span>
|
72
|
73
|
</div>
|
73
|
|
- <div>
|
|
74
|
+ <div @click="toLuckDraw()">
|
74
|
75
|
您有一份福利待领取!去领取
|
75
|
76
|
<i class="iconfont icon-you"></i>
|
76
|
77
|
</div>
|
77
|
78
|
<img class="present" :src="presentClose">
|
78
|
|
- <img class="btn" :src="btn">
|
|
79
|
+ <img class="btn" :src="btn" @click="$router.push({name:'supportMain'})">
|
79
|
80
|
</div>
|
80
|
81
|
</div>
|
81
|
82
|
</div>
|
82
|
|
- <div class="other-end" v-if="status === 5">
|
|
83
|
+ <div class="other-end" v-if="status == 5">
|
83
|
84
|
<div class="box">
|
84
|
85
|
<p>您的好友已砍价至0元,</p>
|
85
|
86
|
<p>获得免费拍照机会!</p>
|
86
|
|
- <div>我也要报名</div>
|
|
87
|
+ <div @click="$router.push({name:'supportMain'})">我也要报名</div>
|
87
|
88
|
</div>
|
88
|
89
|
</div>
|
89
|
|
- <div class="today-end" v-if="status === 6">
|
|
90
|
+ <div class="today-end" v-if="status == 6">
|
90
|
91
|
<div class="box">
|
91
|
92
|
<img :src="kulian">
|
92
|
93
|
<p>今日的主力活动已结束,</p>
|
93
|
94
|
<p>明天再来吧!</p>
|
94
|
95
|
</div>
|
95
|
96
|
</div>
|
96
|
|
- <div class="bottom">
|
97
|
|
- <div :class="{'on':status === 1,'off':status !== 1}">{{btnText}}</div>
|
|
97
|
+ <div class="bottom" v-if="status < 4">
|
|
98
|
+ <div :class="{'on':status < 3,'off':status == 3}" @click="support()">{{btnText}}</div>
|
98
|
99
|
</div>
|
99
|
100
|
</div>
|
100
|
101
|
</template>
|
|
@@ -106,8 +107,10 @@ import popBg from '@/assets/pop-bg.png'
|
106
|
107
|
import presentClose from '@/assets/presentClose.png'
|
107
|
108
|
import btn from '@/assets/btn.png'
|
108
|
109
|
import kulian from '@/assets/kulian.png'
|
|
110
|
+import wxsdk from '@/util/share'
|
109
|
111
|
import { createNamespacedHelpers } from 'vuex'
|
110
|
112
|
const { mapState: mapIndexState, mapActions: mapIndexActions } = createNamespacedHelpers('main')
|
|
113
|
+// const wx = require('weixin-js-sdk')
|
111
|
114
|
export default {
|
112
|
115
|
data () {
|
113
|
116
|
return {
|
|
@@ -117,29 +120,110 @@ export default {
|
117
|
120
|
presentClose,
|
118
|
121
|
btn,
|
119
|
122
|
kulian,
|
120
|
|
- status: 4,
|
|
123
|
+ status: 1,
|
121
|
124
|
btnText: '邀请好友助力',
|
122
|
125
|
showDailog: false,
|
123
|
|
- list: [1, 1, 1, 1, 1, 2]
|
|
126
|
+ showPage: false,
|
|
127
|
+ seconds: 0,
|
|
128
|
+ time: 0
|
124
|
129
|
}
|
125
|
130
|
},
|
126
|
131
|
computed: {
|
127
|
132
|
...mapIndexState({
|
128
|
|
- userInfo: item => item.userInfo
|
|
133
|
+ userInfo: item => item.userInfo,
|
|
134
|
+ game: item => item.game,
|
|
135
|
+ recordInfo: item => item.recordInfo,
|
|
136
|
+ list: item => item.supports
|
|
137
|
+ }),
|
|
138
|
+ countdown () {
|
|
139
|
+ if (this.status != 3 && this.time >= 0) {
|
|
140
|
+ let hour = 23 - new Date().getHours()
|
|
141
|
+ let minutes = 59 - new Date().getMinutes()
|
|
142
|
+ let seconds = 59 - new Date().getSeconds()
|
|
143
|
+ return `<span style='color:#fff;'>砍价倒计时</span>
|
|
144
|
+ <span style='padding: 0 0.03rem;background: #5e5e5e;color: #fff;border-radius:4px;'>${hour > 9 ? hour : '0' + hour}</span>
|
|
145
|
+ <span style='color:#fff;'>:</span>
|
|
146
|
+ <span style='padding: 0 0.03rem;background: #5e5e5e;color: #fff;border-radius:4px;'>${minutes > 9 ? minutes : '0' + minutes}</span>
|
|
147
|
+ <span style='color:#fff;'>:</span>
|
|
148
|
+ <span style='padding: 0 0.03rem;background: rgba(255, 66, 28, 1);color: #fff;border-radius:4px;'>${seconds > 9 ? seconds : '0' + seconds}</span>`
|
|
149
|
+ } else {
|
|
150
|
+ let hour = '00'
|
|
151
|
+ let minutes = '00'
|
|
152
|
+ let seconds = '00'
|
|
153
|
+ return `<span style='color:#fff;'>活动已结束</span>
|
|
154
|
+ <span style='padding: 0 0.03rem;background: #5e5e5e;color: #fff;border-radius:4px;'>${hour}</span>
|
|
155
|
+ <span style='color:#fff;'>:</span>
|
|
156
|
+ <span style='padding: 0 0.03rem;background: #5e5e5e;color: #fff;border-radius:4px;'>${minutes}</span>
|
|
157
|
+ <span style='color:#fff;'>:</span>
|
|
158
|
+ <span style='padding: 0 0.03rem;background: rgba(255, 66, 28, 1);color: #fff;border-radius:4px;'>${seconds}</span>`
|
|
159
|
+ }
|
|
160
|
+ }
|
|
161
|
+ },
|
|
162
|
+ created () {
|
|
163
|
+ this.getGame().then(() => {
|
|
164
|
+ if (!this.$route.query.recordid) {
|
|
165
|
+ this.getRecord(this.game.record.RecordId).then(() => {
|
|
166
|
+ this.checkStatus()
|
|
167
|
+ // this.share(this.game.record.RecordId)
|
|
168
|
+ })
|
|
169
|
+ } else {
|
|
170
|
+ this.getRecord(this.game.record.RecordId).then(() => {
|
|
171
|
+ // this.share(this.$route.query.recordid)
|
|
172
|
+ this.checkStatus()
|
|
173
|
+ })
|
|
174
|
+ }
|
129
|
175
|
})
|
|
176
|
+ setInterval(() => {
|
|
177
|
+ this.time = new Date().getSeconds()
|
|
178
|
+ }, 1000)
|
130
|
179
|
},
|
131
|
180
|
methods: {
|
132
|
|
- ...mapIndexActions(['setUserInfo']),
|
133
|
|
- countdown () {
|
134
|
|
- let hour = 20
|
135
|
|
- let minutes = 40
|
136
|
|
- let seconds = 30
|
137
|
|
- return `<span style='color:#fff;'>砍价倒计时</span>
|
138
|
|
- <span style='padding: 0 0.03rem;background: #5e5e5e;color: #fff;border-radius:4px;'>${hour}</span>
|
139
|
|
- <span style='color:#fff;'>:</span>
|
140
|
|
- <span style='padding: 0 0.03rem;background: #5e5e5e;color: #fff;border-radius:4px;'>${minutes}</span>
|
141
|
|
- <span style='color:#fff;'>:</span>
|
142
|
|
- <span style='padding: 0 0.03rem;background: rgba(255, 66, 28, 1);color: #fff;border-radius:4px;'>${seconds}</span>`
|
|
181
|
+ ...mapIndexActions(['getGame', 'getRecord', 'setSupport']),
|
|
182
|
+ checkStatus () {
|
|
183
|
+ if (this.$route.query.other === 'other') {
|
|
184
|
+ this.status = 2
|
|
185
|
+ this.btnText = '立即助力TA'
|
|
186
|
+ if (this.list.length >= this.game.game.UserNum) {
|
|
187
|
+ this.status = 5
|
|
188
|
+ }
|
|
189
|
+ } else {
|
|
190
|
+ if (this.list.length >= this.game.game.UserNum) {
|
|
191
|
+ this.status = 4
|
|
192
|
+ }
|
|
193
|
+ }
|
|
194
|
+ let end = new Date(this.game.game.EndDate).valueOf()
|
|
195
|
+ let now = new Date().valueOf()
|
|
196
|
+ if (now > end) {
|
|
197
|
+ this.status = 3
|
|
198
|
+ this.btnText = '立即助力TA'
|
|
199
|
+ } else if (this.game.note.LeftNum <= 0 && !this.$route.query.other) {
|
|
200
|
+ this.status = 6
|
|
201
|
+ }
|
|
202
|
+ this.showPage = true
|
|
203
|
+ },
|
|
204
|
+ share (recordid) {
|
|
205
|
+ wxsdk({ url: encodeURIComponent(window.location.href.split('#')[0]) }, {
|
|
206
|
+ title: '城的空间',
|
|
207
|
+ desc: '城的空间',
|
|
208
|
+ link: `${window.location.origin}${window.location.pathname}#/supportDetail?other=other&recordid=${recordid}`,
|
|
209
|
+ thu_image: `https://spaceofcheng.oss-cn-beijing.aliyuncs.com/indexlogo.jpg?x-oss-process=style/wxicon`
|
|
210
|
+ })
|
|
211
|
+ },
|
|
212
|
+ support () {
|
|
213
|
+ if (this.status === 1) {
|
|
214
|
+ this.$toast('微信右上角分享,让好友帮你助力哦!')
|
|
215
|
+ } else if (this.status === 2) {
|
|
216
|
+ this.setSupport({ customerid: this.userInfo.CustomerId, recordid: this.$route.query.recordid }).then(() => {
|
|
217
|
+ this.showDailog = true
|
|
218
|
+ }).catch(() => {
|
|
219
|
+ this.showDailog = true
|
|
220
|
+ })
|
|
221
|
+ } else if (this.status === 3) {
|
|
222
|
+ this.$toast('活动已结束')
|
|
223
|
+ }
|
|
224
|
+ },
|
|
225
|
+ toLuckDraw () {
|
|
226
|
+
|
143
|
227
|
}
|
144
|
228
|
}
|
145
|
229
|
}
|
|
@@ -359,6 +443,9 @@ export default {
|
359
|
443
|
margin-right: 0.2rem;
|
360
|
444
|
font-size: 0.13rem;
|
361
|
445
|
}
|
|
446
|
+ .off {
|
|
447
|
+ background: #b8b8b8;
|
|
448
|
+ }
|
362
|
449
|
}
|
363
|
450
|
.desc {
|
364
|
451
|
display: flex;
|