feat:优化

This commit is contained in:
2026-07-23 20:11:26 +08:00
parent 6042342641
commit 1a493b4faf
2 changed files with 66 additions and 36 deletions
@@ -532,21 +532,28 @@ export default {
},
async getWayOption() {
let parmas = {};
if (this.isPoints) {
parmas["types"] = "4";
} else {
parmas["types"] = "1,2,3";
}
console.log("parmas-----", this.isCoupon);
// if (this.isPoints) {
// parmas["types"] = "4";
// } else {
// parmas["types"] = "1,2,3";
// }
// console.log("parmas-----", this.isCoupon);
if (this.isCoupon) {
parmas["types"] = "1,2,3";
parmas.isDeduction = true;
}
// if (this.isCoupon) {
// parmas["types"] = "1,2,3";
// parmas.isDeduction = true;
// }
if (this.sed?.activedType == "seckill") {
// if (this.sed?.activedType == "seckill") {
// parmas["types"] = "1,2,3";
// }
// #ifdef MP-WEIXIN
parmas["types"] = "1,3";
// #endif
// #ifndef MP-WEIXIN
parmas["types"] = "1,2,3";
}
// #endif
const result = await getSupportPay(parmas);
if (result && result.bizcode === 100) {
const data = result.data || [];
@@ -901,7 +908,7 @@ export default {
if (params.payway == "wechat") {
// #ifdef MP-WEIXIN
params["payway"] = "wechatMiniProgram";
params["payway"] = "wechat";
params["code"] = await new Promise((resolve) => {
uni.login({
provider: "weixin",
@@ -920,7 +927,7 @@ export default {
console.log("收货地址ID--params", params);
let resp = null;
console.log("orderInfo----", this.sed);
console.log("orderInfo----", this.sed, this.orderInfo);
if (this.sed) {
if (
this.orderInfo.paymentMethod == "balance" ||
@@ -939,8 +946,21 @@ export default {
params["activityId"] = Number(this.sed?.activityId); // 秒杀活动ID
resp = await setSeckillOrder(params);
} else {
if (this.isCoupon) params.payway2 = "vcoin";
if (this.isCoupon) {
params.payway2 = "vcoin";
resp = await settlementOrder(params);
} else {
// params["cartIds"] = this.ids;
if (
this.orderInfo.paymentMethod == "balance" ||
this.orderInfo.paymentMethod == "redpacket"
) {
params["password"] = CryptoJS.MD5(this.payPwd).toString();
}
resp = await settle(params);
}
// resp = await settle(params);
}
} else {
params["cartIds"] = this.ids;
@@ -1331,8 +1331,8 @@ export default {
};
console.log("selectTempl", selectTempl);
if (this.isShowCart == 1 || this.isCoupon || isBy) {
console.log("活动类型params---秦星星", params, this.isCoupon);
if (this.isShowCart == 1 || this.isCoupon) {
console.log("活动类型params---秦星星", params, this.isCoupon, this.isShowCart == 1);
params["specsId"] = selectTempl;
let url = "";
if (this.activedType == "seckill") {
@@ -1356,6 +1356,8 @@ export default {
this.specificationShow = false;
}
console.log("活动类型params---秦星星--1", url);
uni.navigateTo({
url: url
});
@@ -1363,6 +1365,12 @@ export default {
}
const resp = await addGoods(params);
if (resp && resp.bizcode === 100) {
if (isBy) {
uni.navigateTo({
url: `/pages/order_package/order_submit/order_submit?ids=${resp.data}&address=${this.selectAddress?.id}`,
});
} else {
this.specificationShow = false;
uni.showToast({
title: "成功加入购物车",
@@ -1370,6 +1378,8 @@ export default {
duration: 2000, // 持续时长,单位ms
});
}
}
},
// 跳转到分享页面
jumpShare() {