feat(ID1000945): 【面料优选】,客服入口补充

【【面料优选】,客服入口补充】https://www.tapd.cn/53459131/prong/stories/view/1153459131001000945
This commit is contained in:
xuan 2023-03-15 11:08:03 +08:00
parent 5d42eef85c
commit e5f36e9ca3
8 changed files with 202 additions and 189 deletions

View File

@ -29,8 +29,10 @@ interface param {
playVideo?: boolean playVideo?: boolean
floatVideoFile?: any[] floatVideoFile?: any[]
showFloatVideo?: boolean showFloatVideo?: boolean
customStyles?: React.CSSProperties
} }
const MoveBtn = ({ showFloatVideo = false, floatVideoFile = [], playVideo = true, orderObj = {}, children = null, onShopClick, showList = [], messageTitle = '', messagePath = '', showCart = false }: param) => { const MoveBtn = (props: param) => {
const { customStyles = {}, showFloatVideo = false, floatVideoFile = [], playVideo = false, orderObj = {}, children = null, onShopClick, showList = [], messageTitle = '', messagePath = '', showCart = false } = props
const userInfo = useSelector(state => state.userInfo) const userInfo = useSelector(state => state.userInfo)
// 获取购物车数据数量 // 获取购物车数据数量
const { getShopCount, commonData } = useCommonData() const { getShopCount, commonData } = useCommonData()
@ -127,7 +129,7 @@ const MoveBtn = ({ showFloatVideo = false, floatVideoFile = [], playVideo = true
} }
return ( return (
<MovableArea className={styles.movableItem}> <MovableArea className={styles.movableItem} style={customStyles}>
{children} {children}
{onShow('shop') && <MovableView {onShow('shop') && <MovableView
onClick={onShopClick} onClick={onShopClick}

View File

@ -8,6 +8,7 @@ import { GetProductKindListApi, GetProductListApi } from '@/api/material'
import { dataLoadingStatus } from '@/common/util' import { dataLoadingStatus } from '@/common/util'
import Product from '@/components/product' import Product from '@/components/product'
import useLogin from '@/use/useLogin' import useLogin from '@/use/useLogin'
import MoveBtn from '@/components/moveBtn'
const PAGE_LIMIT = 10 const PAGE_LIMIT = 10
@ -88,7 +89,8 @@ const Category = () => {
categoryList() categoryList()
}, []) }, [])
return <View className={styles.main}> return <MoveBtn showList={['order']} customStyles={{ overflow: 'scroll' }}>
<View className={styles.main}>
<View className={styles.header}> <View className={styles.header}>
<View className={styles.search}> <View className={styles.search}>
<View className={styles.search_input} onClick={() => goLink('/pages/searchList/search')}> <View className={styles.search_input} onClick={() => goLink('/pages/searchList/search')}>
@ -113,5 +115,6 @@ const Category = () => {
</SideBar> </SideBar>
</View> </View>
</View> </View>
</MoveBtn>
} }
export default Category export default Category

View File

@ -1,6 +1,5 @@
.main { .main {
background-color: #fff; background-color: #fff;
height: 100vh;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.header { .header {

View File

@ -14,6 +14,7 @@ import IconFont from '@/components/iconfont/iconfont'
import IconText from '@/components/iconText' import IconText from '@/components/iconText'
import { HOME_ITEM1, HOME_ITEM2, HOME_ITEM3, HOME_ITEM4 } from '@/common/constant' import { HOME_ITEM1, HOME_ITEM2, HOME_ITEM3, HOME_ITEM4 } from '@/common/constant'
import { EnumLabelPageJumpApi, GetLabelProductsApi } from '@/api/search' import { EnumLabelPageJumpApi, GetLabelProductsApi } from '@/api/search'
import MoveBtn from '@/components/moveBtn'
const Index = () => { const Index = () => {
useLogin() useLogin()
@ -134,6 +135,7 @@ const Index = () => {
} }
return ( return (
<MoveBtn showList={['order']} customStyles={{ overflow: 'scroll' }}>
<View className={styles.main}> <View className={styles.main}>
<View className={styles.header}> <View className={styles.header}>
<View className={styles.search}> <View className={styles.search}>
@ -199,9 +201,8 @@ const Index = () => {
<View className={styles.more_recommend} onClick={handleMoreRecommend}>{'更多推荐 >'}</View> <View className={styles.more_recommend} onClick={handleMoreRecommend}>{'更多推荐 >'}</View>
</View> </View>
</View> </View>
{/* 真机测试:注释了以下这段也没有布局问题 */}
{/* <View className="common_safe_area_y"></View> */}
</View> </View>
</MoveBtn>
) )
} }

View File

@ -17,6 +17,7 @@ import LabAndImg from '@/components/LabAndImg'
import IconFont from '@/components/iconfont/iconfont' import IconFont from '@/components/iconfont/iconfont'
import Tag from '@/components/tag' import Tag from '@/components/tag'
import { EnumAllLabelApi, GetLabelProductsApi, HomePageJumpApi } from '@/api/search' import { EnumAllLabelApi, GetLabelProductsApi, HomePageJumpApi } from '@/api/search'
import MoveBtn from '@/components/moveBtn'
enum FilterOptions { enum FilterOptions {
RECOMMEND = 1, RECOMMEND = 1,
@ -201,6 +202,7 @@ export default () => {
} }
return ( return (
<MoveBtn showList={['order']} customStyles={{ overflow: 'scroll' }}>
<View className={styles.main}> <View className={styles.main}>
<View className={styles.search}> <View className={styles.search}>
<Search placeholder="请输入搜索面料" showBtn btnTitle="搜索" clickOnSearch={getSearchData} defaultValue={router.params.key} changeOnSearch={handleInput} debounceTime={300} /> <Search placeholder="请输入搜索面料" showBtn btnTitle="搜索" clickOnSearch={getSearchData} defaultValue={router.params.key} changeOnSearch={handleInput} debounceTime={300} />
@ -235,7 +237,7 @@ export default () => {
refresherEnabled refresherEnabled
selfOnRefresherRefresh={getRefresherRefresh} selfOnRefresherRefresh={getRefresherRefresh}
refresherTriggered={refresherTriggeredStatus} refresherTriggered={refresherTriggeredStatus}
safeAreaInsetBottom={false} safeAreaInsetBottom
selfonScrollToLower={getScrollToLower} selfonScrollToLower={getScrollToLower}
statusMore={statusMore} statusMore={statusMore}
> >
@ -278,5 +280,6 @@ export default () => {
</View> </View>
</View> </View>
</View> </View>
</MoveBtn>
) )
} }

View File

@ -3,11 +3,9 @@
align-items: center; align-items: center;
background-color: #fff; background-color: #fff;
padding: 24px 24px 24px 56px; padding: 24px 24px 24px 56px;
position: fixed;
bottom: 0;
left: 0;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
position: relative;
z-index: 999; z-index: 999;
box-shadow: 0px -5px 20px -8px rgba(0, 0, 0, 0.06); box-shadow: 0px -5px 20px -8px rgba(0, 0, 0, 0.06);
.select_text { .select_text {

View File

@ -1,13 +1,20 @@
page {
display: flex;
flex-flow: column nowrap;
height: 100vh;
overflow: hidden;
}
.shop_main { .shop_main {
min-height: 100vh;
background-color: #f8f8f8; background-color: #f8f8f8;
display: flex; display: flex;
flex-direction: column; flex-flow: column nowrap;
.shop_con { justify-content: space-between;
// flex: 1;
box-sizing: border-box;
height: calc(100vh - 300px);
overflow: hidden; overflow: hidden;
height: 100%;
.shop_con {
flex: 1 1 auto;
box-sizing: border-box;
overflow: scroll;
} }
.scroll_view { .scroll_view {
padding: 0 24px; padding: 0 24px;

View File

@ -4,15 +4,14 @@ import React, { useCallback, useEffect, useMemo, useRef, useState, useTransition
import ProductBlock from '../productBlock' import ProductBlock from '../productBlock'
import BottomBtn from '../bottomBtn' import BottomBtn from '../bottomBtn'
import Operation from '../operation' import Operation from '../operation'
import type { listType } from '../search'
import Search from '../search' import Search from '../search'
import NoShop from '../noShop' import NoShop from '../noShop'
import RecommendOpen from '../RecommendOpen' import RecommendOpen from '../RecommendOpen'
import styles from './index.module.scss' import styles from './index.module.scss'
import type { listType, saleModeType } from '@/common/enum'
import { DelShoppingCartApi, GetProductColorApi, GetShoppingCartV2Api } from '@/api/shopCart' import { DelShoppingCartApi, GetProductColorApi, GetShoppingCartV2Api } from '@/api/shopCart'
import type { ProductType } from '@/context/ContextShop' import type { ProductType } from '@/context/ContextShop'
import { useCurrenShop } from '@/context/ContextShop' import { useCurrenShop } from '@/context/ContextShop'
import type { saleModeType } from '@/common/enum'
import LoadingCard from '@/components/loadingCard' import LoadingCard from '@/components/loadingCard'
import { alert, goLink } from '@/common/common' import { alert, goLink } from '@/common/common'
import InfiniteScroll from '@/components/infiniteScroll' import InfiniteScroll from '@/components/infiniteScroll'
@ -25,6 +24,7 @@ import { useSelector } from '@/reducers/hooks'
import OrganizationNameModal from '@/components/organizationNameModal' import OrganizationNameModal from '@/components/organizationNameModal'
import useLogin from '@/use/useLogin' import useLogin from '@/use/useLogin'
import { companyDetailApi, companyUpdateApi } from '@/api/company' import { companyDetailApi, companyUpdateApi } from '@/api/company'
import MoveBtn from '@/components/moveBtn'
interface FilterType { interface FilterType {
abstract_sort_key: -1|1|2|-2 abstract_sort_key: -1|1|2|-2
@ -93,7 +93,7 @@ export default () => {
setFilter(e => ({ ...e, sale_mode: val.value })) setFilter(e => ({ ...e, sale_mode: val.value }))
}, []) }, [])
const logadingStatus = useMemo(() => { const loadingStatus = useMemo(() => {
return shopState.loading || isPending return shopState.loading || isPending
}, [shopState.loading, isPending]) }, [shopState.loading, isPending])
@ -224,7 +224,8 @@ export default () => {
} }
}, [state.delCommendId]) }, [state.delCommendId])
return <View className={styles.shop_main}> return <MoveBtn showList={['order']} customStyles={{ overflow: 'scroll' }}>
<View className={styles.shop_main}>
<View className={styles.shop_header}> <View className={styles.shop_header}>
<Operation onSelect={onSortChange} onChange={onChangeSetting} /> <Operation onSelect={onSortChange} onChange={onChangeSetting} />
<View className={styles.search_title}> <View className={styles.search_title}>
@ -232,12 +233,11 @@ export default () => {
</View> </View>
</View> </View>
<View className={styles.shop_con}> <View className={styles.shop_con}>
{logadingStatus && <View className={styles.loading_card}><LoadingCard /></View>} {loadingStatus && <View className={styles.loading_card}><LoadingCard /></View>}
{(!logadingStatus && state.list && state.list.length > 0) && <ScrollView scrollY className={styles.scroll_view}> {(!loadingStatus && state.list && state.list.length > 0) && <ScrollView scrollY className={styles.scroll_view}>
{state.list?.map(item => (<ProductBlock productItem={item} key={item.product_id} />))} {state.list?.map(item => (<ProductBlock productItem={item} key={item.product_id} />))}
<View style={{ height: '100rpx' }}></View>
</ScrollView>} </ScrollView>}
{(!logadingStatus && !state.list) && <NoShop />} {(!loadingStatus && !state.list) && <NoShop />}
</View> </View>
<BottomBtn onSelect={onSelect} model={settingStatus} onBtnClick={onBtnClick} /> <BottomBtn onSelect={onSelect} model={settingStatus} onBtnClick={onBtnClick} />
@ -250,6 +250,6 @@ export default () => {
<View> <View>
<RecommendOpen shopId={state.recommendId || 0} onShow={!!state.recommendId} onClose={onRecommendClose} submitSuccess={onSubmitSuccess} /> <RecommendOpen shopId={state.recommendId || 0} onShow={!!state.recommendId} onClose={onRecommendClose} submitSuccess={onSubmitSuccess} />
</View> </View>
<View className="common_safe_area_y"></View>
</View> </View>
</MoveBtn>
} }