mydc.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. // pages/mine/mydc/mydc.js
  2. const app = getApp()
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. wv_Introduction_total: '',
  9. wv_withdraw_total: '',
  10. wv_register_count: '',
  11. wv_contract_count: '',
  12. wv_finish_count: '',
  13. loaddisplay: true,
  14. wv_extract_count: '',
  15. wv_account_number: '',
  16. wv_account_name: '',
  17. Introduction_arr: []
  18. },
  19. /**
  20. * 生命周期函数--监听页面加载
  21. */
  22. onLoad: function (options) {
  23. let _this = this;
  24. _this.setData({
  25. navH: app.globalData.navHeight
  26. })
  27. // var that = this
  28. // wx.request({
  29. // url: app.globalData.url + '/checkDcIntroducers',
  30. // method: 'get',
  31. // data: {
  32. // wv_phone: app.globalData.userphone
  33. // },
  34. // success: function (res) {
  35. // that.setData({
  36. // wv_Introduction_total: res.data.wv_Introduction_total.toFixed(2),
  37. // wv_withdraw_total: res.data.wv_withdraw_total.toFixed(2),
  38. // wv_register_count: res.data.wv_register_count,
  39. // wv_contract_count: res.data.wv_contract_count,
  40. // wv_finish_count: res.data.wv_finish_count,
  41. // wv_extract_count: res.data.wv_extract_count,
  42. // wv_account_number: res.data.wv_account_number
  43. // })
  44. // wx.request({
  45. // url: app.globalData.url + '/getDcIntroduceLogs',
  46. // method: 'get',
  47. // data: {
  48. // phone: app.globalData.userphone
  49. // },
  50. // success: function (res) {
  51. // that.setData({
  52. // Introduction_arr: res.data
  53. // })
  54. // }
  55. // })
  56. // }
  57. // })
  58. },
  59. /**
  60. * 生命周期函数--监听页面初次渲染完成
  61. */
  62. onReady: function () {
  63. },
  64. /**
  65. * 生命周期函数--监听页面显示
  66. */
  67. onShow: function () {
  68. var that = this
  69. wx.request({
  70. url: app.globalData.url + '/checkDcIntroducers',
  71. method: 'get',
  72. data: {
  73. wv_phone: app.globalData.userphone
  74. },
  75. success: function (res) {
  76. that.setData({
  77. wv_Introduction_total: res.data.wv_Introduction_total.toFixed(2),
  78. wv_withdraw_total: res.data.wv_withdraw_total.toFixed(2),
  79. wv_register_count: res.data.wv_register_count,
  80. wv_contract_count: res.data.wv_contract_count,
  81. wv_finish_count: res.data.wv_finish_count,
  82. wv_extract_count: res.data.wv_extract_count,
  83. wv_account_number: res.data.wv_account_number,
  84. wv_account_name: res.data.wv_account_name
  85. })
  86. wx.request({
  87. url: app.globalData.url + '/getDcIntroduceLogs',
  88. method: 'get',
  89. data: {
  90. phone: app.globalData.userphone
  91. },
  92. success: function (res) {
  93. that.setData({
  94. Introduction_arr: res.data,
  95. loaddisplay: 'none'
  96. })
  97. },
  98. fail() {
  99. app.timeOut()
  100. }
  101. })
  102. },
  103. fail() {
  104. app.timeOut()
  105. }
  106. })
  107. },
  108. /**
  109. * 生命周期函数--监听页面隐藏
  110. */
  111. onHide: function () {
  112. },
  113. hrefExtract: function () {
  114. wx.navigateTo({
  115. url: '/pages/mine/mydc/myextract/myextract'
  116. })
  117. },
  118. /**
  119. * 生命周期函数--监听页面卸载
  120. */
  121. onUnload: function () {
  122. },
  123. /**
  124. * 页面相关事件处理函数--监听用户下拉动作
  125. */
  126. onPullDownRefresh: function () {
  127. },
  128. /**
  129. * 页面上拉触底事件的处理函数
  130. */
  131. onReachBottom: function () {
  132. },
  133. /**
  134. * 用户点击右上角分享
  135. */
  136. onShareAppMessage: function () {
  137. },
  138. extract: function () {
  139. if (this.data.wv_account_number == null || this.data.wv_account_number == "" || this.data.wv_account_name == null || this.data.wv_account_name =="") {
  140. wx.navigateTo({
  141. url: '/pages/mine/myinfo/myinfo'
  142. })
  143. } else if (this.data.wv_Introduction_total <= 0) {
  144. wx.showToast({
  145. title: '请,您没有可提取的金额!',
  146. icon: 'none',
  147. duration: 1500
  148. })
  149. } else {
  150. wx.navigateTo({
  151. url: '/pages/mine/mydc/applyextract/applyextract?amount=' + this.data.wv_Introduction_total
  152. })
  153. }
  154. }
  155. })