售后基本对完
This commit is contained in:
parent
4ac7890915
commit
b2f17afe50
@ -79,3 +79,14 @@ import { useRequest } from "@/use/useHttp"
|
|||||||
method: "post",
|
method: "post",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订阅模板id
|
||||||
|
*/
|
||||||
|
export const SubscriptionMessageApi = () => {
|
||||||
|
return useRequest({
|
||||||
|
url: `/v1/mall/subscriptionMessage`,
|
||||||
|
method: "post",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -10,8 +10,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
|
||||||
// 生成密钥
|
// 生成密钥
|
||||||
|
@ -39,68 +39,64 @@ export default memo(({orderInfo, onClick, onBtnNull}:Param) => {
|
|||||||
|
|
||||||
//售后按钮按售后状态归类, value是该订单状态,可能该按钮会出现
|
//售后按钮按售后状态归类, value是该订单状态,可能该按钮会出现
|
||||||
const orderBtnsList = useRef([
|
const orderBtnsList = useRef([
|
||||||
|
{
|
||||||
|
id: 8,
|
||||||
|
big_value: [ReturnStageQualityCheckPendingRefund.value, ReturnStageServiceOrderPendingRefund.value],
|
||||||
|
cut_value: [ReturnStageQualityCheckPendingRefund.value, ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value ],
|
||||||
|
model_value: [],
|
||||||
|
label: '申请记录'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
value: [ReturnStageApplying.value, ReturnStageWaitCheck.value],
|
big_value: [ReturnStageApplying.value, ReturnStageWaitCheck.value],
|
||||||
|
cut_value: [],
|
||||||
|
model_value: [],
|
||||||
label: '取消退货'
|
label: '取消退货'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
value: [ReturnStageWaitCheck.value],
|
big_value: [ReturnStageWaitCheck.value],
|
||||||
|
cut_value: [],
|
||||||
|
model_value: [],
|
||||||
label: '退货物流'
|
label: '退货物流'
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// id: 3,
|
|
||||||
// value: [ReturnStageChecked.value, ReturnStageQualityCheckPendingRefund.value],
|
|
||||||
// label: '查看物流'
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
id: 4,
|
id: 4,
|
||||||
value: [ReturnStageQualityCheckPendingRefund.value, ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
big_value: [ReturnStageQualityCheckPendingRefund.value, ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
||||||
|
cut_value: [ReturnStageQualityCheckPendingRefund.value, ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
||||||
|
model_value: [],
|
||||||
label: '质检结果'
|
label: '质检结果'
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// id: 5,
|
|
||||||
// value: [ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
|
||||||
// label: '退货码单'
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
id: 6,
|
id: 6,
|
||||||
value: [ReturnStageApplying.value, ReturnStageServiceOrderPendingRefund.value],
|
big_value: [ReturnStageApplying.value, ReturnStageServiceOrderPendingRefund.value],
|
||||||
|
cut_value: [ReturnStageWaitCheck.value, ReturnStageApplying.value],
|
||||||
|
model_value: [ReturnStageApplying.value],
|
||||||
label: '取消退款'
|
label: '取消退款'
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// id: 7,
|
|
||||||
// value: [ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
|
||||||
// label: '退款码单'
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
id: 8,
|
|
||||||
value: [],
|
|
||||||
label: '申请记录'
|
|
||||||
},
|
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
//判断是否显示该按钮
|
//判断是否显示该按钮
|
||||||
const orderBtnsShow = (item) => {
|
const orderBtnsShow = (item) => {
|
||||||
if(!orderInfo) return false
|
let key = ['big_value', 'model_value', 'cut_value']
|
||||||
if(item.id == 1) {
|
if(item.id == 1) {
|
||||||
//取消退货
|
//取消退货
|
||||||
return (orderInfo.type == 1)&&item.value.includes(orderInfo.stage)
|
return (orderInfo.type == 1)&&item[key[orderInfo?.sale_mode]]?.includes(orderInfo.stage)
|
||||||
} else if (item.id == 6) {
|
} else if (item.id == 6) {
|
||||||
//取消退款
|
//取消退款
|
||||||
return (orderInfo.type == 2)&&item.value.includes(orderInfo.stage)
|
return (orderInfo.type == 2)&&item[key[orderInfo?.sale_mode]]?.includes(orderInfo.stage)
|
||||||
} else if (item.id == 4) {
|
} else if (item.id == 4) {
|
||||||
//质检结果
|
//质检结果
|
||||||
return (orderInfo?.type == 1)&&item.value.includes(orderInfo.stage) //退货才有
|
return (orderInfo?.type == 1)&&item[key[orderInfo?.sale_mode]]?.includes(orderInfo.stage) //退货才有
|
||||||
} else {
|
} else {
|
||||||
return item.value.includes(orderInfo.stage)
|
return item[key[orderInfo?.sale_mode]]?.includes(orderInfo.stage)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//显示的按钮数组
|
//显示的按钮数组
|
||||||
const orderBtnsShowList: {id: number, value: any, label: string}[] = useMemo(() => {
|
const orderBtnsShowList: any[] = useMemo(() => {
|
||||||
return orderBtnsList.current.filter(item => {
|
return orderBtnsList.current.filter(item => {
|
||||||
return orderBtnsShow(item)
|
return orderBtnsShow(item)
|
||||||
})
|
})
|
||||||
|
@ -168,7 +168,6 @@ export default memo(({orderInfo, onClick}:Param) => {
|
|||||||
//确认订单
|
//确认订单
|
||||||
const {fetchData: receiveOrderFetchData} = ReceiveOrderApi()
|
const {fetchData: receiveOrderFetchData} = ReceiveOrderApi()
|
||||||
const receiveOrder = async () => {
|
const receiveOrder = async () => {
|
||||||
console.log('123456')
|
|
||||||
Taro.showModal({
|
Taro.showModal({
|
||||||
title: '确定收货?',
|
title: '确定收货?',
|
||||||
success: async function (res) {
|
success: async function (res) {
|
||||||
|
@ -30,7 +30,7 @@ const kindeList:FC<Param> = memo(({order, onNumChange}) => {
|
|||||||
//计步器失返回值
|
//计步器失返回值
|
||||||
const getCounterChange = useCallback((colorItem) => {
|
const getCounterChange = useCallback((colorItem) => {
|
||||||
return (number) => {
|
return (number) => {
|
||||||
onNumChange?.({number, color_id: colorItem.id})
|
onNumChange?.({number, color_id: colorItem.id, sale_order_detail_id:colorItem.sale_order_detail_id})
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ export default () => {
|
|||||||
//大货时获取计步器数据
|
//大货时获取计步器数据
|
||||||
const getNumChange = useCallback((val) => {
|
const getNumChange = useCallback((val) => {
|
||||||
if(parseInt(val.number) > 0) {
|
if(parseInt(val.number) > 0) {
|
||||||
roll_list.current[val.color_id] = {product_color_id: val.color_id, product_roll: val.number}
|
roll_list.current[val.color_id] = {product_color_id: val.color_id, product_roll: val.number, sale_order_detail_id: val.sale_order_detail_id}
|
||||||
} else {
|
} else {
|
||||||
delete roll_list.current[val.color_id]
|
delete roll_list.current[val.color_id]
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,9 @@ import AddressInfoDetail from "./components/addressInfoDetail";
|
|||||||
id: address?.id,
|
id: address?.id,
|
||||||
name: address?.name,
|
name: address?.name,
|
||||||
phone: address?.phone,
|
phone: address?.phone,
|
||||||
shipment_mode: address?.shipment_mode
|
shipment_mode: address?.shipment_mode,
|
||||||
|
take_goods_address: address?.take_goods_address,
|
||||||
|
take_goods_phone: address?.take_goods_phone,
|
||||||
}
|
}
|
||||||
}, [preViewOrder])
|
}, [preViewOrder])
|
||||||
|
|
||||||
|
@ -31,7 +31,9 @@ type Param = {
|
|||||||
province_name: string,
|
province_name: string,
|
||||||
city_name: string,
|
city_name: string,
|
||||||
district_name: string,
|
district_name: string,
|
||||||
address_detail: string
|
address_detail: string,
|
||||||
|
take_goods_address: string,
|
||||||
|
take_goods_phone: string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,14 +48,7 @@ export default memo(forwardRef(({onSelect, onChangeShipmentMode, orderInfo, stat
|
|||||||
}, [orderInfo])
|
}, [orderInfo])
|
||||||
|
|
||||||
|
|
||||||
//地址格式
|
|
||||||
const formatAddress = useMemo(() => {
|
|
||||||
if(addressInfo?.province_name) {
|
|
||||||
return addressInfo.province_name + addressInfo.city_name + addressInfo.district_name + addressInfo.address_detail
|
|
||||||
} else {
|
|
||||||
return ''
|
|
||||||
}
|
|
||||||
}, [addressInfo])
|
|
||||||
|
|
||||||
//打开地址列表
|
//打开地址列表
|
||||||
const [showAddressList, setShowAddressList] = useState(false)
|
const [showAddressList, setShowAddressList] = useState(false)
|
||||||
@ -134,6 +129,15 @@ export default memo(forwardRef(({onSelect, onChangeShipmentMode, orderInfo, stat
|
|||||||
return logisticsShowList.includes(orderInfo?.status as number)
|
return logisticsShowList.includes(orderInfo?.status as number)
|
||||||
}, [orderInfo])
|
}, [orderInfo])
|
||||||
|
|
||||||
|
//地址格式
|
||||||
|
const formatAddress = useMemo(() => {
|
||||||
|
if(receivingStatus == 2) {
|
||||||
|
return addressInfo?.province_name?addressInfo.province_name + addressInfo.city_name + addressInfo.district_name + addressInfo.address_detail:''
|
||||||
|
} else {
|
||||||
|
return addressInfo?.take_goods_address
|
||||||
|
}
|
||||||
|
}, [addressInfo, receivingStatus])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<View className={styles.order_address} onClick={() => changeShow()}>
|
<View className={styles.order_address} onClick={() => changeShow()}>
|
||||||
@ -144,8 +148,8 @@ export default memo(forwardRef(({onSelect, onChangeShipmentMode, orderInfo, stat
|
|||||||
{(receivingStatus == 2 && !logisticsShow)&&<Text className={classnames(styles.moreIconfont,'iconfont icon-a-moreback')}></Text>}
|
{(receivingStatus == 2 && !logisticsShow)&&<Text className={classnames(styles.moreIconfont,'iconfont icon-a-moreback')}></Text>}
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.order_address_text_name}>
|
<View className={styles.order_address_text_name}>
|
||||||
<Text>{addressInfo?.name}</Text>
|
<Text>{receivingStatus == 1?'管理员':addressInfo?.name}</Text>
|
||||||
<Text>{addressInfo?.phone}</Text>
|
<Text>{receivingStatus == 1?addressInfo?.take_goods_phone: addressInfo?.phone}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
{!logisticsShow&&<View className={styles.updateBtn}>
|
{!logisticsShow&&<View className={styles.updateBtn}>
|
||||||
|
@ -29,6 +29,7 @@ type Param = {
|
|||||||
actual_amount: number, //实付金额
|
actual_amount: number, //实付金额
|
||||||
wait_pay_amount: number, //待付金额
|
wait_pay_amount: number, //待付金额
|
||||||
should_collect_order_id: number, //应付单id
|
should_collect_order_id: number, //应付单id
|
||||||
|
av_return_roll: number
|
||||||
},
|
},
|
||||||
onClickBtn?: (val:{status:number, orderInfo:Param['value']}) => void
|
onClickBtn?: (val:{status:number, orderInfo:Param['value']}) => void
|
||||||
}
|
}
|
||||||
@ -56,6 +57,7 @@ export default memo(({value, onClickBtn}: Param) => {
|
|||||||
actual_amount: value?.actual_amount, //实付金额
|
actual_amount: value?.actual_amount, //实付金额
|
||||||
wait_pay_amount: value?.wait_pay_amount, //待付金额
|
wait_pay_amount: value?.wait_pay_amount, //待付金额
|
||||||
sale_mode: value?.sale_mode, //订单类型
|
sale_mode: value?.sale_mode, //订单类型
|
||||||
|
av_return_roll: value?.av_return_roll //可退条数
|
||||||
}
|
}
|
||||||
}, [value])
|
}, [value])
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ type Param = {
|
|||||||
return_address?:string,
|
return_address?:string,
|
||||||
return_phone?: string,
|
return_phone?: string,
|
||||||
onLogistics?: (val: number) => void,
|
onLogistics?: (val: number) => void,
|
||||||
stage?: number
|
stage?: number,
|
||||||
}
|
}
|
||||||
export default memo(({return_address = '', return_phone = '', onLogistics, stage}:Param) => {
|
export default memo(({return_address = '', return_phone = '', onLogistics, stage}:Param) => {
|
||||||
const {
|
const {
|
||||||
@ -32,11 +32,6 @@ export default memo(({return_address = '', return_phone = '', onLogistics, stage
|
|||||||
return stage == ReturnStageWaitCheck.value
|
return stage == ReturnStageWaitCheck.value
|
||||||
}, [stage])
|
}, [stage])
|
||||||
|
|
||||||
//查看物流
|
|
||||||
const showLogistics = useMemo(() => {
|
|
||||||
return (stage == ReturnStageChecked.value || stage == ReturnStageQualityCheckPendingRefund.value)
|
|
||||||
}, [stage])
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -56,8 +51,8 @@ export default memo(({return_address = '', return_phone = '', onLogistics, stage
|
|||||||
<Text>{return_phone}</Text>
|
<Text>{return_phone}</Text>
|
||||||
{upLogistics&&<View className={styles.updateBtn} onClick={() => onLogistics?.(1)}>
|
{upLogistics&&<View className={styles.updateBtn} onClick={() => onLogistics?.(1)}>
|
||||||
上传物流
|
上传物流
|
||||||
</View>}
|
</View>
|
||||||
{showLogistics&&<View className={styles.updateBtn} onClick={() => onLogistics?.(2)}>
|
||<View className={styles.updateBtn} onClick={() => onLogistics?.(2)}>
|
||||||
查看物流
|
查看物流
|
||||||
</View>}
|
</View>}
|
||||||
</View>
|
</View>
|
||||||
|
@ -89,6 +89,11 @@
|
|||||||
.order_list_item_price{
|
.order_list_item_price{
|
||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
color: $color_font_three;
|
color: $color_font_three;
|
||||||
|
text{
|
||||||
|
&:nth-child(1) {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.order_list_item_count{
|
.order_list_item_count{
|
||||||
|
@ -98,7 +98,10 @@ export default memo(({show, onClose, onSubmit, id}:Param) => {
|
|||||||
<View className={styles.order_list_item_con}>
|
<View className={styles.order_list_item_con}>
|
||||||
<View className={styles.order_list_item_des}>
|
<View className={styles.order_list_item_des}>
|
||||||
<View className={styles.order_list_item_title}>{colorItem.code + ' ' + colorItem.name}</View>
|
<View className={styles.order_list_item_title}>{colorItem.code + ' ' + colorItem.name}</View>
|
||||||
<View className={styles.order_list_item_price}>¥{standardPrice(colorItem.sale_price)}</View>
|
<View className={styles.order_list_item_price}>
|
||||||
|
<Text>¥{standardPrice(colorItem.sale_price)}</Text>
|
||||||
|
<Text>总重{standardPrice(colorItem.estimate_weight)}</Text>
|
||||||
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.order_list_item_count}>
|
<View className={styles.order_list_item_count}>
|
||||||
<View className={styles.count_num}>×{formatCount(colorItem)}<text>{formatDetailOrder.unit}</text></View>
|
<View className={styles.count_num}>×{formatCount(colorItem)}<text>{formatDetailOrder.unit}</text></View>
|
||||||
|
131
src/pages/salesAfter/components/cutlKindList/index.module.scss
Normal file
131
src/pages/salesAfter/components/cutlKindList/index.module.scss
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
|
||||||
|
.kindsList_main{
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
.orders_list_con{
|
||||||
|
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 20px;
|
||||||
|
padding: 20px;
|
||||||
|
.orders_return_title{
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 700;
|
||||||
|
padding-bottom: 20px;
|
||||||
|
}
|
||||||
|
.order_list{
|
||||||
|
&:nth-child(n+2) {
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
.order_list_title{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.tag{
|
||||||
|
font-size: $font_size_min;
|
||||||
|
background-color: #CDE5FF;
|
||||||
|
padding: 5px 10px;
|
||||||
|
border-radius: 6px;
|
||||||
|
color: $color_main;
|
||||||
|
}
|
||||||
|
.title{
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: $font_size;
|
||||||
|
margin-left: 20px;
|
||||||
|
flex:1;
|
||||||
|
}
|
||||||
|
.num{
|
||||||
|
color: $color_font_two;
|
||||||
|
font-size: $font_size_min;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.order_list_scroll{
|
||||||
|
margin-top: 30px;
|
||||||
|
|
||||||
|
.order_list_item {
|
||||||
|
display: flex;
|
||||||
|
&:nth-child(2) {
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
.order_list_item_img{
|
||||||
|
width: 126px;
|
||||||
|
height: 126px;
|
||||||
|
border-radius: 20px;
|
||||||
|
}
|
||||||
|
.order_list_item_con{
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
flex:1;
|
||||||
|
border-bottom: 1px solid #f0f0f0;
|
||||||
|
height: 150px;
|
||||||
|
padding-top: 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.order_list_item_des{
|
||||||
|
flex:1;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-left: 30px;
|
||||||
|
.order_list_item_title{
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: $font_size;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
.order_list_item_price{
|
||||||
|
font-size: 26px;
|
||||||
|
color: $color_font_three;
|
||||||
|
text{
|
||||||
|
&:nth-child(n+1) {
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.order_list_item_count{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: flex-end;
|
||||||
|
.count_num{
|
||||||
|
color: $color_main;
|
||||||
|
font-size: $font_size;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
font-weight: 400;
|
||||||
|
text{
|
||||||
|
font-size: $font_size_min;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.count_price {
|
||||||
|
font-size: $font_size;
|
||||||
|
font-weight: 700;
|
||||||
|
text{
|
||||||
|
font-size: $font_size_min;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.order_total{
|
||||||
|
padding-top: 20px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
text{
|
||||||
|
&:nth-child(1) {
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
&:nth-child(2) {
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.order_estimated_amount{
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 30px 0;
|
||||||
|
.order_price_des{
|
||||||
|
font-size: $font_size_medium;
|
||||||
|
color: $color_font_two;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
192
src/pages/salesAfter/components/cutlKindList/index.tsx
Normal file
192
src/pages/salesAfter/components/cutlKindList/index.tsx
Normal file
@ -0,0 +1,192 @@
|
|||||||
|
import { AFTER_ORDER_STATUS, ORDER_STATUS } from "@/common/enum"
|
||||||
|
import { formatHashTag, formatPriceDiv, formatWeightDiv } from "@/common/fotmat"
|
||||||
|
import LabAndImg from "@/components/LabAndImg"
|
||||||
|
import { Text, View } from "@tarojs/components"
|
||||||
|
import { memo, useCallback, useMemo } from "react"
|
||||||
|
import EstimatedAmount from "../estimatedAmount"
|
||||||
|
import styles from './index.module.scss'
|
||||||
|
|
||||||
|
type OrderParam = {
|
||||||
|
estimate_amount: number, //预估金额
|
||||||
|
list: any[],
|
||||||
|
sale_mode: number,
|
||||||
|
sale_mode_name: string,
|
||||||
|
unit: string,
|
||||||
|
total_colors: number,
|
||||||
|
total_fabrics: number,
|
||||||
|
total_number: number,
|
||||||
|
stage: number, //订单状态
|
||||||
|
type: 1|2, //1退货, 2退款
|
||||||
|
total_sale_price: number, //销售金额
|
||||||
|
total_should_collect_money: number, //应收金额
|
||||||
|
total_weight_error_discount: number, //空差优惠
|
||||||
|
the_previous_status: number, //取消订单时的订单状态
|
||||||
|
actual_amount: number //实付金额
|
||||||
|
}
|
||||||
|
|
||||||
|
type Param = {
|
||||||
|
order: OrderParam,
|
||||||
|
comfirm?: boolean //是否是确认订单页面使用
|
||||||
|
}
|
||||||
|
|
||||||
|
export default memo(({order, comfirm = false}:Param) => {
|
||||||
|
//对应数量
|
||||||
|
const formatCount = useCallback((item) => {
|
||||||
|
return order?.sale_mode == 0? item.roll : Number(item.length / 100)
|
||||||
|
}, [order])
|
||||||
|
//对应单价
|
||||||
|
const standardPrice = useCallback(price => {
|
||||||
|
return formatPriceDiv(price).toLocaleString() + '/' + (order?.sale_mode == 1?'m':'kg')
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
//数量格式
|
||||||
|
const numText = useMemo(() => {
|
||||||
|
if(order)
|
||||||
|
return `${order?.total_fabrics}种面料,${order?.total_colors}种颜色,共${order?.total_number}${order?.unit}`
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
//售后单状态枚举
|
||||||
|
const {
|
||||||
|
ReturnStageApplying, // 申请中
|
||||||
|
ReturnStageWaitCheck, // 退货中
|
||||||
|
ReturnStageChecked, // 待验布
|
||||||
|
ReturnStageReturned, // 已退款
|
||||||
|
ReturnStageCancel, // 已取消
|
||||||
|
ReturnStageQualityCheckPendingRefund, // 已验布
|
||||||
|
ReturnStageServiceOrderPendingRefund, // 待退款
|
||||||
|
ReturnStageRejected, // 已拒绝
|
||||||
|
} = AFTER_ORDER_STATUS
|
||||||
|
|
||||||
|
|
||||||
|
//金额列表枚举
|
||||||
|
const priceList = [
|
||||||
|
{
|
||||||
|
id:1,
|
||||||
|
value:[],
|
||||||
|
label:'退货条数',
|
||||||
|
field: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:2,
|
||||||
|
value:[
|
||||||
|
ReturnStageServiceOrderPendingRefund.value,
|
||||||
|
ReturnStageReturned.value
|
||||||
|
],
|
||||||
|
label:'扣款金额',
|
||||||
|
field: 'total_sale_price'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:3,
|
||||||
|
value:[
|
||||||
|
ReturnStageServiceOrderPendingRefund.value,
|
||||||
|
ReturnStageReturned.value
|
||||||
|
],
|
||||||
|
label:'其他扣款',
|
||||||
|
field: 'total_weight_error_discount'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:4,
|
||||||
|
value:[
|
||||||
|
ReturnStageServiceOrderPendingRefund.value,
|
||||||
|
ReturnStageReturned.value
|
||||||
|
],
|
||||||
|
label:'应退金额',
|
||||||
|
field: 'total_should_collect_money'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:5,
|
||||||
|
value:[ReturnStageReturned.value],
|
||||||
|
label:'退款金额',
|
||||||
|
field: 'total_should_collect_money'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:6,
|
||||||
|
value:[ReturnStageReturned.value],
|
||||||
|
label:'退款去向',
|
||||||
|
field: 'actual_amount'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:7,
|
||||||
|
value:[ReturnStageQualityCheckPendingRefund.value],
|
||||||
|
label:'合计金额',
|
||||||
|
field: 'actual_amount'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
//是否显示价格
|
||||||
|
const showPrice = useCallback((priceInfo) => {
|
||||||
|
if(priceInfo.value == 8) {
|
||||||
|
//合计金额
|
||||||
|
|
||||||
|
}
|
||||||
|
return priceInfo.value.includes(order?.stage)
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
const priceConDom = useMemo(() => {
|
||||||
|
if(!order) return
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{
|
||||||
|
priceList.map(item => {
|
||||||
|
return <>{showPrice(item)&&<EstimatedAmount key={item.id} number={formatPriceDiv(order[item.field])} title={item.label} />}</>
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
//整理颜色
|
||||||
|
const labAndRgbAndUrl = useCallback((item) => {
|
||||||
|
return {lab:{...item?.lab}, rgb:{...item?.rgb}, texturl_url: item?.texturl_url}
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
//单价显示判断
|
||||||
|
const sale_price_show = useMemo(() => {
|
||||||
|
return order?.stage != ReturnStageServiceOrderPendingRefund.value && order?.stage != ReturnStageQualityCheckPendingRefund.value
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View className={styles.kindsList_main}>
|
||||||
|
<View className={styles.orders_list_con}>
|
||||||
|
<View className={styles.orders_return_title}>{order?.type == 1?'退货信息':'退款信息'}</View>
|
||||||
|
{
|
||||||
|
order?.list?.map(item => {
|
||||||
|
return <View key={item.product_code} className={styles.order_list}>
|
||||||
|
<View className={styles.order_list_title}>
|
||||||
|
<View className={styles.tag}>{order.sale_mode_name}</View>
|
||||||
|
<View className={styles.title}>{formatHashTag(item.code, item.name)}</View>
|
||||||
|
<View className={styles.num}>共{item?.product_colors?.length}种</View>
|
||||||
|
</View>
|
||||||
|
<View className={styles.order_list_scroll}>
|
||||||
|
{item?.product_colors?.map(colorItem => {
|
||||||
|
return <View key={colorItem.id} className={styles.order_list_item}>
|
||||||
|
<View className={styles.order_list_item_img}>
|
||||||
|
<LabAndImg value={labAndRgbAndUrl(colorItem)}/>
|
||||||
|
</View>
|
||||||
|
<View className={styles.order_list_item_con}>
|
||||||
|
<View className={styles.order_list_item_des}>
|
||||||
|
<View className={styles.order_list_item_title}>{colorItem.code + ' ' + colorItem.name}</View>
|
||||||
|
<View className={styles.order_list_item_price}>
|
||||||
|
{sale_price_show&&<Text>¥{standardPrice(colorItem.sale_price)}</Text>}
|
||||||
|
<Text>总重{formatWeightDiv(colorItem.estimate_weight)}kg</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View className={styles.order_list_item_count}>
|
||||||
|
<View className={styles.count_num}>×{formatCount(colorItem)}<text>{order.unit}</text></View>
|
||||||
|
<View className={styles.count_price}><text>¥</text>{formatPriceDiv(colorItem.estimate_amount).toLocaleString()}</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
})}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
})
|
||||||
|
}
|
||||||
|
<View className={styles.order_total}><Text>合计</Text><Text>{numText}</Text></View>
|
||||||
|
<View className={styles.order_estimated_amount}>
|
||||||
|
{priceConDom}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
})
|
@ -72,6 +72,11 @@
|
|||||||
.order_list_item_price{
|
.order_list_item_price{
|
||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
color: $color_font_three;
|
color: $color_font_three;
|
||||||
|
text{
|
||||||
|
&:nth-child(n+1) {
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.order_list_item_count{
|
.order_list_item_count{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { ORDER_STATUS } from "@/common/enum"
|
import { AFTER_ORDER_STATUS, ORDER_STATUS } from "@/common/enum"
|
||||||
import { formatHashTag, formatPriceDiv } from "@/common/fotmat"
|
import { formatHashTag, formatPriceDiv, formatWeightDiv } from "@/common/fotmat"
|
||||||
import LabAndImg from "@/components/LabAndImg"
|
import LabAndImg from "@/components/LabAndImg"
|
||||||
import { Text, View } from "@tarojs/components"
|
import { Text, View } from "@tarojs/components"
|
||||||
import { memo, useCallback, useMemo } from "react"
|
import { memo, useCallback, useMemo } from "react"
|
||||||
@ -45,57 +45,88 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
return `${order?.total_fabrics}种面料,${order?.total_colors}种颜色,共${order?.total_number}${order?.unit}`
|
return `${order?.total_fabrics}种面料,${order?.total_colors}种颜色,共${order?.total_number}${order?.unit}`
|
||||||
}, [order])
|
}, [order])
|
||||||
|
|
||||||
|
//售后单状态枚举
|
||||||
|
const {
|
||||||
|
ReturnStageApplying, // 申请中
|
||||||
|
ReturnStageWaitCheck, // 退货中
|
||||||
|
ReturnStageChecked, // 待验布
|
||||||
|
ReturnStageReturned, // 已退款
|
||||||
|
ReturnStageCancel, // 已取消
|
||||||
|
ReturnStageQualityCheckPendingRefund, // 已验布
|
||||||
|
ReturnStageServiceOrderPendingRefund, // 待退款
|
||||||
|
ReturnStageRejected, // 已拒绝
|
||||||
|
} = AFTER_ORDER_STATUS
|
||||||
|
|
||||||
|
|
||||||
//金额列表枚举
|
//金额列表枚举
|
||||||
const priceList = [
|
const priceList = [
|
||||||
|
|
||||||
{
|
{
|
||||||
id:1,
|
id:1,
|
||||||
value:[],
|
big_value:[
|
||||||
label:'退货条数',
|
ReturnStageServiceOrderPendingRefund.value,
|
||||||
field: 'estimate_amount'
|
ReturnStageReturned.value
|
||||||
},
|
],
|
||||||
{
|
cut_value: [ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
||||||
id:2,
|
model_value: [],
|
||||||
value:[],
|
|
||||||
label:'扣款金额',
|
label:'扣款金额',
|
||||||
field: 'total_sale_price'
|
field: 'total_sale_price'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id:3,
|
id:2,
|
||||||
value:[],
|
big_value:[
|
||||||
|
ReturnStageServiceOrderPendingRefund.value,
|
||||||
|
ReturnStageReturned.value
|
||||||
|
],
|
||||||
|
cut_value: [],
|
||||||
|
model_value: [],
|
||||||
label:'其他扣款',
|
label:'其他扣款',
|
||||||
field: 'total_weight_error_discount'
|
field: 'total_weight_error_discount'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id:4,
|
id:3,
|
||||||
value:[],
|
big_value:[
|
||||||
|
ReturnStageServiceOrderPendingRefund.value,
|
||||||
|
ReturnStageReturned.value
|
||||||
|
],
|
||||||
|
cut_value: [ReturnStageServiceOrderPendingRefund.value],
|
||||||
|
model_value: [
|
||||||
|
ReturnStageQualityCheckPendingRefund.value,
|
||||||
|
ReturnStageServiceOrderPendingRefund.value
|
||||||
|
],
|
||||||
label:'应退金额',
|
label:'应退金额',
|
||||||
field: 'total_should_collect_money'
|
field: 'total_should_collect_money'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id:5,
|
id:4,
|
||||||
value:[],
|
big_value:[ReturnStageReturned.value],
|
||||||
|
cut_value: [ReturnStageReturned.value],
|
||||||
|
model_value: [ReturnStageReturned.value],
|
||||||
label:'退款金额',
|
label:'退款金额',
|
||||||
field: 'total_should_collect_money'
|
field: 'total_should_collect_money'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id:6,
|
id:5,
|
||||||
value:[],
|
big_value:[ReturnStageReturned.value],
|
||||||
|
cut_value: [ReturnStageReturned.value],
|
||||||
|
model_value: [ReturnStageReturned.value],
|
||||||
label:'退款去向',
|
label:'退款去向',
|
||||||
field: 'actual_amount'
|
field: 'actual_amount'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id:7,
|
id:6,
|
||||||
value:[],
|
big_value:[ReturnStageQualityCheckPendingRefund.value],
|
||||||
label:'实付金额',
|
cut_value: [ReturnStageRejected.value, ReturnStageApplying.value, ReturnStageWaitCheck.value, ReturnStageChecked.value, ReturnStageQualityCheckPendingRefund.value, ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
||||||
|
model_value: [ReturnStageApplying.value],
|
||||||
|
label:'合计金额',
|
||||||
field: 'actual_amount'
|
field: 'actual_amount'
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
//是否显示价格
|
//是否显示价格
|
||||||
const showPrice = useCallback((priceInfo, status) => {
|
const showPrice = useCallback((priceInfo) => {
|
||||||
return priceInfo.value.includes(status)
|
let key = ['big_value', 'model_value', 'cut_value']
|
||||||
|
return priceInfo[key[order?.sale_mode]].includes(order?.stage)
|
||||||
}, [order])
|
}, [order])
|
||||||
|
|
||||||
const priceConDom = useMemo(() => {
|
const priceConDom = useMemo(() => {
|
||||||
@ -104,7 +135,7 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
<>
|
<>
|
||||||
{
|
{
|
||||||
priceList.map(item => {
|
priceList.map(item => {
|
||||||
return <>{showPrice(item, order?.stage)&&<EstimatedAmount key={item.id} number={formatPriceDiv(order[item.field])} title={item.label} />}</>
|
return <>{showPrice(item)&&<EstimatedAmount key={item.id} number={formatPriceDiv(order[item.field])} title={item.label} />}</>
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</>
|
</>
|
||||||
@ -116,6 +147,11 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
return {lab:{...item?.lab}, rgb:{...item?.rgb}, texturl_url: item?.texturl_url}
|
return {lab:{...item?.lab}, rgb:{...item?.rgb}, texturl_url: item?.texturl_url}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
//单价显示判断
|
||||||
|
const sale_price_show = useMemo(() => {
|
||||||
|
return order?.stage != ReturnStageServiceOrderPendingRefund.value && order?.stage != ReturnStageQualityCheckPendingRefund.value
|
||||||
|
}, [order])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.kindsList_main}>
|
<View className={styles.kindsList_main}>
|
||||||
<View className={styles.orders_list_con}>
|
<View className={styles.orders_list_con}>
|
||||||
@ -126,7 +162,7 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
<View className={styles.order_list_title}>
|
<View className={styles.order_list_title}>
|
||||||
<View className={styles.tag}>{order.sale_mode_name}</View>
|
<View className={styles.tag}>{order.sale_mode_name}</View>
|
||||||
<View className={styles.title}>{formatHashTag(item.code, item.name)}</View>
|
<View className={styles.title}>{formatHashTag(item.code, item.name)}</View>
|
||||||
<View className={styles.num}>共{item?.product_colors.length}种</View>
|
<View className={styles.num}>共{item?.product_colors?.length}种</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.order_list_scroll}>
|
<View className={styles.order_list_scroll}>
|
||||||
{item?.product_colors?.map(colorItem => {
|
{item?.product_colors?.map(colorItem => {
|
||||||
@ -137,7 +173,10 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
<View className={styles.order_list_item_con}>
|
<View className={styles.order_list_item_con}>
|
||||||
<View className={styles.order_list_item_des}>
|
<View className={styles.order_list_item_des}>
|
||||||
<View className={styles.order_list_item_title}>{colorItem.code + ' ' + colorItem.name}</View>
|
<View className={styles.order_list_item_title}>{colorItem.code + ' ' + colorItem.name}</View>
|
||||||
<View className={styles.order_list_item_price}>¥{standardPrice(colorItem.sale_price)}</View>
|
<View className={styles.order_list_item_price}>
|
||||||
|
{sale_price_show&&<Text>¥{standardPrice(colorItem.sale_price)}</Text>}
|
||||||
|
<Text>总重{formatWeightDiv(colorItem.estimate_weight)}kg</Text>
|
||||||
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.order_list_item_count}>
|
<View className={styles.order_list_item_count}>
|
||||||
<View className={styles.count_num}>×{formatCount(colorItem)}<text>{order.unit}</text></View>
|
<View className={styles.count_num}>×{formatCount(colorItem)}<text>{order.unit}</text></View>
|
||||||
|
131
src/pages/salesAfter/components/modelKindList/index.module.scss
Normal file
131
src/pages/salesAfter/components/modelKindList/index.module.scss
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
|
||||||
|
.kindsList_main{
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
.orders_list_con{
|
||||||
|
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 20px;
|
||||||
|
padding: 20px;
|
||||||
|
.orders_return_title{
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 700;
|
||||||
|
padding-bottom: 20px;
|
||||||
|
}
|
||||||
|
.order_list{
|
||||||
|
&:nth-child(n+2) {
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
.order_list_title{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.tag{
|
||||||
|
font-size: $font_size_min;
|
||||||
|
background-color: #CDE5FF;
|
||||||
|
padding: 5px 10px;
|
||||||
|
border-radius: 6px;
|
||||||
|
color: $color_main;
|
||||||
|
}
|
||||||
|
.title{
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: $font_size;
|
||||||
|
margin-left: 20px;
|
||||||
|
flex:1;
|
||||||
|
}
|
||||||
|
.num{
|
||||||
|
color: $color_font_two;
|
||||||
|
font-size: $font_size_min;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.order_list_scroll{
|
||||||
|
margin-top: 30px;
|
||||||
|
|
||||||
|
.order_list_item {
|
||||||
|
display: flex;
|
||||||
|
&:nth-child(2) {
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
.order_list_item_img{
|
||||||
|
width: 126px;
|
||||||
|
height: 126px;
|
||||||
|
border-radius: 20px;
|
||||||
|
}
|
||||||
|
.order_list_item_con{
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
flex:1;
|
||||||
|
border-bottom: 1px solid #f0f0f0;
|
||||||
|
height: 150px;
|
||||||
|
padding-top: 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.order_list_item_des{
|
||||||
|
flex:1;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-left: 30px;
|
||||||
|
.order_list_item_title{
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: $font_size;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
.order_list_item_price{
|
||||||
|
font-size: 26px;
|
||||||
|
color: $color_font_three;
|
||||||
|
text{
|
||||||
|
&:nth-child(n+1) {
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.order_list_item_count{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: flex-end;
|
||||||
|
.count_num{
|
||||||
|
color: $color_main;
|
||||||
|
font-size: $font_size;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
font-weight: 400;
|
||||||
|
text{
|
||||||
|
font-size: $font_size_min;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.count_price {
|
||||||
|
font-size: $font_size;
|
||||||
|
font-weight: 700;
|
||||||
|
text{
|
||||||
|
font-size: $font_size_min;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.order_total{
|
||||||
|
padding-top: 20px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
text{
|
||||||
|
&:nth-child(1) {
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
&:nth-child(2) {
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.order_estimated_amount{
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 30px 0;
|
||||||
|
.order_price_des{
|
||||||
|
font-size: $font_size_medium;
|
||||||
|
color: $color_font_two;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
168
src/pages/salesAfter/components/modelKindList/index.tsx
Normal file
168
src/pages/salesAfter/components/modelKindList/index.tsx
Normal file
@ -0,0 +1,168 @@
|
|||||||
|
import { AFTER_ORDER_STATUS, ORDER_STATUS } from "@/common/enum"
|
||||||
|
import { formatHashTag, formatPriceDiv, formatWeightDiv } from "@/common/fotmat"
|
||||||
|
import LabAndImg from "@/components/LabAndImg"
|
||||||
|
import { Text, View } from "@tarojs/components"
|
||||||
|
import { memo, useCallback, useMemo } from "react"
|
||||||
|
import EstimatedAmount from "../estimatedAmount"
|
||||||
|
import styles from './index.module.scss'
|
||||||
|
|
||||||
|
type OrderParam = {
|
||||||
|
estimate_amount: number, //预估金额
|
||||||
|
list: any[],
|
||||||
|
sale_mode: number,
|
||||||
|
sale_mode_name: string,
|
||||||
|
unit: string,
|
||||||
|
total_colors: number,
|
||||||
|
total_fabrics: number,
|
||||||
|
total_number: number,
|
||||||
|
stage: number, //订单状态
|
||||||
|
type: 1|2, //1退货, 2退款
|
||||||
|
total_sale_price: number, //销售金额
|
||||||
|
total_should_collect_money: number, //应收金额
|
||||||
|
total_weight_error_discount: number, //空差优惠
|
||||||
|
the_previous_status: number, //取消订单时的订单状态
|
||||||
|
actual_amount: number //实付金额
|
||||||
|
}
|
||||||
|
|
||||||
|
type Param = {
|
||||||
|
order: OrderParam,
|
||||||
|
comfirm?: boolean //是否是确认订单页面使用
|
||||||
|
}
|
||||||
|
|
||||||
|
export default memo(({order, comfirm = false}:Param) => {
|
||||||
|
//对应数量
|
||||||
|
const formatCount = useCallback((item) => {
|
||||||
|
return order?.sale_mode == 0? item.roll : Number(item.length / 100)
|
||||||
|
}, [order])
|
||||||
|
//对应单价
|
||||||
|
const standardPrice = useCallback(price => {
|
||||||
|
return formatPriceDiv(price).toLocaleString() + '/' + (order?.sale_mode == 1?'m':'kg')
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
//数量格式
|
||||||
|
const numText = useMemo(() => {
|
||||||
|
if(order)
|
||||||
|
return `${order?.total_fabrics}种面料,${order?.total_colors}种颜色,共${order?.total_number}${order?.unit}`
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
//售后单状态枚举
|
||||||
|
const {
|
||||||
|
ReturnStageApplying, // 申请中
|
||||||
|
ReturnStageWaitCheck, // 退货中
|
||||||
|
ReturnStageChecked, // 待验布
|
||||||
|
ReturnStageReturned, // 已退款
|
||||||
|
ReturnStageCancel, // 已取消
|
||||||
|
ReturnStageQualityCheckPendingRefund, // 已验布
|
||||||
|
ReturnStageServiceOrderPendingRefund, // 待退款
|
||||||
|
ReturnStageRejected, // 已拒绝
|
||||||
|
} = AFTER_ORDER_STATUS
|
||||||
|
|
||||||
|
|
||||||
|
//金额列表枚举
|
||||||
|
const priceList = [
|
||||||
|
{
|
||||||
|
id:1,
|
||||||
|
value:[
|
||||||
|
ReturnStageServiceOrderPendingRefund.value,
|
||||||
|
ReturnStageReturned.value
|
||||||
|
],
|
||||||
|
label:'应退金额',
|
||||||
|
field: 'total_should_collect_money'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:2,
|
||||||
|
value:[ReturnStageReturned.value],
|
||||||
|
label:'退款金额',
|
||||||
|
field: 'total_should_collect_money'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:3,
|
||||||
|
value:[ReturnStageReturned.value],
|
||||||
|
label:'退款去向',
|
||||||
|
field: 'actual_amount'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:4,
|
||||||
|
value:[ReturnStageQualityCheckPendingRefund.value],
|
||||||
|
label:'合计金额',
|
||||||
|
field: 'actual_amount'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
//是否显示价格
|
||||||
|
const showPrice = useCallback((priceInfo) => {
|
||||||
|
if(priceInfo.value == 8) {
|
||||||
|
//合计金额
|
||||||
|
|
||||||
|
}
|
||||||
|
return priceInfo.value.includes(order?.stage)
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
const priceConDom = useMemo(() => {
|
||||||
|
if(!order) return
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{
|
||||||
|
priceList.map(item => {
|
||||||
|
return <>{showPrice(item)&&<EstimatedAmount key={item.id} number={formatPriceDiv(order[item.field])} title={item.label} />}</>
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
//整理颜色
|
||||||
|
const labAndRgbAndUrl = useCallback((item) => {
|
||||||
|
return {lab:{...item?.lab}, rgb:{...item?.rgb}, texturl_url: item?.texturl_url}
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
//单价显示判断
|
||||||
|
const sale_price_show = useMemo(() => {
|
||||||
|
return order?.stage != ReturnStageServiceOrderPendingRefund.value && order?.stage != ReturnStageQualityCheckPendingRefund.value
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View className={styles.kindsList_main}>
|
||||||
|
<View className={styles.orders_list_con}>
|
||||||
|
<View className={styles.orders_return_title}>{order?.type == 1?'退货信息':'退款信息'}</View>
|
||||||
|
{
|
||||||
|
order?.list?.map(item => {
|
||||||
|
return <View key={item.product_code} className={styles.order_list}>
|
||||||
|
<View className={styles.order_list_title}>
|
||||||
|
<View className={styles.tag}>{order.sale_mode_name}</View>
|
||||||
|
<View className={styles.title}>{formatHashTag(item.code, item.name)}</View>
|
||||||
|
<View className={styles.num}>共{item?.product_colors?.length}种</View>
|
||||||
|
</View>
|
||||||
|
<View className={styles.order_list_scroll}>
|
||||||
|
{item?.product_colors?.map(colorItem => {
|
||||||
|
return <View key={colorItem.id} className={styles.order_list_item}>
|
||||||
|
<View className={styles.order_list_item_img}>
|
||||||
|
<LabAndImg value={labAndRgbAndUrl(colorItem)}/>
|
||||||
|
</View>
|
||||||
|
<View className={styles.order_list_item_con}>
|
||||||
|
<View className={styles.order_list_item_des}>
|
||||||
|
<View className={styles.order_list_item_title}>{colorItem.code + ' ' + colorItem.name}</View>
|
||||||
|
<View className={styles.order_list_item_price}>
|
||||||
|
{sale_price_show&&<Text>¥{standardPrice(colorItem.sale_price)}</Text>}
|
||||||
|
<Text>总重{formatWeightDiv(colorItem.estimate_weight)}kg</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View className={styles.order_list_item_count}>
|
||||||
|
<View className={styles.count_num}>×{formatCount(colorItem)}<text>{order.unit}</text></View>
|
||||||
|
<View className={styles.count_price}><text>¥</text>{formatPriceDiv(colorItem.estimate_amount).toLocaleString()}</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
})}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
})
|
||||||
|
}
|
||||||
|
<View className={styles.order_total}><Text>合计</Text><Text>{numText}</Text></View>
|
||||||
|
<View className={styles.order_estimated_amount}>
|
||||||
|
{priceConDom}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
})
|
@ -52,7 +52,7 @@ import styles from './index.module.scss'
|
|||||||
total_number: orderDetail.total_number, //总数量
|
total_number: orderDetail.total_number, //总数量
|
||||||
total_fabrics: orderDetail.total_fabrics, //面料数量
|
total_fabrics: orderDetail.total_fabrics, //面料数量
|
||||||
unit: orderDetail.sale_mode == 0?'条':'m', //单位
|
unit: orderDetail.sale_mode == 0?'条':'m', //单位
|
||||||
list: orderDetail.product_list,
|
list: orderDetail.quality_check_pass_product,
|
||||||
stage: orderDetail.stage, //订单状态
|
stage: orderDetail.stage, //订单状态
|
||||||
type: orderDetail.type, //退货or退款
|
type: orderDetail.type, //退货or退款
|
||||||
total_sale_price: orderDetail.total_sale_price, //销售金额
|
total_sale_price: orderDetail.total_sale_price, //销售金额
|
||||||
@ -69,7 +69,10 @@ import styles from './index.module.scss'
|
|||||||
|
|
||||||
//获取底部按钮点击, 获取按钮状态
|
//获取底部按钮点击, 获取按钮状态
|
||||||
const orderStateClick = useCallback((val) => {
|
const orderStateClick = useCallback((val) => {
|
||||||
|
if(val == 8) {
|
||||||
|
//申请记录
|
||||||
|
setApplyRecord(true)
|
||||||
|
}
|
||||||
}, [orderDetail])
|
}, [orderDetail])
|
||||||
|
|
||||||
//页面下拉刷新
|
//页面下拉刷新
|
||||||
@ -85,7 +88,7 @@ import styles from './index.module.scss'
|
|||||||
orderId: orderDetail?.id,
|
orderId: orderDetail?.id,
|
||||||
settle_mode: orderDetail?.settle_mode,
|
settle_mode: orderDetail?.settle_mode,
|
||||||
type: orderDetail?.type, //退货or退款
|
type: orderDetail?.type, //退货or退款
|
||||||
sale_mode: orderDetail?.sale_model, //订单类型
|
sale_mode: orderDetail?.sale_mode, //订单类型
|
||||||
return_apply_order_id: orderDetail?.return_apply_order_id
|
return_apply_order_id: orderDetail?.return_apply_order_id
|
||||||
}
|
}
|
||||||
}, [orderDetail])
|
}, [orderDetail])
|
||||||
@ -119,13 +122,14 @@ import styles from './index.module.scss'
|
|||||||
getSaleOrderPreView()
|
getSaleOrderPreView()
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
//显示生气记录
|
//显示记录
|
||||||
const [applyRecord, setApplyRecord] = useState(false)
|
const [applyRecord, setApplyRecord] = useState(false)
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.order_main}>
|
<View className={styles.order_main}>
|
||||||
<OrderState orderInfo={orderDetail}/>
|
<OrderState orderInfo={orderDetail}/>
|
||||||
<AddressInfoDetail return_address={orderDetail?.return_address} return_phone={orderDetail?.return_phone} stage={orderDetail?.stage} onLogistics={onShowLogistics}/>
|
<AddressInfoDetail return_address={orderDetail?.return_user_name} return_phone={orderDetail?.return_user_phone} stage={orderDetail?.stage} onLogistics={onShowLogistics}/>
|
||||||
<KindList order={formatPreViewOrderMemo}/>
|
<KindList order={formatPreViewOrderMemo}/>
|
||||||
<OrderDes orderInfo={orderDetail}/>
|
<OrderDes orderInfo={orderDetail}/>
|
||||||
<View className={styles.submit_order}>
|
<View className={styles.submit_order}>
|
||||||
|
@ -77,16 +77,16 @@ export default memo(({value, onClickBtn}: Param) => {
|
|||||||
<View className={styles.product_con} onClick={() => goLink('/pages/salesAfter/index', {id: value?.id})}>
|
<View className={styles.product_con} onClick={() => goLink('/pages/salesAfter/index', {id: value?.id})}>
|
||||||
<View className={styles.product_title}>
|
<View className={styles.product_title}>
|
||||||
<View className={styles.product_tag}>{value?.sale_mode_name}</View>
|
<View className={styles.product_tag}>{value?.sale_mode_name}</View>
|
||||||
<View className={styles.product_name}>{formatHashTag(value?.product_list[0].code, value?.product_list[0].name)}</View>
|
<View className={styles.product_name}>{formatHashTag(value?.product_list?.[0].code, value?.product_list?.[0].name)}</View>
|
||||||
<View className={styles.product_status}>{value?.stage_name}</View>
|
<View className={styles.product_status}>{value?.stage_name}</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.product_list}>
|
<View className={styles.product_list}>
|
||||||
<View className={styles.image}>
|
<View className={styles.image}>
|
||||||
<LabAndImg value={labAndRgbAndUrl}/>
|
<LabAndImg value={labAndRgbAndUrl}/>
|
||||||
<View className={styles.color_num}>{value?.product_list[0].product_colors[0].code}</View>
|
<View className={styles.color_num}>{value?.product_list?.[0].product_colors?.[0].code}</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.color_list}>
|
<View className={styles.color_list}>
|
||||||
{value?.product_list[0].product_colors.map((itemColor, index) => {
|
{value?.product_list?.[0].product_colors.map((itemColor, index) => {
|
||||||
return (
|
return (
|
||||||
(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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user