|
|
@@ -216,7 +216,7 @@ const importWechatTitle = () => {
|
|
|
// #ifdef MP-WEIXIN
|
|
|
wx.chooseInvoiceTitle({
|
|
|
success: (res: any) => {
|
|
|
- editForm.invoiceType = res.type === '1' ? 'ORGANIZATION' : 'INDIVIDUAL';
|
|
|
+ editForm.invoiceType = res.type === '0' ? 'ORGANIZATION' : 'INDIVIDUAL';
|
|
|
editForm.invoiceTitle = res.title || '';
|
|
|
editForm.taxId = res.taxNumber || '';
|
|
|
editForm.address = res.companyAddress || '';
|
|
|
@@ -225,9 +225,20 @@ const importWechatTitle = () => {
|
|
|
editForm.bankAccount = res.bankAccount || '';
|
|
|
},
|
|
|
fail: (err: any) => {
|
|
|
- if (err && err.errMsg && !/cancel/.test(err.errMsg)) {
|
|
|
- uni.showToast({ title: "同步失败,请重试", icon: "none" });
|
|
|
+ const msg = err && err.errMsg ? err.errMsg : '';
|
|
|
+ if (/cancel/.test(msg)) return;
|
|
|
+ if (/auth deny/.test(msg)) {
|
|
|
+ uni.showModal({
|
|
|
+ title: "需要授权",
|
|
|
+ content: "请在设置中开启「发票抬头」权限",
|
|
|
+ confirmText: "去设置",
|
|
|
+ success: (res: any) => {
|
|
|
+ if (res.confirm) wx.openSetting({});
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return;
|
|
|
}
|
|
|
+ uni.showToast({ title: "同步失败,请重试", icon: "none" });
|
|
|
}
|
|
|
});
|
|
|
// #endif
|