|
@@ -28,23 +28,12 @@
|
|
|
|
|
|
<!-- 弹窗 -->
|
|
|
<uni-popup ref="popup" type="center">
|
|
|
- <view class="popup" v-if="form.resultGoodType === 5">
|
|
|
- <view>谢谢参与</view>
|
|
|
- <view style="color: #999999; font-size: 28rpx">别灰心,再来一次~</view>
|
|
|
- <img src="@/static/lottery/thankYou.png" />
|
|
|
- <button @click="getAgain">再抽一次</button>
|
|
|
- </view>
|
|
|
- <view class="popup" v-if="form.resultGoodType === 4">
|
|
|
- <view>恭喜您中奖啦!</view>
|
|
|
- <img src="@/static/lottery/point.png" />
|
|
|
- <view style="color: #1A5509; font-size: 32rpx">+ {{ form.resultGoodName }}</view>
|
|
|
- <button @click="getSubmit">领取</button>
|
|
|
- </view>
|
|
|
- <view class="popup" v-if="form.resultGoodType === 3">
|
|
|
- <view>恭喜您中奖啦!</view>
|
|
|
- <img :src="form.resultGoodPic" />
|
|
|
+ <view class="popup">
|
|
|
<view>{{ form.resultGoodName }}</view>
|
|
|
- <button @click="getDetail">填写收货信息</button>
|
|
|
+ <img :src="form.resultGoodPic" />
|
|
|
+ <button v-if="form.resultGoodType === 4" @click="getSubmit">领取</button>
|
|
|
+ <button v-if="form.resultGoodType === 5" @click="getAgain">再抽一次</button>
|
|
|
+ <button v-if="form.resultGoodType === 3" @click="getDetail">填写收货信息</button>
|
|
|
</view>
|
|
|
</uni-popup>
|
|
|
</view>
|
|
@@ -86,7 +75,9 @@ export default {
|
|
|
// 活动规则
|
|
|
ruleList: [],
|
|
|
// 表单
|
|
|
- form: {}
|
|
|
+ form: {},
|
|
|
+ // 防止连点
|
|
|
+ disabled: true
|
|
|
}
|
|
|
},
|
|
|
onLoad(e) {
|
|
@@ -101,6 +92,7 @@ export default {
|
|
|
|
|
|
// 获取页面信息
|
|
|
getList() {
|
|
|
+ this.prizes = []
|
|
|
page({
|
|
|
userId: this.userId
|
|
|
}).then(res => {
|
|
@@ -140,16 +132,25 @@ export default {
|
|
|
if (this.hasLotteryCount > 0) {
|
|
|
if (this.maySignPoint > this.lotteryConsumePoint) {
|
|
|
this.$refs.lucky.play()
|
|
|
- result({
|
|
|
- userId: this.userId
|
|
|
- }).then(res => {
|
|
|
- if (res.data.code === 0) {
|
|
|
- setTimeout(() => {
|
|
|
- this.$refs.lucky.stop(res.data.data.resultGoodSort - 1)
|
|
|
- this.form = res.data.data
|
|
|
- }, 3000)
|
|
|
- }
|
|
|
- })
|
|
|
+ if (this.disabled) {
|
|
|
+ this.disabled = false
|
|
|
+ result({
|
|
|
+ userId: this.userId
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$refs.lucky.stop(res.data.data.resultGoodSort - 1)
|
|
|
+ this.form = res.data.data
|
|
|
+ }, 3000)
|
|
|
+ } else {
|
|
|
+ this.$refs.lucky.stop()
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'error',
|
|
|
+ title: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
icon: 'error',
|
|
@@ -164,9 +165,11 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 抽奖结束触发回调
|
|
|
- endCallBack(prize) {
|
|
|
+ endCallBack() {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.popup.open()
|
|
|
+ this.disabled = true
|
|
|
+ this.getList()
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -178,18 +181,24 @@ export default {
|
|
|
|
|
|
// 领取
|
|
|
getSubmit() {
|
|
|
- receive({
|
|
|
- prizeId: this.form.resultGoodId,
|
|
|
- userId: this.form.userId,
|
|
|
- lotteryCode: this.form.lotteryCode
|
|
|
- }).then(res => {
|
|
|
- if (res.data.code === 0) {
|
|
|
- uni.showToast({
|
|
|
- title: '领取成功!'
|
|
|
- })
|
|
|
- this.$refs.popup.close()
|
|
|
- }
|
|
|
- })
|
|
|
+ if (this.disabled) {
|
|
|
+ this.disabled = false
|
|
|
+ receive({
|
|
|
+ prizeId: this.form.resultGoodId,
|
|
|
+ userId: this.form.userId,
|
|
|
+ lotteryCode: this.form.lotteryCode
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ this.$refs.popup.close()
|
|
|
+ uni.showToast({
|
|
|
+ title: '领取成功!'
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ this.disabled = true
|
|
|
+ }, 2000)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
// 填写收货信息
|