当前位置:网站首页>Applet with multiple tabs and Swipers + paging of each tab
Applet with multiple tabs and Swipers + paging of each tab
2022-07-03 17:43:00 【Twinkle, twinkle, twinkle, twinkle, twinkle, twinkle, twinkle, 】
wxml:
<!-- header -->
<view class="flex flex-col flex-fv flex-fh">
<view class="flex flex-hb flex-ve text-9EA0A4 font32">
<view class="flex flex-ve" bindtap="changeTab">
<view class="mr40 line_height1 {
{ activeIndex == 0 ? 'text-2E3238 font48 font-w':'' }}" data-index="0">tab0</view>
<view class="mr40 line_height1 {
{ activeIndex == 1 ? 'text-2E3238 font48 font-w ':'' }}" data-index="1">tab1</view>
<view class="mr40 line_height1 {
{ activeIndex == 2 ? 'text-2E3238 font48 font-w':'' }}" data-index="2">tab2</view>
</view>
</view>
<view class="f1">
<swiper class="flex-fv" bindchange="bindSwiperChange" current="{
{ activeIndex }}">
<!-- tab0 -->
<swiper-item class="bg-red">
<scroll-view class="flex-fv" scroll-y bindscrolltolower="scrolltolower">
<block wx:for="{
{ tabData[0].list }}" wx:key="index">
<view></view>
</block>
</scroll-view>
</swiper-item>
<!-- tab1 -->
<swiper-item class="bg-green">
<scroll-view class="flex-fv" scroll-y bindscrolltolower="scrolltolower">
<block wx:for="{
{ tabData[1].list }}" wx:key="index">
<view></view>
</block>
</scroll-view>
</swiper-item>
<!-- tab2 -->
<swiper-item class="bg-red">
<scroll-view class="flex-fv" scroll-y bindscrolltolower="scrolltolower">
<block wx:for="{
{ tabData[2].list }}" wx:key="index">
<view style="height: 200rpx;" class="bg-white mt20">{
{ index }}</view>
</block>
</scroll-view>
</swiper-item>
</swiper>
</view>
</view>
js:
import { dateFormatStr } from "../../../utils/util";
const app = getApp()
Page({
/**
* Initial data of the page
*/
data: {
tabData:[
{
list:[],
page:1
},
{
list:[],
page:2
},
{
list:[],
page:3
}
],
activeIndex:0,
page:1,
pageSize:10,
userInfo: {}, // Login personal data
},
/**
* Life cycle function -- Monitor page loading
*/
onLoad(options) {
this.setData({
userInfo: app.globalData.userInfo,
});
this.getList()
},
//tab Switch
changeTab(e){
const { index } = e.target.dataset;
if(index >= 0){
this.setData({
activeIndex:index,
});
}
this.getList()
},
/**
* swiper Switch
* @param {*} e
*/
bindSwiperChange:function(e){
var { current } = e.detail;
this.setData({
activeIndex:current,
});
this.getList()
},
/**
* obtain list
*/
getList(){
const { tabData,activeIndex,pageSize } = this.data
const addlist = []
this.setData({
[`tabData[${activeIndex}].list`]:tabData[activeIndex].list.concat(addlist)
})
},
/**
* Handling function of page pull bottom event
*/
scrolltolower() {
const { tabData,activeIndex } = this.data
console.log('tabData:',tabData)
tabData[activeIndex].page++
this.getList()
},
/**
* Users click the upper right corner to share
*/
onShareAppMessage() {
}
})边栏推荐
- 1146_ SiCp learning notes_ exponentiation
- [combinatorics] recursive equation (four cases where the non-homogeneous part of a linear non-homogeneous recursive equation with constant coefficients is the general solution of the combination of po
- Assembly for unloading Loadfrom() loaded assembly - unloading the assembly loaded with assembly LoadFrom()
- Internet Hospital his Management Platform source, online Inquiry, appointment Registration Smart Hospital Small program source
- Global and Chinese health care OEM and ODM market status survey and investment planning recommendations report 2022-2028
- Brief introduction to the core functions of automatic penetration testing tool
- Comparison of kotlin collaboration + retro build network request schemes
- 一位普通程序员一天工作清单
- POM in idea XML graying solution
- ArrayList分析3 : 删除元素
猜你喜欢

Hongmeng third training

Draw some simple graphics with MFC

国内如何购买Google Colab会员
![[set theory] order relation: summary (partial order relation | partial order set | comparable | strictly less than | covering | hasto | total order relation | quasi order relation | partial order rela](/img/df/a034032e203e7935dafaf8a71cb6c8.jpg)
[set theory] order relation: summary (partial order relation | partial order set | comparable | strictly less than | covering | hasto | total order relation | quasi order relation | partial order rela
![[combinatorics] recursive equation (summary of the solution process of recursive equation | homogeneous | double root | non-homogeneous | characteristic root is 1 | exponential form | the bottom is th](/img/f1/c96c4a6d34e1ae971f492f4aed5a93.jpg)
[combinatorics] recursive equation (summary of the solution process of recursive equation | homogeneous | double root | non-homogeneous | characteristic root is 1 | exponential form | the bottom is th

Embedded-c language-7

Type conversion, variable

Records of long objects and long judgments in the stream of list

TCP拥塞控制详解 | 3. 设计空间

【RT-Thread】nxp rt10xx 设备驱动框架之--Pin搭建和使用
随机推荐
What is the difference between cloud server and cloud virtual machine
Investigation on the operation prospect of the global and Chinese Anti enkephalinase market and analysis report on the investment strategy of the 14th five year plan 2022-2028
How to purchase Google colab members in China
PUT vs. POST for Uploading Files - RESTful API to be Built Using Zend Framework
Applet setting multi account debugging
ArrayList analysis 3: delete elements
毕业总结
vs2013已阻止安装程序,需安装IE10
Getting started with deops
【RT-Thread】nxp rt10xx 设备驱动框架之--Audio搭建和使用
ArrayList分析3 : 删除元素
Introduction to SolidWorks gear design software tool geartrax
Analysis report on production and marketing demand and investment forecast of China's PVC industry from 2021 to 2026
问题随记 —— 在 edge 上看视频会绿屏
[combinatorics] recursive equation (special solution form | special solution solving method | special solution example)
Website with JS doesn't work in IE9 until the Developer Tools is activated
TCP拥塞控制详解 | 3. 设计空间
1147_ Makefile learning_ Target files and dependent files in makefile
Global and Chinese pediatric palliative care drug market development research and investment planning recommendations report 2022-2028
一入“远程”终不悔,几人欢喜几人愁。| 社区征文