This commit is contained in:
parent
3f6aa783f6
commit
cc5da67628
|
|
@ -293,9 +293,17 @@ const submitNum = () => {
|
|||
console.log(res)
|
||||
if(res.code==200){
|
||||
uni.showToast({ title: '编辑成功', icon: 'none' })
|
||||
uni.navigateBack({
|
||||
delta: 2 // 返回到已存在的页面
|
||||
});
|
||||
const pages = getCurrentPages()
|
||||
console.log('🚀 ~ submitNum ~ pages:', pages)
|
||||
if (pages.length == 5) {
|
||||
uni.navigateBack({
|
||||
delta: 3, // 返回到已存在的页面
|
||||
})
|
||||
} else {
|
||||
uni.navigateBack({
|
||||
delta: 2, // 返回到已存在的页面
|
||||
})
|
||||
}
|
||||
}else{
|
||||
uni.showToast({ title: res.msg, icon: 'none' })
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
</uni-col>
|
||||
</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"
|
||||
|
|
@ -138,12 +138,15 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { ref, reactive, computed, nextTick } from 'vue'
|
||||
import { getPickingOutboundListAPI } from '@/services/picking/outbound.js'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { onLoad, onShow, onPageScroll } from '@dcloudio/uni-app'
|
||||
import { debounce } from 'lodash-es'
|
||||
import { onBackPress } from '@dcloudio/uni-app'
|
||||
import { formatDiff } from '@/utils/bnsBase.js'
|
||||
|
||||
|
||||
const scrollTop = ref(0)
|
||||
const total = ref(0) // 数据总量
|
||||
const active = ref(1) // tap索引
|
||||
const tableList = ref([]) // 列表数据源
|
||||
|
|
@ -208,6 +211,10 @@ const getTableList = async (isTap = false, isSearch = false) => {
|
|||
}
|
||||
console.log('queryParams.value查询参数', queryParams.value)
|
||||
const res = await getPickingOutboundListAPI(queryParams.value)
|
||||
setTimeout(() => {
|
||||
scrollTop.value = uni.getStorageSync('scrollTop') || 0
|
||||
console.log('🚀 ~ scrollTop.value:', scrollTop.value)
|
||||
}, 300)
|
||||
console.log('res列表数据', res)
|
||||
total.value = res.data.total
|
||||
if (isTap) {
|
||||
|
|
@ -240,10 +247,14 @@ const getTableList = async (isTap = false, isSearch = false) => {
|
|||
}
|
||||
|
||||
// 页面加载完毕
|
||||
onLoad(() => {
|
||||
onShow(() => {
|
||||
console.log('🚀 ~ onShow:', uni.getStorageSync('queryParams'))
|
||||
queryParams.value.pageNum = 1
|
||||
tableList.value = []
|
||||
total.value = 0
|
||||
if (uni.getStorageSync('queryParams')) {
|
||||
queryParams.value = JSON.parse(uni.getStorageSync('queryParams'))
|
||||
}
|
||||
getTableList()
|
||||
})
|
||||
|
||||
|
|
@ -263,8 +274,19 @@ const onScrollTolower = debounce(() => {
|
|||
}
|
||||
}, 500)
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
// tap 栏切换
|
||||
const changeTab = (index) => {
|
||||
uni.removeStorageSync('scrollTop')
|
||||
uni.removeStorageSync('queryParams')
|
||||
active.value = index
|
||||
console.log('index', index)
|
||||
if (index == 2) {
|
||||
|
|
|
|||
|
|
@ -152,7 +152,9 @@ import { onShow,onLoad } from '@dcloudio/uni-app'
|
|||
|
||||
const urlPermissions = ref([])
|
||||
onShow((options) => {
|
||||
urlPermissions.value = uni.getStorageSync('urlPermissions')
|
||||
urlPermissions.value = uni.getStorageSync('urlPermissions')
|
||||
uni.removeStorageSync('scrollTop')
|
||||
uni.removeStorageSync('queryParams')
|
||||
})
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue