bug(custom): eCX-7259

This commit is contained in:
zhangjing1
2025-09-09 13:53:44 +08:00
parent 5849419933
commit 79837b6b7b
4 changed files with 23 additions and 11 deletions

1
.env
View File

@@ -13,5 +13,4 @@ APP_IMAGE_CDN=https://b-img-cdn.yuanyuanke.cn/ecshopx-vshop
APP_DIANWU_URL=https://demo-ecshopx-dianwu.shopex123.com
APP_MERCHANT_URL=
APP_ADAPAY=
APP_I18N_ORIGIN_LANG=en

View File

@@ -46,6 +46,13 @@ class AtInputNumber extends AtComponent {
localValue: this.props.value
})
}
componentDidUpdate(prevProps) {
if (prevProps.value !== this.props.value) {
this.setState({
localValue: this.props.value
})
}
}
handleClick(clickType) {
const { disabled, value, min, max, step } = this.props

View File

@@ -85,13 +85,13 @@ function SpSkuSelect(props) {
// }
}, [info])
useEffect(() => {
if (!open) {
setState((draft) => {
draft.num = 1
})
}
}, [open])
// useEffect(() => {
// if (!open) {
// setState((draft) => {
// draft.num = 1
// })
// }
// }, [open])
const init = () => {
const { skuList, specItems } = info
@@ -120,7 +120,6 @@ function SpSkuSelect(props) {
if (info.specItems.length > 0 && val.length > 0) {
//多规格动态获取起订量
const newval = val.length == 1 ? val[0] : val.join('-')
console.log('newval:', newval, val, info.specItems)
info.specItems.forEach((item) => {
if (item.customSpecId == newval) {
setState((draft) => {
@@ -130,12 +129,19 @@ function SpSkuSelect(props) {
return item.startNum
}
})
}else{
// 单规格
setState((draft) => {
draft.minNum = info.startNum
draft.num = info.startNum
})
}
//单规格
return info.startNum
} else {
setState((draft) => {
draft.minNum = 1
draft.num = 1
})
return 1
}

View File

@@ -337,8 +337,8 @@ function EspierDetail(props) {
getRecommendList() // 猜你喜欢
}
}
const getMultipleImageInfo = async (imageUrls) => {
const promises = imageUrls.map((url) =>
const getMultipleImageInfo = async (imageUrls=[]) => {
const promises = imageUrls?.map((url) =>
Taro.getImageInfo({ src: url })
.then((info) => info)
.catch((error) => {