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() { async getWayOption() {
let parmas = {}; let parmas = {};
if (this.isPoints) { // if (this.isPoints) {
parmas["types"] = "4"; // parmas["types"] = "4";
} else { // } else {
parmas["types"] = "1,2,3"; // parmas["types"] = "1,2,3";
} // }
console.log("parmas-----", this.isCoupon); // console.log("parmas-----", this.isCoupon);
if (this.isCoupon) { // if (this.isCoupon) {
parmas["types"] = "1,2,3"; // parmas["types"] = "1,2,3";
parmas.isDeduction = true; // 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"; parmas["types"] = "1,2,3";
} // #endif
const result = await getSupportPay(parmas); const result = await getSupportPay(parmas);
if (result && result.bizcode === 100) { if (result && result.bizcode === 100) {
const data = result.data || []; const data = result.data || [];
@@ -901,7 +908,7 @@ export default {
if (params.payway == "wechat") { if (params.payway == "wechat") {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
params["payway"] = "wechatMiniProgram"; params["payway"] = "wechat";
params["code"] = await new Promise((resolve) => { params["code"] = await new Promise((resolve) => {
uni.login({ uni.login({
provider: "weixin", provider: "weixin",
@@ -920,7 +927,7 @@ export default {
console.log("收货地址ID--params", params); console.log("收货地址ID--params", params);
let resp = null; let resp = null;
console.log("orderInfo----", this.sed); console.log("orderInfo----", this.sed, this.orderInfo);
if (this.sed) { if (this.sed) {
if ( if (
this.orderInfo.paymentMethod == "balance" || this.orderInfo.paymentMethod == "balance" ||
@@ -939,8 +946,21 @@ export default {
params["activityId"] = Number(this.sed?.activityId); // 秒杀活动ID params["activityId"] = Number(this.sed?.activityId); // 秒杀活动ID
resp = await setSeckillOrder(params); resp = await setSeckillOrder(params);
} else { } else {
if (this.isCoupon) params.payway2 = "vcoin"; if (this.isCoupon) {
params.payway2 = "vcoin";
resp = await settlementOrder(params); 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 { } else {
params["cartIds"] = this.ids; params["cartIds"] = this.ids;
@@ -1331,8 +1331,8 @@ export default {
}; };
console.log("selectTempl", selectTempl); console.log("selectTempl", selectTempl);
if (this.isShowCart == 1 || this.isCoupon || isBy) { if (this.isShowCart == 1 || this.isCoupon) {
console.log("活动类型params---秦星星", params, this.isCoupon); console.log("活动类型params---秦星星", params, this.isCoupon, this.isShowCart == 1);
params["specsId"] = selectTempl; params["specsId"] = selectTempl;
let url = ""; let url = "";
if (this.activedType == "seckill") { if (this.activedType == "seckill") {
@@ -1356,6 +1356,8 @@ export default {
this.specificationShow = false; this.specificationShow = false;
} }
console.log("活动类型params---秦星星--1", url);
uni.navigateTo({ uni.navigateTo({
url: url url: url
}); });
@@ -1363,6 +1365,12 @@ export default {
} }
const resp = await addGoods(params); const resp = await addGoods(params);
if (resp && resp.bizcode === 100) { 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; this.specificationShow = false;
uni.showToast({ uni.showToast({
title: "成功加入购物车", title: "成功加入购物车",
@@ -1370,6 +1378,8 @@ export default {
duration: 2000, // 持续时长,单位ms duration: 2000, // 持续时长,单位ms
}); });
} }
}
}, },
// 跳转到分享页面 // 跳转到分享页面
jumpShare() { jumpShare() {