user.js 3.1 KB

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