approval.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. waitApproItemClick:function(){
  42. wx.navigateTo({
  43. url: '../applyjoinapprovel/applyjoinapprovel?getapprovelStatus='+0,
  44. })
  45. },
  46. ApprovaledClick:function(){
  47. wx.navigateTo({
  48. url: '../applyjoinapprovel/applyjoinapprovel?getapprovelStatus=' + 1,
  49. })
  50. },
  51. getHisOrderData: function () {
  52. var that = this
  53. wx.request({
  54. url: baseUrl + BASEURL.getUrl.list,
  55. method: 'GET',
  56. data: {
  57. accountphone: 18130506086,
  58. openid: wx.getStorageSync('openId')
  59. },
  60. header: {
  61. 'content-type': 'application/json;charset=UTF-8'
  62. },
  63. success: function (res) {
  64. console.log('queryOrder=', res)
  65. if (res.data.success) {
  66. if (res.data.data.length > 0) {
  67. that.setData({
  68. allorders: res.data.data
  69. })
  70. }
  71. }
  72. }
  73. })
  74. },
  75. ScanPayClick: function () {
  76. },
  77. /**
  78. * 点击tab切换
  79. */
  80. swichNav: function (e) {
  81. var that = this;
  82. console.log('swichNav=', e)
  83. if (this.data.currentTab == e.target.dataset.current) {
  84. return false;
  85. } else {
  86. that.setData({
  87. currentTab: e.target.dataset.current
  88. })
  89. }
  90. },
  91. /**
  92. * 滑动切换tab
  93. */
  94. bindChange: function (e) {
  95. var that = this;
  96. if (e.detail.source == 'touch') {
  97. that.setData({ currentTab: e.detail.current });
  98. }
  99. },
  100. /**
  101. * 生命周期函数--监听页面初次渲染完成
  102. */
  103. onReady: function () {
  104. },
  105. /**
  106. * 生命周期函数--监听页面显示
  107. */
  108. onShow: function () {
  109. },
  110. /**
  111. * 生命周期函数--监听页面隐藏
  112. */
  113. onHide: function () {
  114. },
  115. /**
  116. * 生命周期函数--监听页面卸载
  117. */
  118. onUnload: function () {
  119. },
  120. /**
  121. * 页面相关事件处理函数--监听用户下拉动作
  122. */
  123. onPullDownRefresh: function () {
  124. },
  125. /**
  126. * 页面上拉触底事件的处理函数
  127. */
  128. onReachBottom: function () {
  129. },
  130. /**
  131. * 用户点击右上角分享
  132. */
  133. onShareAppMessage: function () {
  134. }
  135. })