update 1.3.6
parent
bf9a9fb6e3
commit
2404adc363
|
|
@ -172,6 +172,9 @@ function SpSkuSelect (props, ref) {
|
||||||
_selection[idx] = specId
|
_selection[idx] = specId
|
||||||
const key = _selection.join('_')
|
const key = _selection.join('_')
|
||||||
const row = skuDictRef.current[key] || {}
|
const row = skuDictRef.current[key] || {}
|
||||||
|
if (idx !== 1 && (isClickSku || idx === 2) && row?.store <= 0) {
|
||||||
|
return showToast('该规格库存为空~')
|
||||||
|
}
|
||||||
// if (row?.store <= 0 && isClickPattern) {
|
// if (row?.store <= 0 && isClickPattern) {
|
||||||
// if (disabledSet.has(specId) && idx !== 2) return
|
// if (disabledSet.has(specId) && idx !== 2) return
|
||||||
// setState((draft) => {
|
// setState((draft) => {
|
||||||
|
|
@ -191,6 +194,7 @@ function SpSkuSelect (props, ref) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const _selKey = _selection.slice(0, 2).join('_')
|
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) => {
|
const isNotStore = ((idx === 0 && isClickPattern) || idx === 1) && Object.keys(skuDictRef.current).every((key) => {
|
||||||
if (key.indexOf(_selKey) === 0) {
|
if (key.indexOf(_selKey) === 0) {
|
||||||
return skuDictRef.current[key].store <= 0 && ['onsale'].includes(skuDictRef.current[key].approveStatus)
|
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 > 0 && (item.skuValue.length > 0 ? item.skuValue.map((spec, idx) => (
|
||||||
// index === 2 && isNotStore ? null :
|
// 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
|
{(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', {
|
className={classNames('sku-btn btn-noac', {
|
||||||
'btn-primary': spec.specId === selSkuList[index],
|
'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
|
'sku-img': spec.specImgs.length > 0
|
||||||
})}
|
})}
|
||||||
onClick={handleSelectSku.bind(this, spec, index)}
|
onClick={handleSelectSku.bind(this, spec, index)}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue