261024
This commit is contained in:
@@ -49,24 +49,6 @@
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<!-- 排版样式备份 -->
|
||||
<view class="period-item" style="display: none;">
|
||||
<view class="period">18:00 - 20:00</view>
|
||||
<view class="field-list">
|
||||
<view class="field web-bg-info">
|
||||
<text class="field-name">1号场地</text>
|
||||
<text class="price">580元</text>
|
||||
</view>
|
||||
<view class="field web-bg-success active">
|
||||
<text class="field-name">2号场地</text>
|
||||
<text class="price">580元</text>
|
||||
</view>
|
||||
<view class="field web-bg-warning">
|
||||
<text class="field-name">3号场地</text>
|
||||
<text class="price">580元</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 支付按钮 -->
|
||||
<uv-gap height="50"></uv-gap>
|
||||
@@ -169,6 +151,7 @@ export default {
|
||||
where: {},
|
||||
// 时段
|
||||
periodList: [],
|
||||
periodListOrigin: [],
|
||||
// 场地
|
||||
fieldList: [],
|
||||
// 选中的场地
|
||||
@@ -199,9 +182,10 @@ export default {
|
||||
const app = this
|
||||
let totalPrice = 0;
|
||||
app.selection.map(d => {
|
||||
if (app.isHalf === 1) totalPrice += d.halfPrice
|
||||
else totalPrice += d.price
|
||||
if (app.isHalf === 1) totalPrice += parseFloat(d.halfPrice)
|
||||
else totalPrice += parseFloat(d.price)
|
||||
})
|
||||
totalPrice = totalPrice.toFixed(2)
|
||||
carStore.totalPrice = totalPrice
|
||||
// console.log('totalPrice: ', totalPrice);
|
||||
return totalPrice;
|
||||
@@ -264,6 +248,7 @@ export default {
|
||||
this.next7day = []
|
||||
let day = 7
|
||||
if (this.merchantId === 37) day = 1
|
||||
// else if (this.merchantId === 28) day = 30
|
||||
for (let i = 0; i < day; i++) {
|
||||
const day = dayjs().add(i, 'day')
|
||||
this.next7day.push({
|
||||
@@ -293,18 +278,26 @@ export default {
|
||||
const weekList = JSON.parse(item.week)
|
||||
if (parseInt(this.merchantId) === 37) {
|
||||
const today = dayjs().format('YYYY-MM-DD')
|
||||
if ((dayjs().isBefore(dayjs(today + ' 21:00:00')) || dayjs(this.dateTime).isAfter(dayjs())) && weekList.includes(this.week)) this.periodList.push(item)
|
||||
if ((dayjs().isBefore(dayjs(today + ' 21:30:00')) || dayjs(this.dateTime).isAfter(dayjs())) && weekList.includes(this.week)) this.periodList.push(item)
|
||||
} else {
|
||||
// console.log(this.dateTime + ' ' + item.timePeriod.split(' - ')[0])
|
||||
// console.log(dayjs().isBefore(dayjs(this.dateTime + ' ' + item.timePeriod.split(' - ')[0])))
|
||||
if (weekList.includes(this.week) && dayjs().isBefore(dayjs(this.dateTime + ' ' + item.timePeriod.split(' - ')[0]))) this.periodList.push(item)
|
||||
}
|
||||
})
|
||||
const month = dayjs().format('YYYY-MM')
|
||||
this.periodList.map(item => {
|
||||
console.log('this.periodList', this.periodList)
|
||||
// console.log(this.dateTime)
|
||||
const month = dayjs(this.dateTime).format('YYYY-MM')
|
||||
this.periodListOrigin = JSON.parse(JSON.stringify(this.periodList))
|
||||
this.periodList.map((item, index) => {
|
||||
item.price = item.priceOrigin
|
||||
item.halfPrice = item.halfPriceOrigin
|
||||
if (item.prices && item.prices.includes('{')) {
|
||||
const dataList = JSON.parse(item.prices)[month]
|
||||
console.log(JSON.parse(item.prices), month)
|
||||
if (dataList) {
|
||||
console.log(dayjs(this.dateTime).format('D'))
|
||||
console.log(dataList[dayjs(this.dateTime).format('D') - 1])
|
||||
const price = dataList[dayjs(this.dateTime).format('D') - 1]
|
||||
if (price && price !== '') {
|
||||
item.price = price
|
||||
@@ -320,9 +313,10 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// console.log('item', item)
|
||||
return item
|
||||
})
|
||||
console.log('this.timeListOrigin', this.timeListOrigin)
|
||||
},
|
||||
onDisabled() {
|
||||
this.disabled = !this.disabled;
|
||||
@@ -469,7 +463,8 @@ export default {
|
||||
orderCode: key,
|
||||
siteTimeId: siteTime.id,
|
||||
dateTime: `${this.dateTime}`,
|
||||
comments: `${this.dateTime}(${getWeek(week)})${item.timePeriod}`,
|
||||
// comments: `${this.dateTime}(${getWeek(week)})${item.timePeriod}`,
|
||||
comments: `${this.dateTime} ${item.timePeriod}`,
|
||||
week
|
||||
})
|
||||
console.log(app.selection);
|
||||
|
||||
Reference in New Issue
Block a user