pay.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. // pages/pay/pay.js
  2. const app = getApp()
  3. const host = app.globalData.host;
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. accountArray: ["个人发票", "公司发票"],
  10. accountTypeArray: ["纸质发票", "电子发票"],
  11. account:0,
  12. account_type:0,
  13. data:{}
  14. },
  15. /**
  16. * 生命周期函数--监听页面加载
  17. */
  18. onLoad: function (options) {
  19. options.id=9
  20. wx.request({
  21. url: host + '/api/wx/signup',
  22. method: 'GET',
  23. data: { id: options.id },
  24. success:res=>{
  25. this.setData({
  26. data:res.data.data
  27. })
  28. }
  29. })
  30. },
  31. pickerChange:function(){
  32. if (e.target.dataset.name == 'account') {
  33. this.setData({
  34. account: e.detail.value
  35. })
  36. };
  37. if (e.target.dataset.name == 'account_type') {
  38. this.setData({
  39. account_type: e.detail.value
  40. })
  41. };
  42. },
  43. /**
  44. * 生命周期函数--监听页面初次渲染完成
  45. */
  46. onReady: function () {
  47. },
  48. /**
  49. * 生命周期函数--监听页面显示
  50. */
  51. onShow: function () {
  52. },
  53. /**
  54. * 生命周期函数--监听页面隐藏
  55. */
  56. onHide: function () {
  57. },
  58. /**
  59. * 生命周期函数--监听页面卸载
  60. */
  61. onUnload: function () {
  62. },
  63. /**
  64. * 页面相关事件处理函数--监听用户下拉动作
  65. */
  66. onPullDownRefresh: function () {
  67. },
  68. /**
  69. * 页面上拉触底事件的处理函数
  70. */
  71. onReachBottom: function () {
  72. },
  73. /**
  74. * 用户点击右上角分享
  75. */
  76. onShareAppMessage: function () {
  77. }
  78. })