This commit is contained in:
parent
7c20b0bc6c
commit
0414525d66
|
|
@ -54,7 +54,7 @@
|
||||||
</uni-col>
|
</uni-col>
|
||||||
</uni-row>
|
</uni-row>
|
||||||
|
|
||||||
<scroll-view scroll-y @scrolltolower="onScrollTolower" class="scroll-container">
|
<scroll-view scroll-y :scroll-top="scrollTop" @scroll="onScroll" @scrolltolower="onScrollTolower" class="scroll-container">
|
||||||
<view class="table-list-item" :key="index" @click="handleItem(item)" v-for="(item, index) in tableList">
|
<view class="table-list-item" :key="index" @click="handleItem(item)" v-for="(item, index) in tableList">
|
||||||
<!-- <uni-swipe-action>
|
<!-- <uni-swipe-action>
|
||||||
<uni-swipe-action-item @click="onClick($event, item)" :right-options="options"> -->
|
<uni-swipe-action-item @click="onClick($event, item)" :right-options="options"> -->
|
||||||
|
|
@ -139,6 +139,7 @@ const queryParams = ref({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
})
|
})
|
||||||
|
const scrollTop = ref(0) // 滚动位置
|
||||||
|
|
||||||
// 右滑按钮组
|
// 右滑按钮组
|
||||||
const options = ref([
|
const options = ref([
|
||||||
|
|
@ -219,6 +220,10 @@ const getTableList = async (isTap = false) => {
|
||||||
})
|
})
|
||||||
console.log('queryParams.value查询参数', queryParams.value)
|
console.log('queryParams.value查询参数', queryParams.value)
|
||||||
const res = await getRepairListAPI(queryParams.value)
|
const res = await getRepairListAPI(queryParams.value)
|
||||||
|
setTimeout(() => {
|
||||||
|
scrollTop.value = uni.getStorageSync('scrollTop') || 0
|
||||||
|
console.log('🚀 ~ scrollTop.value:', scrollTop.value)
|
||||||
|
}, 400)
|
||||||
total.value = res.data.total
|
total.value = res.data.total
|
||||||
if (isTap) {
|
if (isTap) {
|
||||||
tableList.value = res.data.rows
|
tableList.value = res.data.rows
|
||||||
|
|
@ -243,6 +248,15 @@ onShow(() => {
|
||||||
getTableList(true)
|
getTableList(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
let timer = null
|
||||||
|
const onScroll = (e) => {
|
||||||
|
if (timer) clearTimeout(timer)
|
||||||
|
timer = setTimeout(() => {
|
||||||
|
uni.setStorageSync('scrollTop', e.detail.scrollTop)
|
||||||
|
uni.setStorageSync('queryParams', JSON.stringify(queryParams.value))
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
|
||||||
// 滚动触底事件
|
// 滚动触底事件
|
||||||
const onScrollTolower = debounce(() => {
|
const onScrollTolower = debounce(() => {
|
||||||
console.log('触底事件')
|
console.log('触底事件')
|
||||||
|
|
@ -255,6 +269,10 @@ const onScrollTolower = debounce(() => {
|
||||||
// tap 栏切换
|
// tap 栏切换
|
||||||
const changeTab = (index) => {
|
const changeTab = (index) => {
|
||||||
active.value = index
|
active.value = index
|
||||||
|
uni.setStorageSync('scrollTop', 0)
|
||||||
|
uni.setStorageSync('activeTab', index)
|
||||||
|
uni.removeStorageSync('queryParams')
|
||||||
|
uni.removeStorageSync('scrollTop')
|
||||||
if (index == 1) {
|
if (index == 1) {
|
||||||
queryParams.value.appTaskStatus = 0 // 查未完成的
|
queryParams.value.appTaskStatus = 0 // 查未完成的
|
||||||
queryParams.value.pageNum = 1
|
queryParams.value.pageNum = 1
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@
|
||||||
<uni-row :gutter="24">
|
<uni-row :gutter="24">
|
||||||
<uni-col :span="6">维修单号:</uni-col>
|
<uni-col :span="6">维修单号:</uni-col>
|
||||||
<uni-col :span="18">
|
<uni-col :span="18">
|
||||||
<view class="cont">{{ item.repairTaskCode }}</view>
|
<view class="cont">{{ item.repairCode }}</view>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
</uni-row>
|
</uni-row>
|
||||||
<uni-row :gutter="24">
|
<uni-row :gutter="24">
|
||||||
|
|
@ -130,7 +130,7 @@
|
||||||
<uni-row :gutter="24">
|
<uni-row :gutter="24">
|
||||||
<uni-col :span="6">创建人:</uni-col>
|
<uni-col :span="6">创建人:</uni-col>
|
||||||
<uni-col :span="18"
|
<uni-col :span="18"
|
||||||
><view class="cont">{{ item.createBy }}</view>
|
><view class="cont">{{ item.createBy2 }}</view>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
</uni-row>
|
</uni-row>
|
||||||
<uni-row :gutter="24">
|
<uni-row :gutter="24">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue