商城测试版v5
This commit is contained in:
parent
6f9dd5b838
commit
575799b713
@ -11,8 +11,8 @@
|
|||||||
// export const BASE_URL = `https://dev.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 = `https://www.zzfzyc.com/lymarket` // 正式环境
|
||||||
// export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞
|
// export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞
|
||||||
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:50001/lymarket` // 杰
|
export const BASE_URL = `http://192.168.1.42:50001/lymarket` // 杰
|
||||||
|
|
||||||
// CDN
|
// CDN
|
||||||
// 生成密钥
|
// 生成密钥
|
||||||
|
@ -1,17 +1,45 @@
|
|||||||
import { View } from "@tarojs/components"
|
import { View } from "@tarojs/components"
|
||||||
import classnames from "classnames";
|
import classnames from "classnames";
|
||||||
|
import { forwardRef, useEffect, useImperativeHandle, useState } from "react";
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
|
|
||||||
type params = {
|
type params = {
|
||||||
status?: 'top'|'bottom'|'none'
|
status?: 'top'|'bottom'|'none',
|
||||||
|
onChange?: (val:{status:string, value:string}) => void,
|
||||||
|
sortValue?: {desc: string, asc: string} //排序规则,后端制定
|
||||||
}
|
}
|
||||||
export default ({status = 'none'}: params) => {
|
type sortParam = 'none'|'top'|'bottom'
|
||||||
|
export default forwardRef(({status = 'none', onChange, sortValue}: params,ref) => {
|
||||||
|
const [sortStatus, setSortStatus] = useState<sortParam>()
|
||||||
|
useEffect(() => {
|
||||||
|
setSortStatus(() => status)
|
||||||
|
}, [status])
|
||||||
|
const changeSort = ():{status:sortParam, value:string} => {
|
||||||
|
let status:sortParam = 'none'
|
||||||
|
let value = ''
|
||||||
|
if(sortStatus == 'none') {
|
||||||
|
status = 'top'
|
||||||
|
value = sortValue?.asc!
|
||||||
|
}
|
||||||
|
if(sortStatus == 'top') {
|
||||||
|
status = 'bottom'
|
||||||
|
value = sortValue?.desc!
|
||||||
|
}
|
||||||
|
if(sortStatus == 'bottom') status = 'none'
|
||||||
|
setSortStatus(() => status)
|
||||||
|
onChange?.({status, value})
|
||||||
|
return {status, value}
|
||||||
|
}
|
||||||
|
useImperativeHandle(ref, () => ({
|
||||||
|
changeSort
|
||||||
|
}))
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<View className={styles.click}>
|
<View className={styles.click} onClick={changeSort}>
|
||||||
<View className={classnames(styles.top, status == 'top'&&styles.selected)} ></View>
|
<View className={classnames(styles.top, sortStatus == 'top'&&styles.selected)} ></View>
|
||||||
<View className={classnames(styles.bottom, status == 'bottom'&&styles.selected)}></View>
|
<View className={classnames(styles.bottom, sortStatus == 'bottom'&&styles.selected)}></View>
|
||||||
</View>
|
</View>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
})
|
@ -0,0 +1,44 @@
|
|||||||
|
import Popup from "@/components/popup";
|
||||||
|
import { ScrollView, Text, View } from "@tarojs/components";
|
||||||
|
import { memo, useEffect, useMemo, useState } from "react";
|
||||||
|
import classnames from "classnames";
|
||||||
|
import styles from './index.module.scss'
|
||||||
|
|
||||||
|
//原因选择
|
||||||
|
type Param = {id:number, name:string, typle?:number}
|
||||||
|
type ReasonInfoParam = {
|
||||||
|
show?: boolean, //显示
|
||||||
|
onClose?: () => void, //关闭
|
||||||
|
title?: string, //标题
|
||||||
|
list?: {id:number, name:string, typle?:number, children?:Param[]}[], //数据列表
|
||||||
|
onSelect?: (val: object) => void, //选择
|
||||||
|
defaultValue?: number, //默认选中
|
||||||
|
}
|
||||||
|
export default memo(({show = false, onClose, title = '', list = [], onSelect, defaultValue}: ReasonInfoParam) => {
|
||||||
|
const [hasNextData, setHasNextData] = useState(true) //是否有下一级数据
|
||||||
|
const [selectData, setSelectData] = useState()
|
||||||
|
const [headerList, setHeaderList] = useState<{id: number, name: string}[]>([])
|
||||||
|
const onSelectData = (item) => {
|
||||||
|
setHeaderList((e) => [...e, {id:item.id, name:item.name}])
|
||||||
|
}
|
||||||
|
useEffect(() => {
|
||||||
|
console.log('headerList::', headerList)
|
||||||
|
}, [headerList])
|
||||||
|
return (
|
||||||
|
<Popup showIconButton={false} show={show} title={title} onClose={onClose} >
|
||||||
|
<View className={styles.reason_return_con}>
|
||||||
|
<View className={styles.reason_title}>
|
||||||
|
{headerList.map(item => {
|
||||||
|
return <Text key={item.id}>{item.name}</Text>
|
||||||
|
})}
|
||||||
|
{hasNextData&&<Text>请选择</Text>}
|
||||||
|
</View>
|
||||||
|
<ScrollView scrollY className={styles.reason_scroll}>
|
||||||
|
<View className={styles.reason_list}>
|
||||||
|
{list.map(item => <View onClick={() => onSelectData(item)} key={item.id} className={classnames(styles.reason_item, item.id == defaultValue&&styles.select_item)}>{item.name}</View> )}
|
||||||
|
</View>
|
||||||
|
</ScrollView>
|
||||||
|
</View>
|
||||||
|
</Popup>
|
||||||
|
)
|
||||||
|
})
|
@ -0,0 +1,30 @@
|
|||||||
|
import Popup from "@/components/popup";
|
||||||
|
import { ScrollView, Text, View } from "@tarojs/components";
|
||||||
|
import { memo, useMemo } from "react";
|
||||||
|
import classnames from "classnames";
|
||||||
|
import styles from './index.module.scss'
|
||||||
|
|
||||||
|
//原因选择
|
||||||
|
type ReasonInfoParam = {
|
||||||
|
show?: boolean, //显示
|
||||||
|
onClose?: () => void, //关闭
|
||||||
|
title?: string, //标题
|
||||||
|
list?: {id:number, name:string, typle?:number}[], //数据列表
|
||||||
|
onSelect?: (val: object) => void, //选择
|
||||||
|
defaultValue?: number, //默认选中
|
||||||
|
}
|
||||||
|
export default memo(({show = false, onClose, title = '', list= [], onSelect, defaultValue}: ReasonInfoParam) => {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Popup showIconButton={false} show={show} title={title} onClose={onClose} >
|
||||||
|
<View className={styles.reason_return_con}>
|
||||||
|
<View className={styles.reason_title}><Text>{title}</Text></View>
|
||||||
|
<ScrollView scrollY className={styles.reason_scroll}>
|
||||||
|
<View className={styles.reason_list}>
|
||||||
|
{list.map(item => <View onClick={() => onSelect?.(item)} key={item.id} className={classnames(styles.reason_item, item.id == defaultValue&&styles.select_item)}>{item.name}</View> )}
|
||||||
|
</View>
|
||||||
|
</ScrollView>
|
||||||
|
</View>
|
||||||
|
</Popup>
|
||||||
|
)
|
||||||
|
})
|
@ -1,10 +1,12 @@
|
|||||||
import Popup from "@/components/popup";
|
import Popup from "@/components/popup";
|
||||||
import { ScrollView, Text, View } from "@tarojs/components";
|
import { ScrollView, Text, View } from "@tarojs/components";
|
||||||
import { memo, useMemo } from "react";
|
import { Children, memo, useEffect, useMemo, useRef, useState } from "react";
|
||||||
import classnames from "classnames";
|
import classnames from "classnames";
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
|
import { ReturnExplainApi, ReturnReasonApi } from "@/api/salesAfterOrder";
|
||||||
|
|
||||||
//原因选择
|
//原因选择
|
||||||
|
type Param = {id:number, name:string, typle?:number}
|
||||||
type ReasonInfoParam = {
|
type ReasonInfoParam = {
|
||||||
show?: boolean, //显示
|
show?: boolean, //显示
|
||||||
onClose?: () => void, //关闭
|
onClose?: () => void, //关闭
|
||||||
@ -12,16 +14,59 @@ type ReasonInfoParam = {
|
|||||||
list?: {id:number, name:string, typle?:number}[], //数据列表
|
list?: {id:number, name:string, typle?:number}[], //数据列表
|
||||||
onSelect?: (val: object) => void, //选择
|
onSelect?: (val: object) => void, //选择
|
||||||
defaultValue?: number, //默认选中
|
defaultValue?: number, //默认选中
|
||||||
|
dataLength?: number, //可显示的数据列数
|
||||||
}
|
}
|
||||||
export default memo(({show = false, onClose, title = '', list= [], onSelect, defaultValue}: ReasonInfoParam) => {
|
export default memo(({show = false, onClose, title = '', list = [], onSelect, defaultValue, dataLength = 2}: ReasonInfoParam) => {
|
||||||
|
|
||||||
|
const [initList, setInitList] = useState([])
|
||||||
|
//退货原因
|
||||||
|
const idRef = useRef(0)
|
||||||
|
const {fetchData: fetchDataReturnReason} = ReturnReasonApi()
|
||||||
|
const getReturnReason = async () => {
|
||||||
|
let res = await fetchDataReturnReason()
|
||||||
|
setInitList(res.data?.list||[])
|
||||||
|
}
|
||||||
|
useEffect(() => {
|
||||||
|
getReturnReason()
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
//售后退货说明
|
||||||
|
const {fetchData: fetchDataReturnExplain} = ReturnExplainApi()
|
||||||
|
const getReturnExplain = async () => {
|
||||||
|
let res = await fetchDataReturnExplain({return_reason: idRef.current})
|
||||||
|
setInitList(res.data?.list||[])
|
||||||
|
}
|
||||||
|
|
||||||
|
const [headerList, setHeaderList] = useState<{id: number, name: string}[]>([])
|
||||||
|
const onSelectData = (item) => {
|
||||||
|
if(headerList.length <= dataLength) {
|
||||||
|
idRef.current = item.id
|
||||||
|
if(headerList.length < dataLength - 1) getReturnExplain()
|
||||||
|
headerList[headerList.length == dataLength?(dataLength - 1):headerList.length] = {id:item.id, name:item.name}
|
||||||
|
setHeaderList((e) => [...e])
|
||||||
|
console.log('headerList.length',headerList.length)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const onHeaderClick = (index) => {
|
||||||
|
let list = headerList.slice(0, index + 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Popup showIconButton={false} show={show} title={title} onClose={onClose} >
|
<Popup showIconButton={false} show={show} title={title} onClose={onClose} >
|
||||||
<View className={styles.reason_return_con}>
|
<View className={styles.reason_return_con}>
|
||||||
<View className={styles.reason_title}><Text>{title}</Text></View>
|
<View className={styles.reason_title}>
|
||||||
|
{headerList.map((item, index) => {
|
||||||
|
return <Text key={item.id} onClick={() => onHeaderClick(index)}>{item.name}</Text>
|
||||||
|
})}
|
||||||
|
{dataLength > headerList.length&&<Text>请选择</Text>}
|
||||||
|
</View>
|
||||||
<ScrollView scrollY className={styles.reason_scroll}>
|
<ScrollView scrollY className={styles.reason_scroll}>
|
||||||
<View className={styles.reason_list}>
|
<View className={styles.reason_list}>
|
||||||
{list.map(item => <View onClick={() => onSelect?.(item)} key={item.id} className={classnames(styles.reason_item, item.id == defaultValue&&styles.select_item)}>{item.name}</View> )}
|
{initList.map(item => <View onClick={() => onSelectData(item)} key={item.id} className={classnames(styles.reason_item, item.id == defaultValue&&styles.select_item)}>{item.name}</View> )}
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</View>
|
</View>
|
||||||
|
@ -133,9 +133,8 @@ export default () => {
|
|||||||
alert.success('申请成功')
|
alert.success('申请成功')
|
||||||
goLink('/pages/salesAfterList/index',{}, 'reLaunch')
|
goLink('/pages/salesAfterList/index',{}, 'reLaunch')
|
||||||
} else {
|
} else {
|
||||||
alert.error('申请失败')
|
alert.error(res.msg)
|
||||||
}
|
}
|
||||||
console.log('提交::',submitData)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//底部按钮
|
//底部按钮
|
||||||
|
@ -1,10 +1,17 @@
|
|||||||
.returnRecord_main{
|
.returnRecord_main{
|
||||||
height: 70vh;
|
height: 70vh;
|
||||||
|
.returnRecord_con{
|
||||||
|
padding: 0 20px;
|
||||||
|
}
|
||||||
|
.returnRecord_con{
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
.order_item{
|
.order_item{
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
box-shadow: 0px 0px 12px 0px rgba(0,0,0,0.16);
|
||||||
.header{
|
.header{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -24,12 +24,12 @@ export default memo(({show, onClose, onSubmit, id}:Param) => {
|
|||||||
const searchField = useRef({
|
const searchField = useRef({
|
||||||
page : 1,
|
page : 1,
|
||||||
size : 10,
|
size : 10,
|
||||||
saleOrderID: 0
|
sale_order_id: 0
|
||||||
})
|
})
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if(show && id) {
|
if(show && id) {
|
||||||
searchField.current.saleOrderID = id
|
searchField.current.sale_order_id = id
|
||||||
getOrderList()
|
getOrderList()
|
||||||
}
|
}
|
||||||
}, [show, id])
|
}, [show, id])
|
||||||
@ -61,7 +61,7 @@ export default memo(({show, onClose, onSubmit, id}:Param) => {
|
|||||||
|
|
||||||
//对应数量
|
//对应数量
|
||||||
const formatCount = useCallback((item, sale_mode) => {
|
const formatCount = useCallback((item, sale_mode) => {
|
||||||
return sale_mode == 0? item.roll : Number(item.length / 100)
|
return sale_mode == 0? item.roll + '条' : Number(item.length / 100) + '米'
|
||||||
}, [orderData])
|
}, [orderData])
|
||||||
|
|
||||||
//上拉加载数据
|
//上拉加载数据
|
||||||
@ -74,6 +74,11 @@ export default memo(({show, onClose, onSubmit, id}:Param) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const numText = useCallback((value) => {
|
||||||
|
let total_number_new = value?.sale_mode == 0? value?.total_number:(value?.total_number/100)
|
||||||
|
return `${value?.total_fabrics}种面料,${value?.total_colors}种颜色,共${total_number_new}${value?.sale_mode == 0? '条':'米'}`
|
||||||
|
}, [orderData])
|
||||||
|
|
||||||
//监听滚动
|
//监听滚动
|
||||||
const [scrollStatus, setScrollStatus] = useState(false)
|
const [scrollStatus, setScrollStatus] = useState(false)
|
||||||
const onscroll = useCallback((e) => {
|
const onscroll = useCallback((e) => {
|
||||||
@ -132,7 +137,7 @@ export default memo(({show, onClose, onSubmit, id}:Param) => {
|
|||||||
(index <= 1)&&<View className={styles.color_item}>
|
(index <= 1)&&<View className={styles.color_item}>
|
||||||
<View className={styles.color_title}>{formatHashTag(itemColor.code, itemColor.name)}</View>
|
<View className={styles.color_title}>{formatHashTag(itemColor.code, itemColor.name)}</View>
|
||||||
<View className={styles.color_price}>{standardPrice(itemColor.sale_price, item.sale_mode)}</View>
|
<View className={styles.color_price}>{standardPrice(itemColor.sale_price, item.sale_mode)}</View>
|
||||||
<View className={styles.color_num}>×{formatCount(itemColor, itemColor.sale_mode)}条</View>
|
<View className={styles.color_num}>×{formatCount(itemColor, itemColor.sale_mode)}</View>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -144,7 +149,7 @@ export default memo(({show, onClose, onSubmit, id}:Param) => {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.color_count_num}>{`${item?.total_fabrics}种面料,${item?.total_colors}种颜色,共${item?.total_number}条`}</View>
|
<View className={styles.color_count_num}>{numText(item)}</View>
|
||||||
<View className={styles.order_number}>
|
<View className={styles.order_number}>
|
||||||
<Text>{item?.type == ReturnApplyOrderTypeReturnForRefund.value?'已申请退货':'已申请退款'}</Text>
|
<Text>{item?.type == ReturnApplyOrderTypeReturnForRefund.value?'已申请退货':'已申请退款'}</Text>
|
||||||
<Text>订单号:{item?.order_no}</Text>
|
<Text>订单号:{item?.order_no}</Text>
|
||||||
|
@ -73,7 +73,8 @@ export default memo(({value, onClickBtn}: Param) => {
|
|||||||
|
|
||||||
//总条数
|
//总条数
|
||||||
const numText = useMemo(() => {
|
const numText = useMemo(() => {
|
||||||
return `${value?.total_fabrics}种面料,${value?.total_colors}种颜色,共${value?.total_number}${value?.sale_mode == 0? '条':'米'}`
|
let total_number_new = value?.sale_mode == 0? value?.total_number:(value?.total_number/100)
|
||||||
|
return `${value?.total_fabrics}种面料,${value?.total_colors}种颜色,共${total_number_new}${value?.sale_mode == 0? '条':'米'}`
|
||||||
}, [value])
|
}, [value])
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ export default memo(({value, onClickBtn}: Param) => {
|
|||||||
const userInfo = useSelector(state => state.userInfo)
|
const userInfo = useSelector(state => state.userInfo)
|
||||||
//对应数量
|
//对应数量
|
||||||
const formatCount = useCallback((item, sale_mode) => {
|
const formatCount = useCallback((item, sale_mode) => {
|
||||||
return sale_mode == 0? item.roll : Number(item.length / 100)
|
return sale_mode == 0? item.roll + '条' : Number(item.length / 100) + '米'
|
||||||
}, [value])
|
}, [value])
|
||||||
//对应单价
|
//对应单价
|
||||||
const standardPrice = useCallback((price, sale_mode) => {
|
const standardPrice = useCallback((price, sale_mode) => {
|
||||||
@ -69,20 +69,17 @@ export default memo(({value, onClickBtn}: Param) => {
|
|||||||
ReturnApplyOrderTypeReturnForRefund, // 退货退款
|
ReturnApplyOrderTypeReturnForRefund, // 退货退款
|
||||||
} = REFUND_STATUS_ORDER
|
} = REFUND_STATUS_ORDER
|
||||||
|
|
||||||
|
const numText = useMemo(() => {
|
||||||
|
let total_number_new = value?.sale_mode == 0? value?.total_number:(value?.total_number/100)
|
||||||
|
return `${value?.total_fabrics}种面料,${value?.total_colors}种颜色,共${total_number_new}${value?.sale_mode == 0? '条':'米'}`
|
||||||
|
}, [value])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.order_item}>
|
<View className={styles.order_item}>
|
||||||
<View className={styles.header} onClick={() => goLink('/pages/salesAfter/index', {id: value?.id})}>
|
<View className={styles.header} onClick={() => goLink('/pages/salesAfter/index', {id: value?.id})}>
|
||||||
<View className={styles.user}>
|
<View className={styles.user}>
|
||||||
<Image src={`${userInfo?.adminUserInfo?.avatar_url}`}/>
|
<Image src={`${userInfo?.adminUserInfo?.avatar_url}`}/>
|
||||||
{/* <Text className={styles.name}>{userInfo?.adminUserInfo?.user_name}</Text> */}
|
|
||||||
</View>
|
</View>
|
||||||
{/* <View className={styles.order_num}>
|
|
||||||
<Text>售后单号:{value?.return_order_no}</Text>
|
|
||||||
<Text className={classnames(styles.miconfont, 'iconfont, icon-a-moreback')}></Text>
|
|
||||||
</View>
|
|
||||||
<OrderStatusTag status={value?.type}/> */}
|
|
||||||
<View className={styles.order_con}>
|
<View className={styles.order_con}>
|
||||||
<Text className={styles.name}>{userInfo?.adminUserInfo?.user_name}</Text>
|
<Text className={styles.name}>{userInfo?.adminUserInfo?.user_name}</Text>
|
||||||
<View className={styles.order_num}>
|
<View className={styles.order_num}>
|
||||||
@ -111,7 +108,7 @@ export default memo(({value, onClickBtn}: Param) => {
|
|||||||
(index <= 1)&&<View className={styles.color_item}>
|
(index <= 1)&&<View className={styles.color_item}>
|
||||||
<View className={styles.color_title}>{formatHashTag(itemColor.code, itemColor.name)}</View>
|
<View className={styles.color_title}>{formatHashTag(itemColor.code, itemColor.name)}</View>
|
||||||
<View className={styles.color_price}>{standardPrice(itemColor.sale_price, value.sale_mode)}</View>
|
<View className={styles.color_price}>{standardPrice(itemColor.sale_price, value.sale_mode)}</View>
|
||||||
<View className={styles.color_num}>×{formatCount(itemColor, value.sale_mode)}条</View>
|
<View className={styles.color_num}>×{formatCount(itemColor, value.sale_mode)}</View>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -123,7 +120,7 @@ export default memo(({value, onClickBtn}: Param) => {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.color_count_num}>{`${value?.total_fabrics}种面料,${value?.total_colors}种颜色,共${value?.total_number}条`}</View>
|
<View className={styles.color_count_num}>{numText}</View>
|
||||||
<View className={styles.order_number}>
|
<View className={styles.order_number}>
|
||||||
<Text>{value?.type == ReturnApplyOrderTypeReturnForRefund.value?'已申请退货':'已申请退款'}</Text>
|
<Text>{value?.type == ReturnApplyOrderTypeReturnForRefund.value?'已申请退货':'已申请退款'}</Text>
|
||||||
<Text>订单号:{value?.order_no}</Text>
|
<Text>订单号:{value?.order_no}</Text>
|
||||||
|
@ -33,7 +33,8 @@ export default () => {
|
|||||||
width: '',
|
width: '',
|
||||||
weight_density: '',
|
weight_density: '',
|
||||||
product_kind_id: '',
|
product_kind_id: '',
|
||||||
component: ''
|
component: '',
|
||||||
|
abstract_sort_key: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
//获取面料列表
|
//获取面料列表
|
||||||
@ -132,6 +133,26 @@ export default () => {
|
|||||||
usePullDownRefresh(() => {
|
usePullDownRefresh(() => {
|
||||||
setSearchField({...searchField ,size : 10})
|
setSearchField({...searchField ,size : 10})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
//排序
|
||||||
|
type sortParam = 'none'|'top'|'bottom'
|
||||||
|
const sortComprehensiveRef = useRef<any>(null)
|
||||||
|
const sortCollectionRef = useRef<any>(null)
|
||||||
|
const [sortStatus, setSortStatus] = useState<{comprehensive:sortParam, collection:sortParam}>({
|
||||||
|
comprehensive: 'none',
|
||||||
|
collection: 'none'
|
||||||
|
})
|
||||||
|
const changeSort = (val) => {
|
||||||
|
if(val == 1) {
|
||||||
|
const {status, value} = sortComprehensiveRef.current.changeSort()
|
||||||
|
setSortStatus((e) => ({...e, comprehensive: status, collection: 'none'}))
|
||||||
|
setSearchField((e) => ({...e, abstract_sort_key: value}))
|
||||||
|
} else {
|
||||||
|
const {status, value} = sortCollectionRef.current.changeSort()
|
||||||
|
setSortStatus((e) => ({...e, collection: status, comprehensive: 'none'}))
|
||||||
|
setSearchField((e) => ({...e, abstract_sort_key: value}))
|
||||||
|
}
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<View className={styles.main}>
|
<View className={styles.main}>
|
||||||
<View className={styles.search}>
|
<View className={styles.search}>
|
||||||
@ -148,13 +169,13 @@ export default () => {
|
|||||||
</View>
|
</View>
|
||||||
<View className={styles.filter}>
|
<View className={styles.filter}>
|
||||||
<View className={styles.filter_all}>
|
<View className={styles.filter_all}>
|
||||||
<View className={styles.text_zh}>
|
<View className={styles.text_zh} onClick={() => changeSort(1)}>
|
||||||
<Text>综合</Text>
|
<Text>综合</Text>
|
||||||
<SortBtn status="top"/>
|
<SortBtn status={sortStatus.comprehensive} ref={sortComprehensiveRef} sortValue={{desc: '1', asc: '-1'}}/>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.text_sc} >
|
<View className={styles.text_sc} onClick={() => changeSort(2)}>
|
||||||
<Text>收藏</Text>
|
<Text>收藏</Text>
|
||||||
<SortBtn status="top"/>
|
<SortBtn status={sortStatus.collection} ref={sortCollectionRef} sortValue={{desc: '2', asc: '-2'}}/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
|
@ -118,18 +118,24 @@ export default () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//排序
|
//排序
|
||||||
const [sortStatus, setSortStatus] = useState<{comprehensive:'none'|'top'|'bottom', collection:'none'|'top'|'bottom'}>({
|
type sortParam = 'none'|'top'|'bottom'
|
||||||
|
const sortComprehensiveRef = useRef<any>(null)
|
||||||
|
const sortCollectionRef = useRef<any>(null)
|
||||||
|
const [sortStatus, setSortStatus] = useState<{comprehensive:sortParam, collection:sortParam}>({
|
||||||
comprehensive: 'none',
|
comprehensive: 'none',
|
||||||
collection: 'none'
|
collection: 'none'
|
||||||
})
|
})
|
||||||
const changeSort = (val) => {
|
const changeSort = (val) => {
|
||||||
if(val == 1) {
|
if(val == 1) {
|
||||||
|
const {status, value} = sortComprehensiveRef.current.changeSort()
|
||||||
|
setSortStatus((e) => ({...e, comprehensive: status, collection: 'none'}))
|
||||||
|
setSearchField((e) => ({...e, abstract_sort_key: value}))
|
||||||
} else {
|
} else {
|
||||||
|
const {status, value} = sortCollectionRef.current.changeSort()
|
||||||
|
setSortStatus((e) => ({...e, collection: status, comprehensive: 'none'}))
|
||||||
|
setSearchField((e) => ({...e, abstract_sort_key: value}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.main}>
|
<View className={styles.main}>
|
||||||
<View className={styles.search}>
|
<View className={styles.search}>
|
||||||
@ -139,11 +145,11 @@ export default () => {
|
|||||||
<View className={styles.filter_all}>
|
<View className={styles.filter_all}>
|
||||||
<View className={styles.text_zh} onClick={() => changeSort(1)}>
|
<View className={styles.text_zh} onClick={() => changeSort(1)}>
|
||||||
<Text>综合</Text>
|
<Text>综合</Text>
|
||||||
<SortBtn status={sortStatus.comprehensive}/>
|
<SortBtn status={sortStatus.comprehensive} ref={sortComprehensiveRef} sortValue={{desc: '1', asc: '-1'}}/>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.text_sc} onClick={() => changeSort(2)}>
|
<View className={styles.text_sc} onClick={() => changeSort(2)}>
|
||||||
<Text>收藏</Text>
|
<Text>收藏</Text>
|
||||||
<SortBtn status="none"/>
|
<SortBtn status={sortStatus.collection} ref={sortCollectionRef} sortValue={{desc: '2', asc: '-2'}}/>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.text_ss} onClick={() => goLink('/pages/searchList/hightSearchList')}>
|
<View className={styles.text_ss} onClick={() => goLink('/pages/searchList/hightSearchList')}>
|
||||||
<Text>高级搜索</Text>
|
<Text>高级搜索</Text>
|
||||||
|
@ -41,16 +41,17 @@ export default () => {
|
|||||||
await wxLogin()
|
await wxLogin()
|
||||||
reslove(true)
|
reslove(true)
|
||||||
} else {
|
} else {
|
||||||
Taro.checkSession({
|
//这个东西不要打开,checkSession有调用频率问题
|
||||||
success: async () => {
|
// Taro.checkSession({
|
||||||
reslove(true)
|
// success: async () => {
|
||||||
if(!userInfo.adminUserInfo) getAdminUserInfo()
|
// reslove(true)
|
||||||
},
|
// if(!userInfo.adminUserInfo) getAdminUserInfo()
|
||||||
fail: async () => {
|
// },
|
||||||
await wxLogin()
|
// fail: async () => {
|
||||||
reslove(true)
|
// await wxLogin()
|
||||||
}
|
// reslove(true)
|
||||||
})
|
// }
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ import useLogin from "./useLogin"
|
|||||||
|
|
||||||
type Param = {success: true|false, data: any, msg: string, code: null|number, loading: false|true}
|
type Param = {success: true|false, data: any, msg: string, code: null|number, loading: false|true}
|
||||||
let loginStatus = false //登录状态,true登录中
|
let loginStatus = false //登录状态,true登录中
|
||||||
console.log('你不要过来啊')
|
|
||||||
export default () => {
|
export default () => {
|
||||||
|
|
||||||
let initData = {
|
let initData = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user