update 1.3.6

main
王文龙 2024-03-06 11:43:37 +08:00
parent bf9a9fb6e3
commit 2404adc363
1 changed files with 6 additions and 1 deletions

View File

@ -172,6 +172,9 @@ function SpSkuSelect (props, ref) {
_selection[idx] = specId
const key = _selection.join('_')
const row = skuDictRef.current[key] || {}
if (idx !== 1 && (isClickSku || idx === 2) && row?.store <= 0) {
return showToast('该规格库存为空~')
}
// if (row?.store <= 0 && isClickPattern) {
// if (disabledSet.has(specId) && idx !== 2) return
// setState((draft) => {
@ -191,6 +194,7 @@ function SpSkuSelect (props, ref) {
})
}
const _selKey = _selection.slice(0, 2).join('_')
console.log("🚀 ~ _selKey:", _selKey, _selection)
const isNotStore = ((idx === 0 && isClickPattern) || idx === 1) && Object.keys(skuDictRef.current).every((key) => {
if (key.indexOf(_selKey) === 0) {
return skuDictRef.current[key].store <= 0 && ['onsale'].includes(skuDictRef.current[key].approveStatus)
@ -480,10 +484,11 @@ function SpSkuSelect (props, ref) {
{index > 0 && (item.skuValue.length > 0 ? item.skuValue.map((spec, idx) => (
// index === 2 && isNotStore ? null :
<>
{/* <>{console.log(selSkuList[1], selKey + '_' + spec.specId, skuDictRef.current[selKey + '_' + spec.specId]?.store)}</> */}
{(index === 1 || !isClickPattern || (selSkuList[1] === '5' && spec.specName < 40) || (selSkuList[1] === '6' && skuDictRef.current[selKey + '_' + spec.specId]?.store > 0)) && <View
className={classNames('sku-btn btn-noac', {
'btn-primary': spec.specId === selSkuList[index],
'disabled': selSkuList[1] === 5 && skuDictRef.current[selKey + '_' + spec.specId]?.store <= 0,
'disabled': selSkuList[1] === '5' && skuDictRef.current[selKey + '_' + spec.specId]?.store <= 0,
'sku-img': spec.specImgs.length > 0
})}
onClick={handleSelectSku.bind(this, spec, index)}