|
@@ -67,7 +67,8 @@
|
|
|
<view class="prize-info-content-title" v-if="prizeInfo.prizeType && prizeInfo.prizeType.value != 'coin'">{{ prizeInfo.title }}</view>
|
|
|
<view class="prize-info-content-title" v-else>盲豆</view>
|
|
|
<view class="prize-info-content-tip flex" v-if="isTry == 0" @click="toPrize(prizeInfo.prizeType)">
|
|
|
- <view class="txt">哇,去瞅瞅我的宝贝</view>
|
|
|
+ <view class="txt" v-if="prizeInfo.prizeType && prizeInfo.prizeType.value != 'coin'">哇,去瞅瞅我的宝贝</view>
|
|
|
+ <view class="txt" v-else>哇,去商城兑换商品</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -102,7 +103,7 @@
|
|
|
|
|
|
boxId: '',
|
|
|
isTry: null,
|
|
|
- ticketId: '',
|
|
|
+ orderId: '',
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -117,6 +118,7 @@
|
|
|
if(options) {
|
|
|
this.boxId = options.boxId
|
|
|
this.isTry = Number(options.isTry)
|
|
|
+ this.orderId = options.orderId
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -131,38 +133,47 @@
|
|
|
|
|
|
methods: {
|
|
|
getList() {
|
|
|
- uni.showLoading({
|
|
|
- title: '加载中'
|
|
|
- });
|
|
|
+ let _this = this
|
|
|
let data = {
|
|
|
- boxId: this.boxId,
|
|
|
- isTry: this.isTry,
|
|
|
- ticketId: this.ticketId
|
|
|
+ boxId: _this.boxId,
|
|
|
+ isTry: _this.isTry,
|
|
|
+ orderId: _this.orderId
|
|
|
}
|
|
|
|
|
|
- $http.post('/api/v1/mp/user/ticket/autoCashPrize', data).then(res => {
|
|
|
- if(res.code == 0) {
|
|
|
- this.list = res.data.ticketAwardsPrizeList
|
|
|
- this.list.forEach(item => {
|
|
|
- item.forEach(ele => {
|
|
|
- ele.picUrl = env.filePublic + ele.picUrl
|
|
|
- ele.prizeType = JSON.parse(ele.prizeType)
|
|
|
+ let num = 0
|
|
|
+ let time = setInterval(() => {
|
|
|
+ num ++
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ });
|
|
|
+ $http.post('/api/v1/mp/user/ticket/autoCashPrize', data).then(res => {
|
|
|
+ if(res.code == 0) {
|
|
|
+ clearInterval(time)
|
|
|
+ _this.list = res.data.ticketAwardsPrizeList
|
|
|
+ _this.list.forEach(item => {
|
|
|
+ item.forEach(ele => {
|
|
|
+ ele.picUrl = env.filePublic + ele.picUrl.split(',')[0] + '?imageView2/2/w/170'
|
|
|
+ ele.prizeType = JSON.parse(ele.prizeType)
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
- this.prizeInfo = {
|
|
|
- ...res.data,
|
|
|
- picUrl: env.filePublic + res.data.picUrl,
|
|
|
- prizeType: JSON.parse(res.data.prizeType)
|
|
|
+ _this.prizeInfo = {
|
|
|
+ ...res.data,
|
|
|
+ picUrl: env.filePublic + res.data.picUrl.split(',')[0] + '?imageView2/2/w/340',
|
|
|
+ prizeType: JSON.parse(res.data.prizeType)
|
|
|
+ }
|
|
|
+ setTimeout(()=> {
|
|
|
+ uni.hideLoading();
|
|
|
+ _this.btnShow = true
|
|
|
+ _this.running()
|
|
|
+ },500)
|
|
|
}
|
|
|
- setTimeout(()=> {
|
|
|
+
|
|
|
+ if (num == 10) {
|
|
|
uni.hideLoading();
|
|
|
- this.btnShow = true
|
|
|
- this.running()
|
|
|
- },500)
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
- uni.hideLoading();
|
|
|
- })
|
|
|
+ clearInterval(time)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }, 1000)
|
|
|
},
|
|
|
|
|
|
// 动画开始
|
|
@@ -514,7 +525,6 @@
|
|
|
&__image {
|
|
|
width: 65%;
|
|
|
height: 65%;
|
|
|
- margin-bottom: 30rpx;
|
|
|
|
|
|
image {
|
|
|
width: 100%;
|