🐞 fix:【ID1000658】:

新版内部商城加入购物车的客户搜索无效,
【ID1000661】:序号2,3,9,10,11,13,14,22,37,38,43
This commit is contained in:
Haiyi
2022-11-08 13:54:23 +08:00
parent 7eb3394cd8
commit 4198b9b548
33 changed files with 538 additions and 369 deletions
@@ -10,13 +10,15 @@ import { GetAddressListApi } from "@/api/addressList";
import Tabs from "../tabs"
import IconFont from '@/components/iconfont/iconfont';
interface Props {
handCity?: (province: any, city: any) => void
handCity?: (province: any, city: any) => void,
value?: any
}
export default memo(forwardRef((props: Props, ref) => {
useImperativeHandle(ref, () => ({
close
close,
DropDownItemRef
}))
const DropDownItemRef = useRef<any>()
@@ -73,11 +73,12 @@
display: flex;
.phoneFont {
margin-right: 40px;
// margin-right: 40px;
margin-left: 16px;
font-size: 24px;
font-weight: 400;
color: #4581FF;
width: 100rpx;
}
}
}
@@ -29,19 +29,29 @@ export default memo((props: Props) => {
<View className={styles.mainItem} onClick={() => handNav()}>
<View className={styles.itemTop}>
<View className={styles.itemLeft}>
<View className={styles.itemCile}>{props.obj.name[0]}</View>
<View className={styles.leftSafe}>
<View className={styles.itemCile}>{props.obj.name[0]}</View>
</View>
<View className={styles.item_top_one}>
<View className={styles.item_top_one_flex}>
<View className={styles.itemName}>{props.obj.name}</View>
<View className={styles.itemPhone}>{props.obj.phone}</View>
</View>
<View className={styles.item_tag_box}>
<View className={styles.item_tagItem}>二批</View>
<View className={styles.item_tagItem}>{props.obj.purchaser_type_name || '暂无'}</View>
<View className={styles.item_tagItem}>{props.obj.sale_user_name || '暂无'}</View>
{
props.obj?.label_list?.map(item => {
return (
<View className={styles.item_tagItem}>{item.label_name}</View>
)
})
}
</View>
</View>
</View>
<View className={styles.itemRight} onClick={(e) => handPhone(e)}>
<IconFont name={'icon-dianhua'} size={30} color={'#337FFF'}></IconFont>
<View className={styles.phoneFont}>联系TA</View>
</View>
@@ -1,5 +1,5 @@
import { View } from '@tarojs/components'
import React, { useCallback, memo, useEffect, useMemo, useRef, useState, ReactNode } from 'react'
import React, { useCallback, memo, useEffect, useMemo, useRef, useState, ReactNode, forwardRef, useImperativeHandle } from 'react'
import styles from "./index.module.scss"
import classnames from "classnames";
import Taro, { usePullDownRefresh, useRouter, useDidShow } from '@tarojs/taro';
@@ -7,31 +7,51 @@ import { alert } from '@/common/common'
import { formatPriceDiv, formatDateTime, formatWeightDiv } from '@/common/format'
import DropDownItem from '@/components/dropDown-item'
interface Props {
handSort?: (any) => void
handSort?: (any) => void,
value?: any
}
export default memo((props: Props) => {
export default memo(forwardRef((props: Props, ref) => {
const DropDownItemRef = useRef<any>()
// const close = () => {
// DropDownItemRef.current.closePopup()
// }
useImperativeHandle(ref, () => ({
DropDownItemRef
}))
const [list, setlist] = useState<any[]>([
{
name: '下单时间',
name: '下单时间正序',
id: '1',
checked: false
},
{
name: '创建时间',
name: '创建时间正序',
id: '2',
checked: false
},
{
name: '更新时间',
name: '更新时间正序',
id: '3',
checked: false
},
{
name: '下单时间倒序',
id: '-1',
checked: false
},
{
name: '创建时间倒序',
id: '-2',
checked: false
},
{
name: '更新时间倒序',
id: '-3',
checked: false
}
])
@@ -74,4 +94,4 @@ export default memo((props: Props) => {
</View>
</DropDownItem>
)
})
}))
@@ -1,5 +1,5 @@
import { View } from '@tarojs/components'
import React, { useCallback, memo, useEffect, useMemo, useRef, useState, ReactNode } from 'react'
import React, { useCallback, memo, useEffect, useMemo, useRef, useState, ReactNode, forwardRef, useImperativeHandle } from 'react'
import styles from "./index.module.scss"
import classnames from "classnames";
import Taro, { usePullDownRefresh, useRouter, useDidShow } from '@tarojs/taro';
@@ -9,13 +9,16 @@ import DropDownItem from '@/components/dropDown-item'
import { mppurchaserlist } from "@/api/customer"
interface Props {
handType: (any) => void,
handTags: (any) => void
handTags: (any) => void,
value?: any
}
export default memo((props: Props) => {
export default memo(forwardRef((props: Props, ref) => {
const DropDownItemRef = useRef<any>()
useImperativeHandle(ref, () => ({
DropDownItemRef
}))
const [currentValue, setCurrentValue] = useState<number>(-1)
const [list, setlist] = useState<any[]>([
@@ -99,4 +102,4 @@ export default memo((props: Props) => {
</View>
</DropDownItem>
)
})
}))
+8 -4
View File
@@ -92,6 +92,9 @@ export default () => {
setSearchField((val) => ({ ...val, size: 10, abstract_sort_key: e }))
}, [])
const SortRef = useRef<any>()
const TagRef = useRef<any>()
//筛选城市
const ChoseCityRef = useRef<any>()
const handCity = useCallback((provinceVal, cityVal) => {
@@ -127,6 +130,7 @@ export default () => {
setSearchField((val) => ({ ...val, size: 10, label_ids: arr.length === 0 ? '' : arr }))
}, [])
return (
<View className={styles.mainBox}>
<View className={styles.topBox}>
@@ -134,9 +138,9 @@ export default () => {
<Search placeholder='搜索客户名称、电话、业务员' showBtn={false} changeOnSearch={getSearchData} debounceTime={300} />
</View>
<View className={styles.menuBox}>
<Sort handSort={handSort}></Sort>
<Sort ref={SortRef} handSort={handSort}></Sort>
<ChoseCity ref={ChoseCityRef} handCity={handCity}></ChoseCity>
<Tag handTags={handTags} handType={handType}></Tag>
<Tag ref={TagRef} handTags={handTags} handType={handType}></Tag>
</View>
</View>
<View className={styles.totalFont}>共 {orderData?.total || 0} 个客户</View>
@@ -155,8 +159,8 @@ export default () => {
</InfiniteScroll>
</View>
<View className={styles.bottom_box}>
<View className={styles.bottom_btn} onClick={() => goLink('/pages/customerEditor/index?type=add')}>新建用户</View>
<View className={styles.bottom_btn} onClick={() => goLink('/pages/customerEditor/index?type=add')}>新建客户</View>
</View>
</View>
</View >
)
}