900d42f9 by zhangmeng

票务

1 parent 8a5a4ea6
...@@ -38,6 +38,27 @@ ...@@ -38,6 +38,27 @@
38 {{ triggerLanguage(language, "地址", "Location") }}{{ matchForm.address }} 38 {{ triggerLanguage(language, "地址", "Location") }}{{ matchForm.address }}
39 </div> 39 </div>
40 40
41
42 <div v-if="!countDown">
43 <!-- 倒计时-->
44 <p class="countDownTitle">
45 <span v-if="language==0">报名截止倒计时</span>
46 <span v-else>REGISTRATION COUNTDOWN</span>
47 </p>
48 <van-count-down :time="timeData" format="DD 天 HH 时 mm 分 ss 秒">
49 <template #default="timeData">
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>
41 <!-- 时间 --> 62 <!-- 时间 -->
42 <div class="select_item_box"> 63 <div class="select_item_box">
43 <div class="label"> 64 <div class="label">
...@@ -82,6 +103,8 @@ ...@@ -82,6 +103,8 @@
82 {{ triggerLanguage(language, "添加观影人", "Add Moviegoers") }} 103 {{ triggerLanguage(language, "添加观影人", "Add Moviegoers") }}
83 </div> 104 </div>
84 </div> 105 </div>
106
107 </div>
85 </div> 108 </div>
86 109
87 <div class="container bottom"> 110 <div class="container bottom">
...@@ -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!