浏览代码

update download btn

master
Alex Cheung 1年前
父节点
当前提交
9c2b2bc6e5
共有 2 个文件被更改,包括 18 次插入1 次删除
  1. +9
    -1
      src/pages/Payment/FPS/AckPage.js
  2. +9
    -0
      src/pages/Payment/PaymentCallback.js

+ 9
- 1
src/pages/Payment/FPS/AckPage.js 查看文件

@@ -51,7 +51,7 @@ const AckPage = () => {
// const [transactionTime, setTransactionTime] = React.useState(""); // const [transactionTime, setTransactionTime] = React.useState("");
const [onReady, setOnReady] = React.useState(false); const [onReady, setOnReady] = React.useState(false);
const paymentStatusApi = "/api/payment/status/"; const paymentStatusApi = "/api/payment/status/";
const [onDownload, setOnDownload] = React.useState(false);


React.useEffect(() => { React.useEffect(() => {
loadForm(); loadForm();
@@ -142,8 +142,15 @@ const AckPage = () => {


const doPrint = () => { const doPrint = () => {
// window.print(); // window.print();
setOnDownload(true)
HttpUtils.fileDownload({ HttpUtils.fileDownload({
url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+localStorage.getItem("paymentId"), url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+localStorage.getItem("paymentId"),
onResponse:()=>{
setOnDownload(false)
},
onError:()=>{
setOnDownload(false)
}
}); });
}; };


@@ -182,6 +189,7 @@ const AckPage = () => {
<PaymentDetails <PaymentDetails
formData={paymentData} formData={paymentData}
doPrint={doPrint} doPrint={doPrint}
onDownload={onDownload}
style={{ style={{
display: "flex", display: "flex",
height: "100%", height: "100%",


+ 9
- 0
src/pages/Payment/PaymentCallback.js 查看文件

@@ -40,6 +40,7 @@ const Index = () => {
const [paymentData, setPaymentData] = React.useState({}); const [paymentData, setPaymentData] = React.useState({});
const [itemList, setItemList] = React.useState([]); const [itemList, setItemList] = React.useState([]);
// const [paymentId, setPaymentId] = React.useState(""); // const [paymentId, setPaymentId] = React.useState("");
const [onDownload, setOnDownload] = React.useState(false);


const [transactionData, setTransactionData] = React.useState({}); const [transactionData, setTransactionData] = React.useState({});
// const [transactionDate, setTransactionDate] = React.useState(""); // const [transactionDate, setTransactionDate] = React.useState("");
@@ -144,8 +145,15 @@ const Index = () => {


const doPrint = () => { const doPrint = () => {
// window.print(); // window.print();
setOnDownload(true)
HttpUtils.fileDownload({ HttpUtils.fileDownload({
url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+localStorage.getItem("paymentId"), url: UrlUtils.GEN_PAYMENT_RECEIPT+"/"+localStorage.getItem("paymentId"),
onResponse:()=>{
setOnDownload(false)
},
onError:()=>{
setOnDownload(false)
}
}); });
}; };


@@ -184,6 +192,7 @@ const Index = () => {
<PaymentDetails <PaymentDetails
formData={paymentData} formData={paymentData}
doPrint={doPrint} doPrint={doPrint}
onDownload={onDownload}
style={{ style={{
display: "flex", display: "flex",
height: "100%", height: "100%",


正在加载...
取消
保存