paiming.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. }
  40. })
  41. },
  42. onShow() {
  43. console.log(wx.getStorageSync('user'), "打印");
  44. if (wx.getStorageSync('user') == '') {
  45. wx.redirectTo({
  46. url: '/pages/login/login',
  47. })
  48. } else {
  49. }
  50. },
  51. onLoad() {
  52. this.paiXing();
  53. }
  54. })