YM
2024-03-25 bd95a6030cdeeb3acea564441d0c71feb6e708e2
tabBar问题调整
5个文件已修改
41 ■■■■ 已修改文件
custom-tab-bar/index.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/assort/index.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/cart/index.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/personalCenter/index.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/student/index.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
custom-tab-bar/index.js
@@ -4,11 +4,6 @@
    selected: 0,
    list: TabMenu,
  },
  // observers: {
  //   'active': function (newValue) {
  //     console.log('active变化', newValue);
  //   }
  // },
  methods: {
    changeTab(item) {
      this.setData({
@@ -18,17 +13,6 @@
        url: this.data.list[this.data.selected].url.startsWith('/') ?
          this.data.list[this.data.selected].url : `/${this.data.list[this.data.selected].url}`,
      });
    },
    // init() {
    //   const page = getCurrentPages().pop();
    //   const route = page ? page.route.split('?')[0] : '';
    //   const active = this.data.list.findIndex(
    //     (item) =>
    //       (item.url.startsWith('/') ? item.url.substr(1) : item.url) ===
    //       `${route}`,
    //   );
    //   this.setData({ active });
    // },
    }
  },
});
pages/bookServices/assort/index.js
@@ -39,6 +39,11 @@
   * 生命周期函数--监听页面显示
   */
  onShow() {
    if (typeof this.getTabBar === 'function' && this.getTabBar()) {
      this.getTabBar().setData({
        active: 1
      })
    }
  },
  /**
pages/cart/index.js
@@ -25,9 +25,13 @@
    this.shoppingCartGet();
  },
  onShow() {
    if (typeof this.getTabBar === 'function' && this.getTabBar()) {
      this.getTabBar().setData({
        active: 3
      })
    }
    this.shoppingCartGet();
    this.setData({ totalPrice: 0.00, selectedCount: 0, checkAll: false, })
  },
  onDelete(e) {
    const item = e.currentTarget.dataset.item;
pages/personalCenter/index.js
@@ -145,7 +145,11 @@
  },
  onShow() {
    if (typeof this.getTabBar === 'function' && this.getTabBar()) {
      this.getTabBar().setData({
        active: 4
      })
    }
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
pages/student/index.js
@@ -26,7 +26,11 @@
   * 生命周期函数--监听页面显示
   */
  onShow() {
    if (typeof this.getTabBar === 'function' && this.getTabBar()) {
      this.getTabBar().setData({
        active: 2
      })
    }
  },
  /**