增加培训班管理,增加购物车功能

This commit is contained in:
liuyuan
2025-07-01 16:35:55 +08:00
parent 06340ad137
commit 249b4b93f6
25 changed files with 4428 additions and 1764 deletions

View File

@@ -304,7 +304,7 @@ export default {
}
//如果是延期的
if(this.yanqiStatus){
if(this.yanqiStatus||this.orderType=='pxb'){
this.priceBreakdownList.push({
type: 2,
imgUrl: require("@/static/icon/jifen.png"),
@@ -327,7 +327,7 @@ export default {
if (this.userInfo.id != undefined) {
await this.$http.post("book/user/info/" + this.userInfo.id).then(async(res) => {
this.user = res.user;
if(this.yanqiStatus){
if(this.yanqiStatus||this.orderType=='pxb'){
await this.getTotalPrice(res.user);
}
@@ -447,25 +447,32 @@ export default {
//培训班的购买
async submitPxb() {
debounce(async () => {
uni.showLoading({
title: '加载中'
});
if(!this.name){
uni.showToast({
title: "培训姓名不能为空",
icon: 'none'
});
uni.hideLoading()
return
return false;
}
if(this.buyStatus){
uni.showToast({
title: "请勿重复下单",
icon: "none",
});
return false;
}
uni.showLoading({
title: '加载中'
});
//下单状态
this.buyStatus = true;
var that = this;
let data = {
paymentMethod: that.payType,
orderMoney: that.options.price,
jfDeduction: that.jfNumber,
realMoney: that.actualPayment,
come: '2',
come: '3',
remark: that.options.title,
trainingClassId: that.options.id,
trainingClassIdentity: that.options.identity +''+that.options.price,
@@ -488,6 +495,7 @@ export default {
title: "失败,请重新下单",
icon: "none"
});
that.buyStatus = false;
} else {
if (that.payType == 2) {
// 常规支付
@@ -519,6 +527,7 @@ export default {
}, 1000);
} else {
setTimeout(() => {
that.buyStatus = false;
console.log("延迟调用 失败提示");
uni.showToast({
title: "支付失败"
@@ -545,8 +554,7 @@ export default {
})
}, 1000);
} else {
if (res.data.errMsg.indexOf(
"User canceled") != -1) {
if (res.data.errMsg.indexOf("User canceled") != -1) {
uni.showToast({
title: "用户取消支付",
icon: "none"
@@ -557,6 +565,7 @@ export default {
icon: "none"
});
}
that.buyStatus = false;
}
});
} else if (that.payType == 4) {
@@ -573,12 +582,12 @@ export default {
}
}
}
uni.removeStorageSync('mynavData');
})
.catch(()=>{
uni.hideLoading()
uni.hideLoading();
that.buyStatus = false;
});
}, 400);
}, 1000);
},
//vip的购买
@@ -733,7 +742,7 @@ export default {
this.xieyi = data;
this.xieyiShow = true;
},
}
},
};
</script>