东风启辰小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 1.3KB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // pages/component/tabBar/index.js
  2. const app = getApp();
  3. Component({
  4. /**
  5. * 组件的属性列表
  6. */
  7. properties: {
  8. },
  9. /**
  10. * 组件的初始数据
  11. */
  12. data: {
  13. imgUrl: app.globalData.urlStatic,//图片路径
  14. nowPage: app.globalData.nowPage,//当前tabBar
  15. btnSwitch:true,//按钮开关
  16. },
  17. ready:function(e){
  18. this.setData({
  19. btnSwitch:true,
  20. nowPage: app.globalData.nowPage
  21. })
  22. },
  23. /**
  24. * 组件的方法列表
  25. */
  26. methods: {
  27. cutPage: function(e) {//打开遮罩
  28. let page = e.currentTarget.dataset.page;
  29. if (page == this.data.nowPage){
  30. return;
  31. }
  32. this.data.btnSwitch = false;
  33. app.globalData.nowPage = page;
  34. if (page == '1') {
  35. wx.reLaunch({
  36. url: '/pages/index/index'
  37. })
  38. } else if (page == '2'){
  39. wx.reLaunch({
  40. url: '/pages/star/star'
  41. })
  42. } else if (page == '3'){
  43. // wx.showToast({
  44. // title: '暂未开启',
  45. // icon:'none'
  46. // })
  47. // wx.reLaunch({
  48. // url: '/pages/luckyStar/luckyStar'
  49. // })
  50. wx.reLaunch({
  51. url: '/pages/mountings/mountings'
  52. })
  53. } else if (page == '4'){
  54. wx.reLaunch({
  55. url: '/pages/myCenter/myCenter'
  56. })
  57. }
  58. }
  59. }
  60. })