|
@@ -55,7 +55,7 @@
|
|
|
<view class="guize">
|
|
|
<view>
|
|
|
<text>1.活动时间:</text>
|
|
|
- <text>{{luckDraw.activeStartTime}} 至 {{luckDraw.activeEndTime}}</text>
|
|
|
+ <text>{{startDate}} 至 {{endDate}}</text>
|
|
|
</view>
|
|
|
<view>
|
|
|
<text>2.奖品:</text>
|
|
@@ -66,13 +66,13 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view><text>3.抽奖条件:</text></view>
|
|
|
- <view>
|
|
|
+ <view style="flex-direction: column;">
|
|
|
<view v-for="(item,index) in activeLimitDesc" :key="index">
|
|
|
{{item}}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view><text>4.抽奖说明:</text></view>
|
|
|
- <view>
|
|
|
+ <view style="flex-direction: column;">
|
|
|
<view v-for="(item,index) in activeDesc" :key="index">
|
|
|
{{item}}
|
|
|
</view>
|
|
@@ -136,20 +136,27 @@
|
|
|
<script>
|
|
|
import AlmostLottery from '@/components/almost-lottery/almost-lottery.vue';
|
|
|
import { clearCacheFile } from '@/almost-utils/almost-utils.js';
|
|
|
+import { findCustomerTimes } from '@/api/luckyDraw.js'
|
|
|
export default {
|
|
|
name: 'Home',
|
|
|
components: {
|
|
|
AlmostLottery,
|
|
|
},
|
|
|
computed: {
|
|
|
+ startDate(){
|
|
|
+ return this.luckDraw?this.luckDraw.activeStartTime.split(' ')[0]:'-'
|
|
|
+ },
|
|
|
+ endDate(){
|
|
|
+ return this.luckDraw?this.luckDraw.activeEndTime.split(' ')[0]:'-'
|
|
|
+ },
|
|
|
prizeDesc() {
|
|
|
- return this.luckDraw.prizeDesc.split('\n')
|
|
|
+ return this.luckDraw?this.luckDraw.prizeDesc.split('\n'):''
|
|
|
},
|
|
|
activeLimitDesc() {
|
|
|
- return this.luckDraw.activeLimitDesc.split('\n')
|
|
|
+ return this.luckDraw?this.luckDraw.activeLimitDesc.split('\n'):''
|
|
|
},
|
|
|
activeDesc() {
|
|
|
- return this.luckDraw.activeDesc.split('\n')
|
|
|
+ return this.luckDraw?this.luckDraw.activeDesc.split('\n'):''
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
@@ -247,8 +254,6 @@ export default {
|
|
|
});
|
|
|
|
|
|
let res = await this.requestPrizeList();
|
|
|
- console.log('获取奖品列表', res);
|
|
|
-
|
|
|
if (res.ok) {
|
|
|
let data = res.data;
|
|
|
if (data.length) {
|
|
@@ -290,9 +295,13 @@ export default {
|
|
|
}, 500);
|
|
|
});
|
|
|
},
|
|
|
- // 获取配置
|
|
|
+ // 获取免费抽奖次数
|
|
|
getPrizeSetting(){
|
|
|
- this.reTimes = 3
|
|
|
+ findCustomerTimes({id:this.luckDraw.luckyDrawNo}).then(res => {
|
|
|
+ if(res.status == 200){
|
|
|
+ this.reTimes = res.data.timesSurplus || 0
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 抽奖次数用完了
|
|
|
showPayWin(winTypes){
|
|
@@ -317,8 +326,9 @@ export default {
|
|
|
stoTimer = null;
|
|
|
// 这里随机产生的 prizeId 是模拟后端返回的 prizeId
|
|
|
let prizeId = Math.floor(Math.random() * list.length + 1);
|
|
|
+ console.log(prizeId)
|
|
|
list.forEach((item, index) => {
|
|
|
- if (item.prizeId === prizeId) {
|
|
|
+ if (item.prizeId === ['210509167852392448','210509167852392449','210509167852392450'][prizeId]) {
|
|
|
// 中奖下标
|
|
|
this.prizeIndex = index;
|
|
|
}
|
|
@@ -333,6 +343,7 @@ export default {
|
|
|
// 本次抽奖结束
|
|
|
handleDrawEnd() {
|
|
|
let curPrize = this.prizeList[this.prizeIndex]
|
|
|
+ console.log(curPrize,'curPrize')
|
|
|
this.targetPrize = curPrize
|
|
|
// 旋转结束后,可以执行拿到结果后的逻辑
|
|
|
let prizeName = curPrize.name;
|