|
@@ -1,7 +1,6 @@
|
|
|
<route lang="json5">
|
|
<route lang="json5">
|
|
|
{
|
|
{
|
|
|
layout: 'tabbar',
|
|
layout: 'tabbar',
|
|
|
- needLogin: true,
|
|
|
|
|
style: {
|
|
style: {
|
|
|
navigationBarTitleText: '%income.title%',
|
|
navigationBarTitleText: '%income.title%',
|
|
|
navigationBarBackgroundColor: '#fff',
|
|
navigationBarBackgroundColor: '#fff',
|
|
@@ -16,6 +15,7 @@ import useZPaging from 'z-paging/components/z-paging/js/hooks/useZPaging.js'
|
|
|
|
|
|
|
|
import { getEnum as _getEnum } from '@/api/common'
|
|
import { getEnum as _getEnum } from '@/api/common'
|
|
|
import { getAccountInfo as _getAccountInfo, envelopeList } from '@/api/wallet'
|
|
import { getAccountInfo as _getAccountInfo, envelopeList } from '@/api/wallet'
|
|
|
|
|
+import { useUserStore } from '@/store/user'
|
|
|
import { formatNumber } from '@/utils'
|
|
import { formatNumber } from '@/utils'
|
|
|
import { toPage } from '@/utils/page'
|
|
import { toPage } from '@/utils/page'
|
|
|
|
|
|
|
@@ -30,6 +30,9 @@ useZPaging(paging)
|
|
|
|
|
|
|
|
const dayType = ref(1)
|
|
const dayType = ref(1)
|
|
|
|
|
|
|
|
|
|
+const userStore = useUserStore()
|
|
|
|
|
+const isLoggedIn = computed(() => !!userStore.token)
|
|
|
|
|
+
|
|
|
// 搜索结果
|
|
// 搜索结果
|
|
|
const statusEnum = ref<any[]>([])
|
|
const statusEnum = ref<any[]>([])
|
|
|
const typeEnum = ref<any[]>([])
|
|
const typeEnum = ref<any[]>([])
|
|
@@ -45,6 +48,8 @@ async function getEnum(id: number) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
async function getAccountInfo() {
|
|
async function getAccountInfo() {
|
|
|
|
|
+ if (!isLoggedIn.value)
|
|
|
|
|
+ return
|
|
|
const res = await _getAccountInfo()
|
|
const res = await _getAccountInfo()
|
|
|
console.log(res)
|
|
console.log(res)
|
|
|
if (res.code === '200') {
|
|
if (res.code === '200') {
|
|
@@ -52,6 +57,10 @@ async function getAccountInfo() {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
async function queryList(pageNo: number, pageSize: number) {
|
|
async function queryList(pageNo: number, pageSize: number) {
|
|
|
|
|
+ if (!isLoggedIn.value) {
|
|
|
|
|
+ paging.value.complete([])
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
const data = {
|
|
const data = {
|
|
|
page: pageNo,
|
|
page: pageNo,
|
|
|
size: pageSize,
|
|
size: pageSize,
|
|
@@ -68,7 +77,13 @@ async function queryList(pageNo: number, pageSize: number) {
|
|
|
onShow(() => {
|
|
onShow(() => {
|
|
|
getEnum(4)
|
|
getEnum(4)
|
|
|
getEnum(5)
|
|
getEnum(5)
|
|
|
- getAccountInfo()
|
|
|
|
|
|
|
+ if (isLoggedIn.value) {
|
|
|
|
|
+ getAccountInfo()
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ walletInfo.value = {}
|
|
|
|
|
+ paging.value?.complete([])
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|