apply.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. // pages/apply/apply.js
  2. const app = getApp()
  3. const host = app.globalData.host;
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. list:[]
  10. },
  11. /**
  12. * 生命周期函数--监听页面加载
  13. */
  14. onLoad: function (options) {
  15. wx.showLoading({
  16. title: '',
  17. })
  18. this.setData({
  19. openid: app.globalData.openid
  20. })
  21. this.getData();
  22. },
  23. getData:function(){
  24. wx.request({
  25. url: host+'/api/wx/signup/list',
  26. header:{
  27. openid:this.data.openid
  28. },
  29. method:'GET',
  30. success:res=>{
  31. wx.hideLoading()
  32. let data=res.data.data
  33. for(let i=0;i<data.length;i++){
  34. data[i].subject_item_1 = data[i].subject_item.split('|')
  35. }
  36. this.setData({
  37. list: data
  38. })
  39. }
  40. })
  41. },
  42. pay:function(e){
  43. wx.navigateTo({
  44. url: '../pay/pay?id='+e.target.dataset.id,
  45. })
  46. },
  47. /**
  48. * 生命周期函数--监听页面初次渲染完成
  49. */
  50. onReady: function () {
  51. },
  52. /**
  53. * 生命周期函数--监听页面显示
  54. */
  55. onShow: function () {
  56. this.getData();
  57. },
  58. /**
  59. * 生命周期函数--监听页面隐藏
  60. */
  61. onHide: function () {
  62. },
  63. /**
  64. * 生命周期函数--监听页面卸载
  65. */
  66. onUnload: function () {
  67. },
  68. /**
  69. * 页面相关事件处理函数--监听用户下拉动作
  70. */
  71. onPullDownRefresh: function () {
  72. this.getData();
  73. },
  74. /**
  75. * 页面上拉触底事件的处理函数
  76. */
  77. onReachBottom: function () {
  78. },
  79. /**
  80. * 用户点击右上角分享
  81. */
  82. onShareAppMessage: function () {
  83. }
  84. })