|
@@ -157,6 +157,17 @@ export function GoodsSpecSelector({
|
|
|
}
|
|
}
|
|
|
}, [visible, currentQuantity])
|
|
}, [visible, currentQuantity])
|
|
|
|
|
|
|
|
|
|
+ // 模态窗口显示/隐藏时控制页面滚动
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
|
+ if (visible) {
|
|
|
|
|
+ // 阻止页面滚动 - 滚动到顶部
|
|
|
|
|
+ Taro.pageScrollTo({
|
|
|
|
|
+ scrollTop: 0,
|
|
|
|
|
+ duration: 0
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }, [visible])
|
|
|
|
|
+
|
|
|
// 获取最大可购买数量
|
|
// 获取最大可购买数量
|
|
|
const getMaxQuantity = () => {
|
|
const getMaxQuantity = () => {
|
|
|
if (!selectedSpec) return 999
|
|
if (!selectedSpec) return 999
|
|
@@ -277,7 +288,13 @@ export function GoodsSpecSelector({
|
|
|
if (!visible) return null
|
|
if (!visible) return null
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
- <View className="spec-modal">
|
|
|
|
|
|
|
+ <View
|
|
|
|
|
+ className="spec-modal"
|
|
|
|
|
+ onTouchMove={(e) => {
|
|
|
|
|
+ e.stopPropagation()
|
|
|
|
|
+ e.preventDefault()
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
<View className="spec-modal-content">
|
|
<View className="spec-modal-content">
|
|
|
<View className="spec-modal-header">
|
|
<View className="spec-modal-header">
|
|
|
<Text className="spec-modal-title">选择规格</Text>
|
|
<Text className="spec-modal-title">选择规格</Text>
|