业务交流通
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // app.js
  2. App({
  3. onLaunch() {
  4. // 展示本地存储能力
  5. const logs = wx.getStorageSync('logs') || []
  6. logs.unshift(Date.now())
  7. wx.setStorageSync('logs', logs)
  8. // 登录
  9. wx.login({
  10. success: res => {
  11. // 发送 res.code 到后台换取 openId, sessionKey, unionId
  12. }
  13. })
  14. },
  15. globalData: {
  16. userInfo: null,
  17. openid: "",
  18. appid: "",
  19. sessionKey: "",
  20. suiteCode: "",
  21. customerId: "",
  22. },
  23. // mangerUrl: 'http://test2.hhrchina.com',
  24. mangerUrl: "http://192.168.18.156",
  25. // mangerUrl: "https://www.hhrchina.com",
  26. // mangerUrlPath: "https://www.hhrchina.com",
  27. // 自定义显示tabbar
  28. onTabBar: function (key) {
  29. var _curPageArr = getCurrentPages();
  30. var _curPage = _curPageArr[_curPageArr.length - 1];
  31. var _pagePath = _curPage.__route__;
  32. if (_pagePath.indexOf('/') != 0) {
  33. _pagePath = '/' + _pagePath;
  34. }
  35. var tabBar = this.tabBarData[key];
  36. for (var i = 0; i < tabBar.list.length; i++) {
  37. tabBar.list[i].active = false;
  38. if (tabBar.list[i].pagePath == _pagePath) {
  39. tabBar.list[i].active = true; // 根据页面地址设置当前页面状态
  40. }
  41. }
  42. _curPage.setData({
  43. tabBar: tabBar
  44. });
  45. },
  46. })