更新密码找回uniapp
This commit is contained in:
1 parent
7f9a66da0f
commit
3fdda89833
1304 files changed
+3503
-26132
No files matched your search
@@ -2,13 +2,10 @@
|
||||
<view class="page">
|
||||
<scroll-view class="body" scroll-y :show-scrollbar="false">
|
||||
<view class="body-inner">
|
||||
<!-- 本周概览横幅 -->
|
||||
<view class="hero-banner">
|
||||
<view class="hero-info">
|
||||
<view class="hero-title-row">
|
||||
<text class="hero-title">本周日程</text>
|
||||
<!-- <text class="hero-unit">(项)</text> -->
|
||||
<!-- <text class="hero-count">{{ weekCount }}</text> -->
|
||||
</view>
|
||||
<text class="hero-sub">{{ heroRangeLabel }}</text>
|
||||
</view>
|
||||
@@ -17,7 +14,6 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 可收缩日历 -->
|
||||
<view class="cal-card">
|
||||
<view v-if="expanded" class="cal-head">
|
||||
<text class="cal-title">{{ monthLabel }}</text>
|
||||
@@ -70,7 +66,6 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 选中日期的日程 -->
|
||||
<view class="day-head">
|
||||
<text class="day-title">{{ selectedLabel }}</text>
|
||||
<text class="day-count">{{ dayItems.length }} 项</text>
|
||||
@@ -132,12 +127,10 @@ import { fetchOaSchedules } from '@/api/oaSchedule.js'
|
||||
import { pad, startOfDay, isToday, isTomorrow, dayLabel } from '@/utils/date.js'
|
||||
import { isLoggedIn } from '@/utils/auth.js'
|
||||
|
||||
/** 周一为一周第一天 */
|
||||
const WEEK_LABELS = ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
|
||||
|
||||
const schedules = ref([])
|
||||
const loading = ref(false)
|
||||
/** 默认收缩,仅显示选中日所在周的一行 */
|
||||
const expanded = ref(false)
|
||||
const monthCursor = ref(new Date(new Date().getFullYear(), new Date().getMonth(), 1))
|
||||
const selectedDate = ref(startOfDay(new Date()))
|
||||
@@ -153,7 +146,6 @@ const monthLabel = computed(
|
||||
|
||||
const selectedKey = computed(() => dateKey(selectedDate.value))
|
||||
|
||||
/** 选中日所在周(周一~周日)的 7 个单元格 */
|
||||
const weekCells = computed(() => {
|
||||
const base = selectedDate.value
|
||||
const offset = (base.getDay() + 6) % 7
|
||||
@@ -171,7 +163,6 @@ const weekCells = computed(() => {
|
||||
return cells
|
||||
})
|
||||
|
||||
/** 月历 6×7 单元格,含上下月补齐日期 */
|
||||
const monthCells = computed(() => {
|
||||
const year = monthCursor.value.getFullYear()
|
||||
const month = monthCursor.value.getMonth()
|
||||
@@ -193,7 +184,6 @@ const monthCells = computed(() => {
|
||||
|
||||
const gridCells = computed(() => (expanded.value ? monthCells.value : weekCells.value))
|
||||
|
||||
/** 日程按日期聚合,key 为 YYYY-MM-DD(OA 日程的 schedule_date) */
|
||||
const dayMap = computed(() => {
|
||||
const map = {}
|
||||
schedules.value.forEach((item) => {
|
||||
@@ -204,7 +194,6 @@ const dayMap = computed(() => {
|
||||
return map
|
||||
})
|
||||
|
||||
/** 选中日期的日程:全天在前,其余按开始时间升序 */
|
||||
const dayItems = computed(() => {
|
||||
const list = dayMap.value[selectedKey.value] || []
|
||||
return list.slice().sort((a, b) => {
|
||||
@@ -214,7 +203,6 @@ const dayItems = computed(() => {
|
||||
})
|
||||
})
|
||||
|
||||
/** 本周(周一~周日)范围与日程数 */
|
||||
const weekRange = computed(() => {
|
||||
const now = startOfDay(new Date())
|
||||
const offset = (now.getDay() + 6) % 7
|
||||
@@ -246,7 +234,6 @@ const selectedLabel = computed(() => {
|
||||
return `${d.getMonth() + 1}月${d.getDate()}日 ${week}`
|
||||
})
|
||||
|
||||
/** 日历标记点:未完成(蓝)靠左优先排,已完成(绿)靠后,最多 3 个 */
|
||||
function dayDots(key) {
|
||||
const list = dayMap.value[key] || []
|
||||
const pending = list.filter((item) => !item.completed)
|
||||
@@ -254,14 +241,12 @@ function dayDots(key) {
|
||||
return pending.concat(done).slice(0, 3).map((item) => (item.completed ? 'done' : 'pending'))
|
||||
}
|
||||
|
||||
/** 时间展示:全天显示「全天」,其余显示开始时间或起止区间 */
|
||||
function timeRangeText(item) {
|
||||
if (item.allDay) return '全天'
|
||||
if (!item.start_time) return ''
|
||||
return item.end_time ? `${item.start_time} - ${item.end_time}` : item.start_time
|
||||
}
|
||||
|
||||
/** 数据加载区间:当前日历月前后各扩 7 天,覆盖周视图跨月格子 */
|
||||
function currentRange() {
|
||||
const year = monthCursor.value.getFullYear()
|
||||
const month = monthCursor.value.getMonth()
|
||||
@@ -289,7 +274,6 @@ function pickDay(cell) {
|
||||
cell.date.getMonth() !== monthCursor.value.getMonth()
|
||||
selectedDate.value = startOfDay(cell.date)
|
||||
monthCursor.value = new Date(cell.date.getFullYear(), cell.date.getMonth(), 1)
|
||||
// 月历里选完日期后自动收回周栏
|
||||
if (expanded.value) expanded.value = false
|
||||
if (monthChanged) loadSchedules()
|
||||
}
|
||||
@@ -309,7 +293,6 @@ onShow(() => {
|
||||
async function loadSchedules() {
|
||||
loading.value = true
|
||||
try {
|
||||
// OA 工作日程:按日历区间拉取(前后各扩 7 天),端上按天聚合
|
||||
const { startDate, endDate } = currentRange()
|
||||
const res = await fetchOaSchedules({ startDate, endDate, pageSize: 500 })
|
||||
schedules.value = res.list
|
||||
@@ -349,7 +332,6 @@ function openDetail(id) {
|
||||
padding: 20rpx $page-padding-x 0;
|
||||
}
|
||||
|
||||
/* ---------- 本周概览横幅 ---------- */
|
||||
.hero-banner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -407,7 +389,6 @@ function openDetail(id) {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* ---------- 可收缩日历 ---------- */
|
||||
.cal-card {
|
||||
margin-top: 20rpx;
|
||||
padding: 16rpx 16rpx 8rpx;
|
||||
@@ -531,17 +512,14 @@ function openDetail(id) {
|
||||
border-radius: 50%;
|
||||
background: $color-danger;
|
||||
|
||||
/* 未完成:红色 */
|
||||
&.pending {
|
||||
background: $color-danger;
|
||||
}
|
||||
|
||||
/* 已完成:绿色 */
|
||||
&.done {
|
||||
background: $color-success;
|
||||
}
|
||||
|
||||
/* 选中日:红点转浅红、绿点转浅绿,保证在深蓝底上的对比度 */
|
||||
&.pending.on {
|
||||
background: #fca5a5;
|
||||
}
|
||||
@@ -565,7 +543,6 @@ function openDetail(id) {
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- 当日日程 ---------- */
|
||||
.day-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
Reference in new issue
Block a user