diff --git a/common/api/request.js b/common/api/request.js
index d4d6a86..da44ef7 100644
--- a/common/api/request.js
+++ b/common/api/request.js
@@ -7,33 +7,7 @@ export default async (params) => {
let token = uni.cache.get("token") || "";
const shopId = uni.cache.get("shopId") * 1;
const userInfo = uni.cache.get("userInfo") || {};
- // #ifdef H5
- token = "1b5e8baf0cc1492a858a208f113d0971";
- uni.cache.set('userInfo', {
- "acQrcodeValidTime": "2026-01-13 13:35:59",
- "alipayOpenId": "",
- "birthDay": "",
- "createTime": "2024-03-13 10:56:40",
- "distributionAmount": 0,
- "headImg": "https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132",
- "id": "36689",
- "idCard": "",
- "isAc": 0,
- "lastLoginTime": "2025-12-24 11:24:12",
- "nickName": "微信用户",
- "password": "",
- "payPwd": "e10adc3949ba59abbe56e057f20f883e",
- "phone": "",
- "realName": "",
- "sex": null,
- "status": 1,
- "updateTime": "2025-12-24 11:22:47",
- "usePayPwd": 0,
- "wechatAcOpenId": "",
- "wechatAcQrcode": "http://weixin.qq.com/q/029s5JtP1xfmJ1g_HDxFco",
- "wechatOpenId": "or1l86yipGvwyfPhrKIAcQuSfAV8"
- })
- // #endif
+
let header = {
version: uni.conf.version,
type: uni.getSystemInfoSync().platform,
diff --git a/common/config.js b/common/config.js
index a1d0fa7..b15f716 100644
--- a/common/config.js
+++ b/common/config.js
@@ -1,8 +1,35 @@
// const debug = process.env.NODE_ENV == 'development' ? true : false;
-const debug = false; // false线上 true本地
+const debug = true; // false线上 true本地
let baseUrl = ''
let baseUrlwws = ''
+// #ifdef H5
+uni.cache.set('token', 'b61c8b0f1c9d47ad924e33c48b496ce6')
+uni.cache.set('userInfo', {
+ "acQrcodeValidTime": "2025-11-17 17:57:16",
+ "alipayOpenId": "",
+ "birthDay": "2025-10-17",
+ "createTime": "2024-07-06 11:30:16",
+ "distributionAmount": 0,
+ "headImg": "https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132",
+ "id": "36434",
+ "idCard": "612401199810058031",
+ "isAc": 0,
+ "lastLoginTime": "2025-12-24 14:30:51",
+ "nickName": "微信用户",
+ "password": "",
+ "payPwd": "e10adc3949ba59abbe56e057f20f883e",
+ "phone": "18049104914",
+ "realName": "叶明飞",
+ "sex": 1,
+ "status": 1,
+ "updateTime": "2025-12-24 14:29:51",
+ "usePayPwd": 0,
+ "wechatAcOpenId": "1111",
+ "wechatAcQrcode": "",
+ "wechatOpenId": "or1l86yipGvwyfPhrKIAcQuSfAV8"
+})
+// #endif
const version = "100";
@@ -11,7 +38,7 @@ const autoRemoveCache = {
size: 100000,
};
-function init(){
+function init() {
if (debug) {
baseUrl = 'http://192.168.1.42'
baseUrlwws = "ws://192.168.1.42:2348";
@@ -20,12 +47,12 @@ function init(){
baseUrlwws = "wss://czgeatws.sxczgkj.com/wss";
}
// #ifdef H5
-
+
if (debug) {
baseUrl = "/api";
baseUrlwws = "http://192.168.1.42:2348";
} else {
- baseUrl = "/prodApi";
+ baseUrl = "/prodApi";
baseUrlwws = "https://czgeatws.sxczgkj.com/wss";
}
// #endif
diff --git a/pages/order/components/orderInfo.vue b/pages/order/components/orderInfo.vue
index 84d569f..321f7e3 100644
--- a/pages/order/components/orderInfo.vue
+++ b/pages/order/components/orderInfo.vue
@@ -40,9 +40,19 @@
:nowCarts="nowCarts"
:limitDiscount="cartStore.limitTimeDiscount"
> -->
-
+
+
+
+ {{showAllGoods?'收起':'展开'}}
+
+
+
+
+
+
@@ -328,7 +338,9 @@
import {
BigNumber
} from "bignumber.js";
-
+
+
+ const showAllGoods=ref(false)
let hasCouponCanUse = ref(false);
const usePoints = ref(false);
@@ -852,6 +864,16 @@
await getConsumeDiscount();
getDiscountActivity();
});
+
+ const nowCarts=computed(()=>{
+ if(cartStore.allGoods.length<=0){
+ return []
+ }
+ if(showAllGoods.value){
+ return cartStore.allGoods
+ }
+ return cartStore.allGoods.slice(0,4)
+ })
\ No newline at end of file
diff --git a/pages/product/index.vue b/pages/product/index.vue
index 63dcd80..da012bb 100644
--- a/pages/product/index.vue
+++ b/pages/product/index.vue
@@ -148,8 +148,10 @@
@click.stop="clickspecifications(item, index, index1)">
选择套餐
选规格
+
{{ ifcartNumber(item) < 99 ? ifcartNumber(item) : '99+' }}
+ v-if="returnGoodsImCartNum(item)">{{ returnGoodsImCartNum(item) < 99 ? returnGoodsImCartNum(item) : '99+' }}
@@ -288,8 +290,11 @@
@click.stop="clickspecifications(item1, index, index1)">
选择套餐
选规格
- {{ ifcartNumber(item1) < 99 ? ifcartNumber(item1) : '99+' }}
+
+
+ {{ returnGoodsImCartNum(item1) < 99 ? returnGoodsImCartNum(item1) : '99+' }}
@@ -700,6 +705,7 @@
import {
useCartStore
} from '@/stores/order.js';
+import { computed } from 'vue';
const cartStore = useCartStore();
/**
* store本地存储 end
@@ -800,9 +806,35 @@
};
-
-
-
+
+
+
+
+
+ // 购物车对应的商品数
+ const GoodsIDInCartNumMap=computed(()=>{
+ const map={}
+ for(let cart in cartStore.carts){
+ if(map[cart.product_id]){
+ map[cart.product_id]+=cart.number*1
+ }else{
+ map[cart.product_id]=cart.number*1
+ }
+
+ }
+ return map
+ })
+
+ /**
+ * 返回购物车对应的商品数量
+ */
+ function returnGoodsImCartNum(goods){
+ if(GoodsIDInCartNumMap.value.hasOwnProperty([goods.id]) ){
+ GoodsIDInCartNumMap.value[goods.id]
+ }
+ return 0
+ }
+
// 获取商品数据
const shopProductList = reactive({
@@ -2106,7 +2138,6 @@
//第一步:将所有商品的 cartNumber 初始化为 0
shopProductList.productInfo.forEach((group) => {
group.productList.forEach(async (product) => {
- product.cartNumber = 0;
product.isSaleTimeshow = await isProductAvailable(product.days, product
.startTime, product.endTime);
@@ -2116,7 +2147,6 @@
});
});
shopProductList.hots.forEach(async (i) => {
- i.cartNumber = 0;
i.isSaleTimeshow = await isProductAvailable(i.days, i.startTime, i.endTime);
allGoodsArr.push(i)
cartStore.setGoodsMap(i.id, i);