2.0.0相关修改更新

This commit is contained in:
GaoHao
2024-11-25 16:06:59 +08:00
parent 28950f0ad1
commit 740a3201e4
7 changed files with 94 additions and 68 deletions

View File

@@ -34,7 +34,7 @@
<block v-if="listinfo.useType == 'dine-in-after'">
<rechargeFree
:rechargeFreeChecked="rechargeFreeChecked"
v-if="listinfo.freeDingConfig.enable == 1&&(listinfo.status == 'unpaid' || listinfo.status == 'paying')"
v-if="listinfo.freeDingConfig&&listinfo.freeDingConfig.enable == 1&&(listinfo.status == 'unpaid' || listinfo.status == 'paying')"
ref="rechargeFree"
:freeDisabled="freeDisabled"
:payAmount="listinfo.payAmount"
@@ -43,7 +43,7 @@
<block v-else>
<rechargeFree
:rechargeFreeChecked="rechargeFreeChecked"
v-if="listinfo.freeDingConfig.enable == 1&&(!listinfo.orderInfo.couponInfoList&&listinfo.orderInfo.pointsDiscountAmount<=0)&&(listinfo.status == 'unpaid' || listinfo.status == 'paying')"
v-if="listinfo.freeDingConfig&&listinfo.freeDingConfig.enable == 1&&(!listinfo.orderInfo.couponInfoList&&listinfo.orderInfo.pointsDiscountAmount<=0)&&(listinfo.status == 'unpaid' || listinfo.status == 'paying')"
ref="rechargeFree"
:freeDisabled="freeDisabled"
:payAmount="listinfo.payAmount"
@@ -122,12 +122,24 @@
this.orderId = e.orderId
this.orderorderInfo()
},
onShow() {
mounted() {
if ( this.listinfo.useType == "dine-in-after") {
console.log(this.$refs.orderInfoAfterRef)
this.$nextTick(()=>{
this.$refs.orderInfoAfterRef.childOnShow();
})
}
},
onShow() {
console.log("this.listinfo==",this.listinfo)
if ( this.listinfo.useType == "dine-in-after") {
console.log(this.$refs.orderInfoAfterRef)
this.$nextTick(()=>{
this.$refs.orderInfoAfterRef.childOnShow();
})
}
if ( this.listinfo ) {
this.getAount();
}
},
onUnload() {
@@ -150,7 +162,7 @@
this.couopnInfo = data;
this.freeDisabled = data.freeDisabled
this.freeCheck = data.freeCheck
if ( this.listinfo.payAmount < this.listinfo.freeDingConfig.rechargeThreshold ) {
if ( this.listinfo.freeDingConfig && this.listinfo.payAmount < this.listinfo.freeDingConfig.rechargeThreshold ) {
this.freeDisabled = true
} else {
this.freeDisabled = false
@@ -165,7 +177,6 @@
// this.freeCheck = val;
this.rechargeFreeChecked = !val
if ( this.rechargeFreeChecked ) {
if ( this.couopnInfo) {
if ( this.couopnInfo.isPointsChecked ) {
@@ -186,10 +197,9 @@
}
this.listinfo.payAmount = (this.listinfo.payAmount*this.listinfo.freeDingConfig.rechargeTimes).toFixed(2)
} else {
this.couopnInfo.isPointsChecked = false;
this.listinfo.payAmount = (this.listinfo.payAmount/this.listinfo.freeDingConfig.rechargeTimes).toFixed(2)
if ( this.couopnInfo) {
this.couopnInfo.isPointsChecked = false;
let couponList = this.couopnInfo.userCouponInfos.filter(v => v.type == 1);
if ( couponList.length > 0) {
this.listinfo.payAmount = (couponList.length > 0 ? Number(this.listinfo.payAmount) - couponList[0].discountAmount : this.listinfo.payAmount)
@@ -203,9 +213,6 @@
}
}
console.log(this.freeCheck)
},
saveImage (url) {
uni.saveImage({
@@ -223,7 +230,7 @@
*/
async getAount() {
let res = await this.api.shopUserInfo({
"shopId": this.shopId,
"shopId": this.listinfo.shopId,
"userId": uni.cache.get('userInfo').id,
})
if (res.code == 0) {
@@ -253,11 +260,12 @@
if (this.listinfo.useType == " ") {
//堂食先付费
}
if ( this.listinfo.payAmount < this.listinfo.freeDingConfig.rechargeThreshold ) {
if ( this.listinfo.freeDingConfig && this.listinfo.payAmount < this.listinfo.freeDingConfig.rechargeThreshold ) {
this.freeDisabled = true
}
console.log(this.listinfo)
if ( this.listinfo.useType == "dine-in-after") {
console.log(this.$refs.orderInfoAfterRef)
this.$nextTick(()=>{
this.$refs.orderInfoAfterRef.childOnShow();
})
@@ -265,17 +273,8 @@
this.getAount();
}
let params = {
userId: uni.cache.get('userInfo').id,
status: 1,
orderId: -1,
shopId: this.shopId
}
console.log("params",params)
let ress = await this.api.conponList(params)
if (ress.code == 0) {
let list = ress.data;
}
},
/**
@@ -283,7 +282,7 @@
*/
goRecharge() {
uni.pro.navigateTo('/pages/member/index', {
shopId: this.shopId
shopId: this.listinfo.shopId
})
},
@@ -304,6 +303,7 @@
orderId: this.listinfo.orderId,
userCouponInfos: this.couopnInfo.userCouponInfos,
}
console.log( this.couopnInfo )
if ( this.couopnInfo.isPointsChecked && this.couopnInfo.calcUsablePointsData.pointsNum && this.couopnInfo.calcUsablePointsData.pointsNum > 0) {
params.pointsNum = this.couopnInfo.calcUsablePointsData.pointsNum;
}
@@ -424,7 +424,7 @@
} else {
console.log(this.listinfo.payAmount)
res = await this.api.paymemeberIn({
shopId: uni.cache.get('shopId'),
shopId: this.listinfo.shopId,
amount: this.listinfo.payAmount,
orderId: this.orderId,
// #ifdef MP-WEIXIN