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/components/goods-price.vue b/components/goods-price.vue index 6db6a42..e7db243 100644 --- a/components/goods-price.vue +++ b/components/goods-price.vue @@ -1,6 +1,6 @@ @@ -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 + })