1.微信小程序实现标签页滑块效果
2.小程序完整代码:
3.wxml:
viewclass"swiper-tab"viewclass"swiper-tab-list{{currentTab0?'on':''}}"data-current"0"bindtap"swichNav"留言/viewviewclass"swiper-tab-list{{currentTab1?'on':''}}"data-current"1"bindtap"swichNav"活动/viewviewclass"swiper-tab-list{{currentTab2?'on':''}}"data-current"2"bindtap"swichNav"更多/view/viewswipercurrent"{{currentTab}}"class"swiper-box"duration"300"style"height:{{winHeight-31}}px"bindchange"bindChange"swiper-itemviewimagesrc'{{image}}'class'img'/image/view/swiper-itemswiper-itemviewimagesrc'{{image}}'class'img'/image/view/swiper-itemswiper-itemviewimagesrc'{{image}}'class'img'/image/view/swiper-item/swiper复制代码4.wxss:
Page{background-color:#f1f1f1;}.swiper-tab{background-color:#fff;width:100%;text-align:center;line-height:80rpx;}.swiper-tab-list{font-size:30rpx;display:inline-block;width:33.33%;color:#797979;}.on{color:#ca0c16;border-bottom:5rpxsolid#ca0c16;}.swiper-box{display:block;height:100%;width:100%;overflow:hidden;}.img{width:100%;height:540rpx;}复制代码5.js:
Page({data:{winWidth:0,winHeight:0,currentTab:0,image:"../../images/404.png",},onLoad:function(options){},onReady:function(){varthatthis;wx.getSystemInfo({success:function(res){that.setData({winWidth:res.windowWidth,winHeight:res.windowHeight});}});},//滑动切换tabbindChange:function(e){varthatthis;that.setData({currentTab:e.detail.current});},//点击tab切换swichNav:function(e){varthatthis;if(this.data.currentTabe.target.dataset.current){returnfalse;}else{that.setData({currentTab:e.target.dataset.current})}},onShow:function(){},onHide:function(){},onUnload:function(){},})复制代码6.json:
{"navigationBarTitleText":"消息"}复制代码7.案例二:
8.效果图:
9.代码:
10.wxml:
viewclass"swiper-tab"viewclass"swiper-tab-list{{currentTab0?'on':''}}"data-current"0"bindtap"swichNav"待审批/viewviewclass"swiper-tab-list{{currentTab1?'on':''}}"data-current"1"bindtap"swichNav"已审批/view/viewswipercurrent"{{currentTab}}"class"swiper-box"duration"300"style"height:{{winHeight-31}}px"bindchange"bindChange"swiper-item/swiper-itemswiper-item/swiper-item/swiper复制代码11.js:
Page({/***页面的初始数据*/data:{winWidth:0,winHeight:0,currentTab:0,},//滑动切换tabbindChange:function(e){varthatthis;that.setData({currentTab:e.detail.current});},//点击tab切换swichNav:function(e){varthatthis;if(this.data.currentTabe.target.dataset.current){returnfalse;}else{that.setData({currentTab:e.target.dataset.current})}},/***生命周期函数--监听页面加载*/onLoad:function(options){},/***生命周期函数--监听页面初次渲染完成*/onReady:function(){varthatthis;wx.getSystemInfo({success:function(res){that.setData({winWidth:res.windowWidth,winHeight:res.windowHeight});}});},/***生命周期函数--监听页面显示*/onShow:function(){},/***生命周期函数--监听页面隐藏*/onHide:function(){},/***生命周期函数--监听页面卸载*/onUnload:function(){},/***页面相关事件处理函数--监听用户下拉动作*/onPullDownRefresh:function(){},/***页面上拉触底事件的处理函数*/onReachBottom:function(){},/***用户点击右上角分享*/onShareAppMessage:function(){}})复制代码12.wxss:
Page{background-color:#f1f1f1;}.swiper-tab{background-color:#fff;width:100%;text-align:center;line-height:80rpx;}.swiper-tab-list{font-size:30rpx;display:inline-block;width:50%;color:#797979;}.on{color:#5fdafe;border-bottom:5rpxsolid#30d1ff;}.swiper-box{display:block;height:100%;width:100%;overflow:hidden;}复制代码13.达叔小生:往后余生,唯独有你Youandme,wearefamily!90后帅气小伙,良好的开发习惯;独立思考的能力;主动并且善于沟通简书博客:达叔小生www.jianshu.com/u/c785ece60…
结语下面我将继续对其他知识深入讲解,有兴趣可以继续关注小礼物走一走or点赞
微信小程序实现标签页滑块效果-小程序图片滑块验证码-小程序图形验证码
浏览量:3212
时间:
来源:weixin_34153893
版权声明
即速应用倡导尊重与保护知识产权。如发现本站文章存在版权问题,烦请提供版权疑问、身份证明、版权证明、联系方式等发邮件至197452366@qq.com ,我们将及时处理。本站文章仅作分享交流用途,作者观点不等同于即速应用观点。用户与作者的任何交易与本站无关,请知悉。
最新资讯
-

即速应用,赋能企业玩转微信小程序智慧经营
作为国内领军的智慧商业经营服务商,即速应用始终秉承“让每个企业都拥有自己的智慧店铺”的愿景,持续赋能更多企业玩转智慧经营。即速应用旗下拥有“小程序搭建工具-即速应用”、“私域流量专家-即客云”等产品,帮助商家打通互联网全生态营销闭环。 -

即客云2.0重磅更新,让微信小程序运营更简单!
即客云作为一款基于企业微信的第三方工具,现从多维度提供超过30种功能,自上线以来,已服务多家企业,受到一致好评。近期,我们根据客户反馈和市场调研正式推出升级版 即客云2.0!更新了私域运营SOP,群日历功能,批量拓客,客户雷达,消息推送,个人欢迎语,帮助企业更好运用企业微信;同时提升了社群运营工作标准化,提升运营效率,帮助企业实现客户增长,玩转私域流量。 -

零代码 + AI 双轮驱动|即速应用解锁人工智能小程序开发新范式
无需代码、无需 AI 算法功底,普通人也能快速搭建智能小程序。即速应用将人工智能与零代码开发深度融合,推出 AI 智能生成能力,用户通过自然语言描述需求,AI 自动生成小程序页面、功能模块与后台配置,覆盖商城、预约、同城、社区团购等全场景。平台内置 AI 智能推荐、智能客服、用户画像分析等能力,一键对接微信生态,打通视频号、企业微信、短信跳转,帮企业快速落地 AI 应用,抢占智慧经营先机,让每家企业都拥有 AI 驱动的智慧店铺。











