首页滚动、单体电池滚动
This commit is contained in:
@ -13,7 +13,8 @@
|
||||
"path": "pages/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "移动端框架",
|
||||
"navigationStyle": "custom"
|
||||
"navigationStyle": "custom",
|
||||
"onReachBottomDistance": 100
|
||||
}
|
||||
}, {
|
||||
"path": "pages/work/index",
|
||||
|
||||
@ -12,8 +12,8 @@
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
<scroll-view class="scroll-y" :scroll-y="true" @scrolltolower="lower" scrolltoupper="upper">
|
||||
<view class="content">
|
||||
<view v-if="list.length===0" class="no-data">暂无数据</view>
|
||||
<view class="content scroll-y" v-else>
|
||||
<view class="item-list" v-for="item in list" :key="item.ticketNo+'ticket'" @click="toDetail(item.id)">
|
||||
<view class="item-title" :class="item.status === 1 ? 'done' : 'undone'">工单号:{{item.ticketNo}}</view>
|
||||
<view class="item-content">
|
||||
@ -24,9 +24,7 @@
|
||||
<view class="item-info">处理人:{{item.workName || '-'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="list.length===0" class="no-data">暂无数据</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
@ -58,15 +56,6 @@
|
||||
this.reset()
|
||||
this.init()
|
||||
},
|
||||
lower() {
|
||||
if (this.list.length >= this.total) {
|
||||
return console.log('数据已经加载完成')
|
||||
}
|
||||
this.pageNum += 1;
|
||||
this.init().catch(() => {
|
||||
this.pageNum -= 1
|
||||
})
|
||||
},
|
||||
init() {
|
||||
//0:'待处理', 1:'已处理', 2:'处理中'
|
||||
let url = `/ticket/list?pageNum=${this.pageNum}&pageSize=${this.pageSize}`
|
||||
@ -93,6 +82,17 @@
|
||||
this.pageNum = 1
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
console.log('触底了')
|
||||
if (this.list.length >= this.total) {
|
||||
return console.log('数据已经加载完成')
|
||||
}
|
||||
this.pageNum += 1;
|
||||
this.init().catch(() => {
|
||||
this.pageNum -= 1
|
||||
})
|
||||
|
||||
},
|
||||
onShow() {
|
||||
this.reset()
|
||||
this.init()
|
||||
@ -135,7 +135,7 @@
|
||||
}
|
||||
|
||||
.scroll-y {
|
||||
height: calc(100vh - var(--window-bottom) - var(--window-top));
|
||||
// height: calc(100vh - var(--window-bottom) - var(--window-top));
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
|
||||
@ -126,6 +126,14 @@
|
||||
onPageScroll(e) {
|
||||
this.pageScrollTop = e.scrollTop
|
||||
},
|
||||
onReachBottom() {
|
||||
console.log('触底了')
|
||||
if (this.list.length >= this.total) {
|
||||
return console.log('数据已经加载完成')
|
||||
}
|
||||
this.pageNum += 1 //每次搜索从1开始搜索
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
openSearch() {
|
||||
this.$refs.searchPopup.open()
|
||||
@ -146,11 +154,6 @@
|
||||
deviceId
|
||||
}, dataType)
|
||||
},
|
||||
onReachBottom() {
|
||||
console.log('触底了')
|
||||
this.pageNum += 1 //每次搜索从1开始搜索
|
||||
this.getTableData()
|
||||
},
|
||||
// 搜索
|
||||
onSearch() {
|
||||
this.pageNum = 1 //每次搜索从1开始搜索
|
||||
|
||||
Reference in New Issue
Block a user