商城测试版v6
This commit is contained in:
parent
d5a5099e25
commit
ff8eb0ce1c
@ -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
|
||||||
// 生成密钥
|
// 生成密钥
|
||||||
@ -25,7 +25,6 @@ export const IMG_CND_Prefix = CURRENT_ENV.includes('development')? "https://test
|
|||||||
//在线支付图片baseUrl
|
//在线支付图片baseUrl
|
||||||
export const CAP_HTML_TO_IMAGE_BASE_URL = CURRENT_ENV.includes('development')? "https://test.zzfzyc.com":"https://www.zzfzyc.com"
|
export const CAP_HTML_TO_IMAGE_BASE_URL = CURRENT_ENV.includes('development')? "https://test.zzfzyc.com":"https://www.zzfzyc.com"
|
||||||
|
|
||||||
|
|
||||||
// 上传图片视频
|
// 上传图片视频
|
||||||
export const CDN_UPLOAD_IMG = `${UPLOAD_CDN_URL || ''}`;
|
export const CDN_UPLOAD_IMG = `${UPLOAD_CDN_URL || ''}`;
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ export const isLabImage = (imgurl, rgb, suffix="!w200") => {
|
|||||||
export const numberWithCommas = ({number = 0, digit = 2}) => {
|
export const numberWithCommas = ({number = 0, digit = 2}) => {
|
||||||
if(!isNaN(Number(number))) {
|
if(!isNaN(Number(number))) {
|
||||||
// return parseFloat(number).toFixed(digit).replace(/^\B(?<!\.\d*)(?=(\d{3})+(?!\d))$/g, ",");
|
// return parseFloat(number).toFixed(digit).replace(/^\B(?<!\.\d*)(?=(\d{3})+(?!\d))$/g, ",");
|
||||||
return parseFloat(number).toFixed(digit).toLocaleString()
|
return parseFloat(number).toLocaleString('zh', {minimumFractionDigits: digit})
|
||||||
} else {
|
} else {
|
||||||
return 0.00
|
return 0.00
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ export default memo(({orderInfo, onClick, fixedBottom = true}:Param) => {
|
|||||||
id: 1,
|
id: 1,
|
||||||
label: '取消退货',
|
label: '取消退货',
|
||||||
validatarFunc: (orderInfo) => {
|
validatarFunc: (orderInfo) => {
|
||||||
if(orderInfo.sale_mode !== 1) return [ReturnStageApplying.value, ReturnStageWaitCheck.value].includes(orderInfo.stage)
|
if(orderInfo?.sale_mode != 1 && orderInfo.type == ReturnApplyOrderTypeReturnForRefund.value) return [ReturnStageApplying.value, ReturnStageWaitCheck.value].includes(orderInfo.stage)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -61,7 +61,7 @@ export default memo(({orderInfo, onClick, fixedBottom = true}:Param) => {
|
|||||||
id: 4,
|
id: 4,
|
||||||
label: '质检结果',
|
label: '质检结果',
|
||||||
validatarFunc: (orderInfo) => {
|
validatarFunc: (orderInfo) => {
|
||||||
if(orderInfo.sale_mode !== 1) return [ReturnStageQualityCheckPendingRefund.value, ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value].includes(orderInfo.stage)
|
if(orderInfo.sale_mode !== 1 && orderInfo.type == ReturnApplyOrderTypeReturnForRefund.value) return [ReturnStageQualityCheckPendingRefund.value, ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value].includes(orderInfo.stage)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -69,9 +69,8 @@ export default memo(({orderInfo, onClick, fixedBottom = true}:Param) => {
|
|||||||
id: 6,
|
id: 6,
|
||||||
label: '取消退款',
|
label: '取消退款',
|
||||||
validatarFunc: (orderInfo) => {
|
validatarFunc: (orderInfo) => {
|
||||||
//大货 是销售退款时
|
if (orderInfo?.sale_mode != 1 && orderInfo.type != ReturnApplyOrderTypeReturnForRefund.value) return [ReturnStageApplying.value, ReturnStageServiceOrderPendingRefund.value]?.includes(orderInfo.stage)
|
||||||
if(orderInfo?.sale_mode == 0 && orderInfo.type != ReturnApplyOrderTypeReturnForRefund.value) return [ReturnStageApplying.value, ReturnStageServiceOrderPendingRefund.value]?.includes(orderInfo.stage)
|
if (orderInfo?.sale_mode == 1) return [ReturnStageApplying.value].includes(orderInfo.stage)
|
||||||
if(orderInfo?.sale_mode == 1) return [ReturnStageApplying.value].includes(orderInfo.stage)
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -25,7 +25,7 @@ export default ({show, onClose}:params) => {
|
|||||||
|
|
||||||
const onConfirm = () => {
|
const onConfirm = () => {
|
||||||
onClose?.()
|
onClose?.()
|
||||||
// goLink('/')
|
goLink('/pages/bindSalesman/index')
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -81,5 +81,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.refund_destination{
|
||||||
|
font-size: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -8,15 +8,16 @@ import AmountShow from "../amountShow";
|
|||||||
|
|
||||||
type Param = {
|
type Param = {
|
||||||
style?: Object,
|
style?: Object,
|
||||||
number?: number,
|
number?: number|string,
|
||||||
title?: string,
|
title?: string,
|
||||||
titleStatus?: true|false, //true 标题加大加深
|
titleStatus?: true|false, //true 标题加大加深
|
||||||
numberStatus?: 0|1|2, //数字尺寸
|
numberStatus?: 0|1|2, //数字尺寸
|
||||||
messageTitle?: string,
|
messageTitle?: string,
|
||||||
messageWidth?: number,
|
messageWidth?: number,
|
||||||
messageShow?: true|false,
|
messageShow?: true|false,
|
||||||
|
numberFormat?: 'number'|'text' //数字还是字符串
|
||||||
}
|
}
|
||||||
export default memo(({number = 0, titleStatus = true, title = '', messageTitle = '', numberStatus = 1, messageWidth = 430, messageShow = false}:Param) => {
|
export default memo(({number = 0, titleStatus = true, title = '', messageTitle = '', numberStatus = 1, messageWidth = 430, messageShow = false, numberFormat = 'number'}:Param) => {
|
||||||
const [show, setShow] = useState(messageShow)
|
const [show, setShow] = useState(messageShow)
|
||||||
const onClose = () => {
|
const onClose = () => {
|
||||||
setShow(false)
|
setShow(false)
|
||||||
@ -54,7 +55,8 @@ export default memo(({number = 0, titleStatus = true, title = '', messageTitle =
|
|||||||
<Text className={classnames(styles.miconfont, 'iconfont icon-zhushi')}></Text>
|
<Text className={classnames(styles.miconfont, 'iconfont icon-zhushi')}></Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<AmountShow status={numberStatus} number={number}/>
|
{numberFormat == 'number' && <AmountShow status={numberStatus} number={(number as number / 100)}/>}
|
||||||
|
{(numberFormat == 'text') && <View className={styles.refund_destination}>{number}</View>}
|
||||||
{show&&<View className={styles.close} catchMove onClick={onClose}></View>}
|
{show&&<View className={styles.close} catchMove onClick={onClose}></View>}
|
||||||
</View>
|
</View>
|
||||||
</>
|
</>
|
||||||
|
@ -22,10 +22,11 @@ type Param = {
|
|||||||
is_return?: true|false, //是否申请了售后
|
is_return?: true|false, //是否申请了售后
|
||||||
|
|
||||||
},
|
},
|
||||||
|
showStatus?: 'detail'|'list', //订单详情,订单列表
|
||||||
onClick?: (val: number) => void //点击后触发的事件,返回订单状态
|
onClick?: (val: number) => void //点击后触发的事件,返回订单状态
|
||||||
}
|
}
|
||||||
|
|
||||||
export default memo(({orderInfo, onClick}:Param) => {
|
export default memo(({orderInfo, showStatus = 'detail', onClick}:Param) => {
|
||||||
//订单状态枚举
|
//订单状态枚举
|
||||||
const {
|
const {
|
||||||
SaleOrderStatusBooking,
|
SaleOrderStatusBooking,
|
||||||
@ -126,6 +127,13 @@ export default memo(({orderInfo, onClick}:Param) => {
|
|||||||
return orderStatus.includes(orderInfo.status)
|
return orderStatus.includes(orderInfo.status)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 10,
|
||||||
|
label: '销售码单',
|
||||||
|
validatarFunc: (orderInfo) => {
|
||||||
|
return orderInfo.actual_amount > 0 && orderInfo.wait_pay_amount == 0 && showStatus == 'detail'
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
label: '去付款',
|
label: '去付款',
|
||||||
@ -142,7 +150,8 @@ export default memo(({orderInfo, onClick}:Param) => {
|
|||||||
]
|
]
|
||||||
return orderInfo.wait_pay_amount != 0 && orderStatus.includes(orderInfo.status)
|
return orderInfo.wait_pay_amount != 0 && orderStatus.includes(orderInfo.status)
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|
||||||
//显示的按钮数组
|
//显示的按钮数组
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
right:0;
|
right:0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background: rgba($color: #000, $alpha: 0.3);
|
background: rgba($color: #000, $alpha: 0.3);
|
||||||
border-radius: 36px 0px 10px 0px;
|
border-radius: 36px 0px 20px 0px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
@ -4,18 +4,24 @@ import { goLink } from "@/common/common"
|
|||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import { formatHashTag, formatImgUrl } from "@/common/fotmat"
|
import { formatHashTag, formatImgUrl } from "@/common/fotmat"
|
||||||
import LabAndImg from "../LabAndImg"
|
import LabAndImg from "../LabAndImg"
|
||||||
|
import { useCallback, useMemo } from "react"
|
||||||
|
|
||||||
type Params = {
|
type Params = {
|
||||||
desStatus?: true|false,
|
desStatus?: true|false,
|
||||||
productList?: any[]
|
productList?: any[]
|
||||||
}
|
}
|
||||||
export default ({desStatus = true, productList = []}:Params) => {
|
export default ({desStatus = true, productList = []}:Params) => {
|
||||||
|
|
||||||
|
const labAndImgObj = useCallback((item) => {
|
||||||
|
const img = item?item.texture_url.split(',')[0]:''
|
||||||
|
return {lab:item.lab,rgb:item.rgb,texture_url:img}
|
||||||
|
}, [productList])
|
||||||
return (
|
return (
|
||||||
<View className={styles.products_list}>
|
<View className={styles.products_list}>
|
||||||
{productList?.map(item => {
|
{productList?.map(item => {
|
||||||
return <View className={styles.products_item} onClick={() => goLink(`/pages/details/index?id=${item.id}`)}>
|
return <View className={styles.products_item} onClick={() => goLink(`/pages/details/index?id=${item.id}`)}>
|
||||||
<View className={styles.item_img}>
|
<View className={styles.item_img}>
|
||||||
<LabAndImg value={{lab:item.lab,rgb:item.rgb,texture_url:item.texture_url}}/>
|
<LabAndImg value={labAndImgObj(item)}/>
|
||||||
<View className={styles.num}>{item.product_color_count}色</View>
|
<View className={styles.num}>{item.product_color_count}色</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.item_con}>
|
<View className={styles.item_con}>
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
z-index: 0;
|
||||||
.icon_a_sousuo1_self{
|
.icon_a_sousuo1_self{
|
||||||
font-size: 37px;
|
font-size: 37px;
|
||||||
color: $color_font_two;
|
color: $color_font_two;
|
||||||
|
@ -15,6 +15,7 @@ import { debounce, throttle } from "@/common/util";
|
|||||||
import Counter from "../counter";
|
import Counter from "../counter";
|
||||||
import { ApplyOrderAccessApi, GetAdminUserInfoApi, SubscriptionMessageApi } from "@/api/user";
|
import { ApplyOrderAccessApi, GetAdminUserInfoApi, SubscriptionMessageApi } from "@/api/user";
|
||||||
import useCommonData from "@/use/useCommonData";
|
import useCommonData from "@/use/useCommonData";
|
||||||
|
import BindSalesmanPopup from "../bindSalesmanPopup";
|
||||||
|
|
||||||
type param = {
|
type param = {
|
||||||
show?: true|false,
|
show?: true|false,
|
||||||
@ -89,6 +90,7 @@ export default ({show = false, onClose, intoStatus='shop'}: param) => {
|
|||||||
setLoading(true)
|
setLoading(true)
|
||||||
initStatus.current = true
|
initStatus.current = true
|
||||||
getShoppingCart()
|
getShoppingCart()
|
||||||
|
setShowBindSalesman(() => false)
|
||||||
}
|
}
|
||||||
}, [show])
|
}, [show])
|
||||||
|
|
||||||
@ -232,25 +234,8 @@ export default ({show = false, onClose, intoStatus='shop'}: param) => {
|
|||||||
let res = await useFetchData()
|
let res = await useFetchData()
|
||||||
if(res.data.order_access_status !== 3) {
|
if(res.data.order_access_status !== 3) {
|
||||||
if(res.data.order_access_status == 1) applyOrderAccessFetchData()
|
if(res.data.order_access_status == 1) applyOrderAccessFetchData()
|
||||||
let modal_res = await Taro.showModal({
|
setShowBindSalesman(() => true)
|
||||||
title: '提示',
|
onClose?.()
|
||||||
content: '暂未开通下单权限功能,稍后有客服联系您,请注意接受电话。',
|
|
||||||
confirmText: '联系客服',
|
|
||||||
cancelText: '我知道',
|
|
||||||
})
|
|
||||||
if (modal_res.confirm) {
|
|
||||||
let res = await Taro.showModal({
|
|
||||||
title: '是否拨打服务热线',
|
|
||||||
confirmText: '拨打',
|
|
||||||
content: '(0757) 8270 6695',
|
|
||||||
cancelText: '取消',
|
|
||||||
})
|
|
||||||
if(res.confirm) {
|
|
||||||
Taro.makePhoneCall({
|
|
||||||
phoneNumber: '(0757)82706695'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
getSelectId()
|
getSelectId()
|
||||||
@ -283,6 +268,9 @@ export default ({show = false, onClose, intoStatus='shop'}: param) => {
|
|||||||
}
|
}
|
||||||
}, 300)
|
}, 300)
|
||||||
|
|
||||||
|
//绑定业务员和电话号码
|
||||||
|
const [showBindSalesman, setShowBindSalesman] = useState(false)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.shop_cart_main}>
|
<View className={styles.shop_cart_main}>
|
||||||
<Popup showTitle={false} show={showPopup} onClose={() => closePopup()} >
|
<Popup showTitle={false} show={showPopup} onClose={() => closePopup()} >
|
||||||
@ -363,6 +351,7 @@ export default ({show = false, onClose, intoStatus='shop'}: param) => {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</Popup>
|
</Popup>
|
||||||
|
<BindSalesmanPopup show={showBindSalesman} onClose={() => setShowBindSalesman(false)}/>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,254 +0,0 @@
|
|||||||
import { Image, ScrollView, Text, View } from "@tarojs/components";
|
|
||||||
import { FC, memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
||||||
import classnames from "classnames";
|
|
||||||
import styles from './index.module.scss'
|
|
||||||
import ReasonPopup from "./components/reasonPopup";
|
|
||||||
import { useDidShow, useRouter } from "@tarojs/taro";
|
|
||||||
import { GetSaleOrderDetailApi } from "@/api/order";
|
|
||||||
import KindList from "./components/kindList"
|
|
||||||
import CutKindList from "./components/cutkindList"
|
|
||||||
import { ReturnApplyOrderApi, ReturnExplainApi, ReturnGoodsStatusApi, ReturnReasonApi } from "@/api/salesAfterOrder";
|
|
||||||
import { alert, goLink } from "@/common/common";
|
|
||||||
import UploadImage from "@/components/uploadImage"
|
|
||||||
import TextareaEnhance from "@/components/textareaEnhance";
|
|
||||||
import useLogin from "@/use/useLogin";
|
|
||||||
|
|
||||||
enum returnStatus {
|
|
||||||
return_reason = 1, //原因
|
|
||||||
goods_status = 2, //状况
|
|
||||||
return_explain = 3, //说明
|
|
||||||
|
|
||||||
}
|
|
||||||
export default () => {
|
|
||||||
useLogin()
|
|
||||||
useDidShow(() => {
|
|
||||||
getSaleOrderPreView()
|
|
||||||
})
|
|
||||||
|
|
||||||
const router = useRouter()
|
|
||||||
const orderId = useRef<number>(Number(router.params.id))
|
|
||||||
|
|
||||||
//需要提交的数据
|
|
||||||
const [submitData, setSubmitData] = useState<any>({
|
|
||||||
fabric_piece_accessory_url: [],
|
|
||||||
goods_status: 0,
|
|
||||||
reason_describe: '',
|
|
||||||
return_explain: 0,
|
|
||||||
return_reason: 0,
|
|
||||||
roll: 0,
|
|
||||||
roll_list: [],
|
|
||||||
sale_order_id: orderId.current
|
|
||||||
})
|
|
||||||
|
|
||||||
//获取订单数据
|
|
||||||
const [orderDetail, setOrderDetail] = useState<any>() //获取到的原始数据
|
|
||||||
const {fetchData: getOrderFetchData} = GetSaleOrderDetailApi()
|
|
||||||
const getSaleOrderPreView = async () => {
|
|
||||||
if(orderId.current) {
|
|
||||||
let res = await getOrderFetchData({id: orderId.current})
|
|
||||||
setOrderDetail(res.data)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//监听获取到的数据
|
|
||||||
useEffect(() => {
|
|
||||||
if(orderDetail) {
|
|
||||||
formatData()
|
|
||||||
}
|
|
||||||
}, [orderDetail])
|
|
||||||
|
|
||||||
//格式化数据格式
|
|
||||||
const [formatDetailOrder, setFormatDetailOrder] = useState<any>() //格式化后的数据
|
|
||||||
const formatData = () => {
|
|
||||||
setFormatDetailOrder({
|
|
||||||
sale_mode: orderDetail.sale_mode,
|
|
||||||
sale_mode_name: orderDetail.sale_mode_name,
|
|
||||||
total_colors: orderDetail.total_colors, //总颜色数量
|
|
||||||
total_number: orderDetail.total_number, //总数量
|
|
||||||
total_fabrics: orderDetail.total_fabrics, //面料数量
|
|
||||||
unit: orderDetail.sale_mode == 0?'条':'m', //单位
|
|
||||||
list: orderDetail.product_list,
|
|
||||||
status: orderDetail.status, //订单状态
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//数据总量
|
|
||||||
const dataCount = useMemo(() => {
|
|
||||||
if(formatDetailOrder) {
|
|
||||||
return `${formatDetailOrder.total_fabrics}种面料,${formatDetailOrder.total_colors}种颜色,共${formatDetailOrder.total_number}条`
|
|
||||||
}
|
|
||||||
}, [formatDetailOrder])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//面料数据
|
|
||||||
let roll_list = useRef({})
|
|
||||||
|
|
||||||
//大货时获取计步器数据
|
|
||||||
const getNumChange = useCallback((val) => {
|
|
||||||
if(parseInt(val.number) > 0) {
|
|
||||||
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 {
|
|
||||||
delete roll_list.current[val.color_id]
|
|
||||||
}
|
|
||||||
|
|
||||||
let count = 0
|
|
||||||
Object.values(roll_list.current).map((item: any) => {
|
|
||||||
count += item.product_roll
|
|
||||||
})
|
|
||||||
setSubmitData((e) => ({...e, roll_list:Object.values(roll_list.current), roll: count}))
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
//散剪和剪板
|
|
||||||
const getSelectChange = useCallback((val) => {
|
|
||||||
if(val.status) {
|
|
||||||
roll_list.current[val.color_id] = {product_color_id: val.color_id, product_roll: val.length, sale_order_detail_id: val.sale_order_detail_id}
|
|
||||||
} else {
|
|
||||||
delete roll_list.current[val.color_id]
|
|
||||||
}
|
|
||||||
let count = 0
|
|
||||||
Object.values(roll_list.current).map((item: any) => {
|
|
||||||
count += item.product_roll
|
|
||||||
})
|
|
||||||
setSubmitData((e) => ({...e, roll_list:Object.values(roll_list.current), roll: count}))
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
//获取图片列表
|
|
||||||
const getImageList = useCallback((list) => {
|
|
||||||
setSubmitData((e) => ({...e, fabric_piece_accessory_url:list}))
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
//其他说明
|
|
||||||
const getOtherReason = useCallback((val) => {
|
|
||||||
setSubmitData((e) => ({...e, reason_describe: val}))
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
//提交数据
|
|
||||||
const {fetchData: fetchDataReturnApply} = ReturnApplyOrderApi()
|
|
||||||
const onSubmitData = async () => {
|
|
||||||
if(submitData.roll_list.length <= 0) return alert.error('请选择退货颜色')
|
|
||||||
console.log('submitData::',submitData)
|
|
||||||
let res = await fetchDataReturnApply(submitData)
|
|
||||||
if(res.success) {
|
|
||||||
alert.success('申请成功')
|
|
||||||
goLink('/pages/salesAfterList/index',{}, 'reLaunch')
|
|
||||||
} else {
|
|
||||||
alert.error(res.msg)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//底部按钮
|
|
||||||
const onSubmit = (val) => {
|
|
||||||
if(val == 2) {
|
|
||||||
onSubmitData()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//退货选择弹窗
|
|
||||||
const [showReason, setShowReason] = useState(false)
|
|
||||||
const closeReason = useCallback(() => setShowReason(false), [])
|
|
||||||
const onShowReason = (status) => {
|
|
||||||
if(status == returnStatus.return_reason) {
|
|
||||||
getReturnReason()
|
|
||||||
} else if (status == returnStatus.goods_status) {
|
|
||||||
getReturnGoodsStatus()
|
|
||||||
} else {
|
|
||||||
getReturnExplain()
|
|
||||||
}
|
|
||||||
setShowReason(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log('aaa:', 123456789)
|
|
||||||
|
|
||||||
//请求获取到的数据
|
|
||||||
const [returnGoodsInfo, setReturnGoodsInfo] = useState<{title:string, list: any[], status: 1|2|3}>({title:'', list:[], status: returnStatus.goods_status})
|
|
||||||
//售后货物状况
|
|
||||||
const {fetchData: fetchDataGoodsStatus} = ReturnGoodsStatusApi()
|
|
||||||
const getReturnGoodsStatus = async () => {
|
|
||||||
let res = await fetchDataGoodsStatus()
|
|
||||||
setReturnGoodsInfo((e) => ({...e, title: '货物状况', list:res.data?.list||[], status:returnStatus.goods_status}))
|
|
||||||
}
|
|
||||||
//退货原因
|
|
||||||
const {fetchData: fetchDataReturnReason} = ReturnReasonApi()
|
|
||||||
const getReturnReason = async () => {
|
|
||||||
let res = await fetchDataReturnReason()
|
|
||||||
setReturnGoodsInfo((e) => ({...e, title: '退货原因', list:res.data?.list||[], status:returnStatus.return_reason}))
|
|
||||||
}
|
|
||||||
//售后退货说明
|
|
||||||
const {fetchData: fetchDataReturnExplain} = ReturnExplainApi()
|
|
||||||
const getReturnExplain = async () => {
|
|
||||||
let res = await fetchDataReturnExplain()
|
|
||||||
setReturnGoodsInfo((e) => ({...e, title: '退货说明', list:res.data?.list||[], status:returnStatus.return_explain}))
|
|
||||||
}
|
|
||||||
//选择列表返回的数据
|
|
||||||
const [returnObj, setReturnObj] = useState<{[val:number]:{name:string, id: number}}>({})
|
|
||||||
const onReturnSelect = useCallback((val) => {
|
|
||||||
let {id, name} = val
|
|
||||||
if(returnGoodsInfo.status == returnStatus.goods_status) {
|
|
||||||
setSubmitData((e) => ({...e, goods_status:id}))
|
|
||||||
setReturnObj(e => ({...e, [returnStatus.goods_status]:{name, id}}))
|
|
||||||
}
|
|
||||||
if(returnGoodsInfo.status == returnStatus.return_explain) {
|
|
||||||
setSubmitData((e) => ({...e, return_explain:id}))
|
|
||||||
setReturnObj(e => ({...e, [returnStatus.return_explain]:{name, id}}))
|
|
||||||
}
|
|
||||||
if(returnGoodsInfo.status == returnStatus.return_reason) {
|
|
||||||
setSubmitData((e) => ({...e, return_reason:id}))
|
|
||||||
setReturnObj(e => ({...e, [returnStatus.return_reason]:{name, id}}))
|
|
||||||
}
|
|
||||||
setShowReason(false)
|
|
||||||
}, [returnGoodsInfo])
|
|
||||||
|
|
||||||
return (
|
|
||||||
<View className={styles.apply_after_sales_main}>
|
|
||||||
<View className={styles.apply_after_sales_con}>
|
|
||||||
<View className={styles.kind_number}><Text>{dataCount}</Text></View>
|
|
||||||
<ScrollView scrollY className={styles.scroll}>
|
|
||||||
<View className={styles.scroll_con}>
|
|
||||||
{(orderDetail?.sale_mode == 0)&&<KindList order={formatDetailOrder} onNumChange={getNumChange} />||
|
|
||||||
<CutKindList order={formatDetailOrder} onSelectChange={getSelectChange}/>}
|
|
||||||
<View className={styles.returnSaleInput}>
|
|
||||||
<View className={styles.returnSaleInput_item}>
|
|
||||||
<View className={styles.title}>退货原因</View>
|
|
||||||
<View className={styles.select} onClick={() => onShowReason(returnStatus.return_reason)}>
|
|
||||||
<Text className={returnObj[returnStatus.return_reason]&&styles.selected}>{returnObj[returnStatus.return_reason]?.name||'请选择'}</Text>
|
|
||||||
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View className={styles.returnSaleInput_item}>
|
|
||||||
<View className={styles.title}>货物状况</View>
|
|
||||||
<View className={styles.select} onClick={() => onShowReason(returnStatus.goods_status)}>
|
|
||||||
<Text className={returnObj[returnStatus.goods_status]&&styles.selected}>{returnObj[returnStatus.goods_status]?.name||'请选择'}</Text>
|
|
||||||
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View className={styles.returnSaleInput_item}>
|
|
||||||
<View className={styles.title}>退货说明</View>
|
|
||||||
<View className={styles.select} onClick={() => onShowReason(returnStatus.return_explain)}>
|
|
||||||
<Text className={returnObj[returnStatus.return_explain]&&styles.selected}>{returnObj[returnStatus.return_explain]?.name||'请选择'}</Text>
|
|
||||||
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View className={styles.returnSaleInput_item}>
|
|
||||||
<View className={styles.title}>拍照上传</View>
|
|
||||||
<View className={styles.upload_image}>
|
|
||||||
<UploadImage onChange={getImageList}/>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<TextareaEnhance onChange={getOtherReason} title='其他说明'/>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
</View>
|
|
||||||
</ScrollView>
|
|
||||||
<View className="common_safe_area_y"></View>
|
|
||||||
</View>
|
|
||||||
<View className={styles.btns_con}>
|
|
||||||
<View className={styles.btns_two}>
|
|
||||||
<View className={styles.rest_btn} onClick={() => onSubmit(1)}>取消</View>
|
|
||||||
<View className={styles.verify_btn } onClick={() => onSubmit(2)}>确认</View>
|
|
||||||
</View >
|
|
||||||
</View >
|
|
||||||
<ReasonPopup defaultValue={returnObj[returnGoodsInfo.status]?.id} show={showReason} onClose={closeReason} title={returnGoodsInfo.title} list={returnGoodsInfo.list} onSelect={onReturnSelect}/>
|
|
||||||
</View>
|
|
||||||
)
|
|
||||||
}
|
|
@ -1,253 +0,0 @@
|
|||||||
import { Image, ScrollView, Text, View } from "@tarojs/components";
|
|
||||||
import { FC, memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
||||||
import classnames from "classnames";
|
|
||||||
import styles from './index.module.scss'
|
|
||||||
import ReasonPopup from "./components/reasonPopup";
|
|
||||||
import { useDidShow, useRouter } from "@tarojs/taro";
|
|
||||||
import { GetSaleOrderDetailApi } from "@/api/order";
|
|
||||||
import KindList from "./components/kindList"
|
|
||||||
import { ReturnApplyOrderApi, ReturnExplainApi, ReturnGoodsStatusApi, ReturnReasonApi } from "@/api/salesAfterOrder";
|
|
||||||
import { alert, goLink } from "@/common/common";
|
|
||||||
import UploadImage from "@/components/uploadImage"
|
|
||||||
import TextareaEnhance from "@/components/textareaEnhance";
|
|
||||||
|
|
||||||
enum returnStatus {
|
|
||||||
return_reason = 1, //原因
|
|
||||||
reason_describe = 2, //状况
|
|
||||||
return_explain = 3, //说明
|
|
||||||
|
|
||||||
}
|
|
||||||
export default () => {
|
|
||||||
|
|
||||||
useDidShow(() => {
|
|
||||||
getSaleOrderPreView()
|
|
||||||
})
|
|
||||||
|
|
||||||
const router = useRouter()
|
|
||||||
const orderId = useRef<number>(Number(router.params.id))
|
|
||||||
|
|
||||||
//需要提交的数据
|
|
||||||
const [submitData, setSubmitData] = useState<any>({
|
|
||||||
fabric_piece_accessory_url: [],
|
|
||||||
goods_status: 0,
|
|
||||||
reason_describe: '',
|
|
||||||
return_explain: 0,
|
|
||||||
return_reason: 1,
|
|
||||||
roll: 0,
|
|
||||||
roll_list: [],
|
|
||||||
sale_order_id: orderId.current
|
|
||||||
})
|
|
||||||
|
|
||||||
//获取订单数据
|
|
||||||
const [orderDetail, setOrderDetail] = useState<any>() //获取到的原始数据
|
|
||||||
const {fetchData: getOrderFetchData} = GetSaleOrderDetailApi()
|
|
||||||
const getSaleOrderPreView = async () => {
|
|
||||||
if(orderId.current) {
|
|
||||||
let res = await getOrderFetchData({id: orderId.current})
|
|
||||||
setOrderDetail(res.data)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//监听获取到的数据
|
|
||||||
useEffect(() => {
|
|
||||||
if(orderDetail) {
|
|
||||||
formatData()
|
|
||||||
}
|
|
||||||
}, [orderDetail])
|
|
||||||
|
|
||||||
//格式化数据格式
|
|
||||||
const [formatDetailOrder, setFormatDetailOrder] = useState<any>() //格式化后的数据
|
|
||||||
const formatData = () => {
|
|
||||||
setFormatDetailOrder({
|
|
||||||
sale_mode: orderDetail.sale_mode,
|
|
||||||
sale_mode_name: orderDetail.sale_mode_name,
|
|
||||||
total_colors: orderDetail.total_colors, //总颜色数量
|
|
||||||
total_number: orderDetail.total_number, //总数量
|
|
||||||
total_fabrics: orderDetail.total_fabrics, //面料数量
|
|
||||||
unit: orderDetail.sale_mode == 0?'条':'m', //单位
|
|
||||||
list: orderDetail.product_list,
|
|
||||||
status: orderDetail.status, //订单状态
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//数据总量
|
|
||||||
const dataCount = useMemo(() => {
|
|
||||||
if(formatDetailOrder) {
|
|
||||||
return `${formatDetailOrder.total_fabrics}种面料,${formatDetailOrder.total_colors}种颜色,共${formatDetailOrder.total_number}条`
|
|
||||||
}
|
|
||||||
}, [formatDetailOrder])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//面料数据
|
|
||||||
let roll_list = useRef({})
|
|
||||||
|
|
||||||
//大货时获取计步器数据
|
|
||||||
const getNumChange = useCallback((val) => {
|
|
||||||
if(parseInt(val.number) > 0) {
|
|
||||||
roll_list.current[val.color_id] = {product_color_id: val.color_id, product_roll: val.number}
|
|
||||||
} else {
|
|
||||||
delete roll_list.current[val.color_id]
|
|
||||||
}
|
|
||||||
|
|
||||||
let count = 0
|
|
||||||
Object.values(roll_list.current).map((item: any) => {
|
|
||||||
count += item.product_roll
|
|
||||||
})
|
|
||||||
setSubmitData((e) => ({...e, roll_list:Object.values(roll_list.current), roll: count}))
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
//散剪和剪板
|
|
||||||
const getSelectChange = useCallback((val) => {
|
|
||||||
if(val.status) {
|
|
||||||
roll_list.current[val.color_id] = {product_color_id: val.color_id, product_roll: val.length}
|
|
||||||
} else {
|
|
||||||
delete roll_list.current[val.color_id]
|
|
||||||
}
|
|
||||||
let count = 0
|
|
||||||
Object.values(roll_list.current).map((item: any) => {
|
|
||||||
count += item.product_roll
|
|
||||||
})
|
|
||||||
setSubmitData((e) => ({...e, roll_list:Object.values(roll_list.current), roll: count}))
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
//获取图片列表
|
|
||||||
const getImageList = useCallback((list) => {
|
|
||||||
setSubmitData((e) => ({...e, fabric_piece_accessory_url:list}))
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
//其他说明
|
|
||||||
const getOtherReason = useCallback((val) => {
|
|
||||||
setSubmitData((e) => ({...e, reason_describe: val}))
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
//提交数据
|
|
||||||
const {fetchData: fetchDataReturnApply} = ReturnApplyOrderApi()
|
|
||||||
const onSubmitData = async () => {
|
|
||||||
if(submitData.roll_list.length <= 0) return alert.error('请选择退货颜色')
|
|
||||||
let res = await fetchDataReturnApply(submitData)
|
|
||||||
if(res.success) {
|
|
||||||
alert.success('申请成功')
|
|
||||||
goLink('/pages/salesAfterList/index',{}, 'reLaunch')
|
|
||||||
} else {
|
|
||||||
alert.error('申请失败')
|
|
||||||
}
|
|
||||||
console.log('提交::',submitData)
|
|
||||||
}
|
|
||||||
|
|
||||||
//底部按钮
|
|
||||||
const onSubmit = (val) => {
|
|
||||||
if(val == 2) {
|
|
||||||
onSubmitData()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//退货选择弹窗
|
|
||||||
|
|
||||||
const [showReason, setShowReason] = useState(false)
|
|
||||||
const closeReason = useCallback(() => setShowReason(false), [])
|
|
||||||
const onShowReason = (status) => {
|
|
||||||
if(status == returnStatus.reason_describe) {
|
|
||||||
getReturnReason()
|
|
||||||
} else if (status == returnStatus.return_explain) {
|
|
||||||
getReturnGoodsStatus()
|
|
||||||
} else {
|
|
||||||
getReturnExplain()
|
|
||||||
}
|
|
||||||
setShowReason(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
const [returnGoodsInfo, setReturnGoodsInfo] = useState<{title:string, list: any[], status: 1|2|3}>({title:'', list:[], status: returnStatus.reason_describe})
|
|
||||||
//售后货物状况
|
|
||||||
const {fetchData: fetchDataGoodsStatus} = ReturnGoodsStatusApi()
|
|
||||||
const getReturnGoodsStatus = async () => {
|
|
||||||
let res = await fetchDataGoodsStatus()
|
|
||||||
setReturnGoodsInfo((e) => ({...e, title: '货物状况', list:res.data?.list||[], status:returnStatus.reason_describe}))
|
|
||||||
}
|
|
||||||
//退货原因
|
|
||||||
const {fetchData: fetchDataReturnReason} = ReturnReasonApi()
|
|
||||||
const getReturnReason = async () => {
|
|
||||||
let res = await fetchDataReturnReason()
|
|
||||||
setReturnGoodsInfo((e) => ({...e, title: '退货原因', list:res.data?.list||[], status:returnStatus.return_explain}))
|
|
||||||
}
|
|
||||||
//售后退货说明
|
|
||||||
const {fetchData: fetchDataReturnExplain} = ReturnExplainApi()
|
|
||||||
const getReturnExplain = async () => {
|
|
||||||
let res = await fetchDataReturnExplain()
|
|
||||||
setReturnGoodsInfo((e) => ({...e, title: '退货说明', list:res.data?.list||[], status:returnStatus.return_reason}))
|
|
||||||
}
|
|
||||||
//选择返回的数据
|
|
||||||
const [returnObj, setReturnObj] = useState<{[val:number]:string, id: number}>({})
|
|
||||||
const onReturnSelect = useCallback((val) => {
|
|
||||||
let {id, name} = val
|
|
||||||
if(returnGoodsInfo.status == returnStatus.reason_describe) {
|
|
||||||
setSubmitData((e) => ({...e, reason_describe:id}))
|
|
||||||
setReturnObj(e => ({...e, [returnStatus.reason_describe]:name, id}))
|
|
||||||
}
|
|
||||||
if(returnGoodsInfo.status == returnStatus.return_explain) {
|
|
||||||
setSubmitData((e) => ({...e, return_explain:id}))
|
|
||||||
setReturnObj(e => ({...e, [returnStatus.return_explain]:name, id}))
|
|
||||||
}
|
|
||||||
if(returnGoodsInfo.status == returnStatus.return_reason) {
|
|
||||||
setSubmitData((e) => ({...e, return_reason:id}))
|
|
||||||
setReturnObj(e => ({...e, [returnStatus.return_reason]:name, id}))
|
|
||||||
}
|
|
||||||
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
console.log('returnObj::', returnObj)
|
|
||||||
}, [returnObj])
|
|
||||||
|
|
||||||
return (
|
|
||||||
<View className={styles.apply_after_sales_main}>
|
|
||||||
<View className={styles.apply_after_sales_con}>
|
|
||||||
<View className={styles.kind_number}><Text>{dataCount}</Text></View>
|
|
||||||
<ScrollView scrollY className={styles.scroll}>
|
|
||||||
<View className={styles.scroll_con}>
|
|
||||||
<KindList order={formatDetailOrder} onNumChange={getNumChange} onSelectChange={getSelectChange}/>
|
|
||||||
<View className={styles.returnSaleInput}>
|
|
||||||
<View className={styles.returnSaleInput_item}>
|
|
||||||
<View className={styles.title}>退货原因</View>
|
|
||||||
<View className={styles.select} onClick={() => onShowReason(returnStatus.reason_describe)}>
|
|
||||||
<Text>{returnObj[returnStatus.reason_describe]||'请选择'}</Text>
|
|
||||||
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View className={styles.returnSaleInput_item}>
|
|
||||||
<View className={styles.title}>货物状况</View>
|
|
||||||
<View className={styles.select} onClick={() => onShowReason(returnStatus.return_explain)}>
|
|
||||||
<Text>{returnObj[returnStatus.return_explain]||'请选择'}</Text>
|
|
||||||
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View className={styles.returnSaleInput_item}>
|
|
||||||
<View className={styles.title}>退货说明</View>
|
|
||||||
<View className={styles.select} onClick={() => onShowReason(returnStatus.return_reason)}>
|
|
||||||
<Text>{returnObj[returnStatus.return_reason]||'请选择'}</Text>
|
|
||||||
<Text className={classnames(styles.miconfont, 'iconfont icon-a-moreback')}></Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View className={styles.returnSaleInput_item}>
|
|
||||||
<View className={styles.title}>拍照上传</View>
|
|
||||||
<View className={styles.upload_image}>
|
|
||||||
<UploadImage onChange={getImageList}/>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<TextareaEnhance onChange={getOtherReason} title='其他说明'/>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
</View>
|
|
||||||
</ScrollView>
|
|
||||||
<View className="common_safe_area_y"></View>
|
|
||||||
</View>
|
|
||||||
<View className={styles.btns_con}>
|
|
||||||
<View className={styles.btns_two}>
|
|
||||||
<View className={styles.rest_btn} onClick={() => onSubmit(1)}>取消</View>
|
|
||||||
<View className={styles.verify_btn } onClick={() => onSubmit(2)}>确认</View>
|
|
||||||
</View >
|
|
||||||
</View >
|
|
||||||
<ReasonPopup defaultValue={returnObj.id} show={showReason} onClose={closeReason} title={returnGoodsInfo.title} list={returnGoodsInfo.list} onSelect={onReturnSelect}/>
|
|
||||||
</View>
|
|
||||||
)
|
|
||||||
}
|
|
@ -62,23 +62,17 @@ export default () => {
|
|||||||
const [formatDetailOrder, setFormatDetailOrder] = useState<any>() //格式化后的数据
|
const [formatDetailOrder, setFormatDetailOrder] = useState<any>() //格式化后的数据
|
||||||
const formatData = () => {
|
const formatData = () => {
|
||||||
setFormatDetailOrder({
|
setFormatDetailOrder({
|
||||||
sale_mode: orderDetail.sale_mode,
|
...orderDetail,
|
||||||
sale_mode_name: orderDetail.sale_mode_name,
|
|
||||||
total_colors: orderDetail.total_colors, //总颜色数量
|
|
||||||
total_number: orderDetail.total_number, //总数量
|
|
||||||
total_fabrics: orderDetail.total_fabrics, //面料数量
|
|
||||||
unit: orderDetail.sale_mode == 0?'条':'m', //单位
|
unit: orderDetail.sale_mode == 0?'条':'m', //单位
|
||||||
list: orderDetail.product_list,
|
list: orderDetail.product_list,
|
||||||
status: orderDetail.status, //订单状态
|
|
||||||
av_return_roll: orderDetail.av_return_roll //可退条数
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//数据总量
|
//数据总量
|
||||||
const dataCount = useMemo(() => {
|
const dataCount = useMemo(() => {
|
||||||
if(formatDetailOrder) {
|
if(formatDetailOrder) {
|
||||||
let total_number = formatDetailOrder.sale_mode == 0?formatDetailOrder.total_number + '条':(formatDetailOrder.total_number/100) + '米'
|
let total_number = formatDetailOrder.sale_mode == 0?formatDetailOrder.av_total_number + '条':(formatDetailOrder.av_total_number/100) + '米'
|
||||||
return `${formatDetailOrder.total_fabrics}种面料,${formatDetailOrder.total_colors}种颜色,共${total_number}`
|
return `${formatDetailOrder.av_total_fabrics}种面料,${formatDetailOrder.av_total_colors}种颜色,共${total_number}`
|
||||||
}
|
}
|
||||||
}, [formatDetailOrder])
|
}, [formatDetailOrder])
|
||||||
|
|
||||||
|
@ -11,6 +11,17 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.salesman_name{
|
||||||
|
font-size: 30px;
|
||||||
|
color: #007AFF;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-top: 50px;
|
||||||
|
text{
|
||||||
|
&:nth-child(2) {
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
.inputCode{
|
.inputCode{
|
||||||
width: 670px;
|
width: 670px;
|
||||||
height: 106px;
|
height: 106px;
|
||||||
@ -46,7 +57,7 @@
|
|||||||
width: 670px;
|
width: 670px;
|
||||||
height: 90px;
|
height: 90px;
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
background: linear-gradient(41deg,#007aff, #4fa6ff 86%, #68b4ff 100%);
|
background: linear-gradient(41deg,#007aff, #3a9bfd 86%, #4ba2fa 100%);;
|
||||||
border-radius: 46px;
|
border-radius: 46px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 90px;
|
line-height: 90px;
|
||||||
|
@ -43,7 +43,8 @@ export default () => {
|
|||||||
const onClipboardData = () => {
|
const onClipboardData = () => {
|
||||||
Taro.getClipboardData({
|
Taro.getClipboardData({
|
||||||
success: function (res){
|
success: function (res){
|
||||||
console.log('res.data:::', res.data)
|
let val = res.data.match(/InviteCode:([a-zA-Z0-9]{4})/)
|
||||||
|
setSubmitData((...e) => ({...e, code: val?val[1]:''}))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -62,6 +63,7 @@ export default () => {
|
|||||||
<Text className={classnames('iconfont icon-saomazhifu', styles.miconfont)}></Text>
|
<Text className={classnames('iconfont icon-saomazhifu', styles.miconfont)}></Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
<View className={styles.salesman_name}><Text>邀请人:</Text><Text>李先生(132****6690)</Text></View>
|
||||||
<View className={styles.btns} onClick={onSubmit}>提交</View>
|
<View className={styles.btns} onClick={onSubmit}>提交</View>
|
||||||
<View className={styles.message}>
|
<View className={styles.message}>
|
||||||
<Text>温馨提示</Text>
|
<Text>温馨提示</Text>
|
||||||
|
@ -187,7 +187,7 @@ export default (props:Params) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.main}>
|
<View className={styles.main}>
|
||||||
<DesSwiper list={productInfo.texture_url||[]}/>
|
<DesSwiper list={productInfo.texture_url?productInfo.texture_url.toString().split(','):[]}/>
|
||||||
<View className={styles.product_header}>
|
<View className={styles.product_header}>
|
||||||
<View className={styles.title}>
|
<View className={styles.title}>
|
||||||
{productInfo.code&&<View className={styles.name}>{productName}</View>}
|
{productInfo.code&&<View className={styles.name}>{productName}</View>}
|
||||||
|
@ -12,8 +12,6 @@ import Taro, { Events, useDidShow, usePullDownRefresh } from '@tarojs/taro'
|
|||||||
import { GetProductKindListApi, GetProductListApi } from '@/api/material'
|
import { GetProductKindListApi, GetProductListApi } from '@/api/material'
|
||||||
import useLogin from '@/use/useLogin'
|
import useLogin from '@/use/useLogin'
|
||||||
import { dataLoadingStatus } from '@/common/util'
|
import { dataLoadingStatus } from '@/common/util'
|
||||||
import BindSalesman from '@/components/bindSalesmanPopup'
|
|
||||||
import BindSalesmanPopup from '@/components/bindSalesmanPopup'
|
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
|
|
||||||
@ -107,7 +105,6 @@ export default () => {
|
|||||||
</View>
|
</View>
|
||||||
<View className='common_safe_area_y'></View>
|
<View className='common_safe_area_y'></View>
|
||||||
<ShopCart show={showShopCart} onClose={() => setShowShopCart(false)} />
|
<ShopCart show={showShopCart} onClose={() => setShowShopCart(false)} />
|
||||||
<BindSalesmanPopup show={true}/>
|
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
</MoveBtn>
|
</MoveBtn>
|
||||||
|
@ -150,6 +150,12 @@ import { throttle } from "@/common/util";
|
|||||||
alert.error('请选择地址')
|
alert.error('请选择地址')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
let showModalRes = await Taro.showModal({
|
||||||
|
content: '确定提交订单?',
|
||||||
|
confirmText: '确定',
|
||||||
|
cancelText: '取消',
|
||||||
|
})
|
||||||
|
if(showModalRes.confirm) {
|
||||||
await openSubscriptionMessage({scenes: SubmitOrder.value})
|
await openSubscriptionMessage({scenes: SubmitOrder.value})
|
||||||
const res = await saleOrderFetchData(submitOrderData)
|
const res = await saleOrderFetchData(submitOrderData)
|
||||||
if(res.success) {
|
if(res.success) {
|
||||||
@ -157,6 +163,7 @@ import { throttle } from "@/common/util";
|
|||||||
} else {
|
} else {
|
||||||
alert.none(res.msg)
|
alert.none(res.msg)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}, 600)
|
}, 600)
|
||||||
|
|
||||||
//页面下拉刷新
|
//页面下拉刷新
|
||||||
|
208
src/pages/order/components/kindList/index copy.tsx
Normal file
208
src/pages/order/components/kindList/index copy.tsx
Normal file
@ -0,0 +1,208 @@
|
|||||||
|
import { ORDER_STATUS } from "@/common/enum"
|
||||||
|
import { formatHashTag, formatPriceDiv, formatWeightDiv } from "@/common/fotmat"
|
||||||
|
import EstimatedAmount from "@/components/estimatedAmount"
|
||||||
|
import LabAndImg from "@/components/LabAndImg"
|
||||||
|
import { Text, View } from "@tarojs/components"
|
||||||
|
import { memo, useCallback, useMemo, useState } from "react"
|
||||||
|
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,
|
||||||
|
status: number, //订单状态
|
||||||
|
total_sale_price: number, //合计金额
|
||||||
|
total_weight_error_discount: number, //空差优惠
|
||||||
|
the_previous_status: number, //取消订单时的订单状态
|
||||||
|
actual_amount: number, //实付金额
|
||||||
|
wait_pay_amount: number //待付金额
|
||||||
|
}
|
||||||
|
|
||||||
|
type Param = {
|
||||||
|
order: OrderParam,
|
||||||
|
comfirm?: boolean //是否是确认订单页面使用
|
||||||
|
}
|
||||||
|
|
||||||
|
export default memo(({order, comfirm = false}:Param) => {
|
||||||
|
|
||||||
|
const {
|
||||||
|
SaleOrderStatusBooking, // 待接单
|
||||||
|
SaleOrderStatusArranging, // 配布中
|
||||||
|
SaleOrderStatusArranged, // 已配布
|
||||||
|
SaleOrderStatusWaitingPayment, // 待付款
|
||||||
|
SaleOrderStatusWaitingDelivery, // 待发货
|
||||||
|
SaleOrderStatusWaitingReceipt, // 待收货
|
||||||
|
SaleOrderStatusAlreadyReceipt, // 已收货
|
||||||
|
SaleOrderStatusComplete, // 已完成
|
||||||
|
SaleOrderStatusRefund, // 已退款
|
||||||
|
SaleOrderStatusCancel, // 已取消
|
||||||
|
SaleorderstatusWaitingPrePayment, // 预付款
|
||||||
|
SaleOrderStatusTaking //提货
|
||||||
|
} = ORDER_STATUS
|
||||||
|
|
||||||
|
//注册金额
|
||||||
|
type orderPriceListParams = {id: number, label: string, field: string, message: string, validatarFunc: (val: typeof order) => any}
|
||||||
|
const priceList:orderPriceListParams[] = [
|
||||||
|
{
|
||||||
|
id:1,
|
||||||
|
label:'预估金额',
|
||||||
|
field: 'estimate_amount',
|
||||||
|
message: '预估金额按生产商定义的标准匹重计算,仅供参考。详细交易金额以出单为准!',
|
||||||
|
validatarFunc: (order) => {
|
||||||
|
return order['estimate_amount'] > 0 && order['total_sale_price'] <= 0
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:2,
|
||||||
|
label:'合计金额',
|
||||||
|
field: 'total_sale_price',
|
||||||
|
message: '包含空差的货款金额',
|
||||||
|
validatarFunc: (order) => {
|
||||||
|
return order['total_sale_price'] > 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:3,
|
||||||
|
label:'空差优惠',
|
||||||
|
field: 'total_weight_error_discount',
|
||||||
|
message: '扣除空差金额',
|
||||||
|
validatarFunc: (order) => {
|
||||||
|
return order['total_weight_error_discount'] > 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:5,
|
||||||
|
label:'实付金额',
|
||||||
|
field: 'actual_amount',
|
||||||
|
message: '本单实付总金额',
|
||||||
|
validatarFunc: (order) => {
|
||||||
|
let value = [SaleOrderStatusWaitingPayment.value, SaleOrderStatusTaking.value, SaleOrderStatusWaitingDelivery.value, SaleOrderStatusWaitingReceipt.value, SaleOrderStatusAlreadyReceipt.value, SaleOrderStatusComplete.value, SaleOrderStatusRefund.value]
|
||||||
|
return value.includes(order.status)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:4,
|
||||||
|
label:'待付金额',
|
||||||
|
field: 'wait_pay_amount',
|
||||||
|
message: '扣除空差后的货款金额',
|
||||||
|
validatarFunc: (order) => {
|
||||||
|
let value = [SaleOrderStatusWaitingPayment.value, SaleOrderStatusTaking.value, SaleOrderStatusWaitingDelivery.value, SaleOrderStatusWaitingReceipt.value, SaleOrderStatusAlreadyReceipt.value, SaleOrderStatusComplete.value, SaleOrderStatusRefund.value]
|
||||||
|
return value.includes(order.status)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
//订单流程金额展示
|
||||||
|
const priceConDom = useMemo(() => {
|
||||||
|
if(!order) return
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{
|
||||||
|
priceList.map(item => {
|
||||||
|
return <>{item.validatarFunc(order)&&<EstimatedAmount key={item.id} number={order[item.field]} title={item.label} messageTitle={item.message} />}</>
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
//对应数量
|
||||||
|
const formatCount = useCallback((item) => {
|
||||||
|
return order?.sale_mode == 0? item.roll : Number(item.length / 100)
|
||||||
|
}, [order])
|
||||||
|
//对应单价
|
||||||
|
const standardPrice = useCallback(price => {
|
||||||
|
return formatPriceDiv(price, 100, true) + '/' + (order?.sale_mode == 1?'m':'kg')
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
//数量格式
|
||||||
|
const numText = useMemo(() => {
|
||||||
|
if(order) {
|
||||||
|
let total_number = order?.sale_mode == 0?order?.total_number:(order?.total_number/100)
|
||||||
|
return `${order?.total_fabrics} 种面料,${order?.total_colors} 种颜色,共 ${total_number} ${order?.unit}`
|
||||||
|
}
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
//确认订单金额展示
|
||||||
|
const comfirmPriceConDom = useMemo(() => {
|
||||||
|
if(!order) return
|
||||||
|
let item = order.sale_mode == 1?priceList[1]:priceList[0]
|
||||||
|
return<EstimatedAmount key={item.id} number={order[item.field]} title={item.label} messageTitle={item.message}/>
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
//确认金额展示
|
||||||
|
const showPriceConDom = useMemo(() => {
|
||||||
|
return comfirm?comfirmPriceConDom:priceConDom
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
//颜色金额小计
|
||||||
|
const colorPrice = useCallback((item) => {
|
||||||
|
let res = item.total_sale_price||item.estimate_amount
|
||||||
|
return formatPriceDiv(res, 100, true)
|
||||||
|
},[order])
|
||||||
|
|
||||||
|
|
||||||
|
//散剪大约重量
|
||||||
|
const aboutWeight = useCallback((weight) => {
|
||||||
|
if(order.sale_mode == 2 ) {
|
||||||
|
let showWeight = [SaleorderstatusWaitingPrePayment.value, SaleOrderStatusBooking.value, SaleOrderStatusArranging.value].includes(order.status)
|
||||||
|
return showWeight?<View className={styles.order_list_item_price_dg}>; <Text>≈{formatWeightDiv(weight)}kg</Text></View>:<></>
|
||||||
|
}
|
||||||
|
return <></>
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<View className={styles.orders_list_title}>{numText}</View>
|
||||||
|
<View className={styles.orders_list_con}>
|
||||||
|
{
|
||||||
|
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={{lab:item.lab,rgb:item.rgb,texture_url:item.texture_url}}/>
|
||||||
|
</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}
|
||||||
|
{(colorItem?.return_roll > 0)&&<Text>{`已退${colorItem?.return_roll}条`}</Text>}
|
||||||
|
{(colorItem?.apply_return_roll > 0)&&<Text>{`待退${colorItem?.apply_return_roll}条`}</Text>}
|
||||||
|
</View>
|
||||||
|
<View className={styles.order_list_item_price}>
|
||||||
|
¥{standardPrice(colorItem.sale_price)}
|
||||||
|
{aboutWeight(colorItem.estimate_weight)}
|
||||||
|
</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>{colorPrice(colorItem)}</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
})}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
})
|
||||||
|
}
|
||||||
|
<View className={styles.order_estimated_amount}>
|
||||||
|
{showPriceConDom}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
})
|
@ -54,10 +54,8 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
field: 'estimate_amount',
|
field: 'estimate_amount',
|
||||||
message: '预估金额按生产商定义的标准匹重计算,仅供参考。详细交易金额以出单为准!',
|
message: '预估金额按生产商定义的标准匹重计算,仅供参考。详细交易金额以出单为准!',
|
||||||
validatarFunc: (order) => {
|
validatarFunc: (order) => {
|
||||||
let value = [SaleorderstatusWaitingPrePayment.value, SaleOrderStatusBooking.value, SaleOrderStatusArranging.value]
|
return order['estimate_amount'] > 0 && order['total_sale_price'] <= 0
|
||||||
return value.includes(order.status)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id:2,
|
id:2,
|
||||||
@ -65,8 +63,7 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
field: 'total_sale_price',
|
field: 'total_sale_price',
|
||||||
message: '包含空差的货款金额',
|
message: '包含空差的货款金额',
|
||||||
validatarFunc: (order) => {
|
validatarFunc: (order) => {
|
||||||
let value = [SaleOrderStatusTaking.value, SaleOrderStatusArranged.value, SaleOrderStatusWaitingPayment.value, SaleOrderStatusWaitingDelivery.value, SaleOrderStatusWaitingReceipt.value, SaleOrderStatusAlreadyReceipt.value, SaleOrderStatusComplete.value, SaleOrderStatusRefund.value, SaleOrderStatusCancel.value]
|
return order['total_sale_price'] > 0
|
||||||
return (value.includes(order.status)|| order.sale_mode == 1)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -75,8 +72,7 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
field: 'total_weight_error_discount',
|
field: 'total_weight_error_discount',
|
||||||
message: '扣除空差金额',
|
message: '扣除空差金额',
|
||||||
validatarFunc: (order) => {
|
validatarFunc: (order) => {
|
||||||
let value = [SaleOrderStatusWaitingPayment.value, SaleOrderStatusWaitingDelivery.value, SaleOrderStatusWaitingReceipt.value, SaleOrderStatusAlreadyReceipt.value, SaleOrderStatusComplete.value, SaleOrderStatusRefund.value, SaleOrderStatusCancel.value]
|
return order['total_weight_error_discount'] > 0
|
||||||
return (value.includes(order.status) && order.sale_mode == 0 )
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -85,8 +81,7 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
field: 'actual_amount',
|
field: 'actual_amount',
|
||||||
message: '本单实付总金额',
|
message: '本单实付总金额',
|
||||||
validatarFunc: (order) => {
|
validatarFunc: (order) => {
|
||||||
let value = [SaleOrderStatusWaitingPayment.value, SaleOrderStatusTaking.value, SaleOrderStatusWaitingDelivery.value, SaleOrderStatusWaitingReceipt.value, SaleOrderStatusAlreadyReceipt.value, SaleOrderStatusComplete.value, SaleOrderStatusRefund.value]
|
return order['actual_amount'] > 0
|
||||||
return value.includes(order.status)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -95,8 +90,16 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
field: 'wait_pay_amount',
|
field: 'wait_pay_amount',
|
||||||
message: '扣除空差后的货款金额',
|
message: '扣除空差后的货款金额',
|
||||||
validatarFunc: (order) => {
|
validatarFunc: (order) => {
|
||||||
let value = [SaleOrderStatusWaitingPayment.value, SaleOrderStatusTaking.value, SaleOrderStatusWaitingDelivery.value, SaleOrderStatusWaitingReceipt.value, SaleOrderStatusAlreadyReceipt.value, SaleOrderStatusComplete.value, SaleOrderStatusRefund.value]
|
return order['wait_pay_amount'] > 0 && order['refund_amount'] <= 0
|
||||||
return value.includes(order.status)
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:6,
|
||||||
|
label:'退款金额',
|
||||||
|
field: 'refund_amount',
|
||||||
|
message: '已退款金额',
|
||||||
|
validatarFunc: (order) => {
|
||||||
|
return order['refund_amount'] > 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -109,7 +112,7 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
<>
|
<>
|
||||||
{
|
{
|
||||||
priceList.map(item => {
|
priceList.map(item => {
|
||||||
return <>{item.validatarFunc(order)&&<EstimatedAmount key={item.id} number={order[item.field]/100} title={item.label} messageTitle={item.message} />}</>
|
return <>{item.validatarFunc(order)&&<EstimatedAmount key={item.id} number={order[item.field]} title={item.label} messageTitle={item.message} />}</>
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</>
|
</>
|
||||||
@ -137,7 +140,7 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
const comfirmPriceConDom = useMemo(() => {
|
const comfirmPriceConDom = useMemo(() => {
|
||||||
if(!order) return
|
if(!order) return
|
||||||
let item = order.sale_mode == 1?priceList[1]:priceList[0]
|
let item = order.sale_mode == 1?priceList[1]:priceList[0]
|
||||||
return<EstimatedAmount key={item.id} number={order[item.field]/100} title={item.label} messageTitle={item.message}/>
|
return<EstimatedAmount key={item.id} number={order[item.field]} title={item.label} messageTitle={item.message}/>
|
||||||
}, [order])
|
}, [order])
|
||||||
|
|
||||||
//确认金额展示
|
//确认金额展示
|
||||||
|
@ -151,7 +151,7 @@ export default memo(({show, onClose, onSubmit, id}:Param) => {
|
|||||||
</View>
|
</View>
|
||||||
<View className={styles.color_count_num}>{numText(item)}</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>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
55
src/pages/order/components/scanPayCheck/index.module.scss
Normal file
55
src/pages/order/components/scanPayCheck/index.module.scss
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
$top:170px;
|
||||||
|
.scanPay_main{
|
||||||
|
.scanPay_con{
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #F6F6F6;
|
||||||
|
border-radius: 20px;
|
||||||
|
.miconfont_title{
|
||||||
|
transform: rotate(-180deg);
|
||||||
|
position: absolute;
|
||||||
|
left: 20px;
|
||||||
|
top: 27px;
|
||||||
|
font-size: 37px;
|
||||||
|
color: $color_font_three;
|
||||||
|
z-index: 99;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.title{
|
||||||
|
font-size: $font_size_big;
|
||||||
|
color: #000000;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: 700;
|
||||||
|
position: relative;
|
||||||
|
padding: 10px 0;
|
||||||
|
}
|
||||||
|
.desc{
|
||||||
|
font-size: $font_size_min;
|
||||||
|
color: $color_main;
|
||||||
|
text-align: center;
|
||||||
|
padding: 10px 0;
|
||||||
|
.miconfont{
|
||||||
|
font-size: 25px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.scanPay_list{
|
||||||
|
border-radius: 10px;
|
||||||
|
height: 900px;
|
||||||
|
image{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.btns{
|
||||||
|
background: #007aff;
|
||||||
|
border-radius: 40px;
|
||||||
|
width: 668px;
|
||||||
|
height: 82px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 80px;
|
||||||
|
width: 100%;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 32px;
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
}
|
204
src/pages/order/components/scanPayCheck/index.tsx
Normal file
204
src/pages/order/components/scanPayCheck/index.tsx
Normal file
@ -0,0 +1,204 @@
|
|||||||
|
import { Image, ScrollView, Text, View } from "@tarojs/components";
|
||||||
|
import { memo, useEffect, useRef, useState } from "react";
|
||||||
|
import classnames from "classnames";
|
||||||
|
import styles from './index.module.scss'
|
||||||
|
import Popup from "@/components/popup";
|
||||||
|
import Taro from "@tarojs/taro";
|
||||||
|
import { alert } from "@/common/common";
|
||||||
|
import { formatDateTime, formatHashTag, formatImgUrl, formatPriceDiv, formatWeightDiv } from "@/common/fotmat";
|
||||||
|
import useCheckAuthorize from "@/use/useCheckAuthorize";
|
||||||
|
import { GetPayCode } from "@/api/onlinePay";
|
||||||
|
import LoadingCard from "@/components/loadingCard";
|
||||||
|
import { GetOrderPayApi, GetPrepayOrderPayApi } from "@/api/orderPay";
|
||||||
|
|
||||||
|
|
||||||
|
type Param = {
|
||||||
|
show?: true|false,
|
||||||
|
onClose?: () => void,
|
||||||
|
company?: string,
|
||||||
|
qrcode?: string,
|
||||||
|
orderInfo?: any,
|
||||||
|
|
||||||
|
}
|
||||||
|
type ListParam = {
|
||||||
|
product_code: string,
|
||||||
|
product_name: string,
|
||||||
|
product_color_code: string,
|
||||||
|
product_color_name: string,
|
||||||
|
num: string,
|
||||||
|
weight: string,
|
||||||
|
length: string,
|
||||||
|
sale_price: string,
|
||||||
|
total_price: string
|
||||||
|
}
|
||||||
|
export default memo(({show = true, onClose, company, orderInfo}:Param) => {
|
||||||
|
const [detail, setDetail] = useState<any>()
|
||||||
|
|
||||||
|
//获取支付方式数据
|
||||||
|
const [payInfo, setPayInfo] = useState<any>()
|
||||||
|
const {fetchData: orderFetchData} = GetOrderPayApi()
|
||||||
|
const {fetchData: prepayOrderFetchData} = GetPrepayOrderPayApi()
|
||||||
|
const getOrderPay = async () => {
|
||||||
|
if(orderInfo&&orderInfo.should_collect_order_id) {
|
||||||
|
//有应收单id时用应收单获取数据
|
||||||
|
let {data} = await orderFetchData({id: orderInfo?.should_collect_order_id})
|
||||||
|
setPayInfo(() => data)
|
||||||
|
} else {
|
||||||
|
//用预付单id获取支付信息
|
||||||
|
let {data} = await prepayOrderFetchData({id: orderInfo?.pre_collect_order_id})
|
||||||
|
setPayInfo(() => data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if(orderInfo)
|
||||||
|
getOrderPay()
|
||||||
|
}, [orderInfo])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if(show) {
|
||||||
|
getCore()
|
||||||
|
}
|
||||||
|
}, [show])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if(orderInfo && payInfo) {
|
||||||
|
console.log('orderInfo::',orderInfo)
|
||||||
|
let lists:ListParam[] = []
|
||||||
|
orderInfo.product_list?.map(pitem => {
|
||||||
|
pitem?.product_colors?.map(citem => {
|
||||||
|
lists.push({
|
||||||
|
product_code: formatHashTag(pitem.code, '', 'name')!,
|
||||||
|
product_name: pitem.name,
|
||||||
|
product_color_code: formatHashTag(citem.code)!,
|
||||||
|
product_color_name: citem.name,
|
||||||
|
num: citem.roll.toString(),
|
||||||
|
length: (citem.length/100).toString(),
|
||||||
|
weight: formatWeightDiv(citem.estimate_weight).toString(),
|
||||||
|
sale_price: formatPriceDiv(citem.sale_price).toString(),
|
||||||
|
total_price: formatPriceDiv(citem.total_sale_price||citem.estimate_amount).toString(),
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
setDetail(() => ({
|
||||||
|
title: "面料销售电子确认单",
|
||||||
|
company: orderInfo.company_name, //后端公司
|
||||||
|
order_type: orderInfo.sale_mode_name, //类型:大货
|
||||||
|
sale_user: orderInfo.sale_user_name, //业务员
|
||||||
|
order_created_time: formatDateTime(orderInfo.create_time),
|
||||||
|
order_no: orderInfo.order_no,
|
||||||
|
shipment_mode: orderInfo.shipment_mode_name, //发货方式
|
||||||
|
target_user_name: userName(orderInfo), //收件人
|
||||||
|
target_address: address(orderInfo), //收货地址
|
||||||
|
target_description: orderInfo.remark, //发货备注
|
||||||
|
pay_account: payInfo.offline_remittance_information?.transfer_remittance_account, //专属收款账号
|
||||||
|
bank_account_name: payInfo.offline_remittance_information?.account_name, //账户名称
|
||||||
|
bank_name: payInfo.offline_remittance_information?.bank_of_deposit, //开户银行
|
||||||
|
pay_type:"", //支付方式, 可不传
|
||||||
|
client: orderInfo.purchaser_name, //客户名称
|
||||||
|
phone: userPhone(orderInfo), //收货手机号码
|
||||||
|
order_total_length: (orderInfo.total_number/100).toString(), //订单布匹长度
|
||||||
|
order_total_price: formatPriceDiv(orderInfo.total_sale_price).toString(), //订单价格
|
||||||
|
order_total_num: (orderInfo.total_number) + '',
|
||||||
|
qrcode:"", //跳转链接
|
||||||
|
order_total_weight: formatWeightDiv(orderInfo.total_estimate_weight).toString(), //订单布匹重量
|
||||||
|
list: lists
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
}, [orderInfo, payInfo])
|
||||||
|
|
||||||
|
//收货地址
|
||||||
|
const address = (addressInfo) => {
|
||||||
|
if(addressInfo?.shipment_mode == 2) {
|
||||||
|
return addressInfo?.province_name?addressInfo.province_name + addressInfo.city_name + addressInfo.district_name + addressInfo.address_detail:''
|
||||||
|
} else {
|
||||||
|
return addressInfo?.take_goods_address
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//收件人
|
||||||
|
const userName = (addressInfo) => {
|
||||||
|
return addressInfo?.shipment_mode == 2? orderInfo.target_user_name: ''
|
||||||
|
}
|
||||||
|
|
||||||
|
//手机号
|
||||||
|
const userPhone = (addressInfo) => {
|
||||||
|
return addressInfo?.shipment_mode == 2? orderInfo.target_user_phone : orderInfo.take_goods_phone
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//获取支付二维码
|
||||||
|
const [payCodeImage, setPayCodeImage] = useState<string>('')
|
||||||
|
const fileData = useRef({
|
||||||
|
filePath: '',
|
||||||
|
base64: ''
|
||||||
|
})
|
||||||
|
const {fetchData, state} = GetPayCode()
|
||||||
|
const getCore = async () => {
|
||||||
|
let res = await fetchData(detail)
|
||||||
|
const base64 = res.data.base64
|
||||||
|
setPayCodeImage(() => base64)
|
||||||
|
const time = new Date().valueOf()
|
||||||
|
const [, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(base64) || [];
|
||||||
|
let filePath = Taro.env.USER_DATA_PATH + '/img' + time +'.'+ format
|
||||||
|
fileData.current.filePath = filePath
|
||||||
|
fileData.current.base64 = bodyData
|
||||||
|
const save = Taro.getFileSystemManager()
|
||||||
|
save.writeFile({
|
||||||
|
filePath: fileData.current.filePath,
|
||||||
|
data: fileData.current.base64,
|
||||||
|
encoding: 'base64',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//检查是否开启保存图片权限
|
||||||
|
const {check} = useCheckAuthorize({scope:'scope.writePhotosAlbum', msg:'您没授权,无法保存图片'})
|
||||||
|
const saveImageCheck = async () => {
|
||||||
|
const res = await check()
|
||||||
|
res&&saveImage()
|
||||||
|
}
|
||||||
|
|
||||||
|
//保存图片
|
||||||
|
const saveImage = () => {
|
||||||
|
alert.loading('正在保存图片')
|
||||||
|
Taro.saveImageToPhotosAlbum({
|
||||||
|
filePath: fileData.current.filePath,
|
||||||
|
success: function (res) {
|
||||||
|
alert.success('图片保存成功')
|
||||||
|
},
|
||||||
|
fail: function (err) {
|
||||||
|
console.log('err::', err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//预览图片
|
||||||
|
const showImage = () => {
|
||||||
|
console.log('fileData.current.filePath::', fileData.current.filePath)
|
||||||
|
Taro.previewImage({
|
||||||
|
current: fileData.current.filePath, // 当前显示
|
||||||
|
urls: [fileData.current.filePath] // 需要预览的图片http链接列表
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//复制功能
|
||||||
|
return (
|
||||||
|
<View className={styles.scanPay_main}>
|
||||||
|
<Popup show={show} showTitle={false} onClose={onClose}>
|
||||||
|
<View className={styles.scanPay_con}>
|
||||||
|
<View className={classnames('iconfont icon-a-moreback', styles.miconfont_title)} onClick={onClose}></View>
|
||||||
|
<View className={styles.title}>查看销售码单</View>
|
||||||
|
<View className={styles.scanPay_list}>
|
||||||
|
{(state.loading)&&<LoadingCard/>||
|
||||||
|
<ScrollView scrollY className={styles.scanPay_list}>
|
||||||
|
<Image mode="widthFix" src={payCodeImage} onClick={showImage}></Image>
|
||||||
|
</ScrollView>}
|
||||||
|
</View>
|
||||||
|
<View className={styles.btns} onClick={saveImageCheck}>保存电子确认单</View>
|
||||||
|
</View>
|
||||||
|
</Popup>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
)
|
||||||
|
})
|
@ -24,6 +24,7 @@ import OrderState from "./components/orderState";
|
|||||||
import Payment from "./components/payment";
|
import Payment from "./components/payment";
|
||||||
import Remark from "./components/remark";
|
import Remark from "./components/remark";
|
||||||
import ReturnRecord from "./components/returnRecord";
|
import ReturnRecord from "./components/returnRecord";
|
||||||
|
import ScanPayCheck from "./components/scanPayCheck";
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
@ -76,23 +77,9 @@ import styles from './index.module.scss'
|
|||||||
const [formatDetailOrder, setFormatDetailOrder] = useState<any>() //格式化后的数据
|
const [formatDetailOrder, setFormatDetailOrder] = useState<any>() //格式化后的数据
|
||||||
const formatData = () => {
|
const formatData = () => {
|
||||||
setFormatDetailOrder({
|
setFormatDetailOrder({
|
||||||
estimate_amount: orderDetail.estimate_amount, //预估金额
|
...orderDetail,
|
||||||
sale_mode: orderDetail.sale_mode,
|
|
||||||
sale_mode_name: orderDetail.sale_mode_name,
|
|
||||||
total_colors: orderDetail.total_colors, //总颜色数量
|
|
||||||
total_number: orderDetail.total_number, //总数量
|
|
||||||
total_fabrics: orderDetail.total_fabrics, //面料数量
|
|
||||||
unit: orderDetail.sale_mode == 0?'条':'m', //单位
|
unit: orderDetail.sale_mode == 0?'条':'m', //单位
|
||||||
list: orderDetail.product_list,
|
list: orderDetail.product_list,
|
||||||
status: orderDetail.status, //订单状态
|
|
||||||
total_sale_price: orderDetail.total_sale_price, //销售金额
|
|
||||||
total_should_collect_money: orderDetail.total_should_collect_money, //应收金额
|
|
||||||
total_weight_error_discount: orderDetail.total_weight_error_discount, //空差优惠
|
|
||||||
actual_amount: orderDetail.actual_amount, //实付金额
|
|
||||||
the_previous_status: orderDetail.the_previous_status, //取消订单时的订单状态
|
|
||||||
account_period: orderDetail.account_period,
|
|
||||||
wait_pay_amount: orderDetail.wait_pay_amount //待付金额
|
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const formatPreViewOrderMemo = useMemo(() => {
|
const formatPreViewOrderMemo = useMemo(() => {
|
||||||
@ -195,6 +182,8 @@ import styles from './index.module.scss'
|
|||||||
} else if(val == 9) {
|
} else if(val == 9) {
|
||||||
//售后记录
|
//售后记录
|
||||||
onReturnRecordShow()
|
onReturnRecordShow()
|
||||||
|
} else if(val == 10) {
|
||||||
|
setShowScanPayCheck(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
}, [orderDetail])
|
}, [orderDetail])
|
||||||
@ -239,7 +228,7 @@ import styles from './index.module.scss'
|
|||||||
const getLogistics = useCallback(() => {
|
const getLogistics = useCallback(() => {
|
||||||
if (orderDetail?.delivery_appendix_url) {
|
if (orderDetail?.delivery_appendix_url) {
|
||||||
const list = orderDetail?.delivery_appendix_url?.map(item => {
|
const list = orderDetail?.delivery_appendix_url?.map(item => {
|
||||||
return formatImgUrl(item)
|
return formatImgUrl(item, '!w800')
|
||||||
})
|
})
|
||||||
Taro.previewImage({
|
Taro.previewImage({
|
||||||
current: list[0], // 当前显示
|
current: list[0], // 当前显示
|
||||||
@ -289,6 +278,9 @@ import styles from './index.module.scss'
|
|||||||
setReturnRecordShow(false)
|
setReturnRecordShow(false)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
//显示
|
||||||
|
const [showScanPayCheck, setShowScanPayCheck] = useState(false)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.order_main}>
|
<View className={styles.order_main}>
|
||||||
{(orderDetail?.status != SaleorderstatusWaitingPrePayment.value)&&<OrderState orderInfo={orderDetail}/>||
|
{(orderDetail?.status != SaleorderstatusWaitingPrePayment.value)&&<OrderState orderInfo={orderDetail}/>||
|
||||||
@ -328,6 +320,7 @@ import styles from './index.module.scss'
|
|||||||
<Remark onSave={(e) => getRemark(e)} defaultValue={orderDetail?.remark}/>
|
<Remark onSave={(e) => getRemark(e)} defaultValue={orderDetail?.remark}/>
|
||||||
</Popup>
|
</Popup>
|
||||||
<Payment onSubmitSuccess={onPaySuccess} show={payMentShow} onClose={closePayShow} orderInfo={orderDetail} />
|
<Payment onSubmitSuccess={onPaySuccess} show={payMentShow} onClose={closePayShow} orderInfo={orderDetail} />
|
||||||
|
<ScanPayCheck show={showScanPayCheck} onClose={() => setShowScanPayCheck(false)} orderInfo={orderDetail}/>
|
||||||
<ApplyRefund show={refundShow} onClose={applyRefundClose} orderId={orderDetail?.id}/>
|
<ApplyRefund show={refundShow} onClose={applyRefundClose} orderId={orderDetail?.id}/>
|
||||||
<ShopCart intoStatus="again" show={showCart} onClose={() => setShowCart(false)}/>
|
<ShopCart intoStatus="again" show={showCart} onClose={() => setShowCart(false)}/>
|
||||||
<ReturnRecord show={returnRecordShow} onClose={closeReturnRecord} id={orderDetail?.id}/>
|
<ReturnRecord show={returnRecordShow} onClose={closeReturnRecord} id={orderDetail?.id}/>
|
||||||
|
@ -118,11 +118,11 @@ export default memo(({value, onClickBtn}: Param) => {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
<View className={styles.color_item}>
|
{value?.product_list[0].length > 2 && <View className={styles.color_item}>
|
||||||
<View className={styles.color_more}>……</View>
|
<View className={styles.color_more}>……</View>
|
||||||
<View className={styles.color_more}>……</View>
|
<View className={styles.color_more}>……</View>
|
||||||
<View className={styles.color_more}>……</View>
|
<View className={styles.color_more}>……</View>
|
||||||
</View>
|
</View>}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.color_count_num}>
|
<View className={styles.color_count_num}>
|
||||||
@ -130,7 +130,7 @@ export default memo(({value, onClickBtn}: Param) => {
|
|||||||
<Text className={styles.price}><Text>¥</Text>{value.total_sale_price?formatPriceDiv(value.total_sale_price, 100, true):formatPriceDiv(value.estimate_amount, 100, true)}</Text>
|
<Text className={styles.price}><Text>¥</Text>{value.total_sale_price?formatPriceDiv(value.total_sale_price, 100, true):formatPriceDiv(value.estimate_amount, 100, true)}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<OrderBtns orderInfo={orderInfo} onClick={orderBtnsClick}/>
|
<OrderBtns orderInfo={orderInfo} onClick={orderBtnsClick} showStatus='list'/>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -16,6 +16,7 @@ import { alert } from "@/common/common"
|
|||||||
import { useRouter } from "@tarojs/runtime"
|
import { useRouter } from "@tarojs/runtime"
|
||||||
import ApplyRefund from "../order/components/applyRefund"
|
import ApplyRefund from "../order/components/applyRefund"
|
||||||
import ReturnRecord from "../order/components/returnRecord"
|
import ReturnRecord from "../order/components/returnRecord"
|
||||||
|
import ScanPayCheck from "../order/components/scanPayCheck"
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const {checkLogin} = useLogin()
|
const {checkLogin} = useLogin()
|
||||||
@ -122,6 +123,8 @@ export default () => {
|
|||||||
addShopCart(orderInfo)
|
addShopCart(orderInfo)
|
||||||
} else if (status == 9) {
|
} else if (status == 9) {
|
||||||
onReturnRecordShow()
|
onReturnRecordShow()
|
||||||
|
} else if (status == 10) {
|
||||||
|
setShowScanPayCheck(true)
|
||||||
}
|
}
|
||||||
}, [orderData])
|
}, [orderData])
|
||||||
|
|
||||||
@ -190,6 +193,8 @@ export default () => {
|
|||||||
setReturnRecordShow(false)
|
setReturnRecordShow(false)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
//显示
|
||||||
|
const [showScanPayCheck, setShowScanPayCheck] = useState(false)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.order_list_main}>
|
<View className={styles.order_list_main}>
|
||||||
|
224
src/pages/salesAfter/components/kindList/index copy.tsx
Normal file
224
src/pages/salesAfter/components/kindList/index copy.tsx
Normal file
@ -0,0 +1,224 @@
|
|||||||
|
import { AFTER_ORDER_STATUS, ORDER_STATUS, REFUND_STATUS } from "@/common/enum"
|
||||||
|
import { formatHashTag, formatPriceDiv, formatWeightDiv } from "@/common/fotmat"
|
||||||
|
import EstimatedAmount from "@/components/estimatedAmount"
|
||||||
|
import LabAndImg from "@/components/LabAndImg"
|
||||||
|
import { Text, View } from "@tarojs/components"
|
||||||
|
import { memo, useCallback, useMemo } from "react"
|
||||||
|
import styles from './index.module.scss'
|
||||||
|
|
||||||
|
type OrderParam = {
|
||||||
|
estimate_amount: number, //预估金额
|
||||||
|
list: any[],
|
||||||
|
product_list: any[],
|
||||||
|
quality_check_pass_product: 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退款
|
||||||
|
refund_type: number, //退款状态
|
||||||
|
total_sale_price: number, //销售金额
|
||||||
|
total_should_collect_money: number, //应收金额
|
||||||
|
total_weight_error_discount: number, //空差优惠
|
||||||
|
the_previous_status: number, //取消订单时的订单状态
|
||||||
|
actual_amount: number //实付金额
|
||||||
|
quality_check_pass_colors: number, //验布后的颜色总数
|
||||||
|
quality_check_pass_fabrics: number, //验布后的面料数量
|
||||||
|
quality_check_pass_number: 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) {
|
||||||
|
if(!order?.quality_check_pass_fabrics&&!order?.quality_check_pass_number&&!order?.quality_check_pass_colors) {
|
||||||
|
let total_number = order?.sale_mode == 0?order?.total_number:(order?.total_number/100)
|
||||||
|
return `${order?.total_fabrics}种面料,${order?.total_colors}种颜色,共${total_number}${order?.unit}`
|
||||||
|
} else {
|
||||||
|
let total_number = order?.sale_mode == 0?order?.quality_check_pass_number:(order?.quality_check_pass_number/100)
|
||||||
|
return `${order?.quality_check_pass_fabrics}种面料,${order?.quality_check_pass_colors}种颜色,共${total_number}${order?.unit}`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
//获取面料数组
|
||||||
|
const list = useMemo(() => {
|
||||||
|
return order?.quality_check_pass_product?.length > 0?order?.quality_check_pass_product:order?.product_list
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
//售后单状态枚举
|
||||||
|
const {
|
||||||
|
ReturnStageApplying, // 申请中
|
||||||
|
ReturnStageWaitCheck, // 退货中
|
||||||
|
ReturnStageChecked, // 待验布
|
||||||
|
ReturnStageReturned, // 已退款
|
||||||
|
ReturnStageCancel, // 已取消
|
||||||
|
ReturnStageQualityCheckPendingRefund, // 已验布
|
||||||
|
ReturnStageServiceOrderPendingRefund, // 待退款
|
||||||
|
ReturnStageRejected, // 已拒绝
|
||||||
|
} = AFTER_ORDER_STATUS
|
||||||
|
|
||||||
|
//退款状态枚举
|
||||||
|
const {
|
||||||
|
ShouldCollectOrderRefundTypeUnknown,
|
||||||
|
ShouldCollectOrderRefundTypeAdvanceReceiptRefund,
|
||||||
|
ShouldCollectOrderRefundTypeReturnForRefund,
|
||||||
|
ShouldCollectOrderRefundTypeSalesRefund,
|
||||||
|
} = REFUND_STATUS
|
||||||
|
|
||||||
|
//金额列表枚举
|
||||||
|
const priceList = [
|
||||||
|
{
|
||||||
|
id:5,
|
||||||
|
big_value:[
|
||||||
|
ReturnStageQualityCheckPendingRefund.value,
|
||||||
|
ReturnStageServiceOrderPendingRefund.value,
|
||||||
|
ReturnStageReturned.value,
|
||||||
|
],
|
||||||
|
cut_value: [
|
||||||
|
ReturnStageRejected.value,
|
||||||
|
ReturnStageApplying.value,
|
||||||
|
ReturnStageWaitCheck.value,
|
||||||
|
ReturnStageChecked.value,
|
||||||
|
ReturnStageQualityCheckPendingRefund.value,
|
||||||
|
ReturnStageServiceOrderPendingRefund.value,
|
||||||
|
ReturnStageReturned.value,
|
||||||
|
ReturnStageCancel.value
|
||||||
|
],
|
||||||
|
model_value: [
|
||||||
|
ReturnStageApplying.value,
|
||||||
|
ReturnStageWaitCheck.value,
|
||||||
|
ReturnStageChecked.value,
|
||||||
|
ReturnStageQualityCheckPendingRefund.value,
|
||||||
|
ReturnStageServiceOrderPendingRefund.value,
|
||||||
|
ReturnStageReturned.value,
|
||||||
|
ReturnStageCancel.value
|
||||||
|
],
|
||||||
|
label:'合计金额',
|
||||||
|
field: 'total_refund_amount',
|
||||||
|
message: '按原单价*退货重量的金额',
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:1,
|
||||||
|
big_value:[ReturnStageReturned.value],
|
||||||
|
cut_value: [ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
||||||
|
model_value: [],
|
||||||
|
label:'扣款金额',
|
||||||
|
field: 'other_deduction_amount',
|
||||||
|
message: '本次售后扣款金额'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:3,
|
||||||
|
big_value:[ReturnStageReturned.value],
|
||||||
|
cut_value: [ReturnStageReturned.value],
|
||||||
|
model_value: [ReturnStageReturned.value],
|
||||||
|
label:'退款金额',
|
||||||
|
field: 'refund_amount',
|
||||||
|
message: '本次售后应退款金额'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id:4,
|
||||||
|
big_value:[ReturnStageReturned.value],
|
||||||
|
cut_value: [ReturnStageReturned.value],
|
||||||
|
model_value: [ReturnStageReturned.value],
|
||||||
|
label:'退款去向',
|
||||||
|
field: 'refund_flow_name',
|
||||||
|
message: '本次售后应退款金额'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
//是否显示价格
|
||||||
|
const showPrice = useCallback((priceInfo) => {
|
||||||
|
let key = ['big_value', 'model_value', 'cut_value']
|
||||||
|
if(priceInfo.id == 5) {
|
||||||
|
return priceInfo[key[order?.sale_mode]].includes(order?.stage)||(order.refund_type == ShouldCollectOrderRefundTypeSalesRefund.value)
|
||||||
|
} else {
|
||||||
|
return priceInfo[key[order?.sale_mode]].includes(order?.stage)
|
||||||
|
}
|
||||||
|
}, [order])
|
||||||
|
|
||||||
|
const priceConDom = useMemo(() => {
|
||||||
|
if(!order) return
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{
|
||||||
|
priceList.map(item => {
|
||||||
|
return <>{showPrice(item)&&<EstimatedAmount messageTitle={item.message} key={item.id} number={order[item.field]} numberFormat={item.id == 4?'text': 'number'} 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>
|
||||||
|
{
|
||||||
|
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>}
|
||||||
|
{(order?.stage == ReturnStageReturned.value)&&<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>
|
||||||
|
)
|
||||||
|
})
|
@ -40,10 +40,9 @@
|
|||||||
}
|
}
|
||||||
.order_list_scroll{
|
.order_list_scroll{
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
|
|
||||||
.order_list_item {
|
.order_list_item {
|
||||||
display: flex;
|
display: flex;
|
||||||
&:nth-child(2) {
|
&:nth-child(n + 2) {
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
}
|
}
|
||||||
.order_list_item_img{
|
.order_list_item_img{
|
||||||
@ -82,7 +81,6 @@
|
|||||||
.order_list_item_count{
|
.order_list_item_count{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
.count_num{
|
.count_num{
|
||||||
color: $color_main;
|
color: $color_main;
|
||||||
|
@ -59,7 +59,7 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
|
|
||||||
//获取面料数组
|
//获取面料数组
|
||||||
const list = useMemo(() => {
|
const list = useMemo(() => {
|
||||||
return order?.quality_check_pass_product.length > 0?order?.quality_check_pass_product:order?.product_list
|
return order?.quality_check_pass_product?.length > 0?order?.quality_check_pass_product:order?.product_list
|
||||||
}, [order])
|
}, [order])
|
||||||
|
|
||||||
//售后单状态枚举
|
//售后单状态枚举
|
||||||
@ -75,82 +75,49 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
} = AFTER_ORDER_STATUS
|
} = AFTER_ORDER_STATUS
|
||||||
|
|
||||||
//退款状态枚举
|
//退款状态枚举
|
||||||
const {
|
// const {
|
||||||
ShouldCollectOrderRefundTypeUnknown,
|
// ShouldCollectOrderRefundTypeUnknown,
|
||||||
ShouldCollectOrderRefundTypeAdvanceReceiptRefund,
|
// ShouldCollectOrderRefundTypeAdvanceReceiptRefund,
|
||||||
ShouldCollectOrderRefundTypeReturnForRefund,
|
// ShouldCollectOrderRefundTypeReturnForRefund,
|
||||||
ShouldCollectOrderRefundTypeSalesRefund,
|
// ShouldCollectOrderRefundTypeSalesRefund,
|
||||||
} = REFUND_STATUS
|
// } = REFUND_STATUS
|
||||||
|
|
||||||
//金额列表枚举
|
//金额列表枚举
|
||||||
const priceList = [
|
const priceList = [
|
||||||
{
|
{
|
||||||
id:5,
|
id:5,
|
||||||
big_value:[
|
value: [ReturnStageReturned.value],
|
||||||
ReturnStageQualityCheckPendingRefund.value,
|
|
||||||
ReturnStageServiceOrderPendingRefund.value,
|
|
||||||
ReturnStageReturned.value,
|
|
||||||
],
|
|
||||||
cut_value: [ReturnStageRejected.value,
|
|
||||||
ReturnStageApplying.value,
|
|
||||||
ReturnStageWaitCheck.value,
|
|
||||||
ReturnStageChecked.value,
|
|
||||||
ReturnStageQualityCheckPendingRefund.value,
|
|
||||||
ReturnStageServiceOrderPendingRefund.value,
|
|
||||||
ReturnStageReturned.value,
|
|
||||||
ReturnStageCancel.value
|
|
||||||
],
|
|
||||||
model_value: [
|
|
||||||
ReturnStageApplying.value,
|
|
||||||
ReturnStageWaitCheck.value,
|
|
||||||
ReturnStageChecked.value,
|
|
||||||
ReturnStageQualityCheckPendingRefund.value,
|
|
||||||
ReturnStageServiceOrderPendingRefund.value,
|
|
||||||
ReturnStageReturned.value,
|
|
||||||
ReturnStageCancel.value
|
|
||||||
],
|
|
||||||
label:'合计金额',
|
label:'合计金额',
|
||||||
field: 'total_refund_amount',
|
field: 'total_refund_amount',
|
||||||
message: '按原单价*退货重量的金额'
|
message: '按原单价*退货重量的金额',
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id:1,
|
id:1,
|
||||||
big_value:[ReturnStageReturned.value],
|
value: [ReturnStageReturned.value],
|
||||||
cut_value: [ReturnStageServiceOrderPendingRefund.value, ReturnStageReturned.value],
|
|
||||||
model_value: [],
|
|
||||||
label:'扣款金额',
|
label:'扣款金额',
|
||||||
field: 'other_deduction_amount',
|
field: 'other_deduction_amount',
|
||||||
message: '本次售后扣款金额'
|
message: '本次售后扣款金额'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id:3,
|
id:3,
|
||||||
big_value:[ReturnStageReturned.value],
|
value: [ReturnStageReturned.value],
|
||||||
cut_value: [ReturnStageReturned.value],
|
|
||||||
model_value: [ReturnStageReturned.value],
|
|
||||||
label:'退款金额',
|
label:'退款金额',
|
||||||
field: 'refund_amount',
|
field: 'refund_amount',
|
||||||
message: '本次售后应退款金额'
|
message: '本次售后应退款金额'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id:4,
|
id:4,
|
||||||
big_value:[ReturnStageReturned.value],
|
value: [ReturnStageReturned.value],
|
||||||
cut_value: [ReturnStageReturned.value],
|
|
||||||
model_value: [ReturnStageReturned.value],
|
|
||||||
label:'退款去向',
|
label:'退款去向',
|
||||||
field: 'refund_flow_name',
|
field: 'refund_flow_name',
|
||||||
message: '本次售后应退款金额'
|
message: '本次售后退款金额去向'
|
||||||
},
|
},
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
//是否显示价格
|
//是否显示价格
|
||||||
const showPrice = useCallback((priceInfo) => {
|
const showPrice = useCallback((priceInfo) => {
|
||||||
let key = ['big_value', 'model_value', 'cut_value']
|
return priceInfo.value.includes(order?.stage)
|
||||||
if(priceInfo.id == 5) {
|
|
||||||
return priceInfo[key[order?.sale_mode]].includes(order?.stage)||(order.refund_type == ShouldCollectOrderRefundTypeSalesRefund.value)
|
|
||||||
} else {
|
|
||||||
return priceInfo[key[order?.sale_mode]].includes(order?.stage)
|
|
||||||
}
|
|
||||||
}, [order])
|
}, [order])
|
||||||
|
|
||||||
const priceConDom = useMemo(() => {
|
const priceConDom = useMemo(() => {
|
||||||
@ -159,7 +126,7 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
<>
|
<>
|
||||||
{
|
{
|
||||||
priceList.map(item => {
|
priceList.map(item => {
|
||||||
return <>{showPrice(item)&&<EstimatedAmount messageTitle={item.message} key={item.id} number={order[item.field]} title={item.label} />}</>
|
return <>{showPrice(item)&&<EstimatedAmount messageTitle={item.message} key={item.id} number={order[item.field]} numberFormat={item.id == 4?'text': 'number'} title={item.label} />}</>
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</>
|
</>
|
||||||
@ -176,6 +143,11 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
return order?.stage != ReturnStageServiceOrderPendingRefund.value && order?.stage != ReturnStageQualityCheckPendingRefund.value
|
return order?.stage != ReturnStageServiceOrderPendingRefund.value && order?.stage != ReturnStageQualityCheckPendingRefund.value
|
||||||
}, [order])
|
}, [order])
|
||||||
|
|
||||||
|
//销售价格
|
||||||
|
const formatPrice = useCallback((colorItem) => {
|
||||||
|
return (ReturnStageReturned.value == order?.stage) && <View className={styles.count_price}><text>¥</text>{formatPriceDiv(colorItem.estimate_amount, {} , true)}</View>
|
||||||
|
}, [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}>
|
||||||
@ -204,7 +176,7 @@ export default memo(({order, comfirm = false}:Param) => {
|
|||||||
</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>
|
||||||
<View className={styles.count_price}><text>¥</text>{formatPriceDiv(colorItem.estimate_amount).toLocaleString()}</View>
|
{formatPrice(colorItem)}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
@ -153,6 +153,11 @@ export default () => {
|
|||||||
setSearchField((e) => ({...e, abstract_sort_key: value}))
|
setSearchField((e) => ({...e, abstract_sort_key: value}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const labAndImgObj = useCallback((item) => {
|
||||||
|
const img = item?item.texture_url.split(',')[0]:''
|
||||||
|
return {lab:item.lab,rgb:item.rgb,texture_url:img}
|
||||||
|
}, [materialList])
|
||||||
return (
|
return (
|
||||||
<View className={styles.main}>
|
<View className={styles.main}>
|
||||||
<View className={styles.search}>
|
<View className={styles.search}>
|
||||||
@ -202,7 +207,7 @@ export default () => {
|
|||||||
{materialList.list.map(item => {
|
{materialList.list.map(item => {
|
||||||
return <View key={item.id} className={styles.product_item} onClick={() => goLinkPage(item)}>
|
return <View key={item.id} className={styles.product_item} onClick={() => goLinkPage(item)}>
|
||||||
<View className={styles.product_img}>
|
<View className={styles.product_img}>
|
||||||
<LabAndImg value={{lab:item.lab,rgb:item.rgb,texture_url:item.texture_url}}/>
|
<LabAndImg value={labAndImgObj(item)}/>
|
||||||
<View className={styles.color_num}>{(item.product_color_code)}</View>
|
<View className={styles.color_num}>{(item.product_color_code)}</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.product_info}>
|
<View className={styles.product_info}>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
export default {
|
export default {
|
||||||
navigationBarTitleText: '高级搜索',
|
navigationBarTitleText: '搜索',
|
||||||
enablePullDownRefresh: true,
|
enablePullDownRefresh: true,
|
||||||
backgroundTextStyle: 'dark'
|
backgroundTextStyle: 'dark'
|
||||||
}
|
}
|
||||||
|
@ -136,6 +136,11 @@ export default () => {
|
|||||||
setSearchField((e) => ({...e, abstract_sort_key: value}))
|
setSearchField((e) => ({...e, abstract_sort_key: value}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const labAndImgObj = useCallback((item) => {
|
||||||
|
const img = item?item.texture_url.split(',')[0]:''
|
||||||
|
return {lab:item.lab,rgb:item.rgb,texture_url:img}
|
||||||
|
}, [materialList])
|
||||||
return (
|
return (
|
||||||
<View className={styles.main}>
|
<View className={styles.main}>
|
||||||
<View className={styles.search}>
|
<View className={styles.search}>
|
||||||
@ -179,7 +184,7 @@ export default () => {
|
|||||||
{materialList.list.map(item => {
|
{materialList.list.map(item => {
|
||||||
return <View key={item.id} className={styles.product_item} onClick={() => goLinkPage(item)}>
|
return <View key={item.id} className={styles.product_item} onClick={() => goLinkPage(item)}>
|
||||||
<View className={styles.product_img}>
|
<View className={styles.product_img}>
|
||||||
<LabAndImg value={{lab:item.lab,rgb:item.rgb,texture_url:item.texture_url}}/>
|
<LabAndImg value={labAndImgObj(item)}/>
|
||||||
<View className={styles.color_num}>{(item.product_color_count)}色</View>
|
<View className={styles.color_num}>{(item.product_color_count)}色</View>
|
||||||
</View>
|
</View>
|
||||||
<View className={styles.product_info}>
|
<View className={styles.product_info}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user