|
@@ -369,6 +369,8 @@ function selectFile() {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
if (failList.length > 0) toast.warning(`文件大小限制为10MB, 文件格式仅支持 ${allowType.join('、')}, 所选文件有 ${failList.length} 格式不符合`)
|
|
if (failList.length > 0) toast.warning(`文件大小限制为10MB, 文件格式仅支持 ${allowType.join('、')}, 所选文件有 ${failList.length} 格式不符合`)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ toast.warning("选择微信图片异常, 请重试")
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
fail () {
|
|
fail () {
|
|
@@ -396,6 +398,8 @@ function selectFile() {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
if (failList.length > 0) toast.warning(`文件大小限制为10MB, 文件格式仅支持 ${allowType.join('、')}, 所选文件有 ${failList.length} 格式不符合`)
|
|
if (failList.length > 0) toast.warning(`文件大小限制为10MB, 文件格式仅支持 ${allowType.join('、')}, 所选文件有 ${failList.length} 格式不符合`)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ toast.warning("选择微信文件异常, 请重试")
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
fail () {
|
|
fail () {
|
|
@@ -426,6 +430,8 @@ function selectFile() {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
if (failList.length > 0) toast.warning(`文件大小限制为10MB, 所选文件有 ${failList.length} 格式不符合`)
|
|
if (failList.length > 0) toast.warning(`文件大小限制为10MB, 所选文件有 ${failList.length} 格式不符合`)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ toast.warning("选择相册图片异常, 请重试")
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
fail () {
|
|
fail () {
|
|
@@ -436,6 +442,7 @@ function selectFile() {
|
|
|
case "invoice":
|
|
case "invoice":
|
|
|
uni.chooseInvoice({
|
|
uni.chooseInvoice({
|
|
|
success (res) {
|
|
success (res) {
|
|
|
|
|
+ console.log('chooseInvoice res: ', res);
|
|
|
if (res.errMsg == "chooseInvoice:ok") {
|
|
if (res.errMsg == "chooseInvoice:ok") {
|
|
|
let list = JSON.parse(res.invoiceInfo)
|
|
let list = JSON.parse(res.invoiceInfo)
|
|
|
if (list && list.length > 0) {
|
|
if (list && list.length > 0) {
|
|
@@ -445,18 +452,37 @@ function selectFile() {
|
|
|
}
|
|
}
|
|
|
getInvoiceBatch(params).then(res => {
|
|
getInvoiceBatch(params).then(res => {
|
|
|
if (res.code == 0 && res.body) {
|
|
if (res.code == 0 && res.body) {
|
|
|
- console.log('InvoiceBatch res.body: ', res.body);
|
|
|
|
|
// 遍历下载pdf 存储在 fileList 打印
|
|
// 遍历下载pdf 存储在 fileList 打印
|
|
|
res.body.forEach(item => {
|
|
res.body.forEach(item => {
|
|
|
- downloadFile(`发票-${item.payee}.png`, item.userInfo.pdfUrl)
|
|
|
|
|
|
|
+ if (item.userInfo.pdfUrl) {
|
|
|
|
|
+ downloadFile(`发票-${item.payee}.png`, item.userInfo.pdfUrl)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ toast.warning(`发票-${item.payee} PDF地址异常`)
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ toast.warning("获取发票信息异常")
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
+ } else {
|
|
|
|
|
+ toast.warning("选择微信发票异常, 请重试")
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- fail () {
|
|
|
|
|
- toast.warning("选择微信发票失败, 请重试")
|
|
|
|
|
|
|
+ fail (err) {
|
|
|
|
|
+ let tips = "选择微信发票失败, 请重试"
|
|
|
|
|
+ switch (err.errMsg) {
|
|
|
|
|
+ case "chooseInvoice:fail cancel":
|
|
|
|
|
+ tips = "已取消选择发票"
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "chooseInvoice:fail auth deny":
|
|
|
|
|
+ tips = "已拒绝授权,无法访问发票信息"
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "chooseInvoice:fail system error":
|
|
|
|
|
+ tips = "系统错误"
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ toast.warning(tips)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
break;
|
|
break;
|