diff --git a/src/api/onlinePay.ts b/src/api/onlinePay.ts index b2df324..6886495 100644 --- a/src/api/onlinePay.ts +++ b/src/api/onlinePay.ts @@ -2,7 +2,7 @@ import { CAP_HTML_TO_IMAGE_BASE_URL } from '@/common/constant' import { useRequest } from '@/use/useHttp' /** - * 获取在线支付二维码 + * 线上获取在线支付二维码 */ export const GetPayCode = () => { return useRequest({ @@ -12,6 +12,15 @@ export const GetPayCode = () => { }) } +//本地获取二维码 +// export const GetPayCode = () => { +// return useRequest({ +// url: `/caphtml`, +// base_url: CAP_HTML_TO_IMAGE_BASE_URL, +// method: 'post', +// }) +// } + /** * 获取退款码单 */ @@ -22,3 +31,12 @@ export const GetReturnPayCode = () => { method: 'post', }) } + +// 本地获取退款码单 +// export const GetReturnPayCode = () => { +// return useRequest({ +// url: `/caphtml-return`, +// base_url: CAP_HTML_TO_IMAGE_BASE_URL, +// method: 'post', +// }) +// } diff --git a/src/common/constant.js b/src/common/constant.js index 415802b..9980dbf 100644 --- a/src/common/constant.js +++ b/src/common/constant.js @@ -1,4 +1,4 @@ -// export const BASE_URL = CURRENT_BASE_URL +export const BASE_URL = CURRENT_BASE_URL // export const BASE_URL = `http://192.168.0.75:50001/lymarket` // export const BASE_URL = `http://192.168.0.89:50001/lymarket` // export const BASE_URL = `http://10.0.0.5:50001/lymarket` @@ -14,7 +14,7 @@ // 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.22:50002/lymarket` // 婷 -export const BASE_URL = `http://192.168.1.42:50002/lymarket` // 杰 +// export const BASE_URL = `http://192.168.1.42:50002/lymarket` // 杰 // CDN // 生成密钥 @@ -27,6 +27,7 @@ export const IMG_CND_Prefix = CURRENT_ENV.includes('production') ? 'https://cdn. //在线支付图片baseUrl export const CAP_HTML_TO_IMAGE_BASE_URL = CURRENT_ENV.includes('production') ? 'https://www.zzfzyc.com' : 'https://test.zzfzyc.com' +// export const CAP_HTML_TO_IMAGE_BASE_URL = CURRENT_ENV.includes('production') ? 'https://www.zzfzyc.com' : 'http://192.168.1.127:8082' // 上传图片视频 export const CDN_UPLOAD_IMG = `${UPLOAD_CDN_URL || ''}` diff --git a/src/pages/order/components/scanPay/index.tsx b/src/pages/order/components/scanPay/index.tsx index b7d841e..d8638f2 100644 --- a/src/pages/order/components/scanPay/index.tsx +++ b/src/pages/order/components/scanPay/index.tsx @@ -29,6 +29,8 @@ type ListParam = { sale_price: string total_price: string weight_error: string + show_sale_price: boolean + show_total_price: boolean } export default memo(({ show = true, onClose, company, orderInfo }: Param) => { const [detail, setDetail] = useState() @@ -47,7 +49,9 @@ export default memo(({ show = true, onClose, company, orderInfo }: Param) => { length: (citem.length / 100).toString(), weight: formatWeightDiv(citem.actual_weight || citem.estimate_weight).toString(), sale_price: formatPriceDiv(citem.sale_price).toString(), + show_sale_price: orderInfo.is_display_price, total_price: formatPriceDiv(citem.total_sale_price || citem.estimate_amount).toString(), //小计 + show_total_price: orderInfo.is_display_price, weight_error: formatWeightDiv(citem.weight_error).toString(), }) }) @@ -71,21 +75,22 @@ export default memo(({ show = true, onClose, company, orderInfo }: Param) => { phone: userPhone(orderInfo), //收货手机号码 order_total_length: (orderInfo.total_number / 100).toString(), //订单布匹长度 order_total_price: formatPriceDiv(orderInfo.bill_total_sale_price).toString(), //订单价格 + show_order_total_price: orderInfo.is_display_price, order_total_num: orderInfo.total_number + '', qrcode: `${PAY_H5_CODE_URL}?sale_order_no=${orderInfo.order_no}`, //跳转链接 order_total_weight: formatWeightDiv(orderInfo.total_weight || orderInfo.total_estimate_weight).toString(), //订单布匹重量 list: lists, show_qrcode: true, //是否显示码单 estimate_amount: formatPriceDiv(orderInfo.estimate_amount).toString(), - show_estimate_amount: orderInfo.estimate_amount > 0 && orderInfo.total_sale_price <= 0, + show_estimate_amount: orderInfo.estimate_amount > 0 && orderInfo.total_sale_price <= 0 && orderInfo.is_display_price, total_sale_price: formatPriceDiv(orderInfo.total_sale_price).toString(), - show_total_sale_price: orderInfo.total_sale_price > 0, + show_total_sale_price: orderInfo.total_sale_price > 0 && orderInfo.is_display_price, total_weight_error_discount: formatPriceDiv(orderInfo.total_weight_error_discount).toString(), - show_total_weight_error_discount: orderInfo.total_weight_error_discount > 0, + show_total_weight_error_discount: orderInfo.total_weight_error_discount > 0 && orderInfo.is_display_price, actual_amount: formatPriceDiv(orderInfo.actual_amount).toString(), - show_actual_amount: orderInfo.actual_amount > 0, + show_actual_amount: orderInfo.actual_amount > 0 && orderInfo.is_display_price, wait_pay_amount: formatPriceDiv(orderInfo.wait_pay_amount).toString(), - show_wait_pay_amount: orderInfo.wait_pay_amount > 0, + show_wait_pay_amount: orderInfo.wait_pay_amount > 0 && orderInfo.is_display_price, show_barcode: true, order_total_weight_error: formatWeightDiv(orderInfo.total_weight_error).toString(), //总空差重量 })) diff --git a/src/pages/order/components/scanPayCheck/index.tsx b/src/pages/order/components/scanPayCheck/index.tsx index 35b4835..7f2b960 100644 --- a/src/pages/order/components/scanPayCheck/index.tsx +++ b/src/pages/order/components/scanPayCheck/index.tsx @@ -28,6 +28,8 @@ type ListParam = { sale_price: string total_price: string weight_error: string + show_sale_price: boolean + show_total_price: boolean } export default memo(({ show = true, onClose, company, orderInfo }: Param) => { const [detail, setDetail] = useState() @@ -52,7 +54,9 @@ export default memo(({ show = true, onClose, company, orderInfo }: Param) => { length: (citem.length / 100).toString(), weight: formatWeightDiv(citem.actual_weight || citem.estimate_weight).toString(), sale_price: formatPriceDiv(citem.sale_price).toString(), + show_sale_price: orderInfo.is_display_price, total_price: formatPriceDiv(citem.total_sale_price || citem.estimate_amount).toString(), //小计 + show_total_price: orderInfo.is_display_price, weight_error: formatWeightDiv(citem.weight_error).toString(), }) }) @@ -82,15 +86,15 @@ export default memo(({ show = true, onClose, company, orderInfo }: Param) => { list: lists, estimate_amount: formatPriceDiv(orderInfo.estimate_amount).toString(), - show_estimate_amount: orderInfo.estimate_amount > 0 && orderInfo.total_sale_price <= 0, + show_estimate_amount: orderInfo.estimate_amount > 0 && orderInfo.total_sale_price <= 0 && orderInfo.is_display_price, total_sale_price: formatPriceDiv(orderInfo.total_sale_price).toString(), - show_total_sale_price: orderInfo.total_sale_price > 0, + show_total_sale_price: orderInfo.total_sale_price > 0 && orderInfo.is_display_price, total_weight_error_discount: formatPriceDiv(orderInfo.total_weight_error_discount).toString(), - show_total_weight_error_discount: orderInfo.total_weight_error_discount > 0, + show_total_weight_error_discount: orderInfo.total_weight_error_discount > 0 && orderInfo.is_display_price, actual_amount: formatPriceDiv(orderInfo.actual_amount).toString(), - show_actual_amount: orderInfo.actual_amount > 0, + show_actual_amount: orderInfo.actual_amount > 0 && orderInfo.is_display_price, wait_pay_amount: formatPriceDiv(orderInfo.wait_pay_amount).toString(), - show_wait_pay_amount: orderInfo.wait_pay_amount > 0, + show_wait_pay_amount: orderInfo.wait_pay_amount > 0 && orderInfo.is_display_price, show_barcode: true, order_total_weight_error: formatWeightDiv(orderInfo.total_weight_error).toString(), //总空差重量 })) diff --git a/src/pages/salesAfter/components/returnPayCheck/index.tsx b/src/pages/salesAfter/components/returnPayCheck/index.tsx index eccffe1..6ad4e41 100644 --- a/src/pages/salesAfter/components/returnPayCheck/index.tsx +++ b/src/pages/salesAfter/components/returnPayCheck/index.tsx @@ -31,6 +31,9 @@ type ListParam = { deduction_weight: string settle_weight: string deduction_amount: string + show_sale_price: boolean + show_total_price: boolean + show_deduction_amount: boolean } export default memo(({ show = true, onClose, orderInfo }: Param) => { const [detail, setDetail] = useState() @@ -56,11 +59,14 @@ export default memo(({ show = true, onClose, orderInfo }: Param) => { length: (citem.length / 100).toString(), weight: formatWeightDiv(citem.label_weight).toString(), sale_price: formatPriceDiv(citem.sale_price).toString(), + show_sale_price: orderInfo.is_display_price, total_price: formatPriceDiv(citem.refund_amount).toString(), //小计 + show_total_price: orderInfo.is_display_price, weight_error: formatWeightDiv(citem.settle_weight_error).toString(), deduction_weight: formatWeightDiv(citem.deductions_weight).toString(), settle_weight: formatWeightDiv(citem.settle_weight).toString(), deduction_amount: formatPriceDiv(citem.deductions_amount).toString(), + show_deduction_amount: orderInfo.is_display_price, }) }) }) @@ -75,10 +81,12 @@ export default memo(({ show = true, onClose, orderInfo }: Param) => { bank_name: orderInfo.bank_of_deposit, order_total_length: (orderInfo.total_number / 100).toString(), order_total_price: formatPriceDiv(orderInfo.refund_amount).toString(), + show_order_total_price: orderInfo.is_display_price, order_total_num: orderInfo.total_number.toString(), order_total_settle_weight: formatWeightDiv(orderInfo.order_total_settle_weight).toString(), order_total_deduction_weight: formatWeightDiv(orderInfo.order_total_deduction_weight).toString(), order_total_deduction_amount: formatPriceDiv(orderInfo.order_total_deduction_amount).toString(), + show_order_total_deduction_amount: orderInfo.is_display_price, order_total_weight_error: formatWeightDiv(orderInfo.total_weight_error).toString(), list: lists, }))