This commit is contained in:
2025-03-23 10:10:33 +08:00
parent ce0ab24c57
commit de3fd18246
13 changed files with 756 additions and 165 deletions
+11 -6
View File
@@ -211,12 +211,12 @@ export default {
}
},
methods: {
async reload() {
async reload(resetDate = true) {
// 请求数据
uni.showLoading({
title: '数据读取中.'
})
this.setDateList()
this.setDateList(resetDate)
await this.getMerchant()
await this.getTimeList()
await this.getFieldList()
@@ -260,7 +260,7 @@ export default {
// uni.hideLoading()
// })
},
setDateList() {
setDateList(resetDate = true) {
this.next7day = []
let day = 7
if (this.merchantId === 37) day = 1
@@ -273,7 +273,7 @@ export default {
value: day.format('MM月DD日')
})
}
this.dateTime = dayjs().format('YYYY-MM-DD')
if (resetDate) this.dateTime = dayjs().format('YYYY-MM-DD')
this.week = dayjs().format('d') === '0' ? '7' : dayjs().format('d')
},
async getTimeList() {
@@ -328,6 +328,7 @@ export default {
this.disabled = !this.disabled;
},
onDateTime(e) {
this.selection = []
this.periodList = []
if (![37, 44, 32].includes(this.merchantId)) {
const date = dayjs().format('d')
@@ -371,6 +372,7 @@ export default {
},
onType(e) {
const index = e.currentIndex
this.selection = []
if (index === 0) {
this.type = 1;
this.isHalf = 0;
@@ -379,7 +381,7 @@ export default {
this.type = 2;
this.isHalf = 1;
}
this.reload()
this.reload(false)
},
async getMerchant() {
this.merchant = await getThinkSite(this.merchantId)
@@ -444,6 +446,8 @@ export default {
const siteTime = field.periodVoList.find(d => d.period === item.timePeriod)
// 添加到购物车
const week = parseInt(this.week) === 7 ? 0 : this.week
console.log(item)
console.log('this.type', this.type)
app.selection.push({
key,
sid: this.merchantId,
@@ -466,8 +470,9 @@ export default {
siteTimeId: siteTime.id,
dateTime: `${this.dateTime}`,
comments: `${this.dateTime}(${getWeek(week)})${item.timePeriod}`,
week
})
// console.log(app.selection);
console.log(app.selection);
// console.log('period: ', period);
// 是否支持儿童票
// console.log('item.isChildren: ', item.isChildren);