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
@@ -411,11 +411,11 @@ export default {
this.sed = JSON.parse(option.sed); this.sed = JSON.parse(option.sed);
this.leftPathType = "navigateTo"; this.leftPathType = "navigateTo";
this.leftPath = null; this.leftPath = null;
await this.addressList(); await this.addressList();
// console.log('addressListOne',this.addressListOne) // console.log('addressListOne',this.addressListOne)
// if(this.addressListOne && this.addressListOne.length){ // if(this.addressListOne && this.addressListOne.length){
// this.addressShow = true; // this.addressShow = true;
// } // }
this.getOrderTwo(); this.getOrderTwo();
} }
@@ -493,7 +493,7 @@ export default {
}, },
onCancel() { onCancel() {
if (this.type == "2") { if (this.type == "2") {
uni.redirectTo({ uni.redirectTo({
url: "/pages/rwa_package/forgotPass/forgotPass?type=1", url: "/pages/rwa_package/forgotPass/forgotPass?type=1",
}); });
} }
@@ -501,7 +501,7 @@ export default {
}, },
onConfirm() { onConfirm() {
if (this.type == "1") { if (this.type == "1") {
uni.redirectTo({ uni.redirectTo({
url: "/pages/rwa_package/forgotPass/forgotPass?type=1", url: "/pages/rwa_package/forgotPass/forgotPass?type=1",
}); });
} else { } else {
@@ -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") {
// parmas["types"] = "1,2,3";
// }
// #ifdef MP-WEIXIN
parmas["types"] = "1,3";
// #endif
// #ifndef MP-WEIXIN
parmas["types"] = "1,2,3";
// #endif
if (this.sed?.activedType == "seckill") {
parmas["types"] = "1,2,3";
}
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) {
resp = await settlementOrder(params); 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 { } else {
params["cartIds"] = this.ids; params["cartIds"] = this.ids;
@@ -957,8 +977,8 @@ export default {
// 提交订单成功,就唤起支付 // 提交订单成功,就唤起支付
if (resp && resp.bizcode === 100) { if (resp && resp.bizcode === 100) {
console.log("提交订单成功", resp.data); console.log("提交订单成功", resp.data);
const item = resp.data; const item = resp.data;
if (item.status === 1) { if (item.status === 1) {
jumpWayOk(); jumpWayOk();
return; return;
@@ -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,12 +1365,20 @@ export default {
} }
const resp = await addGoods(params); const resp = await addGoods(params);
if (resp && resp.bizcode === 100) { if (resp && resp.bizcode === 100) {
this.specificationShow = false;
uni.showToast({ if (isBy) {
title: "成功加入购物车", uni.navigateTo({
icon: "success", // 可选 success/loading/none url: `/pages/order_package/order_submit/order_submit?ids=${resp.data}&address=${this.selectAddress?.id}`,
duration: 2000, // 持续时长,单位ms });
}); } else {
this.specificationShow = false;
uni.showToast({
title: "成功加入购物车",
icon: "success", // 可选 success/loading/none
duration: 2000, // 持续时长,单位ms
});
}
} }
}, },
// 跳转到分享页面 // 跳转到分享页面