index.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. import {
  2. imgServerUrl
  3. } from '../../config/config.js'
  4. import {
  5. getMoneyAccountDetail,
  6. getHpMemberDetail
  7. } from '../../services/index.js'
  8. Page({
  9. data: {
  10. moneyBalance: '0.00',
  11. imgServerUrl: imgServerUrl,
  12. confirm: '',
  13. model_message: '',
  14. cover: true,
  15. cancel: false,
  16. },
  17. tixian() {
  18. wx.showModal({
  19. title: '提示',
  20. content: '如果您有提现需求,请联系客服400-692-0099',
  21. confirmText: '知道了',
  22. showCancel: false,
  23. success: res => {
  24. if (res.confirm) {
  25. wx.makePhoneCall({
  26. phoneNumber: '4006920099',
  27. })
  28. // wx.showModal({
  29. // title: '提示',
  30. // content: '是否立即拨打电话',
  31. // success: res => {
  32. // if (res.confirm) {
  33. // }
  34. // }
  35. // })
  36. }
  37. }
  38. })
  39. return
  40. const cover = !this.data.cover;
  41. getHpMemberDetail({
  42. user_id: wx.getStorageSync('user_id'),
  43. user_token: wx.getStorageSync('user_token'),
  44. member_id: wx.getStorageSync('member_id'),
  45. }).then(res => {
  46. if (res.errcode === 0) {
  47. let _json = {
  48. 0: {
  49. confirm: '好的',
  50. cancel: true,
  51. model_message: '为了保证资金安全,请先进行实名认证。'
  52. },
  53. 1: {
  54. confirm: '好的',
  55. cancel: true,
  56. model_message: '实名认证正在审核中,请耐心等待。'
  57. },
  58. 3: {
  59. confirm: '去下载',
  60. cancel: false,
  61. model_message: '为了保证资金安全,您需要在app上进行提现。'
  62. },
  63. }
  64. this.setData({
  65. cover,
  66. ..._json[res.data.hpMember.authenticationStatus]
  67. })
  68. }
  69. })
  70. },
  71. confirm() {
  72. this.setData({
  73. cover: true
  74. })
  75. },
  76. cancel() {
  77. this.setData({
  78. cover: true
  79. })
  80. },
  81. /**
  82. * 生命周期函数--监听页面加载
  83. */
  84. onLoad: function(options) {
  85. },
  86. /**
  87. * 生命周期函数--监听页面初次渲染完成
  88. */
  89. onReady: function() {
  90. },
  91. /**
  92. * 生命周期函数--监听页面显示
  93. */
  94. onShow: function() {
  95. getMoneyAccountDetail({
  96. user_id: wx.getStorageSync('user_id'),
  97. user_token: wx.getStorageSync('user_token'),
  98. member_id: wx.getStorageSync('member_id'),
  99. }).then(res => {
  100. if (res.errcode === 0) {
  101. this.setData({
  102. moneyBalance: res.data.MpMemberAccountAPI.moneyBalance.toFixed(2)
  103. })
  104. }
  105. })
  106. },
  107. /**
  108. * 生命周期函数--监听页面隐藏
  109. */
  110. onHide: function() {
  111. },
  112. /**
  113. * 生命周期函数--监听页面卸载
  114. */
  115. onUnload: function() {
  116. },
  117. /**
  118. * 页面相关事件处理函数--监听用户下拉动作
  119. */
  120. onPullDownRefresh: function() {
  121. },
  122. /**
  123. * 页面上拉触底事件的处理函数
  124. */
  125. onReachBottom: function() {
  126. },
  127. })