代客下单修改,登录页面修改,部分页面调整,请求封装调整

This commit is contained in:
2025-11-27 18:02:28 +08:00
parent f9cc02e93f
commit 3bb09ef0b1
45 changed files with 4934 additions and 1054 deletions

View File

@@ -441,8 +441,8 @@ async function getDiscountActivity() {
let res = await discountActivity({
shopId: uni.getStorageSync("shopId"),
});
if (res.code == 200) {
fullReductionActivities.value = res.data ? [res.data] : [];
if (res) {
fullReductionActivities.value = res ? [res] : [];
}
}
onLoad(async (opt) => {
@@ -476,7 +476,7 @@ async function init() {
onMessage();
});
// 获取订单详情
const { data: orderRes } = await getHistoryOrder({ orderId: order.orderId });
const orderRes = await getHistoryOrder({ orderId: order.orderId });
if (orderRes.status == "cancelled") {
uni.showToast({
title: "订单已取消",
@@ -505,7 +505,7 @@ async function init() {
userId: order.userId || pageData.user.userId,
}).then((res) => {
if (res.code == 200) {
pageData.user = res.data;
pageData.user = res;
getCalcUsablePoints();
if (orderRes.pointsNum) {
accountPoints.sel = true;
@@ -811,7 +811,7 @@ function getPayUrl() {
}
getOrderPayUrl(params).then((res) => {
console.log(res, "tishi");
payCodeUrl.value = res.data;
payCodeUrl.value = res;
pageData.payUrlShow = true;
});
}
@@ -823,7 +823,7 @@ async function getPayType() {
const payTypeList = await getPayTypeList();
pays.payTypes.list = [];
const arr = ["cash", "member-account"];
payTypeList.data.map((v) => {
payTypeList.map((v) => {
if (v.payType != "bank") {
let disabled = false;
if (orderCostSummary.value.finalPayAmount <= 0) {
@@ -880,11 +880,11 @@ async function getCalcUsablePoints() {
shopUserId: pageData.user.id,
orderAmount: pointsCanDicountMaxMoney.value,
});
console.log("getCalcUsablePoints", res.data);
pointDeductionRule.pointsPerYuan = res.data.equivalentPoints;
pointDeductionRule.maxDeductionAmount = res.data.maxDeductionAmount;
accountPoints.calcRes = res.data;
accountPoints.num = res.data.maxUsablePoints;
console.log("getCalcUsablePoints", res);
pointDeductionRule.pointsPerYuan = res.equivalentPoints;
pointDeductionRule.maxDeductionAmount = res.maxDeductionAmount;
accountPoints.calcRes = res;
accountPoints.num = res.maxUsablePoints;
return res;
}
@@ -1039,8 +1039,8 @@ function getShopUserDetail() {
// shopId: uni.getStorageSync("shopInfo").id,
id: pageData.user.id,
}).then((res) => {
if (res.data) {
pageData.user = res.data;
if (res) {
pageData.user = res;
}
});
}
@@ -1051,9 +1051,9 @@ function getNewUserDiscount() {
getDiscountByUserId({
shopUserId: pageData.user.id,
}).then((res) => {
if (res.data) {
newUserDiscount.value = res.data.amount || 0;
newUserDiscountRes.value = res.data;
if (res) {
newUserDiscount.value = res.amount || 0;
newUserDiscountRes.value = res;
}
});
}
@@ -1226,12 +1226,11 @@ async function pay(par) {
payStatus = "";
return false;
}
console.log(payRes);
if (payRes && payRes.code == 200) {
if (payRes ) {
paySuccess();
} else {
uni.showToast({
title: payRes.msg || "支付失败",
title: "支付失败",
icon: "none",
});
}
@@ -1345,7 +1344,7 @@ function cashConfirmShow() {
*/
async function getHistoryAndUpdateGoodsList() {
// 获取订单详情
const { data: orderRes } = await getHistoryOrder({ orderId: order.orderId });
const orderRes = await getHistoryOrder({ orderId: order.orderId });
if (orderRes.status == "cancelled") {
uni.showToast({
title: "订单已取消",