当前位置:网站首页>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() {
}
})边栏推荐
- Financial management (Higher Vocational College) financial management online Assignment 1 in autumn 20
- vs2013已阻止安装程序,需安装IE10
- Research on Swift
- c# . Net tool ecosystem
- 互聯網醫院HIS管理平臺源碼,在線問診,預約掛號 智慧醫院小程序源碼
- Create a new file from templates with bash script - create new file from templates with bash script
- 面试官:值为 nil 为什么不等于 nil ?
- UE4 official charging resources, with a total price of several thousand
- Write a program to process a list container of string type. Find a special value in the container 9.27: and delete it if found. Rewrite the above procedure with deque container.
- [combinatorics] recursive equation (special solution example 1 Hannover tower complete solution process | special solution example 2 special solution processing when the characteristic root is 1)
猜你喜欢

【JokerのZYNQ7020】DDS_ Compiler。

TCP congestion control details | 3 design space

2021 ICPC regional competition (Shanghai) g.edge groups (tree DP)

MySQL has been stopped in the configuration interface during installation

Global and Chinese health care OEM and ODM market status survey and investment planning recommendations report 2022-2028
![[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

Hongmeng fourth training

面试官:值为 nil 为什么不等于 nil ?

vs2013已阻止安装程序,需安装IE10

鸿蒙第四次培训
随机推荐
Graduation summary
[combinatorics] recursive equation (special solution form | special solution solving method | special solution example)
[combinatorics] generating function (linear property | product property)
Create a new file from templates with bash script - create new file from templates with bash script
Global and Chinese health care OEM and ODM market status survey and investment planning recommendations report 2022-2028
绝对定位时元素水平垂直居中
Type conversion, variable
QT learning diary 9 - dialog box
Golang unit test, mock test and benchmark test
[combinatorics] recursive equation (solution of linear non-homogeneous recursive equation with constant coefficients | standard form and general solution of recursive equation | proof of general solut
Online assignment 3 of mobile Internet technology in the 20th autumn of electronic technology [standard answer]
Hongmeng third training
How to purchase Google colab members in China
Answer to the homework assessment of advanced English reading (II) of the course examination of Fuzhou Normal University in February 2022
【RT-Thread】nxp rt10xx 设备驱动框架之--Audio搭建和使用
面试官:值为 nil 为什么不等于 nil ?
Financial management (Higher Vocational College) financial management online Assignment 1 in autumn 20
How to enforce parameters in PowerShell- How do I make parameters mandatory in PowerShell?
University of Electronic Science and technology, accounting computerization, spring 20 final exam [standard answer]
ArrayList分析3 : 删除元素