index.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. const app = getApp();
  2. Component({
  3. data: {
  4. selected: 0,
  5. color: "#7A7E83",
  6. selectedColor: "#3cc51f",
  7. list: [
  8. {
  9. pagePath: "/pages/index/index",
  10. text: "首页",
  11. iconPath: "/static/tabbar/index.png",
  12. selectedIconPath: "/static/tabbar/index-active.png"
  13. },
  14. {
  15. pagePath: "/pages/store/store",
  16. text: "门店",
  17. iconPath: "/static/tabbar/store.png",
  18. selectedIconPath: "/static/tabbar/store-active.png"
  19. },
  20. {
  21. pagePath: "/pages/mine/mine",
  22. text: "我的",
  23. iconPath: "/static/tabbar/me.png",
  24. selectedIconPath: "/static/tabbar/me-active.png"
  25. }
  26. ],
  27. showAgreementModal:false,
  28. programConfig: {}
  29. },
  30. lifetimes: {
  31. ready() {
  32. this.setData({
  33. programConfig: app.globalData.programConfig
  34. });
  35. }
  36. },
  37. methods: {
  38. switchTab(e) {
  39. const { path, index } = e.currentTarget.dataset
  40. wx.switchTab({ url: path })
  41. this.setData({ selected: index })
  42. },
  43. openShowAgreementModal(){
  44. this.setData({ showAgreementModal: true })
  45. },
  46. }
  47. })