|
@@ -21,14 +21,14 @@
|
|
:key="index"
|
|
:key="index"
|
|
>
|
|
>
|
|
<button
|
|
<button
|
|
- :disabled="!item.remain"
|
|
|
|
|
|
+ :disabled="item.status !== 0 || !item.remain"
|
|
:class="{
|
|
:class="{
|
|
active: index === timeIdx,
|
|
active: index === timeIdx,
|
|
}"
|
|
}"
|
|
@click="handleClickTime(index)"
|
|
@click="handleClickTime(index)"
|
|
>
|
|
>
|
|
<span>{{item.time}}</span><br>
|
|
<span>{{item.time}}</span><br>
|
|
- <span>{{item.remain !== null ? `剩余${item.remain}` : ``}}</span>
|
|
|
|
|
|
+ <span>{{item.status === 2 ? '已结束' : item.status === 1 ? '进行中' : item.remain !== null ? `剩余${item.remain}` : ``}}</span>
|
|
</button>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -43,23 +43,23 @@
|
|
<div class="card info-card">
|
|
<div class="card info-card">
|
|
<h2>个人信息</h2>
|
|
<h2>个人信息</h2>
|
|
<div class="item">
|
|
<div class="item">
|
|
- <span class="key">* 姓  名</span>
|
|
|
|
|
|
+ <span class="key"><span class="star">*</span> 姓  名</span>
|
|
<input type="text" v-model="name">
|
|
<input type="text" v-model="name">
|
|
</div>
|
|
</div>
|
|
<div class="item">
|
|
<div class="item">
|
|
- <span class="key">* 身份证号</span>
|
|
|
|
|
|
+ <span class="key"><span class="star">*</span> 身份证号</span>
|
|
<input type="text" v-model="idCard">
|
|
<input type="text" v-model="idCard">
|
|
</div>
|
|
</div>
|
|
<div class="item">
|
|
<div class="item">
|
|
- <span class="key">* 手机号码</span>
|
|
|
|
|
|
+ <span class="key"><span class="star">*</span> 手机号码</span>
|
|
<input type="text" v-model="phone">
|
|
<input type="text" v-model="phone">
|
|
</div>
|
|
</div>
|
|
<div class="item">
|
|
<div class="item">
|
|
- <span class="key">  年  龄</span>
|
|
|
|
|
|
+ <span class="key"> 年  龄</span>
|
|
<input type="text" v-model="age">
|
|
<input type="text" v-model="age">
|
|
</div>
|
|
</div>
|
|
<div class="item">
|
|
<div class="item">
|
|
- <span class="key">* 人  数</span>
|
|
|
|
|
|
+ <span class="key"><span class="star">*</span> 人  数</span>
|
|
<input type="text" v-model="number">
|
|
<input type="text" v-model="number">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -106,6 +106,8 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ now: null,
|
|
|
|
+
|
|
attractionId: 1,
|
|
attractionId: 1,
|
|
year: null,
|
|
year: null,
|
|
month: null,
|
|
month: null,
|
|
@@ -115,10 +117,12 @@ export default {
|
|
{
|
|
{
|
|
time: '8:30-12:00',
|
|
time: '8:30-12:00',
|
|
remain: null,
|
|
remain: null,
|
|
|
|
+ status: null,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
time: '12:00-18:30',
|
|
time: '12:00-18:30',
|
|
remain: null,
|
|
remain: null,
|
|
|
|
+ status: null,
|
|
},
|
|
},
|
|
],
|
|
],
|
|
timeIdx: null,
|
|
timeIdx: null,
|
|
@@ -174,6 +178,26 @@ export default {
|
|
console.log(res);
|
|
console.log(res);
|
|
this.timeList[1].remain = res.data
|
|
this.timeList[1].remain = res.data
|
|
})
|
|
})
|
|
|
|
+
|
|
|
|
+ this.now = new Date()
|
|
|
|
+
|
|
|
|
+ const targetTimeAM = new Date(`${this.year}-${this.month}-${this.day} 10:00`)
|
|
|
|
+ if (this.now.getTime() - targetTimeAM.getTime() < 0) {
|
|
|
|
+ this.timeList[0].status = 0 // 未开始
|
|
|
|
+ } else if ((this.now.getTime() - targetTimeAM.getTime() >= 0) && (this.now.getTime() - targetTimeAM.getTime() < 2 * 60 * 60 *1000)) {
|
|
|
|
+ this.timeList[0].status = 1 // 进行中
|
|
|
|
+ } else {
|
|
|
|
+ this.timeList[0].status = 2 // 已结束
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const targetTimePM = new Date(`${this.year}-${this.month}-${this.day} 12:00`)
|
|
|
|
+ if (this.now.getTime() - targetTimePM.getTime() < 0) {
|
|
|
|
+ this.timeList[1].status = 0 // 未开始
|
|
|
|
+ } else if ((this.now.getTime() - targetTimePM.getTime() >= 0) && (this.now.getTime() - targetTimePM.getTime() < 6.5 * 60 * 60 *1000)) {
|
|
|
|
+ this.timeList[1].status = 1 // 进行中
|
|
|
|
+ } else {
|
|
|
|
+ this.timeList[1].status = 2 // 已结束
|
|
|
|
+ }
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
onConfirmDate(date) {
|
|
onConfirmDate(date) {
|
|
@@ -200,6 +224,26 @@ export default {
|
|
console.log(res);
|
|
console.log(res);
|
|
this.timeList[1].remain = res.data
|
|
this.timeList[1].remain = res.data
|
|
})
|
|
})
|
|
|
|
+
|
|
|
|
+ this.now = new Date()
|
|
|
|
+
|
|
|
|
+ const targetTimeAM = new Date(`${this.year}-${this.month}-${this.day} 10:00`)
|
|
|
|
+ if (this.now.getTime() - targetTimeAM.getTime() < 0) {
|
|
|
|
+ this.timeList[0].status = 0 // 未开始
|
|
|
|
+ } else if ((this.now.getTime() - targetTimeAM.getTime() >= 0) && (this.now.getTime() - targetTimeAM.getTime() < 2 * 60 * 60 *1000)) {
|
|
|
|
+ this.timeList[0].status = 1 // 进行中
|
|
|
|
+ } else {
|
|
|
|
+ this.timeList[0].status = 2 // 已结束
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const targetTimePM = new Date(`${this.year}-${this.month}-${this.day} 12:00`)
|
|
|
|
+ if (this.now.getTime() - targetTimePM.getTime() < 0) {
|
|
|
|
+ this.timeList[1].status = 0 // 未开始
|
|
|
|
+ } else if ((this.now.getTime() - targetTimePM.getTime() >= 0) && (this.now.getTime() - targetTimePM.getTime() < 6.5 * 60 * 60 *1000)) {
|
|
|
|
+ this.timeList[1].status = 1 // 进行中
|
|
|
|
+ } else {
|
|
|
|
+ this.timeList[1].status = 2 // 已结束
|
|
|
|
+ }
|
|
},
|
|
},
|
|
handleClickTime(index) {
|
|
handleClickTime(index) {
|
|
this.timeIdx = index
|
|
this.timeIdx = index
|
|
@@ -241,7 +285,9 @@ export default {
|
|
|
|
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
@import "../../assets/libs/swiper.css";
|
|
@import "../../assets/libs/swiper.css";
|
|
-
|
|
|
|
|
|
+.star {
|
|
|
|
+ color: red;
|
|
|
|
+}
|
|
.booking {
|
|
.booking {
|
|
background: #f1eff2;
|
|
background: #f1eff2;
|
|
height: calc(100% - 80px);
|
|
height: calc(100% - 80px);
|