approval.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. // tab切换
  12. currentTab: 0,
  13. clientHeight: '',
  14. /**
  15. * 页面配置
  16. */
  17. winWidth: 0,
  18. winHeight: 0,
  19. already:[],
  20. wait:[],
  21. fill:[],
  22. fromType:'1'
  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. if(res.data.success && res.data.data){
  51. that.setData({
  52. already: res.data.data.already,
  53. wait: res.data.data.wait,
  54. fill: res.data.data.fill
  55. })
  56. }
  57. }, function (res) {
  58. wx.showToast({
  59. title: '加载数据失败',
  60. icon: 'none',
  61. duration: 2000
  62. })
  63. })
  64. },
  65. ApprovaledClick:function(event){
  66. var itemdata = event.currentTarget.dataset.item
  67. var fromtype = event.currentTarget.dataset.fromtype
  68. console.log('event', event)
  69. wx.navigateTo({
  70. url: '../applyjoinapprovel/applyjoinapprovel' + '?getItemdata=' + JSON.stringify(itemdata) + '&getfromType=' + fromtype,
  71. })
  72. },
  73. getHisOrderData: function () {
  74. var that = this
  75. wx.request({
  76. url: baseUrl + BASEURL.getUrl.list,
  77. method: 'GET',
  78. data: {
  79. accountphone: 18130506086,
  80. openid: wx.getStorageSync('openId')
  81. },
  82. header: {
  83. 'content-type': 'application/json;charset=UTF-8'
  84. },
  85. success: function (res) {
  86. console.log('queryOrder=', res)
  87. if (res.data.success) {
  88. if (res.data.data.length > 0) {
  89. that.setData({
  90. allorders: res.data.data
  91. })
  92. }
  93. }
  94. }
  95. })
  96. },
  97. ScanPayClick: function () {
  98. },
  99. /**
  100. * 点击tab切换
  101. */
  102. swichNav: function (e) {
  103. var that = this;
  104. // console.log('swichNav=', e)
  105. if (this.data.currentTab == e.target.dataset.current) {
  106. return false;
  107. } else {
  108. that.setData({
  109. currentTab: e.target.dataset.current
  110. })
  111. }
  112. },
  113. /**
  114. * 滑动切换tab
  115. */
  116. bindChange: function (e) {
  117. var that = this;
  118. if (e.detail.source == 'touch') {
  119. that.setData({ currentTab: e.detail.current });
  120. }
  121. },
  122. /**
  123. * 生命周期函数--监听页面初次渲染完成
  124. */
  125. onReady: function () {
  126. },
  127. /**
  128. * 生命周期函数--监听页面显示
  129. */
  130. onShow: function () {
  131. },
  132. /**
  133. * 生命周期函数--监听页面隐藏
  134. */
  135. onHide: function () {
  136. },
  137. /**
  138. * 生命周期函数--监听页面卸载
  139. */
  140. onUnload: function () {
  141. },
  142. /**
  143. * 页面相关事件处理函数--监听用户下拉动作
  144. */
  145. onPullDownRefresh: function () {
  146. },
  147. /**
  148. * 页面上拉触底事件的处理函数
  149. */
  150. onReachBottom: function () {
  151. },
  152. /**
  153. * 用户点击右上角分享
  154. */
  155. onShareAppMessage: function () {
  156. }
  157. })