重构会员卡数据库

This commit is contained in:
2024-07-13 13:46:11 +08:00
parent e8b3a99607
commit f3c18408d3
55 changed files with 3802 additions and 272 deletions
+23 -16
View File
@@ -2,9 +2,9 @@
<view class="container">
<!-- deBug信息 -->
<view v-if="merchant" class="web-debug web-text-success" style="display: none;">
场馆ID:{{ merchant.merchantId }} 场馆编号:{{ merchant.merchantCode }} 场馆名称:{{ merchant.merchantName }}
日期:{{ dateTime }}
星期:{{ week }}
场馆ID:{{ merchant.merchantId }} 场馆编号:{{ merchant.merchantCode }} 场馆名称:{{ merchant.merchantName }}
日期:{{ dateTime }}
星期:{{ week }}
订单总金额:{{ totalPrice }}
类型:{{ type }}
场地信息:{{ orderInfo }}
@@ -233,7 +233,7 @@
// 加载预定日期
app.next7day = next7day.map((d, i) => {
if (!app.dateTime && i == 0) {
if (!app.dateTime && i === 0) {
app.dateTime = d.dateTime
app.week = d.week
carStore.dateTime = d.dateTime
@@ -273,11 +273,11 @@
},
onType(e) {
const index = e.currentIndex
if (index == 0) {
if (index === 0) {
this.type = 0;
this.isHalf = 0;
}
if (index == 1) {
if (index === 1) {
this.type = 1;
this.isHalf = 1;
}
@@ -320,13 +320,20 @@
// },
getBookingPeriod() {
const {
serverTime
serverTime,
merchantId
} = this
const now = new Date();
const hours = now.getHours();
const minutes = now.getMinutes()
const startTime = serverTime.today == this.dateTime ? String(hours) + String(minutes) : undefined
const week = this.week == 0 ? 7 : this.week
let startTime;
startTime = serverTime.today == this.dateTime ? String(hours) + String(minutes) : undefined
// 游泳馆当前21:30前都可以预定
if(merchantId === '3028' && Number(startTime) < 2130){
startTime = undefined
}
PeriodApi.listPeriod({
merchantId: this.merchantId,
isStatus: 0,
@@ -344,7 +351,7 @@
icon: 'none'
})
uni.hideLoading()
if(err.message == '您还有未支付订单,请先支付'){
if(err.message === '您还有未支付订单,请先支付'){
setTimeout(() => {
return uni.switchTab({
url: '/pages/order/order'
@@ -395,7 +402,7 @@
// 场地
// const f = this.fieldList[i2]
const key = getKey(`${this.dateTime}${item.timePeriod}${this.merchantId}${item.fieldId}`)
const index = app.selection.findIndex(d => d.key == key)
const index = app.selection.findIndex(d => d.key === key)
if (index >= 0) {
app.selection.splice(index, 1)
} else {
@@ -457,7 +464,7 @@
console.log('period: ',period);
// 是否支持儿童票
console.log('item.isChildren: ',item.isChildren);
if(item.isChildren == 1){
if(item.isChildren === 1){
console.log('item.isChildren2: ',item.isChildren);
carStore.childrenPrice = period.childrenPrice
}else{
@@ -477,11 +484,11 @@
const startTime = new Date(`${this.dateTime} ${timeText}:00`).getTime()
return startTime / 1000 || 0;
},
isActive(item) {
const index = this.selection.find(d => d.key == getKey(`${this.dateTime}${item.timePeriod}${this.merchantId}${item.fieldId}`))
const index = this.selection.find(d => d.key === getKey(`${this.dateTime}${item.timePeriod}${this.merchantId}${item.fieldId}`))
if(item.sold){
if(item.isHalf == 1){
if(item.isHalf === 1){
return 'web-bg-warning'
}
return 'web-bg-info'
@@ -504,7 +511,7 @@
// }
// },
remove(item) {
const index = this.selection.findIndex(d => d.key == item.key)
const index = this.selection.findIndex(d => d.key === item.key)
this.selection.splice(index, 1)
carStore.orderInfo = this.selection
},
@@ -698,4 +705,4 @@
}
}
}
</style>
</style>