商城测试版v7
This commit is contained in:
@@ -5,7 +5,7 @@ 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 { formatDateTime, formatHashTag, formatImgUrl, formatPriceDiv, formatRemoveHashTag, formatWeightDiv } from "@/common/fotmat";
|
||||
import useCheckAuthorize from "@/use/useCheckAuthorize";
|
||||
import { GetPayCode } from "@/api/onlinePay";
|
||||
import LoadingCard from "@/components/loadingCard";
|
||||
@@ -33,28 +33,6 @@ type ListParam = {
|
||||
}
|
||||
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 if(orderInfo&&orderInfo.pre_collect_order_id) {
|
||||
//用预付单id获取支付信息
|
||||
let {data} = await prepayOrderFetchData({id: orderInfo?.pre_collect_order_id})
|
||||
setPayInfo(() => data)
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if(orderInfo)
|
||||
getOrderPay()
|
||||
}, [orderInfo])
|
||||
|
||||
useEffect(() => {
|
||||
if(show) {
|
||||
@@ -63,14 +41,14 @@ export default memo(({show = true, onClose, company, orderInfo}:Param) => {
|
||||
}, [show])
|
||||
|
||||
useEffect(() => {
|
||||
if(orderInfo && payInfo) {
|
||||
if(orderInfo) {
|
||||
let lists:ListParam[] = []
|
||||
orderInfo.product_list?.map(pitem => {
|
||||
pitem?.product_colors?.map(citem => {
|
||||
lists.push({
|
||||
product_code: formatHashTag(pitem.code, '', 'name')!,
|
||||
product_code: formatRemoveHashTag(pitem.code),
|
||||
product_name: pitem.name,
|
||||
product_color_code: formatHashTag(citem.code)!,
|
||||
product_color_code: formatRemoveHashTag(citem.code),
|
||||
product_color_name: citem.name,
|
||||
num: citem.roll.toString(),
|
||||
length: (citem.length/100).toString(),
|
||||
@@ -91,21 +69,21 @@ export default memo(({show = true, onClose, company, orderInfo}:Param) => {
|
||||
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_account: orderInfo.account, //专属收款账号
|
||||
bank_account_name: orderInfo.account_name, //账户名称
|
||||
bank_name: orderInfo.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) + '',
|
||||
order_total_num: (orderInfo.total_number).toString(),
|
||||
qrcode:"", //跳转链接
|
||||
order_total_weight: formatWeightDiv(orderInfo.total_estimate_weight).toString(), //订单布匹重量
|
||||
list: lists
|
||||
}))
|
||||
}
|
||||
}, [orderInfo, payInfo])
|
||||
}, [orderInfo])
|
||||
|
||||
//收货地址
|
||||
const address = (addressInfo) => {
|
||||
@@ -199,6 +177,5 @@ export default memo(({show = true, onClose, company, orderInfo}:Param) => {
|
||||
</View>
|
||||
</Popup>
|
||||
</View>
|
||||
|
||||
)
|
||||
})
|
||||
Reference in New Issue
Block a user