diff --git a/src/common/constant.ts b/src/common/constant.ts index e59daa3..e1cdf3f 100644 --- a/src/common/constant.ts +++ b/src/common/constant.ts @@ -1,10 +1,10 @@ -// 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.89:50001/lymarket` // export const BASE_URL = `http://10.0.0.5:50001/lymarket` // export const BASE_URL = `http://192.168.0.89:40001/lymarket` // export const BASE_URL = 'https://test.zzfzyc.com/lymarket' // 测试环境 -export const BASE_URL = 'https://pre.zzfzyc.com/lymarket' // 预发布 +// export const BASE_URL = 'https://pre.zzfzyc.com/lymarket' // 预发布 // export const BASE_URL = 'https://dev.zzfzyc.com/lymarket' // 开发环境 // export const BASE_URL = 'https://www.zzfzyc.com/lymarket' // 正式环境 // export const BASE_URL = 'http://192.168.1.7:50002/lymarket' // 添 diff --git a/src/components/filter/index.tsx b/src/components/filter/index.tsx index 417317b..7cca343 100644 --- a/src/components/filter/index.tsx +++ b/src/components/filter/index.tsx @@ -68,14 +68,15 @@ const Filter = (props: params) => { return { ...prev, label_ids: (() => { - if (prev.label_ids.includes(id)) { - const index = prev.label_ids.findIndex(item => item === id) - prev.label_ids.splice(index, 1) - return prev.label_ids - } - else { - return [...prev.label_ids, id] - } + // if (prev.label_ids.includes(id)) { + // const index = prev.label_ids.findIndex(item => item === id) + // prev.label_ids.splice(index, 1) + // return prev.label_ids + // } + // else { + // return [...prev.label_ids, id] + // } + return [id] // 单选 })(), } }) diff --git a/src/pages/searchList/components/selectData/index.tsx b/src/pages/searchList/components/selectData/index.tsx index 79f5bea..70310fb 100644 --- a/src/pages/searchList/components/selectData/index.tsx +++ b/src/pages/searchList/components/selectData/index.tsx @@ -29,15 +29,17 @@ export default ({ list = [], defaultValue = [], onClickTag }: Params) => { const multipleSelection = useRef([]) const clickEvent = (item: ListProps) => { - if (multipleSelection.current.includes(item.id)) { - const index = multipleSelection.current.findIndex(id => id === item.id) - multipleSelection.current.splice(index, 1) - } - else { - multipleSelection.current.push(item.id) - } - console.log(item, multipleSelection.current) - onClickTag?.(multipleSelection.current) + console.log('clickEvent', item) + // if (multipleSelection.current.includes(item.id)) { + // const index = multipleSelection.current.findIndex(id => id === item.id) + // multipleSelection.current.splice(index, 1) + // } + // else { + // multipleSelection.current.push(item.id) + // } + // console.log(item, multipleSelection.current) + multipleSelection.current = [item.id] + onClickTag?.([item.id]) setTabId(item.id) } return ( diff --git a/src/pages/searchList/searchList.tsx b/src/pages/searchList/searchList.tsx index acbb01f..f56664c 100644 --- a/src/pages/searchList/searchList.tsx +++ b/src/pages/searchList/searchList.tsx @@ -38,7 +38,10 @@ export default () => { await getAllLabel() if (router.params.pageJump) { const res = await fetchData({ page_jump: router.params.pageJump || 1 }) - const labelIds = res.data.list.map(item => item.product_label_id) + let labelIds = res.data.list.map(item => item.product_label_id) + if (labelIds.length > 0) { + labelIds = [labelIds[0]] + } setLabelIds(labelIds) setSearchField(prev => ({ ...prev, label_ids: labelIds.join(',') })) }