paiming.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. const app = require('../../utils/util.js');
  2. Page({
  3. data: {
  4. logs: [],
  5. active: 0,
  6. collectInfosList: [{
  7. name: '张三',
  8. time: "2020-08-07T11:47:47.400Z"
  9. },
  10. {
  11. name: '李四',
  12. time: "2020-08-07T11:47:47.400Z"
  13. },
  14. ],
  15. list: {},
  16. visitInfosList: [{
  17. name: '张三111',
  18. visitTime: "2020-02-16T11:22:07.697Z"
  19. },
  20. {
  21. name: '李四22',
  22. visitTime: "2020-02-16T11:22:07.697Z"
  23. },
  24. ]
  25. },
  26. paiXing() {
  27. wx.request({
  28. url: app.globalData.publicUrl + '/applet/userValue',
  29. method: "GET",
  30. header: {
  31. appletsId: wx.getStorageSync('openId')
  32. },
  33. success: (res) => {
  34. console.log(res, "000");
  35. this.setData({
  36. list: res.data.data,
  37. number: res.data.data.userTotalValue.toString(),
  38. })
  39. console.log(this.data.number,"knakna");
  40. }
  41. })
  42. },
  43. onShow() {
  44. console.log(wx.getStorageSync('user'), "打印");
  45. if (wx.getStorageSync('user') == '') {
  46. wx.redirectTo({
  47. url: '/pages/login/login',
  48. })
  49. } else {
  50. }
  51. },
  52. onLoad() {
  53. this.paiXing();
  54. }
  55. })