update
parent
0a2e723acf
commit
bf9a9fb6e3
|
|
@ -41,7 +41,6 @@ function SpCoupon (props) {
|
||||||
status,
|
status,
|
||||||
valid,
|
valid,
|
||||||
} = info
|
} = info
|
||||||
console.log("🚀 ~ info:", info)
|
|
||||||
|
|
||||||
const { tag, invalidBg, bg } = COUPON_TYPE[cardType]
|
const { tag, invalidBg, bg } = COUPON_TYPE[cardType]
|
||||||
const couponTagBg = info.tagClass === 'used' || info.tagClass === 'overdue' || !info.valid ? invalidBg : bg
|
const couponTagBg = info.tagClass === 'used' || info.tagClass === 'overdue' || !info.valid ? invalidBg : bg
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ function SpGoodsCell (props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log('isNaN(memberPrice):', info.orderItemType)
|
// console.log('isNaN(memberPrice):', info.orderItemType)
|
||||||
|
const max = parseInt(info?.limitedBuy ? info?.limitedBuy?.limit_buy : info.store)
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<View className='sp-goods-cell'>
|
<View className='sp-goods-cell'>
|
||||||
|
|
@ -129,7 +130,7 @@ function SpGoodsCell (props) {
|
||||||
</View>}
|
</View>}
|
||||||
<View className='item-ft'>
|
<View className='item-ft'>
|
||||||
|
|
||||||
{info.num && <Text className='item-num'>数量:{info.num}</Text>}
|
{info.num && <Text className='item-num'>数量:{info.num} {max <= 5 && <Text style={{ marginLeft: '10px' }}>(库存紧张)</Text>}</Text>}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ function SpPage (props, ref) {
|
||||||
showNavkfIcon = false,
|
showNavkfIcon = false,
|
||||||
showNavHomeIcon = false,
|
showNavHomeIcon = false,
|
||||||
showNavSearchIcon = false,
|
showNavSearchIcon = false,
|
||||||
|
showLogoLoading = false,
|
||||||
} = props
|
} = props
|
||||||
let { renderTitle } = props
|
let { renderTitle } = props
|
||||||
const wrapRef = useRef(null)
|
const wrapRef = useRef(null)
|
||||||
|
|
@ -371,6 +372,10 @@ function SpPage (props, ref) {
|
||||||
{/* {loading && <SpNote img='loading.gif' />} */}
|
{/* {loading && <SpNote img='loading.gif' />} */}
|
||||||
{loading && <SpLoading />}
|
{loading && <SpLoading />}
|
||||||
|
|
||||||
|
{showLogoLoading && <View className='loading-box'>
|
||||||
|
<SpImage height={244} width={244} src='logo-load.jpg' isNew />
|
||||||
|
</View>}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{!isDefault && !loading && <View className='sp-page-body' style={styleNames({
|
{!isDefault && !loading && <View className='sp-page-body' style={styleNames({
|
||||||
|
|
|
||||||
|
|
@ -212,4 +212,33 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.loading-box {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: 1100;
|
||||||
|
background: rgba(255, 255, 255, 0.6);
|
||||||
|
animation: fadeInAnimation 0.3s ease-in;
|
||||||
|
.sp-image {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
width: 300px;
|
||||||
|
height: 300px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes fadeInAnimation {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,9 @@ const initialState = {
|
||||||
isClickNum: false,
|
isClickNum: false,
|
||||||
isClickPattern: false,
|
isClickPattern: false,
|
||||||
showClickPattern: false,
|
showClickPattern: false,
|
||||||
skuTxtArr: []
|
skuTxtArr: [],
|
||||||
|
selSkuList: [],
|
||||||
|
isNotStore: false
|
||||||
}
|
}
|
||||||
|
|
||||||
function SpSkuSelect (props, ref) {
|
function SpSkuSelect (props, ref) {
|
||||||
|
|
@ -47,9 +49,10 @@ function SpSkuSelect (props, ref) {
|
||||||
// console.log('SpSkuSelect:info', info)
|
// console.log('SpSkuSelect:info', info)
|
||||||
// const [state, setState] = useImmer(initialState)
|
// const [state, setState] = useImmer(initialState)
|
||||||
const [state, setState] = useAsyncCallback(initialState)
|
const [state, setState] = useAsyncCallback(initialState)
|
||||||
const { selection, curImage, disabledSet, curItem, skuText, num, loading, isClickSku, showClickPattern, skuTxtArr } = state
|
const { selection, curImage, disabledSet, curItem, skuText, num, loading, isClickSku, showClickPattern, skuTxtArr, isClickPattern, selSkuList, isNotStore } = state
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const skuDictRef = useRef({})
|
const skuDictRef = useRef({})
|
||||||
|
const selKey = selSkuList[0] + '_' + selSkuList[1]
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (info && !info.nospec) {
|
if (info && !info.nospec) {
|
||||||
|
|
@ -82,6 +85,9 @@ function SpSkuSelect (props, ref) {
|
||||||
}
|
}
|
||||||
|
|
||||||
calcDisabled(selection, -1)
|
calcDisabled(selection, -1)
|
||||||
|
setState((draft) => {
|
||||||
|
draft.selSkuList[0] = selection[0]
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const calcDisabled = (selection, e = 0) => {
|
const calcDisabled = (selection, e = 0) => {
|
||||||
|
|
@ -156,37 +162,50 @@ function SpSkuSelect (props, ref) {
|
||||||
|
|
||||||
// console.log('disabledSet:', disabledSet)
|
// console.log('disabledSet:', disabledSet)
|
||||||
|
|
||||||
const handleSelectSku = (spec, idx) => {
|
const handleSelectSku = async (spec, idx) => {
|
||||||
|
if (!isClickPattern && idx === 2) {
|
||||||
|
return showToast('请先选择版型')
|
||||||
|
}
|
||||||
const { specId } = spec
|
const { specId } = spec
|
||||||
const _selection = [...selection]
|
const _selection = [...selection]
|
||||||
|
|
||||||
_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 (row?.store <= 0) {
|
// if (row?.store <= 0 && isClickPattern) {
|
||||||
if (disabledSet.has(specId) && idx !== 2) return
|
// if (disabledSet.has(specId) && idx !== 2) return
|
||||||
setState((draft) => {
|
// setState((draft) => {
|
||||||
draft.selection[idx] = specId //null
|
// draft.selection[idx] = specId //null
|
||||||
draft.curImage = 1
|
// draft.curImage = 1
|
||||||
})
|
// })
|
||||||
return showToast('该规格库存为空')
|
// return showToast('该规格库存为空')
|
||||||
}
|
// }
|
||||||
if (!state.isClickNum) {
|
if (!isClickPattern) {
|
||||||
setState((draft) => {
|
await setState((draft) => {
|
||||||
draft.isClickNum = idx === 2
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (!state.isClickPattern) {
|
|
||||||
setState((draft) => {
|
|
||||||
draft.isClickPattern = idx === 1
|
draft.isClickPattern = idx === 1
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
setState(
|
if (!state.isClickNum) {
|
||||||
|
await setState((draft) => {
|
||||||
|
draft.isClickNum = idx === 2
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const _selKey = _selection.slice(0, 2).join('_')
|
||||||
|
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)
|
||||||
|
} else {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
await setState(
|
||||||
(draft) => {
|
(draft) => {
|
||||||
draft.selection[idx] = specId //null
|
draft.selection[idx] = specId //null
|
||||||
|
draft.selSkuList[idx] = specId
|
||||||
draft.curImage = 1
|
draft.curImage = 1
|
||||||
draft.isClickSku = draft.isClickNum ? row.store > 0 : idx === 2
|
draft.isClickSku = draft.isClickNum ? row.store > 0 : idx === 2
|
||||||
draft.showClickPattern = draft.isClickPattern ? row.store > 0 : idx === 1
|
draft.showClickPattern = draft.isClickPattern ? row.store > 0 : idx === 1
|
||||||
|
draft.isNotStore = isNotStore
|
||||||
},
|
},
|
||||||
(row) => {
|
(row) => {
|
||||||
calcDisabled(row.selection, idx)
|
calcDisabled(row.selection, idx)
|
||||||
|
|
@ -428,7 +447,7 @@ function SpSkuSelect (props, ref) {
|
||||||
<View
|
<View
|
||||||
className={classNames('sku-btn', {
|
className={classNames('sku-btn', {
|
||||||
'active': spec.specId == selection[index],
|
'active': spec.specId == selection[index],
|
||||||
'disabled': disabledSet.has(spec.specId),
|
'disabled': isClickSku && disabledSet.has(spec.specId),
|
||||||
})}
|
})}
|
||||||
onClick={handleSelectSku.bind(this, spec, index)}
|
onClick={handleSelectSku.bind(this, spec, index)}
|
||||||
key={`sku-values-item__${idx}`}
|
key={`sku-values-item__${idx}`}
|
||||||
|
|
@ -438,21 +457,38 @@ function SpSkuSelect (props, ref) {
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
</ScrollView>}
|
</ScrollView>}
|
||||||
{index > 0 && (item.skuValue.length > 0 ? item.skuValue.map((spec, idx) => (
|
{/* {index > 0 && (item.skuValue.length > 0 ? item.skuValue.map((spec, idx) => (
|
||||||
<>
|
<>
|
||||||
{index === 2 && (showClickPattern && disabledSet.has(spec.specId)) ? null : <View
|
{index === 2 && (showClickPattern && disabledSet.has(spec.specId)) ? null : <View
|
||||||
className={classNames('sku-btn btn-noac', {
|
className={classNames('sku-btn btn-noac', {
|
||||||
'active': spec.specId == selection[index],
|
'active': spec.specId == selection[index],
|
||||||
'btn-primary': index !== 2 ? index === 1 ? spec.specId == selection[index] && showClickPattern : spec.specId == selection[index] : spec.specId == selection[index] && isClickSku,
|
'btn-primary': index !== 2 ? index === 1 ? spec.specId == selection[index] && showClickPattern : spec.specId == selection[index] : spec.specId == selection[index] && isClickSku,
|
||||||
'disabled': index === 1 && disabledSet.has(spec.specId),
|
'disabled': isClickPattern && index === 1 && disabledSet.has(spec.specId),
|
||||||
|
'sku-img': spec.specImgs.length > 0
|
||||||
|
})}
|
||||||
|
onClick={handleSelectSku.bind(this, spec, index)}
|
||||||
|
key={`sku-values-item__${idx}`}
|
||||||
|
>
|
||||||
|
<View className={classNames('spec-name', { 'pad': index === 2 })}>{spec.specName}</View>
|
||||||
|
</View>}
|
||||||
|
</>
|
||||||
|
)) : <View className="spec-name">暂无库存</View>)} */}
|
||||||
|
{/*
|
||||||
|
上面是备份下面为修改,2024-03-05 !!!
|
||||||
|
窄版只显示35-39 库存0置灰。常规版显示所有 库存0不显示。
|
||||||
|
*/}
|
||||||
|
{index > 0 && (item.skuValue.length > 0 ? item.skuValue.map((spec, idx) => (
|
||||||
|
// index === 2 && isNotStore ? null :
|
||||||
|
<>
|
||||||
|
{(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,
|
||||||
'sku-img': spec.specImgs.length > 0
|
'sku-img': spec.specImgs.length > 0
|
||||||
})}
|
})}
|
||||||
onClick={handleSelectSku.bind(this, spec, index)}
|
onClick={handleSelectSku.bind(this, spec, index)}
|
||||||
key={`sku-values-item__${idx}`}
|
key={`sku-values-item__${idx}`}
|
||||||
>
|
>
|
||||||
{/* {spec.specImgs.length > 0 && (
|
|
||||||
<SpImage src={spec.specImgs[0]} width={260} height={260} />
|
|
||||||
)} */}
|
|
||||||
<View className={classNames('spec-name', { 'pad': index === 2 })}>{spec.specName}</View>
|
<View className={classNames('spec-name', { 'pad': index === 2 })}>{spec.specName}</View>
|
||||||
</View>}
|
</View>}
|
||||||
</>
|
</>
|
||||||
|
|
@ -460,6 +496,7 @@ function SpSkuSelect (props, ref) {
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
))}
|
))}
|
||||||
|
{isNotStore && <View style={{ padding: '10rpx 0' }}>暂无库存</View>}
|
||||||
{/* {!hideInputNumber && renderLimitTip()} */}
|
{/* {!hideInputNumber && renderLimitTip()} */}
|
||||||
<View className="select">
|
<View className="select">
|
||||||
{/* {skuText.split(' ').map((item, index) => <Text key={`sku-text__${index}`} style={{ marginRight: '14px' }}>{item}</Text>)} */}
|
{/* {skuText.split(' ').map((item, index) => <Text key={`sku-text__${index}`} style={{ marginRight: '14px' }}>{item}</Text>)} */}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ export const CHECKOUT_GOODS_ITEM = {
|
||||||
origincountry_name: 'origincountry_name',
|
origincountry_name: 'origincountry_name',
|
||||||
point: 'point',
|
point: 'point',
|
||||||
isPoint: 'is_point',
|
isPoint: 'is_point',
|
||||||
|
store: 'store',
|
||||||
item_point: 'item_point',
|
item_point: 'item_point',
|
||||||
price: ({ price }) => price / 100, // 销售价
|
price: ({ price }) => price / 100, // 销售价
|
||||||
activityPrice: ({ activity_price }) => activity_price / 100, // 秒杀价
|
activityPrice: ({ activity_price }) => activity_price / 100, // 秒杀价
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,8 @@ function CompGoodsItem (props) {
|
||||||
onDelete = () => { },
|
onDelete = () => { },
|
||||||
onChange = () => { },
|
onChange = () => { },
|
||||||
onClickImgAndTitle = () => { },
|
onClickImgAndTitle = () => { },
|
||||||
onChangeGoodsIsCheck = () => { }
|
onChangeGoodsIsCheck = () => { },
|
||||||
|
showWarning = false
|
||||||
} = props
|
} = props
|
||||||
const { priceSetting } = useSelector((state) => state.sys)
|
const { priceSetting } = useSelector((state) => state.sys)
|
||||||
const { userInfo = {}, vipInfo = {} } = useSelector((state) => state.user)
|
const { userInfo = {}, vipInfo = {} } = useSelector((state) => state.user)
|
||||||
|
|
@ -68,7 +69,7 @@ function CompGoodsItem (props) {
|
||||||
limitTxt = `每${info?.limitedBuy?.rule.day}天,限购${limitNum}件`
|
limitTxt = `每${info?.limitedBuy?.rule.day}天,限购${limitNum}件`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const max = parseInt(info?.limitedBuy ? info?.limitedBuy?.limit_buy : info.store)
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
{children}
|
{children}
|
||||||
|
|
@ -125,13 +126,14 @@ function CompGoodsItem (props) {
|
||||||
{isShowAddInput ? (
|
{isShowAddInput ? (
|
||||||
<SpInputNumber
|
<SpInputNumber
|
||||||
value={localNum}
|
value={localNum}
|
||||||
max={parseInt(info?.limitedBuy ? info?.limitedBuy?.limit_buy : info.store)}
|
max={max}
|
||||||
min={1}
|
min={1}
|
||||||
onChange={onChangeInputNumber}
|
onChange={onChangeInputNumber}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Text className='item-num'>x {info.num}</Text>
|
<Text className='item-num'>x {info.num}</Text>
|
||||||
)}
|
)}
|
||||||
|
{showWarning && max <= 5 && <Text style={{ marginLeft: '10px' }}>(库存紧张)</Text>}
|
||||||
</View>
|
</View>
|
||||||
<SpPrice value={_price / 100} noDecimal={false} size={20} showSeparator />
|
<SpPrice value={_price / 100} noDecimal={false} size={20} showSeparator />
|
||||||
{info.market_price > 0 && enMarketPrice && (
|
{info.market_price > 0 && enMarketPrice && (
|
||||||
|
|
|
||||||
|
|
@ -880,7 +880,7 @@ function CartCheckout (props) {
|
||||||
<View className='goods-list'>
|
<View className='goods-list'>
|
||||||
{detailInfo.map((item, idx) => (
|
{detailInfo.map((item, idx) => (
|
||||||
<View className='sp-order-item__wrap' key={idx}>
|
<View className='sp-order-item__wrap' key={idx}>
|
||||||
<SpGoodsCell info={item} />
|
<SpGoodsCell info={item} showWarning />
|
||||||
{/* <SpOrderItem
|
{/* <SpOrderItem
|
||||||
key={`${idx}1`}
|
key={`${idx}1`}
|
||||||
info={item}
|
info={item}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,8 @@ import './espier-index.scss'
|
||||||
const initialState = {
|
const initialState = {
|
||||||
recommendList: [], // 猜你喜欢
|
recommendList: [], // 猜你喜欢
|
||||||
current: 0, // 0:普通商品 1:跨境商品
|
current: 0, // 0:普通商品 1:跨境商品
|
||||||
policyModal: false // 隐私弹框
|
policyModal: false, // 隐私弹框
|
||||||
|
loading: false
|
||||||
}
|
}
|
||||||
|
|
||||||
function CartIndex () {
|
function CartIndex () {
|
||||||
|
|
@ -51,7 +52,7 @@ function CartIndex () {
|
||||||
const router = $instance.router
|
const router = $instance.router
|
||||||
|
|
||||||
const [state, setState] = useImmer(initialState)
|
const [state, setState] = useImmer(initialState)
|
||||||
const { current, recommendList, policyModal } = state
|
const { current, recommendList, policyModal, loading } = state
|
||||||
|
|
||||||
const { colorPrimary, openRecommend } = useSelector((state) => state.sys)
|
const { colorPrimary, openRecommend } = useSelector((state) => state.sys)
|
||||||
const { validCart = [], invalidCart = [], cartCount } = useSelector((state) => state.cart)
|
const { validCart = [], invalidCart = [], cartCount } = useSelector((state) => state.cart)
|
||||||
|
|
@ -66,7 +67,6 @@ function CartIndex () {
|
||||||
}, [isLogin])
|
}, [isLogin])
|
||||||
|
|
||||||
useDidShow(() => {
|
useDidShow(() => {
|
||||||
console.log('useDidShow', isLogin)
|
|
||||||
if (isLogin) fetch()
|
if (isLogin) fetch()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -80,14 +80,20 @@ function CartIndex () {
|
||||||
}
|
}
|
||||||
|
|
||||||
const getCartList = async () => {
|
const getCartList = async () => {
|
||||||
Taro.showLoading({ title: '' })
|
// Taro.showLoading({ title: '', })
|
||||||
|
setState((draft) => {
|
||||||
|
draft.loading = true
|
||||||
|
})
|
||||||
const { type = 'distributor' } = router?.params || {}
|
const { type = 'distributor' } = router?.params || {}
|
||||||
const params = {
|
const params = {
|
||||||
shop_type: type
|
shop_type: type
|
||||||
}
|
}
|
||||||
await dispatch(fetchCartList(params))
|
await dispatch(fetchCartList(params))
|
||||||
await dispatch(updateCount(params))
|
await dispatch(updateCount(params))
|
||||||
Taro.hideLoading()
|
|
||||||
|
setState((draft) => {
|
||||||
|
draft.loading = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const resolveActiveGroup = () => {
|
const resolveActiveGroup = () => {
|
||||||
|
|
@ -166,7 +172,6 @@ function CartIndex () {
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 1000
|
pageSize: 1000
|
||||||
})
|
})
|
||||||
console.log("🚀 ~ list:----169", list)
|
|
||||||
setState((draft) => {
|
setState((draft) => {
|
||||||
draft.recommendList = list
|
draft.recommendList = list
|
||||||
})
|
})
|
||||||
|
|
@ -183,7 +188,10 @@ function CartIndex () {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
const onChangeGoodsIsCheck = async (item, type, checked) => {
|
const onChangeGoodsIsCheck = async (item, type, checked) => {
|
||||||
Taro.showLoading({ title: '' })
|
// Taro.showLoading({ title: '' })
|
||||||
|
setState((draft) => {
|
||||||
|
draft.loading = true
|
||||||
|
})
|
||||||
let parmas = { is_checked: checked }
|
let parmas = { is_checked: checked }
|
||||||
if (type === 'all') {
|
if (type === 'all') {
|
||||||
const cartIds = item.list.map((item) => item.cart_id)
|
const cartIds = item.list.map((item) => item.cart_id)
|
||||||
|
|
@ -216,6 +224,9 @@ function CartIndex () {
|
||||||
|
|
||||||
const onChangeCartGoodsItem = useDebounce(async (item, num) => {
|
const onChangeCartGoodsItem = useDebounce(async (item, num) => {
|
||||||
console.log(`onChangeCartGoodsItem:`, num)
|
console.log(`onChangeCartGoodsItem:`, num)
|
||||||
|
setState((draft) => {
|
||||||
|
draft.loading = true
|
||||||
|
})
|
||||||
let { shop_id, cart_id } = item
|
let { shop_id, cart_id } = item
|
||||||
const { type = 'distributor' } = router.params
|
const { type = 'distributor' } = router.params
|
||||||
await dispatch(updateCartItemNum({ shop_id, cart_id, num, type }))
|
await dispatch(updateCartItemNum({ shop_id, cart_id, num, type }))
|
||||||
|
|
@ -271,6 +282,7 @@ function CartIndex () {
|
||||||
'has-tabbar': tabbar == 1
|
'has-tabbar': tabbar == 1
|
||||||
})}
|
})}
|
||||||
renderFooter={tabbar == 1 && <SpTabbar />}
|
renderFooter={tabbar == 1 && <SpTabbar />}
|
||||||
|
showLogoLoading={loading}
|
||||||
showNavLogo isBlack showNavkfIcon
|
showNavLogo isBlack showNavkfIcon
|
||||||
>
|
>
|
||||||
{/* {!isLogin && (
|
{/* {!isLogin && (
|
||||||
|
|
@ -353,6 +365,7 @@ function CartIndex () {
|
||||||
onChange={onChangeCartGoodsItem.bind(this, c_sitem)}
|
onChange={onChangeCartGoodsItem.bind(this, c_sitem)}
|
||||||
onChangeGoodsIsCheck={onChangeGoodsIsCheck.bind(this, c_sitem, 'single', !c_sitem.is_checked)}
|
onChangeGoodsIsCheck={onChangeGoodsIsCheck.bind(this, c_sitem, 'single', !c_sitem.is_checked)}
|
||||||
onClickImgAndTitle={onClickImgAndTitle.bind(this, c_sitem)}
|
onClickImgAndTitle={onClickImgAndTitle.bind(this, c_sitem)}
|
||||||
|
showWarning
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
{/**组合商品开始 */}
|
{/**组合商品开始 */}
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
padding: 26px 40px 26px 60px;
|
padding: 26px 40px 26px 60px;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: calc(#{$page-ipx-footer-height} - 2px);
|
bottom: calc(#{$page-ipx-footer-height} - 2px);
|
||||||
z-index: 1080;
|
z-index: 100;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
border-top: 1px solid #d9d9d9;
|
border-top: 1px solid #d9d9d9;
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,31 @@ page {
|
||||||
// &.swiper-narrow {
|
// &.swiper-narrow {
|
||||||
// height: calc(100vh - 620px - #{$tabbar-height} - var(--status-bar-height));
|
// height: calc(100vh - 620px - #{$tabbar-height} - var(--status-bar-height));
|
||||||
// }
|
// }
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.item-img-box {
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, 0%);
|
||||||
|
bottom: 0px;
|
||||||
|
z-index: 99;
|
||||||
|
animation: fadeInAnimation 0.35s ease-in;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
.item-img-txt {
|
||||||
|
font-size: 26px;
|
||||||
|
color: #fff;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 74rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.item-img {
|
||||||
|
width: 190px;
|
||||||
|
height: 120px;
|
||||||
|
object-fit: contain;
|
||||||
|
margin-bottom: 6px;
|
||||||
}
|
}
|
||||||
.swiper-narrow {
|
.swiper-narrow {
|
||||||
// height: calc(100vh - 620px - #{$tabbar-height} - var(--status-bar-height));
|
// height: calc(100vh - 620px - #{$tabbar-height} - var(--status-bar-height));
|
||||||
|
|
@ -119,10 +144,11 @@ page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.spot-pagination {
|
.spot-pagination {
|
||||||
|
animation: fadeInAnimation 0.35s ease-in;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
bottom: 6%;
|
bottom: 10%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
|
|
|
||||||
|
|
@ -500,13 +500,17 @@ function Home () {
|
||||||
{/* {isUpOperation && <View className="item-btns">
|
{/* {isUpOperation && <View className="item-btns">
|
||||||
<View className="item-tit">BOSTON</View>
|
<View className="item-tit">BOSTON</View>
|
||||||
<View className="item-btn">
|
<View className="item-btn">
|
||||||
<View className="item-btn-txt">立即预约</View>
|
<View className="item-btn-txt">立即预约</View>
|
||||||
<View className="item-btn-icon icon-my icon-arrow-right"></View>
|
<View className="item-btn-icon icon-my icon-arrow-right"></View>
|
||||||
</View>
|
</View>
|
||||||
</View>} */}
|
</View>} */}
|
||||||
</SwiperItem>
|
</SwiperItem>
|
||||||
))}
|
))}
|
||||||
</Swiper>
|
</Swiper>
|
||||||
|
{!isUpOperation && <View className="item-img-box">
|
||||||
|
<View className="item-img-txt">滑 动 探 索</View>
|
||||||
|
<Image className="item-img" height="62" src={require('../assets/i-sou.gif')} isShowMenuByLongpress={false} lazyLoad isNew={false} />
|
||||||
|
</View>}
|
||||||
{!isUpOperation && <View className='spot-pagination'>
|
{!isUpOperation && <View className='spot-pagination'>
|
||||||
{swiperList.map((_, index) => (
|
{swiperList.map((_, index) => (
|
||||||
<View key={index} className={'spot-pagination-bullet ' + ((state.currentIndex == index) ? 'spot-pagination-bullet-active' : "")} style={{ width: 1 / state.length * 100 + '%' }}></View>
|
<View key={index} className={'spot-pagination-bullet ' + ((state.currentIndex == index) ? 'spot-pagination-bullet-active' : "")} style={{ width: 1 / state.length * 100 + '%' }}></View>
|
||||||
|
|
|
||||||
|
|
@ -64,8 +64,9 @@ function CompEvaluation (props) {
|
||||||
<View className="evaluation-content-line"></View>
|
<View className="evaluation-content-line"></View>
|
||||||
</View>
|
</View>
|
||||||
))}
|
))}
|
||||||
<View className="click-all" onClick={onViewMore}>查看全部 <Text className='iconfont icon-qianwang-01'></Text></View>
|
{list.length == 0 ? <View className='default-msg'>暂无商品评价</View>
|
||||||
{list.length == 0 && <View className='default-msg'>暂无商品评价</View>}
|
: <View className="click-all" onClick={onViewMore}>查看全部 <Text className='iconfont icon-qianwang-01'></Text></View>
|
||||||
|
}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import {
|
||||||
SpPage,
|
SpPage,
|
||||||
SpScrollView,
|
SpScrollView,
|
||||||
SpDrawer,
|
SpDrawer,
|
||||||
SpSelect
|
SpNote
|
||||||
} from '@/components'
|
} from '@/components'
|
||||||
import { fetchUserFavs } from '@/store/slices/user'
|
import { fetchUserFavs } from '@/store/slices/user'
|
||||||
import doc from '@/doc'
|
import doc from '@/doc'
|
||||||
|
|
@ -330,6 +330,12 @@ function ItemList () {
|
||||||
url
|
url
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const renderEmpty = () => {
|
||||||
|
return (<SpNote className='sp-note-1' isUrl img={`${process.env.APP_IMAGE_CDN_NEW}/cart/logo-hui.png`} height={144} width={144}>
|
||||||
|
抱歉 没有搜索到结果
|
||||||
|
</SpNote>)
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<SpPage
|
<SpPage
|
||||||
scrollToTopBtn
|
scrollToTopBtn
|
||||||
|
|
@ -370,7 +376,7 @@ function ItemList () {
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
<View className='item-list-head'>
|
<View className='item-list-head'>
|
||||||
{tagList.length > 0 && (
|
{false && tagList.length > 0 && (
|
||||||
<SpTagBar className='tag-list' list={tagList} value={curTagIdx} onChange={onChangeTag}>
|
<SpTagBar className='tag-list' list={tagList} value={curTagIdx} onChange={onChangeTag}>
|
||||||
{/* <View
|
{/* <View
|
||||||
className="filter-btn"
|
className="filter-btn"
|
||||||
|
|
@ -390,7 +396,7 @@ function ItemList () {
|
||||||
onChange={handleFilterChange}
|
onChange={handleFilterChange}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
<SpScrollView className='item-list-scroll' auto={false} ref={goodsRef} fetch={fetch}>
|
<SpScrollView className='item-list-scroll' auto={false} ref={goodsRef} fetch={fetch} renderEmpty={renderEmpty()}>
|
||||||
<View className='goods-list'>
|
<View className='goods-list'>
|
||||||
<View className='left-container'>
|
<View className='left-container'>
|
||||||
{leftList.map((list, idx) => {
|
{leftList.map((list, idx) => {
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,19 @@
|
||||||
// /* #ifdef h5 */
|
// /* #ifdef h5 */
|
||||||
// @include page-scroll($searchbar-height + $navigate-height + 16 * 2 + $tabs-height + 10, 0);
|
// @include page-scroll($searchbar-height + $navigate-height + 16 * 2 + $tabs-height + 10, 0);
|
||||||
// /* #endif */
|
// /* #endif */
|
||||||
.sp-note {
|
// .sp-note {
|
||||||
margin-bottom: 50px;
|
// margin-bottom: 50px;
|
||||||
|
// }
|
||||||
|
.sp-note-1 {
|
||||||
|
.sp-image {
|
||||||
|
margin-top: 300px;
|
||||||
|
}
|
||||||
|
> .sp-note__text {
|
||||||
|
margin-top: 24px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 40px;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.filter-btn {
|
.filter-btn {
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,6 @@ export default class ItemFav extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onShareTimeline (res) {
|
onShareTimeline (res) {
|
||||||
console.log("🚀 ~ ItemFav ~ res:", res)
|
|
||||||
return this.getAppShareInfo()
|
return this.getAppShareInfo()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -358,7 +357,9 @@ export default class ItemFav extends Component {
|
||||||
{/* {page.isLoading ? <Loading>正在加载...</Loading> : null} */}
|
{/* {page.isLoading ? <Loading>正在加载...</Loading> : null} */}
|
||||||
{/* !page.isLoading && */}
|
{/* !page.isLoading && */}
|
||||||
{!page.hasNext && !list.length && (
|
{!page.hasNext && !list.length && (
|
||||||
<SpNote img='trades_empty.png'>暂无数据~</SpNote>
|
<SpNote isUrl img={`${process.env.APP_IMAGE_CDN_NEW}/cart/logo-hui.png`} height={144} width={144}>
|
||||||
|
暂无收藏商品
|
||||||
|
</SpNote>
|
||||||
)}
|
)}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,17 @@
|
||||||
/* #ifdef h5 */
|
/* #ifdef h5 */
|
||||||
top: $navigate-height-h5 + $tabs-height + 29px;
|
top: $navigate-height-h5 + $tabs-height + 29px;
|
||||||
/* #endif */
|
/* #endif */
|
||||||
|
.sp-note {
|
||||||
|
.sp-image {
|
||||||
|
margin-top: 400px;
|
||||||
|
}
|
||||||
|
&__text {
|
||||||
|
margin-top: 24px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 40px;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&__type-grid {
|
&__type-grid {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
|
|
@ -587,7 +587,7 @@ export default class RecommendList extends Component {
|
||||||
const height = windowWidth * 9 / 17
|
const height = windowWidth * 9 / 17
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SpPage renderFooter={<SpTabbar />} className='has-nav' title="" isBlack>
|
<SpPage renderFooter={<SpTabbar />} loading={page.isLoading} className='has-nav' title="" isBlack>
|
||||||
<View className='page-recommend-list'>
|
<View className='page-recommend-list'>
|
||||||
{false && <>
|
{false && <>
|
||||||
<View className='recommend-list__toolbar'>
|
<View className='recommend-list__toolbar'>
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,8 @@ const initialState = {
|
||||||
finishNum: 0,
|
finishNum: 0,
|
||||||
zitiNum: 0,
|
zitiNum: 0,
|
||||||
deposit: 0,
|
deposit: 0,
|
||||||
isOpen: false
|
isOpen: false,
|
||||||
|
loading: false
|
||||||
}
|
}
|
||||||
|
|
||||||
function MemberIndex (props) {
|
function MemberIndex (props) {
|
||||||
|
|
@ -132,12 +133,18 @@ function MemberIndex (props) {
|
||||||
})
|
})
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isLogin) {
|
if (isLogin) {
|
||||||
|
setState((draft) => {
|
||||||
|
draft.loading = true
|
||||||
|
})
|
||||||
getMemberCenterData()
|
getMemberCenterData()
|
||||||
setMemberBackground()
|
setMemberBackground()
|
||||||
const { redirect } = $instance.router.params
|
const { redirect } = $instance.router.params
|
||||||
if (redirect) {
|
if (redirect) {
|
||||||
Taro.redirectTo({ url: decodeURIComponent(redirect) })
|
Taro.redirectTo({ url: decodeURIComponent(redirect) })
|
||||||
}
|
}
|
||||||
|
setState((draft) => {
|
||||||
|
draft.loading = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}, [isLogin])
|
}, [isLogin])
|
||||||
|
|
||||||
|
|
@ -459,7 +466,7 @@ function MemberIndex (props) {
|
||||||
// console.log('====config===', config.menu)
|
// console.log('====config===', config.menu)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SpPage className='pages-member-index has-navbar' renderFooter={<SpTabbar />} isTop>
|
<SpPage loading={state.loading} className='pages-member-index has-navbar' renderFooter={<SpTabbar />} isTop>
|
||||||
<View
|
<View
|
||||||
className='header-block'
|
className='header-block'
|
||||||
style={styleNames({
|
style={styleNames({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue