🐞 fix:修复客户管理不允许二次弹窗

This commit is contained in:
Haiyi
2022-11-11 17:58:46 +08:00
parent 45c656e0ed
commit ca9638ca48
7 changed files with 59 additions and 33 deletions
@@ -11,20 +11,29 @@ import Tabs from "../tabs"
import IconFont from '@/components/iconfont/iconfont';
interface Props {
handCity?: (province: any, city: any) => void,
value?: any
value?: any,
onCloseOverlay?: () => void
}
export default memo(forwardRef((props: Props, ref) => {
useImperativeHandle(ref, () => ({
close,
DropDownItemRef
}))
const DropDownItemRef = useRef<any>()
const close = () => {
DropDownItemRef.current.closePopup()
}
useImperativeHandle(
ref,
() => {
return {
show: DropDownItemRef?.current?.show,
showPopup: DropDownItemRef?.current.showPopup,
closePopup: DropDownItemRef?.current?.closePopup,
}
},
[DropDownItemRef?.current],
)
//获取地址
const { fetchData } = GetAddressListApi()
@@ -183,7 +192,7 @@ export default memo(forwardRef((props: Props, ref) => {
props.handCity?.('', '')
}
return (
<DropDownItem ref={DropDownItemRef} title={'所有省市'} value={-1} activeColor='#337fff'>
<DropDownItem ref={DropDownItemRef} title={'所有省市'} value={-1} activeColor='#337fff' onCloseOverlay={props?.onCloseOverlay}>
<View className={styles.mainBox}>
<Tabs list={TarBarList} handChose={(item) => handChose?.(item)} handReset={() => handReset()}></Tabs>
{
@@ -8,7 +8,8 @@ import { formatPriceDiv, formatDateTime, formatWeightDiv } from '@/common/format
import DropDownItem from '@/components/dropDown-item'
interface Props {
handSort?: (any) => void,
value?: any
value?: any,
onCloseOverlay?: () => void
}
type ListType = {
@@ -20,12 +21,17 @@ type ListType = {
export default memo(forwardRef((props: Props, ref) => {
const DropDownItemRef = useRef<any>()
// const close = () => {
// DropDownItemRef.current.closePopup()
// }
useImperativeHandle(ref, () => ({
DropDownItemRef
}))
useImperativeHandle(
ref,
() => {
return {
show: DropDownItemRef?.current?.show,
showPopup: DropDownItemRef?.current.showPopup,
closePopup: DropDownItemRef?.current?.closePopup,
}
},
[DropDownItemRef?.current],
)
const [list, setlist] = useState<ListType[]>([
@@ -88,7 +94,7 @@ export default memo(forwardRef((props: Props, ref) => {
return (
<DropDownItem ref={DropDownItemRef} title={title} value={currentValue} activeColor='#337fff'>
<DropDownItem ref={DropDownItemRef} title={title} value={currentValue} activeColor='#337fff' onCloseOverlay={props?.onCloseOverlay}>
<View className={styles.mainBox}>
{
list.map((item, index) => {
@@ -5,21 +5,30 @@ import classnames from "classnames";
import Taro, { usePullDownRefresh, useRouter, useDidShow } from '@tarojs/taro';
import { alert } from '@/common/common'
import { formatPriceDiv, formatDateTime, formatWeightDiv } from '@/common/format'
import {EnumPurchaserType} from '@/api/order'
import { EnumPurchaserType } from '@/api/order'
import DropDownItem from '@/components/dropDown-item'
import { mppurchaserlist } from "@/api/customer"
interface Props {
handType: (any) => void,
handTags: (any) => void,
value?: any
value?: any,
onCloseOverlay?: () => void
}
export default memo(forwardRef((props: Props, ref) => {
const DropDownItemRef = useRef<any>()
useImperativeHandle(ref, () => ({
DropDownItemRef
}))
useImperativeHandle(
ref,
() => {
return {
show: DropDownItemRef?.current?.show,
showPopup: DropDownItemRef?.current.showPopup,
closePopup: DropDownItemRef?.current?.closePopup,
}
},
[DropDownItemRef?.current],
)
const [currentValue, setCurrentValue] = useState<number>(-1)
const [list, setlist] = useState<any[]>([
@@ -81,7 +90,7 @@ export default memo(forwardRef((props: Props, ref) => {
}
return (
<DropDownItem ref={DropDownItemRef} title={'自定标签'} value={currentValue} activeColor='#337fff'>
<DropDownItem ref={DropDownItemRef} title={'自定标签'} value={currentValue} activeColor='#337fff' onCloseOverlay={props?.onCloseOverlay}>
<View className={styles.mainBox}>
<View className={styles.pussTitle}>客户类型</View>
<View className={styles.pussBox}>
+7 -4
View File
@@ -16,6 +16,7 @@ import ItemLiist from "./components/ItemList"
import InfiniteScroll from '@/components/infiniteScroll'
import { ClientListApi } from '@/api/order'
import { goLink } from '@/common/common'
import SelectGroup from '@/components/SelectGroup'
export default () => {
const [searchField, setSearchField] = useState<
@@ -142,10 +143,12 @@ export default () => {
<View className={styles.search_input}>
<Search placeholder='搜索客户名称、电话、业务员' showBtn={false} changeOnSearch={getSearchData} debounceTime={300} />
</View>
<View className={styles.menuBox}>
<Sort ref={SortRef} handSort={handSort}></Sort>
<ChoseCity ref={ChoseCityRef} handCity={handCity}></ChoseCity>
<Tag ref={TagRef} handTags={handTags} handType={handType}></Tag>
<View className={styles.menuBox} >
<SelectGroup>
<Sort ref={SortRef} handSort={handSort} onCloseOverlay={() => true}></Sort>
<ChoseCity ref={ChoseCityRef} handCity={handCity} onCloseOverlay={() => true}></ChoseCity>
<Tag ref={TagRef} handTags={handTags} handType={handType} onCloseOverlay={() => true}></Tag>
</SelectGroup>
</View>
</View>
<View className={styles.totalFont}>共 {orderData?.total || 0} 个客户</View>