diff --git a/components/card_payment/card_payment.vue b/components/card_payment/card_payment.vue index 7195175..c86d8de 100644 --- a/components/card_payment/card_payment.vue +++ b/components/card_payment/card_payment.vue @@ -16,7 +16,7 @@ 去结算 - + 已加购商品 @@ -117,10 +117,10 @@ } }); - const popupSpacerHeight = computed(() => { - const deltaPx = uni.upx2px(30); - return Math.max(0, (Number(props.bottomOffset) || 0) - deltaPx); - }); + const safeAreaBottom = Number(uni.getSystemInfoSync()?.safeAreaInsets?.bottom || 0); + const popupOpened = ref(false); + const popupBottomInsetPx = ref(0); + const popupSpacerHeight = computed(() => Math.max(0, Number(popupBottomInsetPx.value) || 0)); const cartList = ref([]); let price = ref(0); let num = ref(0); @@ -155,15 +155,38 @@ getCartList(); }); let popupRef = ref(null); + const resolvePopupBottomInsetPx = () => { + return Math.max(0, (Number(props.bottomOffset) || 0) - safeAreaBottom); + }; + const onPopupChange = (e: any) => { + popupOpened.value = !!e?.show; + if (popupOpened.value) { + popupBottomInsetPx.value = resolvePopupBottomInsetPx(); + } else { + popupBottomInsetPx.value = 0; + } + }; const showPopup = () => { if (!popupRef.value) return; + popupOpened.value = true; + popupBottomInsetPx.value = resolvePopupBottomInsetPx(); popupRef.value.open('bottom'); }; const hidePopup = () => { + popupOpened.value = false; + popupBottomInsetPx.value = 0; popupRef.value.close(); }; onMounted(() => { }); + watch( + () => cartList.value?.length, + (len) => { + if (popupOpened.value && (!len || len <= 0)) { + hidePopup(); + } + }, + ); //#region 选择规格弹窗 let showSelectSku = ref(false); let goodsInfo = ref({}); diff --git a/manifest.json b/manifest.json index d02332c..6fe8dec 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "优购商城", "appid" : "__UNI__8B19741", "description" : "", - "versionName" : "1.4.6", - "versionCode" : 146, + "versionName" : "1.4.7", + "versionCode" : 147, "transformPx" : false, "app-plus" : { "privacy" : { diff --git a/pages/AI/comDetails.vue b/pages/AI/comDetails.vue index 17a441e..7b3ccb7 100644 --- a/pages/AI/comDetails.vue +++ b/pages/AI/comDetails.vue @@ -68,14 +68,21 @@ - - + + + + + 立即购买 + +