From bde30fa70cfa0c4ed046b13684ca9d5cb5031f64 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Fri, 26 Dec 2025 16:14:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=B4=E6=97=B6=E8=8F=9C?= =?UTF-8?q?=E5=92=8C=E6=95=B0=E7=AD=BE=E5=AD=90=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E4=BF=AE=E5=A4=8D=E4=B8=8B=E5=8D=95=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=95=86=E5=93=81=E5=BC=B9=E7=AA=97=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/api/request.js | 4 +- common/config.js | 2 +- distribution/income-details/index.vue | 6 +- pages/order/components/order-item.vue | 19 ++- pages/order/components/orderInfoAfter.vue | 11 +- pages/order/index.vue | 40 +++-- pages/product/components/goods-modal.vue | 178 +++++++++++++++----- pages/product/components/shoppingCartes.vue | 18 +- pages/product/index.vue | 8 +- stores/carts.js | 8 +- 10 files changed, 206 insertions(+), 88 deletions(-) diff --git a/common/api/request.js b/common/api/request.js index c8192cc..c6a2e1b 100644 --- a/common/api/request.js +++ b/common/api/request.js @@ -35,8 +35,8 @@ export default async (params) => { }); } // #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-25 11:41:15","nickName":"微信用户","password":"","payPwd":"e10adc3949ba59abbe56e057f20f883e","phone":"18049104914","realName":"叶明飞","sex":1,"status":1,"updateTime":"2025-12-25 09:41:58","usePayPwd":0,"wechatAcOpenId":"1111","wechatAcQrcode":"","wechatOpenId":"or1l86yipGvwyfPhrKIAcQuSfAV8"}) + uni.cache.set('token', '1b5e8baf0cc1492a858a208f113d0971') + uni.cache.set('userInfo',{"acQrcodeValidTime":"2026-01-13 13:35:59","alipayOpenId":"","birthDay":"2025-12-25","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-26 10:01:12","nickName":"微信用户","password":"","payPwd":"e10adc3949ba59abbe56e057f20f883e","phone":"18049104914","realName":"","sex":1,"status":1,"updateTime":"2025-12-26 09:59:31","usePayPwd":0,"wechatAcOpenId":"","wechatAcQrcode":"http://weixin.qq.com/q/029s5JtP1xfmJ1g_HDxFco","wechatOpenId":"or1l86yipGvwyfPhrKIAcQuSfAV8"}) // #endif return new Promise((resolve, reject) => { const timeoutDuration = params.timeout || 10000; // 可以通过 params 传入超时时间,默认 10 秒 diff --git a/common/config.js b/common/config.js index d36e877..e8083e6 100644 --- a/common/config.js +++ b/common/config.js @@ -1,5 +1,5 @@ // const debug = process.env.NODE_ENV == 'development' ? true : false; -const debug = true; // false线上 true本地 +const debug = false; // false线上 true本地 let baseUrl = '' let baseUrlwws = '' diff --git a/distribution/income-details/index.vue b/distribution/income-details/index.vue index 8369648..b832b8b 100644 --- a/distribution/income-details/index.vue +++ b/distribution/income-details/index.vue @@ -45,7 +45,7 @@ - @@ -53,9 +53,9 @@ {{ totalIncome }} - + --> - + diff --git a/pages/order/components/order-item.vue b/pages/order/components/order-item.vue index b0b67be..c1b5ca2 100644 --- a/pages/order/components/order-item.vue +++ b/pages/order/components/order-item.vue @@ -7,14 +7,21 @@ 限时折扣 - + - {{ item.productName }} + {{ item.productName||item.product_name }} {{ item.skuName }} @@ -55,18 +62,22 @@ ¥ + + {{item.discount_sale_amount}} ¥{{ item.salePrice }} - x{{ item.num }} + x{{ item.num }} + x{{ item.number }} diff --git a/pages/order/components/orderInfoAfter.vue b/pages/order/components/orderInfoAfter.vue index 5acf1a3..ea1aca2 100644 --- a/pages/order/components/orderInfoAfter.vue +++ b/pages/order/components/orderInfoAfter.vue @@ -70,7 +70,10 @@ + v-if="!item.isTemporary"> + @@ -174,8 +177,8 @@ {{listinfo.packFeess}} - - + + @@ -198,7 +201,7 @@ {{listinfo.payAmount}} - + diff --git a/pages/order/index.vue b/pages/order/index.vue index a207d9d..a580e8e 100644 --- a/pages/order/index.vue +++ b/pages/order/index.vue @@ -63,7 +63,11 @@ + v-if="!item.isTemporary"> + @@ -130,32 +134,37 @@ import { useNavbarStore } from '@/stores/navbarStore'; - import {APIshopUserInfo} from '@/common/api/member.js' + import { + APIshopUserInfo + } from '@/common/api/member.js' const store = useNavbarStore(); - - async function agignOrder(item){ + + async function agignOrder(item) { await APIshopUserInfo({ - shopId:item.shopId - }).then(shopUserInfo=>{ - if(shopUserInfo){ + shopId: item.shopId + }).then(shopUserInfo => { + if (shopUserInfo) { uni.cache.set("dinersNum", 1); uni.cache.set("tableCode", shopUserInfo.id); uni.cache.set("shopId", item.shopId); uni.navigateTo({ - url: "/pages/product/index?type=beforehand&order_id="+item.id+'&one_more_order=1', + url: "/pages/product/index?type=beforehand&order_id=" + item.id + + '&one_more_order=1', }); } }) - + } - function totalGoodsNum(arr){ - if(!arr){ + + function totalGoodsNum(arr) { + if (!arr) { return 0 } - return arr.reduce((prve,cur)=>{ - return prve+cur.num - },0) + return arr.reduce((prve, cur) => { + return prve + cur.num + }, 0) } + function isRemoveOrder(item) { uni.showModal({ title: '提示', @@ -578,7 +587,8 @@ .ml-20 { margin-left: 20rpx; } - .take_food_number{ + + .take_food_number { padding: 20rpx; background-color: #F8F8F8; margin-left: 36rpx; diff --git a/pages/product/components/goods-modal.vue b/pages/product/components/goods-modal.vue index db53d68..dcdf4cb 100644 --- a/pages/product/components/goods-modal.vue +++ b/pages/product/components/goods-modal.vue @@ -1,9 +1,9 @@ - - - + @@ -236,6 +299,7 @@ import { computed, inject, + onMounted, ref, watch } from "vue"; @@ -266,7 +330,10 @@ }); // / 选择规格的方法 - const goodsidClick = (setmenuindex, option, goodsid) => { + const goodsidClick = (setmenuindex, option, goodsid, setmenu) => { + if (props.goods.groupType == 0) { + return + } if (!selectedOptions.value[setmenuindex]) { // 如果 selectedOptions.value[setmenuindex] 不存在,初始化一个空数组 selectedOptions.value[setmenuindex] = []; @@ -278,11 +345,14 @@ } else if (!isMaxSelected(setmenuindex)) { // 如果未达到最大选择数量,添加到选中列表 selectedOptions.value[setmenuindex].push(option); + } else if (isMaxSelected(setmenuindex) && setmenu.number == 1) { + selectedOptions.value[setmenuindex] = [option] } }; // 计算所有选中条件是否都符合 const allConditionsSatisfied = computed(() => { + console.log('props.goods', props.goods); // 检查 specifications.item.groupSnap 是否存在 if (!props.goods?.groupSnap) { return false; @@ -306,6 +376,8 @@ const selSku = ref(null) // 处理规格选择的方法 const selectSpec = async (specType, option) => { + console.log('specType', specType) + console.log('option', option) // 规格清零 shopCartNumber.value = 0; @@ -405,6 +477,9 @@ const visible = defineModel({ default: false, }); + + + function stockNumberIsFull(item) { @@ -542,7 +617,7 @@ if (goods.type != 'package' && shopCartNumber.value <= 0) { return; } - if (goods.type == 'package' && !allConditionsSatisfied.value) { + if (goods.type == 'package' && goods.groupType!=0 && !allConditionsSatisfied.value) { return } @@ -649,16 +724,30 @@ } } }; + + const boxHeight = ref(500) + + onMounted(async () => { + // #ifdef MP-WEIXIN || MP-ALIPAY + const menuButtonInfo = uni.getMenuButtonBoundingClientRect(); + const systemInfo = uni.getSystemInfoSync(); + const statusBarHeight = systemInfo.statusBarHeight; + // 计算标题的垂直偏移量 + const verticalOffset = menuButtonInfo.top; + + const titleHeight = menuButtonInfo.height; + console.log('systemInfo', systemInfo); + boxHeight.value = systemInfo.windowHeight - verticalOffset - menuButtonInfo.height - systemInfo + .safeAreaInsets.bottom - 4 + + // #endif + })