myFollow.js 708 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // pages/navi/navi.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. currentTab: 0,
  8. winWidth: 0,
  9. winHeight: 0
  10. },
  11. switchNav:function(e){
  12. var id = e.currentTarget.id;
  13. this.setData({currentTab:id});
  14. },
  15. /**
  16. * 生命周期函数--监听页面加载
  17. */
  18. onLoad: function (e) {
  19. var page = this;
  20. wx.getSystemInfo({
  21. success: (res) => {
  22. page.setData({winWidth:res.windowWidth});
  23. page.setData({winHeight:res.windowHeight});
  24. },
  25. })
  26. },
  27. switchNav:function(e){
  28. var id = e.currentTarget.id;
  29. this.setData({currentTab:id});
  30. },
  31. updatePage: function(e) {
  32. this.setData({
  33. currentTab: e.detail.current
  34. })
  35. }
  36. })