extension.js 1.9 KB

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