900d42f9 by zhangmeng

票务

1 parent 8a5a4ea6
...@@ -38,49 +38,72 @@ ...@@ -38,49 +38,72 @@
38 {{ triggerLanguage(language, "地址", "Location") }}{{ matchForm.address }} 38 {{ triggerLanguage(language, "地址", "Location") }}{{ matchForm.address }}
39 </div> 39 </div>
40 40
41 <!-- 时间 --> 41
42 <div class="select_item_box"> 42 <div v-if="!countDown">
43 <div class="label"> 43 <!-- 倒计时-->
44 {{ triggerLanguage(language, "时间", "Event Date & Time") }} 44 <p class="countDownTitle">
45 </div> 45 <span v-if="language==0">报名截止倒计时</span>
46 <div class="select_item"> 46 <span v-else>REGISTRATION COUNTDOWN</span>
47 <div 47 </p>
48 v-for="(it, index) in tickList" 48 <van-count-down :time="timeData" format="DD 天 HH 时 mm 分 ss 秒">
49 :key="index" 49 <template #default="timeData">
50 :class="[ 50 <span class="block">{{ timeData.days }}</span>
51 <span class="colon">{{ language == 0 ? '天' : 'Days' }}</span>
52 <span class="block">{{ timeData.hours }}</span>
53 <span class="colon">{{ language == 0 ? '时' : 'Hrs' }}</span>
54 <span class="block">{{ timeData.minutes }}</span>
55 <span class="colon">{{ language == 0 ? '分' : 'Min' }}</span>
56 <span class="block">{{ timeData.seconds }}</span>
57 <span class="colon">{{ language == 0 ? '秒' : 'Sec' }}</span>
58 </template>
59 </van-count-down>
60 </div>
61 <div v-else>
62 <!-- 时间 -->
63 <div class="select_item_box">
64 <div class="label">
65 {{ triggerLanguage(language, "时间", "Event Date & Time") }}
66 </div>
67 <div class="select_item">
68 <div
69 v-for="(it, index) in tickList"
70 :key="index"
71 :class="[
51 it.id == selectForm.id ? 'tagActive' : 'tag', 72 it.id == selectForm.id ? 'tagActive' : 'tag',
52 it.isView==0?'forbid':'' 73 it.isView==0?'forbid':''
53 ]" 74 ]"
54 @click="selectTick(it)" 75 @click="selectTick(it)"
55 > 76 >
56 {{ it.name }} <span v-if="it.ticketType==1" class="tao">{{ 77 {{ it.name }} <span v-if="it.ticketType==1" class="tao">{{
57 language == 0 ? '套票' : 'Package ticket' 78 language == 0 ? '套票' : 'Package ticket'
58 }}</span> 79 }}</span>
80 </div>
59 </div> 81 </div>
60 </div> 82 </div>
61 </div> 83 <!-- 票档 -->
62 <!-- 票档 --> 84 <div class="select_item_box">
63 <div class="select_item_box"> 85 <div class="label">
64 <div class="label"> 86 {{ triggerLanguage(language, "票档", "Tickets") }}
65 {{ triggerLanguage(language, "票档", "Tickets") }} 87 </div>
66 </div> 88 <div class="select_item">
67 <div class="select_item"> 89 <div
68 <div 90 v-for="(it, index) in tickClass"
69 v-for="(it, index) in tickClass" 91 :key="index"
70 :key="index" 92 :class="[
71 :class="[
72 it.id == selectForm.latId ? 'tagActive' : 'tag', 93 it.id == selectForm.latId ? 'tagActive' : 'tag',
73 ]" 94 ]"
74 @click="select(it)" 95 @click="select(it)"
75 > 96 >
76 {{ it.name }} 97 {{ it.name }}
98 </div>
77 </div> 99 </div>
78 </div> 100 </div>
101 <!-- button -->
102 <div class="btn forPc" style="margin-left: 40px" @click="toSelectSeat()">
103 {{ triggerLanguage(language, "添加观影人", "Add Moviegoers") }}
104 </div>
79 </div> 105 </div>
80 <!-- button --> 106
81 <div class="btn forPc" style="margin-left: 40px" @click="toSelectSeat()">
82 {{ triggerLanguage(language, "添加观影人", "Add Moviegoers") }}
83 </div>
84 </div> 107 </div>
85 </div> 108 </div>
86 109
...@@ -110,10 +133,12 @@ const route = useRoute(); ...@@ -110,10 +133,12 @@ const route = useRoute();
110 const router = useRouter(); 133 const router = useRouter();
111 const activeId = ref(route.params.activeId) 134 const activeId = ref(route.params.activeId)
112 const flag = ref(false) 135 const flag = ref(false)
136 const countDown = ref(false)
113 const props = defineProps({ 137 const props = defineProps({
114 activityId: [String, Number], 138 activityId: [String, Number],
115 }); 139 });
116 140 const timeData = ref({})
141 const nowData = ref(dayjs().valueOf())
117 const matchForm = ref({}) 142 const matchForm = ref({})
118 const tickClass = ref([]) 143 const tickClass = ref([])
119 const selectForm = ref({ 144 const selectForm = ref({
...@@ -128,6 +153,8 @@ getDetail() ...@@ -128,6 +153,8 @@ getDetail()
128 async function getDetail() { 153 async function getDetail() {
129 const res = await getTicketInfoByActivityId({activityId: activeId.value}) 154 const res = await getTicketInfoByActivityId({activityId: activeId.value})
130 matchForm.value = res.data 155 matchForm.value = res.data
156 timeData.value = dayjs(res.data.ticketStart).valueOf()
157 if (timeData.value <= nowData.value) countDown.value = true
131 } 158 }
132 159
133 // 根据赛事ID获取票档 160 // 根据赛事ID获取票档
...@@ -190,7 +217,7 @@ function toSelectSeat() { ...@@ -190,7 +217,7 @@ function toSelectSeat() {
190 width: 1200px; 217 width: 1200px;
191 margin: 0 auto; 218 margin: 0 auto;
192 background-color: #fff; 219 background-color: #fff;
193 box-shadow: 0px 0px 46px 0px rgba(1, 16, 64, 0.08); 220 box-shadow: 0 0 46px 0 rgba(1, 16, 64, 0.08);
194 border-radius: 8px; 221 border-radius: 8px;
195 box-sizing: border-box; 222 box-sizing: border-box;
196 font-family: SourceHanSansCN, SourceHanSansCN; 223 font-family: SourceHanSansCN, SourceHanSansCN;
...@@ -404,4 +431,61 @@ function toSelectSeat() { ...@@ -404,4 +431,61 @@ function toSelectSeat() {
404 padding: 0 431 padding: 0
405 } 432 }
406 } 433 }
434
435 .countDownTitle {
436 text-align: center;
437 color: #000;
438 position: relative;
439 width: 100%;
440 left: 0;
441 font-size: 35px;
442 }
443
444 .countDownTitle span {
445 background: #fff;
446 padding: 0 10px;
447 position: relative;
448 z-index: 1;
449 }
450
451 .countDownTitle::after {
452 position: absolute;
453 background: #ccc;
454 height: 1px;
455 content: '';
456 top: 0;
457 bottom: 0;
458 margin: auto;
459 width: 100%;
460 left: 0;
461 }
462
463 .van-count-down {
464 text-align: center;
465 margin: 20px 0;
466 display: flex;
467 justify-content: center;
468 }
469
470 .colon {
471 display: inline-block;
472 font-size: 20px;
473 margin: 0 8px;
474 color: #7B7F83;
475 }
476
477 .block {
478 display: inline-block;
479 opacity: 0.7;
480 width: 120px;
481 height: 120px;
482 line-height: 120px;
483 color: #fff;
484 font-size: 35px;
485 font-weight: bold;
486 border-radius: 10px;
487 background: url(@/assets/img/djs_bg.png) left;
488 background-size: 100% 100%;
489 text-align: center;
490 }
407 </style> 491 </style>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!