choose-invoice-title.js 981 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. Page({
  2. onShareAppMessage() {
  3. return {
  4. title: '获取发票抬头',
  5. path: 'packageAPI/pages/api/choose-invoice-title/choose-invoice-title'
  6. }
  7. },
  8. data: {
  9. theme: 'light',
  10. type: '',
  11. title: '',
  12. taxNumber: '',
  13. companyAddress: '',
  14. telephone: '',
  15. bankName: '',
  16. bankAccount: '',
  17. },
  18. chooseInvoiceTitle() {
  19. wx.chooseInvoiceTitle({
  20. success: (res) => {
  21. this.setData({
  22. type: res.type,
  23. title: res.title,
  24. taxNumber: res.taxNumber,
  25. companyAddress: res.companyAddress,
  26. telephone: res.telephone,
  27. bankName: res.bankName,
  28. bankAccount: res.bankAccount
  29. })
  30. },
  31. fail: (err) => {
  32. console.error(err)
  33. }
  34. })
  35. },
  36. onLoad() {
  37. this.setData({
  38. theme: wx.getSystemInfoSync().theme || 'light'
  39. })
  40. if (wx.onThemeChange) {
  41. wx.onThemeChange(({theme}) => {
  42. this.setData({theme})
  43. })
  44. }
  45. }
  46. })