5 changed files with 148 additions and 140 deletions
@ -1,94 +1,87 @@ |
|||||
<template> |
<template> |
||||
<view class="flex flex-col h-full bg-gray-50" @click="openAuth"> |
<view class="flex flex-col h-full bg-gray-50" @click="openAuth"> |
||||
<view class="relative" @touchmove="onMove"> |
<view class="relative" @touchmove="onMove"> |
||||
<!-- 日历 --> |
<!-- 日历 --> |
||||
<Calendar @selected-change="onDateChange" :show-back="true" ref="calendar" @handleFindPoint="handleFindPoint" /> |
<Calendar @selected-change="onDateChange" :show-back="true" ref="calendar" @handleFindPoint="handleFindPoint" /> |
||||
<!-- 上传 导入wbs --> |
<!-- 上传 导入wbs --> |
||||
<!-- <Upload @success="onUploadSuccess" @error="onUploadError" /> --> |
<!-- <Upload @success="onUploadSuccess" @error="onUploadError" /> --> |
||||
</view> |
</view> |
||||
|
|
||||
<!-- 项目列表 --> |
<!-- 项目列表 --> |
||||
<Projects @getProjects="getProjects" class="flex-1 overflow-y-auto" /> |
<Projects @getProjects="getProjects" class="flex-1 overflow-y-auto" /> |
||||
|
|
||||
<!-- 全局提示框 --> |
<!-- 全局提示框 --> |
||||
<u-top-tips ref="uTips"></u-top-tips> |
<u-top-tips ref="uTips"></u-top-tips> |
||||
</view> |
</view> |
||||
</template> |
</template> |
||||
|
|
||||
<script setup> |
<script setup> |
||||
import { reactive, ref, onMounted, computed, watch } from 'vue'; |
import { reactive, ref, onMounted, computed, watch } from 'vue'; |
||||
import { useStore } from 'vuex'; |
import { useStore } from 'vuex'; |
||||
import dayjs from 'dayjs'; |
import dayjs from 'dayjs'; |
||||
|
|
||||
const data = reactive({ |
const data = reactive({ |
||||
calendar: null, |
calendar: null, |
||||
days: [], |
days: [], |
||||
}); |
}); |
||||
|
|
||||
const height = ref(null); |
const height = ref(null); |
||||
const store = useStore(); |
const store = useStore(); |
||||
const token = computed(() => store.state.user.token); |
const token = computed(() => store.state.user.token); |
||||
|
|
||||
onMounted(() => { |
onMounted(() => { |
||||
const system = uni.getSystemInfoSync(); |
const system = uni.getSystemInfoSync(); |
||||
height.value = `${system.windowHeight}px`; |
height.value = `${system.windowHeight}px`; |
||||
}); |
}); |
||||
|
|
||||
const handleFindPoint = async (start, end) => { |
const handleFindPoint = async (start, end) => { |
||||
try { |
try { |
||||
const startTime = start |
const startTime = start || dayjs().startOf('month').valueOf(); |
||||
|| dayjs() |
const endTime = end || dayjs().endOf('month').valueOf(); |
||||
.startOf('month') |
const res = await uni.$u.api.findRedPoint(startTime, endTime); |
||||
.valueOf(); |
store.commit('project/setDotList', res); |
||||
const endTime = end |
} catch (error) { |
||||
|| dayjs() |
console.log('error: ', error); |
||||
.endOf('month') |
} |
||||
.valueOf(); |
}; |
||||
const res = await uni.$u.api.findRedPoint(startTime, endTime); |
|
||||
store.commit('project/setDotList', res); |
// 监听token |
||||
} catch (error) { |
watch( |
||||
console.log('error: ', error); |
() => token.value, |
||||
} |
newValue => { |
||||
}; |
if (!newValue) return; |
||||
|
if (newValue) { |
||||
// 监听token |
handleFindPoint(); |
||||
watch( |
} |
||||
() => token.value, |
}, |
||||
newValue => { |
{ immediate: true }, |
||||
if (!newValue) return; |
); |
||||
if (newValue) { |
</script> |
||||
handleFindPoint(); |
|
||||
} |
<style> |
||||
}, |
.content { |
||||
{ immediate: true }, |
display: flex; |
||||
); |
flex-direction: column; |
||||
|
align-items: center; |
||||
</script> |
justify-content: center; |
||||
|
} |
||||
<style> |
|
||||
.content { |
.logo { |
||||
display: flex; |
height: 200rpx; |
||||
flex-direction: column; |
width: 200rpx; |
||||
align-items: center; |
margin-top: 200rpx; |
||||
justify-content: center; |
margin-left: auto; |
||||
} |
margin-right: auto; |
||||
|
margin-bottom: 50rpx; |
||||
.logo { |
} |
||||
height: 200rpx; |
|
||||
width: 200rpx; |
.text-area { |
||||
margin-top: 200rpx; |
display: flex; |
||||
margin-left: auto; |
justify-content: center; |
||||
margin-right: auto; |
} |
||||
margin-bottom: 50rpx; |
|
||||
} |
.title { |
||||
|
font-size: 36rpx; |
||||
.text-area { |
color: #8f8f94; |
||||
display: flex; |
} |
||||
justify-content: center; |
|
||||
} |
|
||||
|
|
||||
.title { |
|
||||
font-size: 36rpx; |
|
||||
color: #8f8f94; |
|
||||
} |
|
||||
</style> |
</style> |
||||
|
Loading…
Reference in new issue