开收据调整

This commit is contained in:
2024-09-10 16:11:10 +08:00
parent 37c8d6560f
commit 86ca43d214
6 changed files with 13 additions and 10 deletions

View File

@@ -33,9 +33,18 @@ Page({
})
},
record() {
const { detail } = this.data;
if (detail.orderStatus === 1) {
alertInfo("审核中的充值不能开收据")
return;
}
if (detail.orderStatus === 2) {
alertInfo("已退回的充值不能开收据")
return;
}
const handleDownload = () => {
return new Promise((resolve, rej) => {
const { detail } = this.data;
const result = wx.getAccountInfoSync();
const { envVersion } = result.miniProgram;
let api = ""
@@ -55,11 +64,9 @@ Page({
api = `https://zgd.hbhcbn.com/recharge-print-api`;
break;
}
console.log("api", `${api}/${detail.id}`)
wx.downloadFile({
url: `${api}/${detail.id}`,
success: (res) => {
console.log('res', res)
if (res.statusCode === 200) {
if (!res.tempFilePath) {
alertError("获取文件失败")