approval.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. // pages/Hisorders/Hisorders.js
  2. var BASEURL = require('../../utils/wxconstant.js')
  3. var baseUrl = BASEURL.BaseUrl()
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. allorders: [],
  10. todayorders: [1],
  11. weekorders: [1, 2, 3],
  12. monthorders: [1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4],
  13. // tab切换
  14. currentTab: 0,
  15. clientHeight: '',
  16. /**
  17. * 页面配置
  18. */
  19. winWidth: 0,
  20. winHeight: 0,
  21. },
  22. /**
  23. * 生命周期函数--监听页面加载
  24. */
  25. onLoad: function (options) {
  26. var that = this
  27. /**
  28. * 获取系统信息
  29. */
  30. wx.getSystemInfo({
  31. success: function (res) {
  32. that.setData({
  33. winWidth: res.windowWidth,
  34. winHeight: res.windowHeight,
  35. clientHeight: res.windowHeight
  36. });
  37. }
  38. })
  39. that.getHisOrderData()
  40. },
  41. approItemClick:function(){
  42. wx.navigateTo({
  43. url: '../applyjoinapprovel/applyjoinapprovel?getapprovelStatus='+1,
  44. })
  45. },
  46. getHisOrderData: function () {
  47. var that = this
  48. wx.request({
  49. url: baseUrl + BASEURL.getUrl.list,
  50. method: 'GET',
  51. data: {
  52. accountphone: 18130506086,
  53. openid: wx.getStorageSync('openId')
  54. },
  55. header: {
  56. 'content-type': 'application/json;charset=UTF-8'
  57. },
  58. success: function (res) {
  59. console.log('queryOrder=', res)
  60. if (res.data.success) {
  61. if (res.data.data.length > 0) {
  62. that.setData({
  63. allorders: res.data.data
  64. })
  65. }
  66. }
  67. }
  68. })
  69. },
  70. ScanPayClick: function () {
  71. },
  72. /**
  73. * 点击tab切换
  74. */
  75. swichNav: function (e) {
  76. var that = this;
  77. console.log('swichNav=', e)
  78. if (this.data.currentTab == e.target.dataset.current) {
  79. return false;
  80. } else {
  81. that.setData({
  82. currentTab: e.target.dataset.current
  83. })
  84. }
  85. },
  86. /**
  87. * 滑动切换tab
  88. */
  89. bindChange: function (e) {
  90. var that = this;
  91. if (e.detail.source == 'touch') {
  92. that.setData({ currentTab: e.detail.current });
  93. }
  94. },
  95. /**
  96. * 生命周期函数--监听页面初次渲染完成
  97. */
  98. onReady: function () {
  99. },
  100. /**
  101. * 生命周期函数--监听页面显示
  102. */
  103. onShow: function () {
  104. },
  105. /**
  106. * 生命周期函数--监听页面隐藏
  107. */
  108. onHide: function () {
  109. },
  110. /**
  111. * 生命周期函数--监听页面卸载
  112. */
  113. onUnload: function () {
  114. },
  115. /**
  116. * 页面相关事件处理函数--监听用户下拉动作
  117. */
  118. onPullDownRefresh: function () {
  119. },
  120. /**
  121. * 页面上拉触底事件的处理函数
  122. */
  123. onReachBottom: function () {
  124. },
  125. /**
  126. * 用户点击右上角分享
  127. */
  128. onShareAppMessage: function () {
  129. }
  130. })