approval.js 3.3 KB

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