feat:客户对接100%

This commit is contained in:
Haiyi 2022-10-28 18:40:48 +08:00
parent 708b5027bb
commit 2408765817
5 changed files with 68 additions and 25 deletions

View File

@ -1,4 +1,4 @@
// export const BASE_URL = CURRENT_BASE_URL export const BASE_URL = CURRENT_BASE_URL
// export const BASE_URL = `http://192.168.0.75:50001/lymarket` // export const BASE_URL = `http://192.168.0.75:50001/lymarket`
// export const BASE_URL = `http://192.168.0.89:50001/lymarket` // export const BASE_URL = `http://192.168.0.89:50001/lymarket`
// export const BASE_URL = `http://10.0.0.5:50001/lymarket` // export const BASE_URL = `http://10.0.0.5:50001/lymarket`
@ -15,7 +15,7 @@
// export const BASE_URL = `http://192.168.1.7:50002/lymarket` // 添 // export const BASE_URL = `http://192.168.1.7:50002/lymarket` // 添
// export const BASE_URL = `http://192.168.1.42:50002/lymarket` // 杰 // export const BASE_URL = `http://192.168.1.42:50002/lymarket` // 杰
// export const BASE_URL = `http://192.168.1.95:40001/lymarket` // 华 // export const BASE_URL = `http://192.168.1.95:40001/lymarket` // 华
export const BASE_URL = 'http://192.168.1.22:50002/lymarket' // 婷 // export const BASE_URL = 'http://192.168.1.22:50002/lymarket' // 婷
// CDN // CDN
// 生成密钥 // 生成密钥

View File

@ -152,11 +152,36 @@ export default memo(forwardRef((props: Props, ref) => {
return list return list
} }
//重置
const handReset = () => {
TarBarList.map((item, index) => {
if (index == 0) {
item.name = '选择省'
item.showBorder = true
} else {
item.showBorder = false
}
return item
})
setTarBarList([...TarBarList])
setCurrentValue(1)
choseCityArr.current.list = []
list.map(item => {
item.check = false
return item
})
setlist([...list])
cityList.map(item => {
item.check = false
return item
})
setcityList([...cityList])
props.handCity?.('', '')
}
return ( return (
<DropDownItem ref={DropDownItemRef} title={'所有省市'} value={-1} activeColor='#337fff'> <DropDownItem ref={DropDownItemRef} title={'所有省市'} value={-1} activeColor='#337fff'>
<View className={styles.mainBox}> <View className={styles.mainBox}>
<Tabs list={TarBarList} handChose={(item) => handChose?.(item)}></Tabs> <Tabs list={TarBarList} handChose={(item) => handChose?.(item)} handReset={() => handReset()}></Tabs>
{ {
currentValue == 1 && <ScrollView scrollY className={styles.scrollView}> currentValue == 1 && <ScrollView scrollY className={styles.scrollView}>
{ {

View File

@ -1,5 +1,18 @@
.main {
display: flex;
justify-content: space-between;
align-items: center;
.resetBox {
font-size: 28px;
font-weight: 500;
color: #337FFF;
margin-right: 48px;
}
}
.flexBox { .flexBox {
width: 100%; // width: 100%;
height: 102px; height: 102px;
background: #ffffff; background: #ffffff;
display: flex; display: flex;

View File

@ -5,28 +5,33 @@ import classnames from "classnames";
interface Props { interface Props {
list: any[], list: any[],
handChose?: (any) => void handChose?: (any) => void,
handReset?: () => void
} }
export default memo((props: Props) => { export default memo((props: Props) => {
const { list = [], handChose } = props const { list = [], handChose } = props
return ( return (
<View className={styles.flexBox}> <View className={styles.main}>
{ <View className={styles.flexBox}>
list.map((item, index) => { {
return ( list.map((item, index) => {
<View className={styles.itemBox} key={index} onClick={() => handChose?.(item)}> return (
<View <View className={styles.itemBox} key={index} onClick={() => handChose?.(item)}>
className={classnames(item.showBorder ? styles.activeItems : styles.itemFont)} <View
className={classnames(item.showBorder ? styles.activeItems : styles.itemFont)}
>{item?.name}</View > >{item?.name}</View >
{ {
item.showBorder && <View className={styles.borderBox} ></View> item.showBorder && <View className={styles.borderBox} ></View>
} }
</View > </View >
) )
}) })
} }
</View >
</View >
<View className={styles.resetBox} onClick={() => props?.handReset?.()}></View>
</View>
) )
}) })

View File

@ -97,15 +97,15 @@ export default () => {
const handCity = useCallback((provinceVal, cityVal) => { const handCity = useCallback((provinceVal, cityVal) => {
const provinceArr: number[] = [] const provinceArr: number[] = []
const cityArr: number[] = [] const cityArr: number[] = []
provinceVal.forEach(item => { provinceVal.length && provinceVal.forEach(item => {
provinceArr.push(item.id) provinceArr.push(item.id)
}) })
cityVal.forEach(item => { cityVal.length && cityVal.forEach(item => {
cityArr.push(item.id) cityArr.push(item.id)
}) })
console.log(provinceArr, cityArr) console.log(provinceArr, cityArr)
pageNum.current.page = 1 pageNum.current.page = 1
setSearchField((val) => ({ ...val, province_id: provinceArr, city_id: cityArr, size: 10 })) setSearchField((val) => ({ ...val, province_id: provinceArr.length > 0 ? provinceArr : '', city_id: cityArr.length > 0 ? cityArr : '', size: 10 }))
// ChoseCityRef.current.close() // ChoseCityRef.current.close()
}, []) }, [])