Kaynağa Gözat

老虎机高度调整

Xiao_123 4 ay önce
ebeveyn
işleme
684058bdd7

+ 1 - 1
src/views/mall/components/prizeDraw.vue

@@ -2,7 +2,7 @@
   <div class="prizeDrawBox">
     <!-- <city @inputChange="null"></city> -->
     <gridPage v-if="props.type === '1'" :lotteryId="props.lotteryId" @end="endCallback"></gridPage>
-    <slotMachinePage v-if="props.type === '2'" :lotteryId="props.lotteryId" @end="endCallback"></slotMachinePage>
+    <slotMachinePage v-if="props.type === '2'" :lotteryId="props.lotteryId" height="120" @end="endCallback"></slotMachinePage>
 
     <CtDialog :visible="showDialog" titleClass="text-h6" :footer="false" :widthType="3" title="抽奖详情" @close="showDialog = false">
       <div class="d-flex align-center flex-column">

+ 6 - 6
src/views/mall/components/prizeDraw/slotMachine.vue

@@ -4,7 +4,7 @@
     <SlotMachine
       ref="myLucky"
       width="300px"
-      height="300px"
+      :height="height + 'px'"
       :prizes="prizes"
       :blocks="blocks"
       :slots="slots"
@@ -30,7 +30,7 @@ import { getPrizeByLotteryId } from '@/api/mall/prize'
 import Snackbar from '@/plugins/snackbar'
 import { ref } from 'vue'
 const emit = defineEmits(['start', 'end'])
-const props = defineProps({ lotteryId: [Number, String] })
+const props = defineProps({ lotteryId: [Number, String], height: [Number, String] })
 
 const myLucky = ref()
 // 背景样式
@@ -39,10 +39,10 @@ const blocks = [
 ]
 // 转速与方向
 const slots = [
-    { speed: 15, direction: -1 },
-    { speed: 15, direction: 1 },
-    { speed: 15, direction: -1 },
-  ]
+  { speed: 15, direction: -1 },
+  { speed: 15, direction: 1 },
+  { speed: 15, direction: -1 },
+]
 const prizes = ref([])
 const defaultConfig = {
   rowSpacing: '10px',