From 6c4c7810bdc7cadb6cb5e7dc29019c1005dde7db Mon Sep 17 00:00:00 2001 From: Haiyi <1021441632@qq.com> Date: Wed, 28 Dec 2022 17:03:33 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(=E7=A0=81=E5=8D=95):?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A0=81=E5=8D=95qrcode=E7=9A=84key=E5=80=BC?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/order/index.tsx | 5 ++++- src/pages/orderDetails/index.tsx | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pages/order/index.tsx b/src/pages/order/index.tsx index e2cb4f5..5ba9042 100644 --- a/src/pages/order/index.tsx +++ b/src/pages/order/index.tsx @@ -418,7 +418,7 @@ const Order = () => { itemObj.total_weight_error_discount / 100 ).toString(), order_total_num: itemObj.total_number.toString(), - qrcode: `${PAY_H5_CODE_URL}?sale_order_no=${itemObj.order_no}`, + qrcode: `${PAY_H5_CODE_URL}?key=${md5Key}`, order_total_weight: (itemObj.total_weight / 1000).toString(), estimate_amount: (itemObj.estimate_amount / 100).toString(), total_sale_price: (itemObj.total_sale_price / 100).toString(), @@ -464,6 +464,7 @@ const Order = () => { setItemObj(item) if (item.status !== 10) { const res = await infoOneFetch({ id: item.should_collect_order_id }) + setmd5Key(res.data.md5_key) payList.map((item) => { if (item.id === 3) { item.name = `${res.data.account_period}天账期` @@ -500,6 +501,7 @@ const Order = () => { } else { const res = await infoTwoFetch({ id: item.pre_collect_order_id }) + setmd5Key(res.data.md5_key) const arr: any = [] arr.push( { @@ -545,6 +547,7 @@ const Order = () => { setTitle('待支付款项') setShowPay(true) } + const [md5Key, setmd5Key] = useState('') // 确认交易 const { fetchData: payOneFetch } = OrderPaymentOrderPaymentSubmission() const { fetchData: payTwoFetch } = OrderPaymentPreCollectOrderOrderPaymentSubmission() diff --git a/src/pages/orderDetails/index.tsx b/src/pages/orderDetails/index.tsx index ee8c378..831e0f8 100644 --- a/src/pages/orderDetails/index.tsx +++ b/src/pages/orderDetails/index.tsx @@ -392,6 +392,7 @@ const OrderDetails = () => { if (item.status !== 10) { const res = await infoOneFetch({ id: item.should_collect_order_id }) + setmd5Key(res.data.md5_key) payList.map((item) => { if (item.id === 3) { item.name = `${res.data.account_period}天账期` @@ -428,6 +429,7 @@ const OrderDetails = () => { } else { const res = await infoTwoFetch({ id: item.pre_collect_order_id }) + setmd5Key(res.data.md5_key) const arr: any = [] arr.push( { @@ -480,6 +482,9 @@ const OrderDetails = () => { usePullDownRefresh(() => { getDetail() }) + + const [md5Key, setmd5Key] = useState('') + const { fetchData: payFetch } = GetPayCode() const handScanpay = async() => { const list: any = [] @@ -530,7 +535,7 @@ const OrderDetails = () => { infoObj.total_weight_error_discount / 100 ).toString(), order_total_num: infoObj.total_number.toString(), - qrcode: `${PAY_H5_CODE_URL}?sale_order_no=${infoObj.order_no}`, + qrcode: `${PAY_H5_CODE_URL}?key=${md5Key}`, order_total_weight: (infoObj.total_weight / 1000).toString(), estimate_amount: (infoObj.estimate_amount / 100).toString(), total_sale_price: (infoObj.total_sale_price / 100).toString(),