wallet.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. var app = getApp();
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. showDialog: false
  8. },
  9. /**
  10. * 生命周期函数--监听页面加载
  11. */
  12. onLoad: function (options) {
  13. },
  14. /**
  15. * 点击提现
  16. */
  17. cashMoney: function(){
  18. var pages_all = getCurrentPages();
  19. if (pages_all.length > 3) {
  20. wx.redirectTo({
  21. url: '/lionfish_comshop/moduleA/groupCenter/editInfo'
  22. })
  23. } else {
  24. wx.navigateTo({
  25. url: '/lionfish_comshop/moduleA/groupCenter/editInfo'
  26. })
  27. }
  28. },
  29. /**
  30. * 确认对话框
  31. */
  32. confirm: function(){
  33. this.setData({
  34. showDialog: false
  35. })
  36. console.log(111)
  37. },
  38. /**
  39. * 取消对话框
  40. */
  41. cancel: function(){
  42. this.setData({
  43. showDialog: false
  44. })
  45. },
  46. /**
  47. * 生命周期函数--监听页面初次渲染完成
  48. */
  49. onReady: function () {
  50. },
  51. /**
  52. * 生命周期函数--监听页面显示
  53. */
  54. onShow: function () {
  55. var token = wx.getStorageSync('token');
  56. var that = this;
  57. app.util.request({
  58. 'url': 'entry/wxapp/user',
  59. 'data': {
  60. controller: 'community.get_community_info',
  61. 'token': token
  62. },
  63. dataType: 'json',
  64. success: function (res) {
  65. if (res.data.code == 0) {
  66. let commission_info = res.data.commission_info;
  67. if(commission_info&&commission_info.mix_total_money) {
  68. commission_info.mix_total_money = (commission_info.mix_total_money*1).toFixed(2);
  69. }
  70. that.setData({
  71. member_info: res.data.member_info,
  72. community_info: res.data.community_info,
  73. commission_info,
  74. total_order_count: res.data.total_order_count,
  75. total_member_count: res.data.total_member_count,
  76. today_order_count: res.data.today_order_count,
  77. today_effect_order_count: res.data.today_effect_order_count,
  78. today_pay_order_count: res.data.today_pay_order_count,
  79. today_pre_total_money: res.data.today_pre_total_money,
  80. today_all_total_money: res.data.today_all_total_money,
  81. month_pre_total_money: res.data.month_pre_total_money,
  82. pre_total_money: res.data.pre_total_money,
  83. wait_sub_total_money: res.data.wait_sub_total_money,
  84. dongmoney: res.data.dongmoney,
  85. tixian_sucess_money: res.data.tixian_sucess_money
  86. });
  87. } else {
  88. //is_login
  89. wx.reLaunch({
  90. url: '/lionfish_comshop/pages/user/me',
  91. })
  92. }
  93. }
  94. })
  95. }
  96. })