收藏
回答

多租户,每个租户都有自己的appid,如何让租户自定义主题?

自定义tabbar
<view class="tabbar" wx:if="{{ showTabBar }}">
    <view class="tabbar-container">
        <block wx:for="{{actives}}" wx:key="id">
            <view class="tabbar-item" data-item="{{item}}" style="color: {{activeIndex === item.id ? mainColor : '#999999'}}" bind:tap="changeIndex">
                <view>
                    <text class="{{item.iconPath}}"></text>
                </view>
                <text class="item-title">{{item.name}}</text>
            </view>
        </block>
    </view>
</view>
Component({
    properties: {
    },
    data: {
        actives: [{
                iconPath: 'iconfont icon-a-Frame1',
                name: '首页',
                pagePath: '/pages/index/index',
                id: 0
            },
            {
                iconPath: 'iconfont icon-a-Frame2',
                name: '卡券',
                pagePath: '/pages/ticket/index',
                id: 1
            },
            {
                iconPath: 'iconfont icon-a-Frame3',
                name: '我的',
                pagePath: '/pages/mine/index',
                id: 2
            },
        ],
        activeIndex: 0,
        mainColor: getApp().globalData.mainColor,
        showTabBar: true
    },
    methods: {
        changeIndex(e) {
            const item = e.currentTarget.dataset.item;
            this.setData({
                activeIndex: item.id
            })
            wx.switchTab({ url:item.pagePath });
        },
    }
})
回答关注问题邀请回答
收藏

4 个回答

  • 社区技术运营专员-Jahozheng
    社区技术运营专员-Jahozheng
    2024-11-04

    按照链接提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

    2024-11-04
    有用
    回复
  • 第三方平台小助手
    第三方平台小助手
    2024-10-29

    你好,具体是如何实现操作的?提供可复现的代码片段、录频等信息,是该接口https://developers.weixin.qq.com/miniprogram/dev/api/ext/wx.getExtConfig.html 获取第三方自定义配置无效?

    2024-10-29
    有用
    回复 1
    • 漫天
      漫天
      2024-11-04
      不是第三方的颜色无效   是点击的时候  按钮没有跟着选中当前项
      2024-11-04
      回复
  • 秋乁冬
    秋乁冬
    星期一 14:31
    这是你的逻辑问题,切换页面后,activeIndex 初始化为0了,所以你要点第二次才行
    
    星期一 14:31
    有用
    回复
  • 漫天
    漫天
    2024-11-04

    2024-11-04
    有用
    回复
登录 后发表内容