control.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. const app=getApp();
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. websrc:"",
  8. },
  9. /**
  10. * 生命周期函数--监听页面加载
  11. */
  12. onLoad: function (options) {
  13. this.jumpPageRouter(options);
  14. },
  15. /**
  16. * 设置webview链接
  17. */
  18. jumpPageRouter (options) {
  19. if(app.globalData.personMsg.binded.isManager==1){
  20. this.setData({
  21. websrc:app.globalData.webUrl + 'applet.html#/manage?token=' + app.globalData.token+'&type=2'+'&orgid='+app.globalData.personMsg.binded.org_id + '&client_type=' + app.globalData.clientype+'&empid='+app.globalData.personMsg.binded.id
  22. })
  23. }else{
  24. this.setData({
  25. websrc:app.globalData.webUrl + 'applet.html#/manage?token=' + app.globalData.token+'&type=1'+'&orgid='+app.globalData.personMsg.binded.org_id + '&client_type=' + app.globalData.clientype+'&empid='+app.globalData.personMsg.binded.id
  26. })
  27. }
  28. },
  29. binderror: function () {
  30. wx.switchTab({
  31. url: '/pages/control/control'
  32. })
  33. },
  34. /**
  35. * 生命周期函数--监听页面初次渲染完成
  36. */
  37. onReady: function () {
  38. },
  39. /**
  40. * 生命周期函数--监听页面显示
  41. */
  42. onShow: function () {
  43. // this.getTabBar().setData({
  44. // tabflag: true
  45. // })
  46. // if (typeof this.getTabBar === 'function' && this.getTabBar()) {
  47. // this.getTabBar().setData({
  48. // selected:2
  49. // })
  50. // }
  51. },
  52. /**
  53. * 生命周期函数--监听页面隐藏
  54. */
  55. onHide: function () {
  56. },
  57. /**
  58. * 生命周期函数--监听页面卸载
  59. */
  60. onUnload: function () {
  61. },
  62. /**
  63. * 页面相关事件处理函数--监听用户下拉动作
  64. */
  65. onPullDownRefresh: function () {
  66. },
  67. /**
  68. * 页面上拉触底事件的处理函数
  69. */
  70. onReachBottom: function () {
  71. },
  72. })