user.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. var app = getApp();
  2. // pages/user/user.js
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. url: app.globalData.urlImages,
  9. userinfo:[],
  10. orderStatusNum:[],
  11. coupon:'',
  12. collect:''
  13. },
  14. /**
  15. * 生命周期函数--监听页面加载
  16. */
  17. onLoad: function (options) {
  18. app.setBarColor();
  19. app.setUserInfo();
  20. var header = {
  21. 'content-type': 'application/x-www-form-urlencoded',
  22. };
  23. var that = this;
  24. wx.request({
  25. url: app.globalData.url + '/routine/auth_api/my?uid=' + app.globalData.uid,
  26. method: 'POST',
  27. header: header,
  28. success: function (res) {
  29. that.setData({
  30. userinfo: res.data.data,
  31. orderStatusNum: res.data.data.orderStatusNum
  32. })
  33. }
  34. });
  35. },
  36. goNotification:function(){
  37. wx.navigateTo({
  38. url: '/pages/news-list/news-list',
  39. })
  40. },
  41. onShow: function () {
  42. var header = {
  43. 'content-type': 'application/x-www-form-urlencoded',
  44. };
  45. var that = this;
  46. wx.request({
  47. url: app.globalData.url + '/routine/auth_api/my?uid=' + app.globalData.uid,
  48. method: 'POST',
  49. header: header,
  50. success: function (res) {
  51. that.setData({
  52. userinfo: res.data.data
  53. })
  54. }
  55. });
  56. },
  57. /**
  58. * 生命周期函数--我的余额
  59. */
  60. money:function(){
  61. wx.navigateTo({
  62. url: '/pages/main/main?now=' + this.data.userinfo.now_money + '&uid='+app.globalData.uid,
  63. success: function (res) { },
  64. fail: function (res) { },
  65. complete: function (res) { },
  66. })
  67. },
  68. /**
  69. * 生命周期函数--我的积分
  70. */
  71. integral: function () {
  72. wx.navigateTo({
  73. url: '/pages/integral-con/integral-con?inte=' + this.data.userinfo.integral + '&uid=' + app.globalData.uid,
  74. success: function (res) { },
  75. fail: function (res) { },
  76. complete: function (res) { },
  77. })
  78. },
  79. /**
  80. * 生命周期函数--我的优惠卷
  81. */
  82. coupons: function () {
  83. wx.navigateTo({
  84. url: '/pages/coupon/coupon',
  85. success: function (res) { },
  86. fail: function (res) { },
  87. complete: function (res) { },
  88. })
  89. },
  90. /**
  91. * 生命周期函数--我的收藏
  92. */
  93. collects: function () {
  94. wx.navigateTo({
  95. url: '/pages/collect/collect',
  96. })
  97. },
  98. /**
  99. * 生命周期函数--我的推广人
  100. */
  101. extension:function(){
  102. wx.navigateTo({
  103. url: '/pages/feree/feree',
  104. success: function (res) { },
  105. fail: function (res) { },
  106. complete: function (res) { },
  107. })
  108. },
  109. /**
  110. * 生命周期函数--我的推广
  111. */
  112. myextension: function () {
  113. wx.navigateTo({
  114. url: '/pages/extension/extension',
  115. success: function (res) { },
  116. fail: function (res) { },
  117. complete: function (res) { },
  118. })
  119. },
  120. /**
  121. * 生命周期函数--我的砍价
  122. */
  123. // cut_down_the_price:function(){
  124. // wx.navigateTo({
  125. // url: '../../pages/feree/feree',
  126. // success: function (res) { },
  127. // fail: function (res) { },
  128. // complete: function (res) { },
  129. // })
  130. // }
  131. })