From bf90b988f092d743f07392af96d77fb3e09ca2e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=96=87=E9=BE=99?= Date: Wed, 21 Feb 2024 15:11:17 +0800 Subject: [PATCH] update --- src/assets/bo.png | Bin 0 -> 1528 bytes src/components/sp-goods-price/index.js | 4 +- src/components/sp-page/index.js | 2 +- src/components/sp-sku-select-new/index.js | 14 +- src/components/sp-sku-select-new/index.scss | 4 +- src/pages/category/comps/comp-series.js | 24 +- src/pages/item/comps/comp-buytoolbar.js | 21 +- src/pages/item/comps/comp-buytoolbar.scss | 2 +- src/pages/item/espier-detail.js | 29 +- src/pages/recommend/list.js | 342 +++++++++++++------- src/pages/recommend/list.scss | 35 ++ src/subpages/marketing/coupon-center.js | 3 +- src/subpages/member/user-info.js | 6 +- 13 files changed, 322 insertions(+), 164 deletions(-) create mode 100644 src/assets/bo.png diff --git a/src/assets/bo.png b/src/assets/bo.png new file mode 100644 index 0000000000000000000000000000000000000000..412db3b36aca5cd98c57645a7e02bcfb45d55325 GIT binary patch literal 1528 zcmVPx#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91J)i>s1ONa40RR91Jpcdz05KU0uK)lAVo5|nRA>d|o6Tz-RT#!|8>&%i zcU6&)+=T(LQlYr$LKoTTO3^~mMM3`rL4|e`ckL#t?kv6Frs6^r7q%-mDp|PDpdePc zF%_{?yQtAcZHT{LI;Xyw+}xY_xXCp4fhRL(=A8F^pP6&#e5N%vB&@Bijbr+0cnlta zGjIwXf(M}YSK$i04wvB-xCj^Ex2;yo`^^SIC*W~-5#E4RV0rCmZ=!L^32GY7!$09L zpk3`x*CD=D#Rx%6QhpAeg!^G0e{sR8`ZfF>F2QT?CcFjjg9qUwuniBxXP`fchhQH6 za^ZbAN7er|e{-m5#O{Zu;NLKhKe%uX&ca>~Vqk2R%gSplSI>jT&^YYCh^r)??H}H7@9G~KM?{B&?SFY-z&EU+ zh%ZSzT;6JZC5;0bPeg}A`8Q7Ce3kx`YmMqC7!NeAh_j_0Ef)M}MQC_unuvlC8yCzA zFZOZ6fX!0;N?U~*^@j7$#rR;X>c+pl=8TL!wb%~(v1r6^I4?AxHcl8nZt56ZJIQ2E zC&6Z6SHIGEVT01f3ynMBRNpe>nuM`yd8TiHhTcSj{f7kgI7a9VZk|s$Id0-#tMx53(-1oobUzrbGjfQwT-iq(1vAF;2Y zzWCk^IDV}(Jfyt8sh^X|v@a;izBe_%&T%!p+II z-GcGF4u2%Vw_&Akiy|^T3!Y~RKGhQI?`d zZalq@>SH^7IaG^R!g<-#uL=~rO5WGtbHoxyLj_Fq%^LMw&h)OY@{i;k+33xNS~>V_ zkJh|*Cc2IAy}ZKFR_7)lI?iHtN$>5oES~@(M{m_K6Mh=;3AZ`9*Vm^{Z>rMy3y2)O zoe0_69<4nm>CN-T~UZd=;bue$!BaYS@T#M#|S!hPfUs%~@UE}k9j!00dYtN#e&tM-O_JtBL}y@}dUCf?+`L1wFf6Yf?M>9FuTu5y7YKpc eUN-W7E&l^?^4{*7nU5I&0000 } - {marketPrice > 0 && enMarketPrice && ( + {/* {marketPrice > 0 && enMarketPrice && ( - )} + )} */} {info.memberPrice < info.price && enMemberPrice && ( diff --git a/src/components/sp-page/index.js b/src/components/sp-page/index.js index 02a3789..84bbe5c 100755 --- a/src/components/sp-page/index.js +++ b/src/components/sp-page/index.js @@ -131,7 +131,7 @@ function SpPage (props, ref) { draft.pageTitle = pageTitle draft.isTabBarPage = isTabBarPage draft.showLeftContainer = !['/subpages/guide/index', '/pages/index'].includes(`/${page?.route}`) - draft.showCustomNavigation = ['/pages/cart/espier-index', '/pages/index', '/subpages/member/index', '/pages/category/index'].includes(`/${page?.route}`) + draft.showCustomNavigation = ['/pages/cart/espier-index', '/pages/index', '/subpages/member/index', '/pages/category/index', '/pages/recommend/list'].includes(`/${page?.route}`) // draft.showCustomNavigation = true draft.showNavCartIcon = ['/subpages/marketing/coupon-center', '/subpages/marketing/coupon', '/pages/item/list'].includes(`/${page?.route}`) }) diff --git a/src/components/sp-sku-select-new/index.js b/src/components/sp-sku-select-new/index.js index 609c440..5b9ee6d 100755 --- a/src/components/sp-sku-select-new/index.js +++ b/src/components/sp-sku-select-new/index.js @@ -48,7 +48,7 @@ function SpSkuSelect (props, ref) { hideInputNumber = false, onChangeImg } = props - console.log('SpSkuSelect:info', info) + // console.log('SpSkuSelect:info', info) // const [state, setState] = useImmer(initialState) const [state, setState] = useAsyncCallback(initialState) const { selection, curImage, disabledSet, curItem, skuText, num, loading } = state @@ -84,7 +84,7 @@ function SpSkuSelect (props, ref) { const makeReg = (sel, row, val) => { const tSel = sel.slice() const regStr = tSel.map((s, idx) => (row === idx ? val : !s ? '(\\d+)' : s)).join('_') - console.log('regStr:', regStr) + // console.log('regStr:', regStr) return new RegExp(regStr) } @@ -114,12 +114,12 @@ function SpSkuSelect (props, ref) { // disabledSet // ) - const curItem = skuDictRef.current[selection.join('_')] + const curItem = skuDictRef.current[selection.join('_')] || skuDictRef.current[Object.keys(skuDictRef.current)[0]] // const skuText = curItem // ? `已选:${curItem.specItem.map((item) => `${item.skuName}:${item.specName}`).join(',')}` // : '请选择规格' const skuText = curItem - ? `已选择 ${curItem.specItem.map((item, index) => `${index === 1 ? item.specName.substr(0, 2) : item.specName}`).join(' ')}码` + ? `已选择 ${curItem.specItem.map((item, index) => `${index === 1 ? item.specName.substr(0, 2) : item.specName}`).join(' ')}码` : '请选择规格' setState((draft) => { @@ -137,7 +137,7 @@ function SpSkuSelect (props, ref) { // console.log('disabledSet:', disabledSet) const handleSelectSku = ({ specId }, idx) => { - console.log("🚀 ~ { specId }, idx:", specId, idx) + // console.log("🚀 ~ { specId }, idx:", specId, idx) if (disabledSet.has(specId)) return setState( (draft) => { @@ -412,7 +412,7 @@ function SpSkuSelect (props, ref) { ))} {!hideInputNumber && renderLimitTip()} - {skuText} + {skuText.split(' ').map((item, index) => {item})} {/* */} @@ -423,4 +423,4 @@ SpSkuSelect.options = { addGlobalClass: true } -export default React.forwardRef(SpSkuSelect) +export default React.memo(React.forwardRef(SpSkuSelect)) diff --git a/src/components/sp-sku-select-new/index.scss b/src/components/sp-sku-select-new/index.scss index 0a65be1..f3cac70 100755 --- a/src/components/sp-sku-select-new/index.scss +++ b/src/components/sp-sku-select-new/index.scss @@ -47,10 +47,10 @@ // margin-top: 30px; // margin-bottom: 100px; .select { - position: absolute; + // position: absolute; top: 156px; right: 50px; - font-size: 22px; + font-size: 24px; } } .sku-group { diff --git a/src/pages/category/comps/comp-series.js b/src/pages/category/comps/comp-series.js index a2ef5c4..56db8b2 100755 --- a/src/pages/category/comps/comp-series.js +++ b/src/pages/category/comps/comp-series.js @@ -97,7 +97,7 @@ const CompSeries = (props) => { const currentTopImg = info[activeIndex].img || '' //当前分类顶部图片 const currentChildren = info[activeIndex].children || [] // 子类 - const currentID = info[activeIndex].id || '' + const currentID = info[activeIndex].id || info[activeIndex].category_id || '' return ( {/* left */} @@ -146,9 +146,13 @@ const CompSeries = (props) => { )} {!showChild ? currentChildren.map((item, index) => { - return ( { - setShowChild(true) - setSelChild(item) + return (index === 0 || currentID === '18' ? { + if (item.children?.length) { + setShowChild(true) + setSelChild(item) + } else { + handleClickItem(item) + } }}> {item.name} @@ -159,6 +163,18 @@ const CompSeries = (props) => { height={350} src={item.img} /> + : handleClickItem(item)} + > + + {item.name} + ) // return item.children ? ( // // diff --git a/src/pages/item/comps/comp-buytoolbar.js b/src/pages/item/comps/comp-buytoolbar.js index 600fe83..da4f33f 100755 --- a/src/pages/item/comps/comp-buytoolbar.js +++ b/src/pages/item/comps/comp-buytoolbar.js @@ -42,14 +42,14 @@ function CompGoodsBuyToolbar (props) { btns.push(BUY_TOOL_BTNS.ONLY_SHOW) return } - if (info.store == 0) { - if (info.subscribe) { - btns.push(BUY_TOOL_BTNS.SUBSCRIBE) - } else { - btns.push(BUY_TOOL_BTNS.NOTICE) - } - return - } + // if (info.store == 0) { + // if (info.subscribe) { + // btns.push(BUY_TOOL_BTNS.SUBSCRIBE) + // } else { + // btns.push(BUY_TOOL_BTNS.NOTICE) + // } + // return + // } if (info.isGift) { btns.push(BUY_TOOL_BTNS.GIFT) @@ -81,12 +81,11 @@ function CompGoodsBuyToolbar (props) { return } - btns.push(BUY_TOOL_BTNS.ADD_CART) - btns.push(BUY_TOOL_BTNS.FAST_BUY) + btns.push({ ...BUY_TOOL_BTNS.ADD_CART, btnStatus: info.store == 0 ? 'disabled' : 'default' }) + btns.push({ ...BUY_TOOL_BTNS.FAST_BUY, btnStatus: info.store == 0 ? 'disabled' : 'active' }) } RenderBtns() - // console.log('btns:', btns) const onChangeLogin = async ({ key }) => { const { dtid, card_id, user_card_id } = $instance.router.params diff --git a/src/pages/item/comps/comp-buytoolbar.scss b/src/pages/item/comps/comp-buytoolbar.scss index befd017..1e8ffb3 100755 --- a/src/pages/item/comps/comp-buytoolbar.scss +++ b/src/pages/item/comps/comp-buytoolbar.scss @@ -101,7 +101,7 @@ /* prettier-ignore */ border: 1PX solid #E5E5E5; background: #e5e5e5; - color: #8d8d8d; + color: #8d8d8d !important; } &.sp-login { margin-left: 0; diff --git a/src/pages/item/espier-detail.js b/src/pages/item/espier-detail.js index 3b229a1..404a7bb 100755 --- a/src/pages/item/espier-detail.js +++ b/src/pages/item/espier-detail.js @@ -102,7 +102,8 @@ const initialState = { selSkuImg: '', swiperList: [], selColorIdx: 0, - introList: [] + introList: [], + scrollTop: 0 } function EspierDetail (props) { @@ -148,7 +149,8 @@ function EspierDetail (props) { selSkuImg, swiperList, selColorIdx, - introList + introList, + scrollTop } = state useEffect(() => { @@ -455,10 +457,9 @@ function EspierDetail (props) { {/* */} {!info && } {info && ( - { - // console.log('e', e.detail) + { const { scrollTop } = e.detail - if (scrollTop >= 640) { + if (scrollTop >= 600) { setState((draft) => { draft.isShowScroll = true }) @@ -731,18 +732,18 @@ function EspierDetail (props) { }} onChange={(skuText, curItem, idx) => { console.log("🚀 ~ curItem:", curItem, idx) - setState((draft) => { + curItem && setState((draft) => { draft.skuText = skuText draft.curItem = curItem // 不切换顶部轮播图 - draft.swiperList = curItem?.specItem?.[idx]?.specImgs draft.selSkuImg = curItem.specItem?.[0]?.specImgs?.[0] + if (idx === 0) draft.swiperList = curItem?.specItem?.[idx]?.specImgs }) }} /> - + {/* {info?.itemName} - + */} {isArray(info.intro) ? ( {info.intro.map((item, idx) => ( @@ -785,6 +786,11 @@ function EspierDetail (props) { }) draft.introList[index].isOpen = !item.isOpen }) + if (!item.isOpen) { + setState((draft) => { + draft.scrollTop = 610 + Math.random() + }) + } }} title={item.title} > @@ -798,6 +804,11 @@ function EspierDetail (props) { }) draft.introList[index].isOpen = !item.isOpen }) + if (!item.isOpen) { + setState((draft) => { + draft.scrollTop = 610 + Math.random() + }) + } }}> {item.isOpen ? : } diff --git a/src/pages/recommend/list.js b/src/pages/recommend/list.js index 90e60c7..8451fa1 100755 --- a/src/pages/recommend/list.js +++ b/src/pages/recommend/list.js @@ -1,6 +1,6 @@ import React, { Component } from 'react' import Taro, { getCurrentInstance } from '@tarojs/taro' -import { View, Text, ScrollView, Picker } from '@tarojs/components' +import { View, Text, ScrollView, Picker, Video } from '@tarojs/components' import { SpAddress } from '@/components' import { withPager, withBackToTop } from '@/hocs' import { connect } from 'react-redux' @@ -13,10 +13,11 @@ import { SpNote, FilterBar, SpTabbar, - SpPage + SpPage, + SpImage } from '@/components' import api from '@/api' -import { classNames, pickBy } from '@/utils' +import { classNames, pickBy, isWeixin } from '@/utils' import S from '@/spx' import './list.scss' @@ -24,7 +25,7 @@ import './list.scss' @connect(({ colors }) => ({ colors: colors.current })) -@withPager +// @withPager @withBackToTop export default class RecommendList extends Component { $instance = getCurrentInstance() @@ -45,6 +46,10 @@ export default class RecommendList extends Component { isShowSearch: false, shareInfo: {}, isSpAddressOpened: false, + play: false, + page: { + isLoading: true + } } } @@ -68,14 +73,19 @@ export default class RecommendList extends Component { } }) } - Taro.showLoading({ title: '' }) - this.resetPage() - this.setState({ - list: [] - }) + // Taro.showLoading({ title: '' }) + // this.resetPage() + // this.setState({ + // list: [] + // }) setTimeout(() => { - this.nextPage() - Taro.hideLoading() + // this.nextPage() + // Taro.hideLoading() + this.setState({ + page: { + isLoading: false + } + }) }, 200) // this.praiseNum() @@ -529,6 +539,30 @@ export default class RecommendList extends Component { }) } + handleVideoClick = (play) => { + let video + if (isWeixin) { + video = Taro.createVideoContext('recommend-video') + } else if (isWeb) { + video = document.getElementById('recommend-video') + } + + if (!video) { + return + } + + if (play) { + setTimeout(() => { + video.play() + }, 200) + } else { + isWeixin ? video.stop() : video.pause() + } + this.setState({ + play + }) + } + render () { const { list, @@ -543,36 +577,38 @@ export default class RecommendList extends Component { areaList, query, isShowSearch, - isSpAddressOpened + isSpAddressOpened, + play } = this.state const { colors } = this.props let address = info.province + info.city return ( - } className='has-nav' title="鞋床故事"> + } className='has-nav' title="" isBlack> - - - - - - - - {selectColumn.name || '栏目'} + {false && <> + + + - - {/* + + + {selectColumn.name || '栏目'} + + + {/* {address || '地区'} */} - - - {address || '地区'} - - + + + {address || '地区'} + + - {address ? ( - - // x - ) : ( - '' - )} - - - - - - - {columnList.map((item, index) => { - return ( + {address ? ( - {item.name} + className='zoom-btn icon-close iconfont' + onClick={this.handleRegionRefresh.bind(this)} + > + // x + ) : ( + '' + )} + + + + + + + {columnList.map((item, index) => { + return ( + + {item.name} + + ) + })} + + + + + + + + 重置 + + + 确定 + + + + + + + {list.map((item) => { + return ( + + this.handleClickItem(item)} + /> ) })} - - - + + {page.isLoading ? 正在加载... : null} + {!page.isLoading && !page.hasNext && !list.length && ( + 暂无数据~ + )} + + } + {page.isLoading ? : + + - - - 重置 - - - 确定 - - - - - - - {list.map((item) => { - return ( - - this.handleClickItem(item)} - /> - - ) - })} - - {page.isLoading ? 正在加载... : null} - {!page.isLoading && !page.hasNext && !list.length && ( - 暂无数据~ - )} - - + } diff --git a/src/pages/recommend/list.scss b/src/pages/recommend/list.scss index cc0e9f4..f178fc6 100755 --- a/src/pages/recommend/list.scss +++ b/src/pages/recommend/list.scss @@ -3,6 +3,41 @@ margin-top: 60px; } .page-recommend-list { + .recommend-content { + width: 100%; + .top-txt { + margin-top: 46px; + margin-bottom: 40px; + &-title { + text-align: center; + font-size: 30px; + margin-bottom: 24px; + font-weight: bold; + } + &-dec { + white-space: pre-wrap; + word-wrap: break-word; + text-align: center; + margin-bottom: 30px; + &-item { + text-align: center; + font-size: 20px; + line-height: 1.5; + margin: 0 auto; + } + } + .line { + margin: 0 auto; + width: 50px; + height: 6px; + background: #000; + border-radius: 4px; + } + } + .content-item { + margin-bottom: 50px; + } + } /* #ifdef alipay */ .filter-bar { position: absolute; diff --git a/src/subpages/marketing/coupon-center.js b/src/subpages/marketing/coupon-center.js index 4861879..b188bd3 100755 --- a/src/subpages/marketing/coupon-center.js +++ b/src/subpages/marketing/coupon-center.js @@ -152,10 +152,11 @@ function CouponCenter (props) { const getPoint = async () => { await api.member.depositToPoint({ money: 10000 }) - showToast('积分+500') + showToast('积分+100') setState((draft) => { draft.couponList = [] }) + getMypoint() listRef.current?.reset() } return ( diff --git a/src/subpages/member/user-info.js b/src/subpages/member/user-info.js index 13f53f7..7cf8c6d 100755 --- a/src/subpages/member/user-info.js +++ b/src/subpages/member/user-info.js @@ -27,6 +27,7 @@ const initialState = { listLength: 0, nList: [], listLength: 0, + loading: true } function MemberUserInfo () { @@ -44,6 +45,7 @@ function MemberUserInfo () { areaList, multiIndex, nList, + loading } = state const { userInfo = {} } = useSelector((_state) => _state.user) const pageRef = useRef() @@ -180,6 +182,7 @@ function MemberUserInfo () { draft.formUserInfo = _formUserInfo draft.areaList = [arrProvice, arrCity, arrCounty] draft.multiIndex = _multiIndex + draft.loading = false }) } @@ -520,7 +523,7 @@ function MemberUserInfo () { if (isWeixin) { return ( ) } else { @@ -540,6 +543,7 @@ function MemberUserInfo () { 保存 } + loading={loading} > {/* */}