|
|
|
@ -13,7 +13,7 @@ |
|
|
|
<!-- #endif --> |
|
|
|
|
|
|
|
<!-- <view class="flex flex-col h-full bg-gray-50" @click="openAuth"> --> |
|
|
|
<theme class="flex flex-col h-full bg-gray-50"> |
|
|
|
<theme class="relative flex flex-col h-full bg-gray-50"> |
|
|
|
<view class="relative"> |
|
|
|
<!-- <view class="relative" @touchmove="onMove"> --> |
|
|
|
<!-- 日历 --> |
|
|
|
@ -23,7 +23,12 @@ |
|
|
|
<Upload @success="onUploadSuccess" @error="onUploadError" /> |
|
|
|
</view> |
|
|
|
|
|
|
|
<u-button class="mt-4" @click="toLogin">登录</u-button> |
|
|
|
<view class="login-box absolute" @click="toLogin"> |
|
|
|
<text v-if="!userInfo">游客</text> |
|
|
|
<image v-else src="../../static/headimg.png" mode=""></image> |
|
|
|
</view> |
|
|
|
<!-- <u-button class="mt-4" @click="toLogin">登录</u-button> --> |
|
|
|
|
|
|
|
<!-- 项目列表 --> |
|
|
|
<Projects @getProjects="getProjects" class="flex-1 overflow-y-auto" /> |
|
|
|
|
|
|
|
@ -42,6 +47,7 @@ |
|
|
|
const uTips = ref(null); |
|
|
|
// const firstOpenApp = computed(() => store.state.firstOpenApp); |
|
|
|
// const isOpenApp = computed(() => store.state.isOpenApp); // 是否打开APP |
|
|
|
const userInfo = computed(() => store.state.user.user); |
|
|
|
|
|
|
|
const data = reactive({ |
|
|
|
calendar: null, |
|
|
|
@ -52,13 +58,17 @@ |
|
|
|
handleFindPoint(); |
|
|
|
|
|
|
|
// 监听token |
|
|
|
// watchEffect(() => { |
|
|
|
watchEffect(() => { |
|
|
|
const user = uni.$storage.getStorageSync('user'); |
|
|
|
if (!userInfo.value && user) { |
|
|
|
store.commit('user/setUser', JSON.parse(user)); |
|
|
|
} |
|
|
|
// if (!token.value) return; |
|
|
|
// if (token.value) { |
|
|
|
// getProjects(); |
|
|
|
// handleFindPoint(); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
}); |
|
|
|
|
|
|
|
// 获取项目列表 |
|
|
|
function getProjects(start = dayjs().startOf('day').valueOf(), end = dayjs().endOf('day').valueOf()) { |
|
|
|
@ -129,9 +139,12 @@ |
|
|
|
// } |
|
|
|
|
|
|
|
function toLogin() { |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages/user/login' |
|
|
|
}); |
|
|
|
console.log(11) |
|
|
|
if (!userInfo.value) { |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages/user/login' |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
@ -161,4 +174,28 @@ |
|
|
|
font-size: 36rpx; |
|
|
|
color: #8f8f94; |
|
|
|
} |
|
|
|
|
|
|
|
.login-box { |
|
|
|
top: 10px; |
|
|
|
right: 10px; |
|
|
|
z-index: 999; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
width: 50px; |
|
|
|
height: 50px; |
|
|
|
border-radius: 50%; |
|
|
|
background-color: #eeeeee; |
|
|
|
text-align: center; |
|
|
|
line-height: 50px; |
|
|
|
border: 1px solid #ddd; |
|
|
|
overflow: hidden; |
|
|
|
|
|
|
|
image { |
|
|
|
display: inline-block; |
|
|
|
width: 40px; |
|
|
|
height: 40px; |
|
|
|
object-fit: cover; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
|