当前位置: 首页 > news >正文

长沙电子商务网站建设学电脑培训班

长沙电子商务网站建设,学电脑培训班,天津网站建设方案优化,wordpress 评论表情插件一、先上效果 二 方法 1、自定义底部tabbar 实现: https://developers.weixin.qq.com/miniprogram/dev/framework/ability/custom-tabbar.html 官网去抄 简单写下:在代码根目录下添加入口文件 除了js 文件的list 需要调整 其他原封不动 代码&#xf…

一、先上效果

在这里插入图片描述

二 方法

1、自定义底部tabbar

实现:

https://developers.weixin.qq.com/miniprogram/dev/framework/ability/custom-tabbar.html 官网去抄

简单写下:在代码根目录下添加入口文件 除了js 文件的list 需要调整 其他原封不动
在这里插入图片描述

代码:
js部分

Component({data: {selected: 0,color: "#7A7E83",selectedColor: "#0081FF",list: [{  // 同app.json下的tabbar列表"iconPath": "/assets/img/build.png","selectedIconPath": "/assets/img/buildSelect.png","pagePath": "/pages/index/index","text": "淘楼"},{"iconPath": "/assets/img/my.png","selectedIconPath": "/assets/img/selectMy.png","pagePath": "/pages/my/index","text": "我的"}]},attached() {},methods: {switchTab(e) {console.log(e.currentTarget)const data = e.currentTarget.datasetconst url = data.pathwx.switchTab({url})this.setData({selected: data.index})}}
})

json

{"component": true,"usingComponents": {}
}

wxml

<!--miniprogram/custom-tab-bar/index.wxml-->
<view class="tab-bar"><view class="tab-bar-border"></view><view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab"><image src="{{selected === index ? item.selectedIconPath : item.iconPath}}"></image><view style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</view></view>
</view>

wxss

  position: fixed;bottom: 0;left: 0;right: 0;height: 48px;background: white;display: flex;padding-bottom: env(safe-area-inset-bottom);z-index: 99;
}.tab-bar-border {background-color: rgba(0, 0, 0, 0.33);position: absolute;left: 0;top: 0;width: 100%;height: 1px;transform: scaleY(0.5);
}.tab-bar-item {flex: 1;text-align: center;display: flex;justify-content: center;align-items: center;flex-direction: column;
}.tab-bar-item image {width: 27px;height: 27px;
}.tab-bar-item view {font-size: 10px;
}.tab-bar {position: fixed;bottom: 0;left: 0;right: 0;height: 48px;background: white;display: flex;padding-bottom: env(safe-area-inset-bottom);z-index: 99;
}.tab-bar-border {background-color: rgba(0, 0, 0, 0.33);position: absolute;left: 0;top: 0;width: 100%;height: 1px;transform: scaleY(0.5);
}.tab-bar-item {flex: 1;text-align: center;display: flex;justify-content: center;align-items: center;flex-direction: column;
}.tab-bar-item image {width: 27px;height: 27px;
}.tab-bar-item view {font-size: 10px;
}

2、 list 的中的页面 都需要在onShow中加入一下方法

    if (typeof this.getTabBar === 'function' &&this.getTabBar()) {this.getTabBar().setData({selected: 0})}

三、遮罩层 盖住底部tabbar 自己实现一个遮罩层或者使用组件 我这儿用的组件 只需要让z-index:的值大于99999 即可

<!-- 遮罩层 -->
<van-overlay show="{{ overlayShow }}" vertical z-index="{{999999}}"><view class="overlay-content"><van-loading type="spinner">加载中...</van-loading></view>
</van-overlay>
http://www.mnyf.cn/news/42043.html

相关文章:

  • 学网站开发的软件线上销售怎么做推广
  • 网站建设的经费昆明seo优化
  • 用来做区位分析的地图网站收录网
  • 做私彩网站需注意什么seo的收费标准
  • 南京做网站哪家最好颜色广告
  • 网站开发建设合同范本北京核心词优化市场
  • 珠海网站建设的公司排名宁波网站推广平台效果好
  • 苹果电脑如何做网站短网址在线生成
  • 音乐网站开发参考文献公司官网怎么做
  • 毕业设计做网站起个名字微信小程序开发详细步骤
  • 国内重大新闻10条阳江seo
  • 天猫网站做链接怎么做优化一个网站需要多少钱
  • 做b2b比较好的网站有哪些杭州seo排名公司
  • 政务服务网站建设运行情况seo引擎优化
  • 51个人网站网站排名优化快速
  • 醴陵微信小程序网站开发价格网页推广方案
  • 哈尔滨网站设计哪家好google关键词搜索技巧
  • 天津市建设工程定额网站酒店网络营销推广方式
  • 衡量网站质量的标准手机优化管家
  • 峡江网站建设百度竞价排名公式
  • 如何做免费的网站网站开发培训
  • wed网站开发是什么网络推广及销售
  • 网站建设资源360建网站
  • 比价网站开发十大电商代运营公司
  • 广州技术支持:奇亿网站建设我想做电商怎么加入
  • 美好乡村建设网站2022百度搜索风云榜
  • 有什么网站可以做数学题网络推广深圳有效渠道
  • 网站设计网站开发百度搜索引擎的网址
  • 做网站哪里便宜今日广州新闻最新消息
  • 个人域名备案 网站名称搜索引擎营销的主要模式有哪些