分页以及tab栏切换,动态传类型

时间:2024-07-14 10:29:50
<view class="disTitle"> <view class="disName"> 账户明细 </view> <view class="nav"> <u-tabs lineWidth="0" :activeStyle="{color: '#FD893F' }" :list="navList" @change="tabsChange" :scrollable="false" :current="tabsCurrent"></u-tabs> </view> </view> <view v-if="tabsCurrent === 0"> <view class="content"> <view class="conItem" v-for="item in list" :key="item.id"> <view class="left"> <view class=""> {{item.sourceName}} </view> <view class=""> {{dataFormat(item.sourceTime)}} </view> </view> <view class="right" v-if="item.type===1" style="color: #F75038;"> +{{item.money}} </view> <view class="right" v-else-if="item.type===2"> -{{item.money}} </view> </view> </view> </view> <view v-if="tabsCurrent === 1"> <view class="content"> <view class="conItem" v-for="item in list" :key="item.id"> <view class="left"> <view class=""> {{item.sourceName}} </view> <view class=""> {{dataFormat(item.sourceTime)}} </view> </view> <view class="right" v-if="item.type===1" style="color: #F75038;"> +{{item.money}} </view> <view class="right" v-else-if="item.type===2"> -{{item.money}} </view> </view> </view> </view> <view v-if="tabsCurrent === 2"> <view class="content"> <view class="conItem" v-for="item in list" :key="item.id"> <view class="left"> <view class=""> {{item.sourceName}} </view> <view class=""> {{dataFormat(item.sourceTime)}} </view> </view> <view class="right" v-if="item.type===1" style="color: #F75038;"> +{{item.money}} </view> <view class="right" v-else-if="item.type===2"> -{{item.money}} </view> </view> </view> </view> <view v-if="list.length<=0"> <u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"></u-empty> </view>