优化:点击我的工单-有就直接未解决tab

This commit is contained in:
Zy
2026-08-17 09:50:59 +08:00
parent 10bbc8a782
commit 0a835ecc41
2 changed files with 23 additions and 9 deletions

View File

@@ -80,7 +80,7 @@
<script setup> <script setup>
import { ref, computed } from 'vue' import { ref, computed } from 'vue'
import { onReady, onShow } from '@dcloudio/uni-app' import { onReady, onShow, onLoad } from '@dcloudio/uni-app'
import TabsComponents from '@/components/tabs/tabs.vue' import TabsComponents from '@/components/tabs/tabs.vue'
import NavBar from '@/components/navbar/navbar.vue' import NavBar from '@/components/navbar/navbar.vue'
import { getUserTicketlist } from '@/api/ticket.js' import { getUserTicketlist } from '@/api/ticket.js'
@@ -120,6 +120,17 @@ function scrolltolower() {
queryParmas.value.pageNum += 1 queryParmas.value.pageNum += 1
getlist() getlist()
} }
onLoad(data => {
if (data.MyOrderNum === '0') {
activeStatus.value = 0
queryParmas.value.problemStatus = undefined
} else {
activeStatus.value = 1
queryParmas.value.problemStatus = 1
}
})
function getlist() { function getlist() {
if (isLoading.value || !hasMore.value) return if (isLoading.value || !hasMore.value) return
isLoading.value = true isLoading.value = true

View File

@@ -186,7 +186,7 @@ const goToTicketHall = () => {
// 我的工单 // 我的工单
const goToMyTicket = () => { const goToMyTicket = () => {
uni.navigateTo({ uni.navigateTo({
url: '/pageSubPack/ticket/myticket' url: '/pageSubPack/ticket/myticket?MyOrderNum=' + MyOrderNum.value
}) })
} }
// 跳转到 今日巡检 // 跳转到 今日巡检
@@ -373,10 +373,13 @@ function getbannarData(forceRefresh = false) {
bannerList.value = newData bannerList.value = newData
} }
// 写入缓存 // 写入缓存
uni.setStorageSync(BANNER_CACHE_KEY, JSON.stringify({ uni.setStorageSync(
data: newData, BANNER_CACHE_KEY,
time: Date.now() JSON.stringify({
})) data: newData,
time: Date.now()
})
)
} else { } else {
bannerList.value = [] bannerList.value = []
} }
@@ -414,9 +417,9 @@ onShow(() => {
if (!hasInit.value) { if (!hasInit.value) {
// 首次加载:onLoad 已触发过核心数据请求,这里只补 onLoad 没调的和需要每次都刷新的 // 首次加载:onLoad 已触发过核心数据请求,这里只补 onLoad 没调的和需要每次都刷新的
hasInit.value = true hasInit.value = true
getbannarData() // onLoad 没调 banner getbannarData() // onLoad 没调 banner
getMyOrderNum() // onLoad 没调工单数 getMyOrderNum() // onLoad 没调工单数
permStore.initPerm() // 刷新权限缓存 permStore.initPerm() // 刷新权限缓存
// currentVillageData 和 getInspectionData 已在 onLoad 中调用,不再重复 // currentVillageData 和 getInspectionData 已在 onLoad 中调用,不再重复
return return
} }