
<view>
<!-- Tab布局 -->
<view class='navBox'>
<view class='titleBox' bindtap='titleClick' data-idx='0'>
<text class="{{0 == currentIndex ? 'fontColorBox' : ''}}">装备</text>
<hr class="{{0 == currentIndex ? 'lineBox' : 'notLineBox'}}" />
</view>
<view class='titleBox' bindtap='titleClick' data-idx='1'>
<text class="{{1 == currentIndex ? 'fontColorBox1' : ''}}">活动</text>
<hr class="{{1 == currentIndex ? 'lineBox' : 'notLineBox'}} " />
</view>
</view>
<!-- 内容布局 -->
<swiper style="height: 90vh;" bindchange='pagechange' current='{{currentIndex}}'>
<swiper-item class='swiperTtemBox'>
<view>装备内容1</view>
<view>装备内容1</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容1</view>
<view>装备内容</view>
<view>装备内容2</view>
<view>装备内容</view>
<view>装备内容2</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容4</view>
<view>装备内容</view>
<view>装备内容6</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容8</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容</view>
<view>装备内容9</view>
<view>装备内容10</view>
</swiper-item>
<swiper-item class='swiperTtemBox'>
<view>活动内容</view>
</swiper-item>
</swiper>
</view>
Page {
background: rgb(121, 139, 211);
height: 100%;
position: fixed;
}
.fontColorBox,
.fontColorBox1 {
color: black;
}
.navBox {
width: 100%;
height: 108rpx;
background: white;
display: flex;
align-items: center;
justify-content: center;
}
.navBox view:last-child {
padding-left: 20%;
}
.titleBox {
color: rgb(168, 170, 175);
font-size: 30rpx;
display: flex;
flex-direction: column;
align-items: center;
}
.lineBox,.notLineBox{
width: 32rpx;
height: 8rpx;
}
.lineBox {
background: rgb(43, 44, 45);
margin-top: 16rpx;
border-radius: 4rpx;
}
.notLineBox {
background: transparent;
}
.swiperTtemBox {
height: 100vh;
overflow: scroll;
margin: 12rpx 0rpx;
background: white;
font-size: 28rpx;
}
Page({
data: {
currentIndex: 0,
},
pagechange: function (e) {
console.log(e,9999)
if ("touch" === e.detail.source) {
let currentPageIndex = this.data.currentIndex;
currentPageIndex = (currentPageIndex + 1) % 2;
this.setData({
currentIndex: currentPageIndex,
})
}
},
titleClick: function (e) {
this.setData({
currentIndex: e.currentTarget.dataset.idx
})
},
})