开票
Showing
1 changed file
with
37 additions
and
15 deletions
| ... | @@ -39,11 +39,12 @@ | ... | @@ -39,11 +39,12 @@ |
| 39 | </div> | 39 | </div> |
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | <div v-if="!countDown"> | 42 | <div v-if="timeData>0"> |
| 43 | <!-- 倒计时--> | 43 | <!-- 倒计时--> |
| 44 | |||
| 44 | <p class="countDownTitle"> | 45 | <p class="countDownTitle"> |
| 45 | <span v-if="language==0">报名截止倒计时</span> | 46 | <span v-if="language==0">售票倒计时</span> |
| 46 | <span v-else>REGISTRATION COUNTDOWN</span> | 47 | <span v-else>TICKET COUNTDOWN</span> |
| 47 | </p> | 48 | </p> |
| 48 | <van-count-down :time="timeData" format="DD 天 HH 时 mm 分 ss 秒"> | 49 | <van-count-down :time="timeData" format="DD 天 HH 时 mm 分 ss 秒"> |
| 49 | <template #default="timeData"> | 50 | <template #default="timeData"> |
| ... | @@ -109,10 +110,17 @@ | ... | @@ -109,10 +110,17 @@ |
| 109 | </div> | 110 | </div> |
| 110 | </div> | 111 | </div> |
| 111 | </div> | 112 | </div> |
| 112 | <!-- button --> | 113 | |
| 113 | <div class="btn forPc" style="margin-left: 40px" @click="toSelectSeat()"> | 114 | <div v-if="endTime<=0" class="btn forPc" style="margin-left: 40px;opacity: 0.5;cursor: not-allowed;" |
| 115 | @click="toSelectClosed"> | ||
| 116 | {{ | ||
| 117 | triggerLanguage(language, "售票结束", "Sale closed") | ||
| 118 | }} | ||
| 119 | </div> | ||
| 120 | <div v-else class="btn forPc" style="margin-left: 40px" @click="toSelectSeat()"> | ||
| 114 | {{ triggerLanguage(language, "添加观影人", "Add Moviegoers") }} | 121 | {{ triggerLanguage(language, "添加观影人", "Add Moviegoers") }} |
| 115 | </div> | 122 | </div> |
| 123 | |||
| 116 | </div> | 124 | </div> |
| 117 | 125 | ||
| 118 | </div> | 126 | </div> |
| ... | @@ -148,8 +156,8 @@ const countDown = ref(false) | ... | @@ -148,8 +156,8 @@ const countDown = ref(false) |
| 148 | const props = defineProps({ | 156 | const props = defineProps({ |
| 149 | activityId: [String, Number], | 157 | activityId: [String, Number], |
| 150 | }); | 158 | }); |
| 151 | const timeData = ref({}) | 159 | const timeData = ref() |
| 152 | const nowData = ref(dayjs().valueOf()) | 160 | const endTime = ref() |
| 153 | const matchForm = ref({}) | 161 | const matchForm = ref({}) |
| 154 | const tickClass = ref([]) | 162 | const tickClass = ref([]) |
| 155 | const selectForm = ref({ | 163 | const selectForm = ref({ |
| ... | @@ -166,8 +174,12 @@ getDetail() | ... | @@ -166,8 +174,12 @@ getDetail() |
| 166 | async function getDetail() { | 174 | async function getDetail() { |
| 167 | const res = await getTicketInfoByActivityId({activityId: activeId.value}) | 175 | const res = await getTicketInfoByActivityId({activityId: activeId.value}) |
| 168 | matchForm.value = res.data | 176 | matchForm.value = res.data |
| 169 | timeData.value = dayjs(res.data.ticketStart).valueOf() | 177 | console.log(res) |
| 170 | if (timeData.value <= nowData.value) countDown.value = true | 178 | const today = dayjs().format('YYYY-MM-DD HH:mm:ss') |
| 179 | timeData.value = dayjs(res.data.ticketStart).diff(today, 'millisecond') | ||
| 180 | endTime.value = dayjs(res.data.ticketEnd).diff(today, 'millisecond') | ||
| 181 | // if (timeData.value <= nowData.value) countDown.value = true | ||
| 182 | // timeData.value = dayjs('2024-08-10 00:00:00').diff(today, 'millisecond') | ||
| 171 | } | 183 | } |
| 172 | 184 | ||
| 173 | // 根据赛事ID获取票档 | 185 | // 根据赛事ID获取票档 |
| ... | @@ -204,7 +216,6 @@ function selectTick(v) { | ... | @@ -204,7 +216,6 @@ function selectTick(v) { |
| 204 | selectForm.value.price = v.price | 216 | selectForm.value.price = v.price |
| 205 | selectForm.value.priceEn = v.priceEn | 217 | selectForm.value.priceEn = v.priceEn |
| 206 | } | 218 | } |
| 207 | |||
| 208 | } | 219 | } |
| 209 | 220 | ||
| 210 | function toSelectSeat() { | 221 | function toSelectSeat() { |
| ... | @@ -224,6 +235,13 @@ function toSelectSeat() { | ... | @@ -224,6 +235,13 @@ function toSelectSeat() { |
| 224 | }) | 235 | }) |
| 225 | } | 236 | } |
| 226 | 237 | ||
| 238 | function toSelectClosed() { | ||
| 239 | ElMessageBox.confirm(language.value == 0 ? '售票结束' : 'Sale closed', language.value == 0 ? '提示' : 'Tips', { | ||
| 240 | confirmButtonText: language.value == 0 ? '确定' : 'OK', | ||
| 241 | cancelButtonText: language.value == 0 ? '取消' : 'Cancel', | ||
| 242 | type: 'warning' | ||
| 243 | }) | ||
| 244 | } | ||
| 227 | </script> | 245 | </script> |
| 228 | 246 | ||
| 229 | <style lang="scss" scoped> | 247 | <style lang="scss" scoped> |
| ... | @@ -256,6 +274,7 @@ function toSelectSeat() { | ... | @@ -256,6 +274,7 @@ function toSelectSeat() { |
| 256 | 274 | ||
| 257 | .info { | 275 | .info { |
| 258 | padding-top: 12px; | 276 | padding-top: 12px; |
| 277 | width: 100%; | ||
| 259 | 278 | ||
| 260 | .title { | 279 | .title { |
| 261 | font-weight: bold; | 280 | font-weight: bold; |
| ... | @@ -299,7 +318,7 @@ function toSelectSeat() { | ... | @@ -299,7 +318,7 @@ function toSelectSeat() { |
| 299 | } | 318 | } |
| 300 | 319 | ||
| 301 | .forbid { | 320 | .forbid { |
| 302 | opacity: 0.5; | 321 | opacity: 0.5 !important; |
| 303 | cursor: not-allowed !important; | 322 | cursor: not-allowed !important; |
| 304 | } | 323 | } |
| 305 | 324 | ||
| ... | @@ -456,7 +475,7 @@ function toSelectSeat() { | ... | @@ -456,7 +475,7 @@ function toSelectSeat() { |
| 456 | position: relative; | 475 | position: relative; |
| 457 | width: 100%; | 476 | width: 100%; |
| 458 | left: 0; | 477 | left: 0; |
| 459 | font-size: 35px; | 478 | font-size: 28px; |
| 460 | } | 479 | } |
| 461 | 480 | ||
| 462 | .countDownTitle span { | 481 | .countDownTitle span { |
| ... | @@ -488,6 +507,8 @@ function toSelectSeat() { | ... | @@ -488,6 +507,8 @@ function toSelectSeat() { |
| 488 | .colon { | 507 | .colon { |
| 489 | display: inline-block; | 508 | display: inline-block; |
| 490 | font-size: 20px; | 509 | font-size: 20px; |
| 510 | height: 110px; | ||
| 511 | line-height: 110px; | ||
| 491 | margin: 0 8px; | 512 | margin: 0 8px; |
| 492 | color: #7B7F83; | 513 | color: #7B7F83; |
| 493 | } | 514 | } |
| ... | @@ -495,9 +516,9 @@ function toSelectSeat() { | ... | @@ -495,9 +516,9 @@ function toSelectSeat() { |
| 495 | .block { | 516 | .block { |
| 496 | display: inline-block; | 517 | display: inline-block; |
| 497 | opacity: 0.7; | 518 | opacity: 0.7; |
| 498 | width: 120px; | 519 | width: 100px; |
| 499 | height: 120px; | 520 | height: 110px; |
| 500 | line-height: 120px; | 521 | line-height: 110px; |
| 501 | color: #fff; | 522 | color: #fff; |
| 502 | font-size: 35px; | 523 | font-size: 35px; |
| 503 | font-weight: bold; | 524 | font-weight: bold; |
| ... | @@ -506,4 +527,5 @@ function toSelectSeat() { | ... | @@ -506,4 +527,5 @@ function toSelectSeat() { |
| 506 | background-size: 100% 100%; | 527 | background-size: 100% 100%; |
| 507 | text-align: center; | 528 | text-align: center; |
| 508 | } | 529 | } |
| 530 | |||
| 509 | </style> | 531 | </style> | ... | ... |
-
Please register or sign in to post a comment