|
@@ -1,7 +1,8 @@
|
|
<template>
|
|
<template>
|
|
<div class="prizeDrawBox">
|
|
<div class="prizeDrawBox">
|
|
<city @inputChange="null"></city>
|
|
<city @inputChange="null"></city>
|
|
- <gridPage :disabled="!Number(luckyDrawsNum)" :lotteryId="props.lotteryId" @start="startCallback" @end="endCallback"></gridPage>
|
|
|
|
|
|
+ <gridPage v-if="type === '1'" :disabled="!Number(luckyDrawsNum)" :lotteryId="props.lotteryId" @end="endCallback"></gridPage>
|
|
|
|
+ <slotMachinePage v-if="type === '2'" :disabled="!Number(luckyDrawsNum)" :lotteryId="props.lotteryId" @end="endCallback"></slotMachinePage>
|
|
<div class="numberBox mt-5">您还剩余<span class="colorBase">{{ luckyDrawsNum }}</span>次抽奖机会</div>
|
|
<div class="numberBox mt-5">您还剩余<span class="colorBase">{{ luckyDrawsNum }}</span>次抽奖机会</div>
|
|
|
|
|
|
<CtDialog :visible="showDialog" titleClass="text-h6" :footer="false" :widthType="3" title="抽奖详情" @close="showDialog = false">
|
|
<CtDialog :visible="showDialog" titleClass="text-h6" :footer="false" :widthType="3" title="抽奖详情" @close="showDialog = false">
|
|
@@ -22,11 +23,18 @@
|
|
defineOptions({ name: 'prizeDraw'})
|
|
defineOptions({ name: 'prizeDraw'})
|
|
import city from './prizeDraw/city.vue'
|
|
import city from './prizeDraw/city.vue'
|
|
import gridPage from './prizeDraw/grid.vue'
|
|
import gridPage from './prizeDraw/grid.vue'
|
|
|
|
+import slotMachinePage from './prizeDraw/slotMachine.vue'
|
|
import { ref } from 'vue'
|
|
import { ref } from 'vue'
|
|
import { getNumByLotteryId } from '@/api/mall/prize'
|
|
import { getNumByLotteryId } from '@/api/mall/prize'
|
|
|
|
|
|
const emit = defineEmits(['success'])
|
|
const emit = defineEmits(['success'])
|
|
-const props = defineProps({ lotteryId: [Number, String] })
|
|
|
|
|
|
+const props = defineProps({
|
|
|
|
+ lotteryId: [Number, String],
|
|
|
|
+ type: {
|
|
|
|
+ type:String,
|
|
|
|
+ default: '1'
|
|
|
|
+ }
|
|
|
|
+})
|
|
|
|
|
|
// 获取抽奖次数
|
|
// 获取抽奖次数
|
|
const luckyDrawsNum = ref(0)
|
|
const luckyDrawsNum = ref(0)
|
|
@@ -40,7 +48,6 @@ const showDialog = ref(false)
|
|
const prizeData = ref({})
|
|
const prizeData = ref({})
|
|
const endCallback = (value) => {
|
|
const endCallback = (value) => {
|
|
console.log(value.prize, '抽中的奖品')
|
|
console.log(value.prize, '抽中的奖品')
|
|
-
|
|
|
|
prizeData.value = value.prize
|
|
prizeData.value = value.prize
|
|
showDialog.value = true
|
|
showDialog.value = true
|
|
getLuckyNum()
|
|
getLuckyNum()
|