微信H5获取微信发票抬头列表
James2024-01-30前端开发 微信公众号微信H5 前端开发 import wx from 'weixin-js-sdk'
wx.config({
beta: true,
debug: false,
appId,
timestamp,
nonceStr,
signature,
jsApiList: [
'chooseInvoiceTitle'
]
})
export function wxChooseInvoice () {
return new Promise((resolve, reject) => {
wx.invoke('chooseInvoiceTitle', {
scene: 1
}, function (res) {
resolve(res)
})
})
}
wxChooseInvoice().then(res => {
const info = res.choose_invoice_title_info
if (info) {
const {type, title, taxNumber, companyAddress, telephone, bankName, bankAccount} = JSON.parse(info)
console.log()
}
})