extension.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. var app = getApp();
  2. Page({
  3. data: {
  4. url: app.globalData.urlImages,
  5. userinfo: [],
  6. yearsum:'',
  7. extractsum:''
  8. },
  9. onLoad: function (options) {
  10. app.setBarColor();
  11. app.setUserInfo();
  12. var header = {
  13. 'content-type': 'application/x-www-form-urlencoded',
  14. };
  15. this.money(header);
  16. this.Yesterday_commission(header);
  17. this.extract(header);
  18. },
  19. money: function (header) {
  20. var that = this;
  21. wx.request({
  22. url: app.globalData.url + '/routine/auth_api/my?uid=' + app.globalData.uid,
  23. method: 'POST',
  24. header: header,
  25. success: function (res) {
  26. if (res.data.code == 200) {
  27. that.setData({
  28. userinfo: res.data.data
  29. })
  30. }else{
  31. that.setData({
  32. userinfo: []
  33. })
  34. }
  35. }
  36. })
  37. },
  38. cash: function () {
  39. var that = this;
  40. wx.navigateTo({
  41. url: '/pages/cash/cash?uid='+ app.globalData.uid,
  42. })
  43. },
  44. Yesterday_commission: function (header) {
  45. var that = this;
  46. wx.request({
  47. url: app.globalData.url + '/routine/auth_api/yesterdayCommission?uid=' + app.globalData.uid,
  48. method: 'POST',
  49. header: header,
  50. success: function (res) {
  51. if (res.data.code == 200) {
  52. that.setData({
  53. yearsum: res.data.data
  54. })
  55. }else{
  56. that.setData({
  57. yearsum: ''
  58. })
  59. }
  60. }
  61. })
  62. },
  63. extract: function (header) {
  64. var that = this;
  65. wx.request({
  66. url: app.globalData.url + '/routine/auth_api/extractsum?uid=' + app.globalData.uid,
  67. method: 'POST',
  68. header: header,
  69. success: function (res) {
  70. if (res.data.code == 200) {
  71. that.setData({
  72. extractsum: res.data.data
  73. })
  74. }else{
  75. that.setData({
  76. extractsum: ''
  77. })
  78. }
  79. }
  80. })
  81. },
  82. spread: function () {
  83. wx.navigateTo({
  84. url: "/pages/spread/spread",
  85. })
  86. }
  87. })