index.js 539 B

12345678910111213141516171819202122232425
  1. var app = getApp()
  2. Page({
  3. onLoad: function () {
  4. wx.getSystemInfo({
  5. success: (res) => {
  6. this.setData({
  7. screenWidth: res.screenWidth,
  8. screenHeight: res.screenHeight,
  9. bannerWidth: res.screenWidth,
  10. bannerHeight: res.screenWidth * 363 / 543
  11. })
  12. }
  13. })
  14. var pt_student = wx.getStorageSync('pt_student')
  15. if (!pt_student) {
  16. wx.redirectTo({
  17. url: '/pages/login/index',
  18. })
  19. } else {
  20. app.globalData.ptStudent = pt_student;
  21. }
  22. }
  23. })