diff --git a/components/paymentMethod copy.vue b/components/paymentMethod copy.vue
deleted file mode 100644
index 84e0447..0000000
--- a/components/paymentMethod copy.vue
+++ /dev/null
@@ -1,260 +0,0 @@
-
-
-
-
- 支付方式
-
-
-
-
-
-
-
- {{ item.name }}
-
-
- 当前余额¥{{orderVIP?(orderVIP.amount||0):0}}
- 去充值
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/components/paymentMethod.vue b/components/paymentMethod.vue
index 65a219b..2a26f9e 100644
--- a/components/paymentMethod.vue
+++ b/components/paymentMethod.vue
@@ -15,7 +15,7 @@
{{ item.name }}
- 当前余额¥{{ orderVIP ? orderVIP.amount || 0 : 0 }}
+ 当前余额¥{{ shopUserInfo ? shopUserInfo.amount || 0 : 0 }}
去充值
@@ -66,6 +66,14 @@ const props = defineProps({
type: Array,
default: () => [],
},
+ shopUserInfo:{
+ type: Object,
+ default: () => {
+ return{
+ amount:0
+ }
+ },
+ }
});
// 工具函数 - 深拷贝对象(切断引用)
@@ -77,15 +85,10 @@ function returnDisabled(item) {
return props.disablePayType.includes(item.name);
}
-const orderVIP = ref(null);
const emits = defineEmits(["customevent", "groupChange"]);
-watchEffect(() => {
- orderVIP.value = uni.cache.get("orderVIP");
-});
-const orderVIPfun = (data) => {
- orderVIP.value = data;
-};
+
+
// 支付方式列表(保持不变)
const paymentMethodList = ref([
@@ -207,13 +210,12 @@ const goRecharge = () => {
return;
}
uni.navigateTo({
- url: `/pages/user/member/czzx?shopId=${orderVIP.value?.shopId || ''}`,
+ url: `/pages/user/member/czzx?shopId=${props.shopUserInfo?.shopId || ''}`,
});
};
defineExpose({
groupChanges,
- orderVIPfun,
});
diff --git a/pages/order/confirm-order-back.vue b/pages/order/confirm-order-back.vue
deleted file mode 100644
index 50e940e..0000000
--- a/pages/order/confirm-order-back.vue
+++ /dev/null
@@ -1,1407 +0,0 @@
-
-
-
-
-
-
-
- 待支付
- 已完成
- 退单
- 部分退单
- 取消订单
-
- 下单时间:{{ listinfo.createTime }}
-
- 付款时间:{{listinfo.paidTime}}
-
-
-
-
-
- 扫码加好友,优惠多多
- 优惠活动多
- 充值有好礼
- 会员享低价
- 长按保存,微信内扫一扫加好友
-
-
-
-
-
-
-
-
-
-
- {{cartStore.orderCostSummary}}
-
-
-
-
-
-
-
-
-
-
-
-
-
- 实付金额:
-
- ¥{{listinfo.totalCost}}
-
-
-
-
-
-
-
-
-
- 加菜
-
-
-
-
-
-
-
- 仅下单
-
-
-
-
-
- 加菜
-
-
-
-
-
- {{paymentmethod.paymentBtnText}}
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/order/confirm-order.vue b/pages/order/confirm-order.vue
index dc6d290..1a41fe5 100644
--- a/pages/order/confirm-order.vue
+++ b/pages/order/confirm-order.vue
@@ -67,7 +67,7 @@
-
@@ -203,6 +203,7 @@
useWebSocket
} from "@/stores/carts-websocket.js";
import * as chatApi from "@/http/php/chat";
+ import * as rechargeApi from '@/common/api/market/recharge.js'
import MsgListItem from '@/components/msg-list-item/msg-list-item.vue'
@@ -858,8 +859,6 @@
icon: "none",
});
const shopUserInfo = uni.cache.get("shopUserInfo");
- console.log("shopUserInfo", shopUserInfo);
- console.log("listinfo", listinfo);
if (shopUserInfo) {
if (shopUserInfo.userId == listinfo.userId) {
pay_unlock();
@@ -1011,7 +1010,6 @@
// 更新数据
if (orderVIP.value) {
orderVIP.value = uni.cache.get("orderVIP");
- paymentMethodref.value.orderVIPfun(uni.cache.get("orderVIP"));
if (listinfo.id && ordershopUserInfo.value.registerType != "before") {
orderorderInfo();
}
@@ -1113,10 +1111,11 @@
}
const limitTimeDiscountRes = ref(null)
+ const rechargeConfig=ref(null)
async function init(opt) {
- await storeuser.actionsproductqueryProduct();
-
- console.log("init");
+ const res1= await storeuser.actionsproductqueryProduct();
+ orderVIP.value=res1
+ console.log('orderVIP',orderVIP.value)
cartStore.clearOrderConfig();
Object.assign(options, opt);
listinfo.id = options.orderId;
@@ -1158,6 +1157,11 @@
const shopInfoRes = await APIusershopInfodetail({
shopId: options.shopId,
});
+ //智慧充值
+ const rechargeConfigRes=await rechargeApi.config({shopId: options.shopId})
+ if(rechargeConfigRes&&typeof rechargeConfigRes ==='object'){
+ rechargeConfig.value=rechargeConfigRes
+ }
//获取积分配置
pointsApi.pointsConfig().then(res => {
cartStore.setPointDeductionRule(res);
@@ -1282,6 +1286,9 @@
if (!isCanUseCharge.value) {
arr.add("余额支付");
}
+ if(rechargeConfig.value&&!rechargeConfig.value.isEnable){
+ arr.add("余额支付");
+ }
return Array.from(arr);
});
diff --git a/pages/order/detail.vue b/pages/order/detail.vue
index ceb99b8..617e81d 100644
--- a/pages/order/detail.vue
+++ b/pages/order/detail.vue
@@ -583,7 +583,6 @@
console.log(uni.cache.get('orderVIP'))
orderVIP.value = uni.cache.get('orderVIP')
ordershopUserInfo.value = orderVIP.value.shopInfo
- paymentMethodref.value.orderVIPfun(uni.cache.get('orderVIP'))
if (orderId.value) {
orderorderInfo()
}
diff --git a/pages/product/index.vue b/pages/product/index.vue
index 702eef8..6c5bab0 100644
--- a/pages/product/index.vue
+++ b/pages/product/index.vue
@@ -1585,11 +1585,10 @@
// 返回商品对应sku数据
function cartInit(arr) {
+
const result = []
- console.log('cartInitArr', arr);
- console.log('allGoodsArr', allGoodsArr);
cartStore.carts = arr.map(v => {
- const goods = allGoodsArr.find(g => g.id == v.product_id)
+ const goods = cartStore.allGoodsArr.find(g => g.id == v.product_id)
const goodsSkuList = goods ? goods.skuList : []
const findSku = goodsSkuList.find(sku => sku.id == v.sku_id)
const memberPrice = findSku ? findSku.memberPrice : 0
@@ -1599,6 +1598,13 @@
}, cartStore.limitTimeDiscount, shopInfo,
shopUserInfo.value, 'product_id');
if (!goods) {
+ console.log('删除未匹配到的商品', {
+ id: v.id,
+ operate_type: "del",
+ table_code: uni.cache.get('tableCode'),
+ shop_id: uni.cache.get('shopId'),
+ type: "shopping",
+ })
useSocket.sendMessage({
id: v.id,
operate_type: "del",
@@ -1647,7 +1653,7 @@
isLoading.value = false;
return false;
}
- console.log('product index 收到消息', Message);
+
// 检查消息是否已经处理过
if (processedMessageIds.has(Message.msg_id)) {
return;
@@ -2084,11 +2090,11 @@
}
return currentTime >= startTime && currentTime <= endTime;
});
- let allGoodsArr = []
+ const allGoodsArr = ref([])
// 列表请求
const productqueryProduct = async () => {
cartStore.goodsIsloading = false;
- allGoodsArr = []; // 确保声明过(建议用ref/let声明,避免全局隐式变量)
+ allGoodsArr.value=[]
try {
shopProductList.hots = await productminiApphotsquery();
shopProductList.productInfo = await APIgroupquery();
@@ -2114,7 +2120,7 @@
product.startTime,
product.endTime
);
- allGoodsArr.push(product);
+ allGoodsArr.value.push(product);
cartStore.setGoodsMap(product.id, product);
}
}
@@ -2123,14 +2129,15 @@
for (const i of shopProductList.hots) {
i.cartNumber = 0;
i.isSaleTimeshow = await isProductAvailable(i.days, i.startTime, i.endTime);
- allGoodsArr.push(i);
+ allGoodsArr.value.push(i);
cartStore.setGoodsMap(i.id, i);
}
// 此时所有异步操作完成,allGoodsArr已有数据
- console.log('allGoodsArr', allGoodsArr);
- console.log('shopProductList', shopProductList);
-
+ // console.log('allGoodsArr', allGoodsArr);
+ // console.log('shopProductList', shopProductList);
+ console.log('cartStore.carts', cartStore.carts)
+ cartStore.allGoodsArr=allGoodsArr.value
if (cartStore.carts.length > 0) {
cartInit(cartStore.carts);
}
diff --git a/stores/carts.js b/stores/carts.js
index 824a79a..1579900 100644
--- a/stores/carts.js
+++ b/stores/carts.js
@@ -39,6 +39,9 @@ export const useCartsStore = defineStore("cart", () => {
);
//用户信息
const shopUserInfo = ref(uni.cache.get("shopUserInfo") || {});
+
+ //全部的商品列表
+ const allGoodsArr=ref([])
const consumeDiscount = ref({});
@@ -754,6 +757,6 @@ export const useCartsStore = defineStore("cart", () => {
//限时折扣
limitTimeDiscount,
shopUserInfo,
- socketSendMsg,
+ socketSendMsg,allGoodsArr
};
});
\ No newline at end of file