diff --git a/src/components/sp-coupon/index.js b/src/components/sp-coupon/index.js index c95736a..a5475d8 100755 --- a/src/components/sp-coupon/index.js +++ b/src/components/sp-coupon/index.js @@ -41,7 +41,6 @@ function SpCoupon (props) { status, valid, } = info - console.log("🚀 ~ info:", info) const { tag, invalidBg, bg } = COUPON_TYPE[cardType] const couponTagBg = info.tagClass === 'used' || info.tagClass === 'overdue' || !info.valid ? invalidBg : bg diff --git a/src/components/sp-goods-cell/index.js b/src/components/sp-goods-cell/index.js index e9eca5b..e195e29 100755 --- a/src/components/sp-goods-cell/index.js +++ b/src/components/sp-goods-cell/index.js @@ -60,6 +60,7 @@ function SpGoodsCell (props) { } // console.log('isNaN(memberPrice):', info.orderItemType) + const max = parseInt(info?.limitedBuy ? info?.limitedBuy?.limit_buy : info.store) return ( <> @@ -129,7 +130,7 @@ function SpGoodsCell (props) { } - {info.num && 数量:{info.num}} + {info.num && 数量:{info.num} {max <= 5 && (库存紧张)}} diff --git a/src/components/sp-page/index.js b/src/components/sp-page/index.js index 8014598..00ca351 100755 --- a/src/components/sp-page/index.js +++ b/src/components/sp-page/index.js @@ -52,6 +52,7 @@ function SpPage (props, ref) { showNavkfIcon = false, showNavHomeIcon = false, showNavSearchIcon = false, + showLogoLoading = false, } = props let { renderTitle } = props const wrapRef = useRef(null) @@ -371,6 +372,10 @@ function SpPage (props, ref) { {/* {loading && } */} {loading && } + {showLogoLoading && + + } + {!isDefault && !loading && { if (info && !info.nospec) { @@ -82,6 +85,9 @@ function SpSkuSelect (props, ref) { } calcDisabled(selection, -1) + setState((draft) => { + draft.selSkuList[0] = selection[0] + }) } const calcDisabled = (selection, e = 0) => { @@ -156,37 +162,50 @@ function SpSkuSelect (props, ref) { // console.log('disabledSet:', disabledSet) - const handleSelectSku = (spec, idx) => { + const handleSelectSku = async (spec, idx) => { + if (!isClickPattern && idx === 2) { + return showToast('请先选择版型') + } const { specId } = spec const _selection = [...selection] _selection[idx] = specId const key = _selection.join('_') const row = skuDictRef.current[key] || {} - if (row?.store <= 0) { - if (disabledSet.has(specId) && idx !== 2) return - setState((draft) => { - draft.selection[idx] = specId //null - draft.curImage = 1 - }) - return showToast('该规格库存为空') - } - if (!state.isClickNum) { - setState((draft) => { - draft.isClickNum = idx === 2 - }) - } - if (!state.isClickPattern) { - setState((draft) => { + // if (row?.store <= 0 && isClickPattern) { + // if (disabledSet.has(specId) && idx !== 2) return + // setState((draft) => { + // draft.selection[idx] = specId //null + // draft.curImage = 1 + // }) + // return showToast('该规格库存为空') + // } + if (!isClickPattern) { + await setState((draft) => { 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.selection[idx] = specId //null + draft.selSkuList[idx] = specId draft.curImage = 1 draft.isClickSku = draft.isClickNum ? row.store > 0 : idx === 2 draft.showClickPattern = draft.isClickPattern ? row.store > 0 : idx === 1 + draft.isNotStore = isNotStore }, (row) => { calcDisabled(row.selection, idx) @@ -428,7 +447,7 @@ 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 && (showClickPattern && disabledSet.has(spec.specId)) ? null : 0 + })} + onClick={handleSelectSku.bind(this, spec, index)} + key={`sku-values-item__${idx}`} + > + {spec.specName} + } + + )) : 暂无库存)} */} + {/* + 上面是备份下面为修改,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)) && 0 })} onClick={handleSelectSku.bind(this, spec, index)} key={`sku-values-item__${idx}`} > - {/* {spec.specImgs.length > 0 && ( - - )} */} {spec.specName} } @@ -460,6 +496,7 @@ function SpSkuSelect (props, ref) { ))} + {isNotStore && 暂无库存} {/* {!hideInputNumber && renderLimitTip()} */} {/* {skuText.split(' ').map((item, index) => {item})} */} diff --git a/src/doc/checkout.js b/src/doc/checkout.js index c68522e..0f72963 100755 --- a/src/doc/checkout.js +++ b/src/doc/checkout.js @@ -11,6 +11,7 @@ export const CHECKOUT_GOODS_ITEM = { origincountry_name: 'origincountry_name', point: 'point', isPoint: 'is_point', + store: 'store', item_point: 'item_point', price: ({ price }) => price / 100, // 销售价 activityPrice: ({ activity_price }) => activity_price / 100, // 秒杀价 diff --git a/src/pages/cart/comps/comp-goodsitem.js b/src/pages/cart/comps/comp-goodsitem.js index 3c9b394..73be482 100755 --- a/src/pages/cart/comps/comp-goodsitem.js +++ b/src/pages/cart/comps/comp-goodsitem.js @@ -20,7 +20,8 @@ function CompGoodsItem (props) { onDelete = () => { }, onChange = () => { }, onClickImgAndTitle = () => { }, - onChangeGoodsIsCheck = () => { } + onChangeGoodsIsCheck = () => { }, + showWarning = false } = props const { priceSetting } = useSelector((state) => state.sys) const { userInfo = {}, vipInfo = {} } = useSelector((state) => state.user) @@ -68,7 +69,7 @@ function CompGoodsItem (props) { limitTxt = `每${info?.limitedBuy?.rule.day}天,限购${limitNum}件` } } - + const max = parseInt(info?.limitedBuy ? info?.limitedBuy?.limit_buy : info.store) return ( {children} @@ -125,13 +126,14 @@ function CompGoodsItem (props) { {isShowAddInput ? ( ) : ( x {info.num} )} + {showWarning && max <= 5 && (库存紧张)} {info.market_price > 0 && enMarketPrice && ( diff --git a/src/pages/cart/espier-checkout.js b/src/pages/cart/espier-checkout.js index eae45da..abed064 100755 --- a/src/pages/cart/espier-checkout.js +++ b/src/pages/cart/espier-checkout.js @@ -880,7 +880,7 @@ function CartCheckout (props) { {detailInfo.map((item, idx) => ( - + {/* state.sys) const { validCart = [], invalidCart = [], cartCount } = useSelector((state) => state.cart) @@ -66,7 +67,6 @@ function CartIndex () { }, [isLogin]) useDidShow(() => { - console.log('useDidShow', isLogin) if (isLogin) fetch() }) @@ -80,14 +80,20 @@ function CartIndex () { } const getCartList = async () => { - Taro.showLoading({ title: '' }) + // Taro.showLoading({ title: '', }) + setState((draft) => { + draft.loading = true + }) const { type = 'distributor' } = router?.params || {} const params = { shop_type: type } await dispatch(fetchCartList(params)) await dispatch(updateCount(params)) - Taro.hideLoading() + + setState((draft) => { + draft.loading = false + }) } const resolveActiveGroup = () => { @@ -166,7 +172,6 @@ function CartIndex () { page: 1, pageSize: 1000 }) - console.log("🚀 ~ list:----169", list) setState((draft) => { draft.recommendList = list }) @@ -183,7 +188,10 @@ function CartIndex () { // } const onChangeGoodsIsCheck = async (item, type, checked) => { - Taro.showLoading({ title: '' }) + // Taro.showLoading({ title: '' }) + setState((draft) => { + draft.loading = true + }) let parmas = { is_checked: checked } if (type === 'all') { const cartIds = item.list.map((item) => item.cart_id) @@ -216,6 +224,9 @@ function CartIndex () { const onChangeCartGoodsItem = useDebounce(async (item, num) => { console.log(`onChangeCartGoodsItem:`, num) + setState((draft) => { + draft.loading = true + }) let { shop_id, cart_id } = item const { type = 'distributor' } = router.params await dispatch(updateCartItemNum({ shop_id, cart_id, num, type })) @@ -271,6 +282,7 @@ function CartIndex () { 'has-tabbar': tabbar == 1 })} renderFooter={tabbar == 1 && } + showLogoLoading={loading} showNavLogo isBlack showNavkfIcon > {/* {!isLogin && ( @@ -353,6 +365,7 @@ function CartIndex () { onChange={onChangeCartGoodsItem.bind(this, c_sitem)} onChangeGoodsIsCheck={onChangeGoodsIsCheck.bind(this, c_sitem, 'single', !c_sitem.is_checked)} onClickImgAndTitle={onClickImgAndTitle.bind(this, c_sitem)} + showWarning /> {/**组合商品开始 */} diff --git a/src/pages/cart/espier-index.scss b/src/pages/cart/espier-index.scss index 70d62db..9fd03e7 100755 --- a/src/pages/cart/espier-index.scss +++ b/src/pages/cart/espier-index.scss @@ -69,7 +69,7 @@ padding: 26px 40px 26px 60px; position: fixed; bottom: calc(#{$page-ipx-footer-height} - 2px); - z-index: 1080; + z-index: 100; left: 0; right: 0; border-top: 1px solid #d9d9d9; diff --git a/src/pages/home/index.scss b/src/pages/home/index.scss index a5d8baf..c9edf24 100755 --- a/src/pages/home/index.scss +++ b/src/pages/home/index.scss @@ -76,6 +76,31 @@ page { // &.swiper-narrow { // 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 { // height: calc(100vh - 620px - #{$tabbar-height} - var(--status-bar-height)); @@ -119,10 +144,11 @@ page { } } .spot-pagination { + animation: fadeInAnimation 0.35s ease-in; position: absolute; left: 50%; transform: translateX(-50%); - bottom: 6%; + bottom: 10%; display: flex; justify-content: center; width: 80%; diff --git a/src/pages/index.js b/src/pages/index.js index 39a0255..39988d3 100755 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -500,13 +500,17 @@ function Home () { {/* {isUpOperation && BOSTON - 立即预约 - + 立即预约 + } */} ))} + {!isUpOperation && + 滑 动 探 索 + + } {!isUpOperation && {swiperList.map((_, index) => ( diff --git a/src/pages/item/comps/comp-evaluation.js b/src/pages/item/comps/comp-evaluation.js index f9b5e4e..fdb0ab9 100755 --- a/src/pages/item/comps/comp-evaluation.js +++ b/src/pages/item/comps/comp-evaluation.js @@ -64,8 +64,9 @@ function CompEvaluation (props) { ))} - 查看全部 - {list.length == 0 && 暂无商品评价} + {list.length == 0 ? 暂无商品评价 + : 查看全部 + } ) diff --git a/src/pages/item/list.js b/src/pages/item/list.js index 79061f0..df13495 100755 --- a/src/pages/item/list.js +++ b/src/pages/item/list.js @@ -12,7 +12,7 @@ import { SpPage, SpScrollView, SpDrawer, - SpSelect + SpNote } from '@/components' import { fetchUserFavs } from '@/store/slices/user' import doc from '@/doc' @@ -330,6 +330,12 @@ function ItemList () { url }) } + + const renderEmpty = () => { + return ( + 抱歉 没有搜索到结果 + ) + } return ( - {tagList.length > 0 && ( + {false && tagList.length > 0 && ( {/* - + {leftList.map((list, idx) => { diff --git a/src/pages/item/list.scss b/src/pages/item/list.scss index c5a3685..9f027c3 100755 --- a/src/pages/item/list.scss +++ b/src/pages/item/list.scss @@ -71,8 +71,19 @@ // /* #ifdef h5 */ // @include page-scroll($searchbar-height + $navigate-height + 16 * 2 + $tabs-height + 10, 0); // /* #endif */ - .sp-note { - margin-bottom: 50px; + // .sp-note { + // 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 { diff --git a/src/pages/member/item-fav.js b/src/pages/member/item-fav.js index 900791c..ad7f397 100755 --- a/src/pages/member/item-fav.js +++ b/src/pages/member/item-fav.js @@ -49,7 +49,6 @@ export default class ItemFav extends Component { } onShareTimeline (res) { - console.log("🚀 ~ ItemFav ~ res:", res) return this.getAppShareInfo() } @@ -358,7 +357,9 @@ export default class ItemFav extends Component { {/* {page.isLoading ? 正在加载... : null} */} {/* !page.isLoading && */} {!page.hasNext && !list.length && ( - 暂无数据~ + + 暂无收藏商品 + )} diff --git a/src/pages/member/item-fav.scss b/src/pages/member/item-fav.scss index 1c12021..a92faf0 100755 --- a/src/pages/member/item-fav.scss +++ b/src/pages/member/item-fav.scss @@ -84,6 +84,17 @@ /* #ifdef h5 */ top: $navigate-height-h5 + $tabs-height + 29px; /* #endif */ + .sp-note { + .sp-image { + margin-top: 400px; + } + &__text { + margin-top: 24px; + font-weight: bold; + font-size: 40px; + color: #000; + } + } } &__type-grid { display: flex; diff --git a/src/pages/recommend/list.js b/src/pages/recommend/list.js index 7b60dd1..58631f2 100755 --- a/src/pages/recommend/list.js +++ b/src/pages/recommend/list.js @@ -587,7 +587,7 @@ export default class RecommendList extends Component { const height = windowWidth * 9 / 17 return ( - } className='has-nav' title="" isBlack> + } loading={page.isLoading} className='has-nav' title="" isBlack> {false && <> diff --git a/src/subpages/member/index.js b/src/subpages/member/index.js index 8f229e0..f33768c 100755 --- a/src/subpages/member/index.js +++ b/src/subpages/member/index.js @@ -102,7 +102,8 @@ const initialState = { finishNum: 0, zitiNum: 0, deposit: 0, - isOpen: false + isOpen: false, + loading: false } function MemberIndex (props) { @@ -132,12 +133,18 @@ function MemberIndex (props) { }) useEffect(() => { if (isLogin) { + setState((draft) => { + draft.loading = true + }) getMemberCenterData() setMemberBackground() const { redirect } = $instance.router.params if (redirect) { Taro.redirectTo({ url: decodeURIComponent(redirect) }) } + setState((draft) => { + draft.loading = false + }) } }, [isLogin]) @@ -459,7 +466,7 @@ function MemberIndex (props) { // console.log('====config===', config.menu) return ( - } isTop> + } isTop>