index.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. var app = getApp();
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. isIpx: app.globalData.isIpx,
  8. },
  9. /**
  10. * 生命周期函数--监听页面加载
  11. */
  12. onLoad: function (options) {
  13. this.getData();
  14. },
  15. getData: function(){
  16. let that = this;
  17. const token = wx.getStorageSync('token');
  18. wx.showLoading();
  19. app.util.request({
  20. url: 'entry/wxapp/user',
  21. data: {
  22. controller: 'supplymobile.supplyindex_info',
  23. token
  24. },
  25. dataType: 'json',
  26. success: function(res) {
  27. wx.hideLoading();
  28. if (res.data.code == 0) {
  29. let {
  30. supply_info,
  31. wait_send_count,
  32. wait_refund_count,
  33. today_order_count,
  34. yestday_order_count,
  35. total_order_count,
  36. wait_statement_money,
  37. has_statement_money,
  38. has_get_money
  39. } = res.data.data;
  40. that.setData({
  41. supply_info,
  42. wait_send_count,
  43. wait_refund_count,
  44. today_order_count,
  45. yestday_order_count,
  46. total_order_count,
  47. wait_statement_money,
  48. has_statement_money,
  49. has_get_money
  50. });
  51. } else {
  52. app.util.message(res.data.msg, 'switchTo:/lionfish_comshop/pages/user/me', 'error');
  53. }
  54. }
  55. })
  56. },
  57. goLink: function (event) {
  58. let link = event.currentTarget.dataset.link;
  59. var pages_all = getCurrentPages();
  60. if (pages_all.length > 3) {
  61. wx.redirectTo({
  62. url: link
  63. })
  64. } else {
  65. wx.navigateTo({
  66. url: link
  67. })
  68. }
  69. },
  70. /**
  71. * 页面相关事件处理函数--监听用户下拉动作
  72. */
  73. onPullDownRefresh: function () {
  74. }
  75. })