定位提示

dev
lion 4 months ago
parent d230ce71b1
commit be81295257

@ -47,7 +47,7 @@ export default {
type: Array, type: Array,
default: () => [] default: () => []
}, },
// rpx // , rpx
rowHeightRpx: { rowHeightRpx: {
type: Number, type: Number,
default: 140 default: 140
@ -76,7 +76,7 @@ export default {
data() { data() {
return { return {
FIRST_DOW: 0, // 0=Sunday FIRST_DOW: 0, // 0=Sunday
// rpx 使 rpx // rpx ,使 rpx
cellHeight: this.rowHeightRpx, cellHeight: this.rowHeightRpx,
headerHeight: this.headerHeightRpx, headerHeight: this.headerHeightRpx,
weekHeaderHeight: this.weekHeaderHeightRpx, weekHeaderHeight: this.weekHeaderHeightRpx,
@ -214,7 +214,7 @@ export default {
segs.push({ segs.push({
...ev, ...ev,
weekStartISO: weekStart.toISOString(), weekStartISO: weekStart.toISOString(),
// ISO/ // , ISO/
segStartMs: segStart.getTime(), segStartMs: segStart.getTime(),
segEndMs: segEnd.getTime(), segEndMs: segEnd.getTime(),
startCol, startCol,
@ -226,7 +226,7 @@ export default {
} }
}) })
// lane // lane,
const byWeek = {} const byWeek = {}
segs.forEach(s => { segs.forEach(s => {
const key = s.weekStartISO const key = s.weekStartISO
@ -270,7 +270,7 @@ export default {
segs.forEach(seg => { segs.forEach(seg => {
const segStart = new Date(seg.segStartMs) const segStart = new Date(seg.segStartMs)
// weeks // weeks ,
const startStr = `${segStart.getFullYear()}-${this.pad2(segStart.getMonth()+1)}-${this.pad2(segStart.getDate())}` const startStr = `${segStart.getFullYear()}-${this.pad2(segStart.getMonth()+1)}-${this.pad2(segStart.getDate())}`
let row = 0 let row = 0
let col = seg.startCol let col = seg.startCol
@ -288,7 +288,7 @@ export default {
const leftPct = col * cellWidthPct const leftPct = col * cellWidthPct
const widthPct = seg.spanCols * cellWidthPct const widthPct = seg.spanCols * cellWidthPct
const vOffset = (seg.laneIndex || 0) * (this.barHeight + this.barSpacing) const vOffset = (seg.laneIndex || 0) * (this.barHeight + this.barSpacing)
const innerTopPadding = 8 // const innerTopPadding = 8 // ,
const topRpx = (row * this.cellHeight) + this.dateNumberHeight + innerTopPadding + vOffset - 10 const topRpx = (row * this.cellHeight) + this.dateNumberHeight + innerTopPadding + vOffset - 10
seg._style = { seg._style = {
@ -313,14 +313,14 @@ export default {
formatTitle(title) { formatTitle(title) {
const raw = (title == null ? '' : String(title)).trim() const raw = (title == null ? '' : String(title)).trim()
if (!raw) return '' if (!raw) return ''
// |- // |,-
if (raw.includes('') || raw.includes('|')) { if (raw.includes('') || raw.includes('|')) {
const pipeParts = raw.split(/[|]/).map(s => s.trim()).filter(Boolean) const pipeParts = raw.split(/[|]/).map(s => s.trim()).filter(Boolean)
const afterPipe = pipeParts.length ? pipeParts[pipeParts.length - 1] : raw const afterPipe = pipeParts.length ? pipeParts[pipeParts.length - 1] : raw
const core = afterPipe.split(/\s*[-—–-]\s*/)[0] const core = afterPipe.split(/\s*[-—–-]\s*/)[0]
return core.trim() return core.trim()
} }
// // ,
const dashParts = raw.split(/\s*[-—–-]\s*/).map(s => s.trim()).filter(Boolean) const dashParts = raw.split(/\s*[-—–-]\s*/).map(s => s.trim()).filter(Boolean)
if (dashParts.length >= 3) { if (dashParts.length >= 3) {
// - - // - -
@ -388,7 +388,7 @@ export default {
const s = this.parseDateTime(ev.start_time) const s = this.parseDateTime(ev.start_time)
const e = ev.end_time ? this.parseDateTime(ev.end_time) : this.parseDateTime(ev.start_time) const e = ev.end_time ? this.parseDateTime(ev.end_time) : this.parseDateTime(ev.start_time)
s.setHours(0,0,0,0); e.setHours(0,0,0,0) s.setHours(0,0,0,0); e.setHours(0,0,0,0)
// // ,
const isMulti = ev.end_time && (s.getTime() !== e.getTime()) const isMulti = ev.end_time && (s.getTime() !== e.getTime())
if (isMulti) return false if (isMulti) return false
return d0.getTime() === s.getTime() return d0.getTime() === s.getTime()
@ -403,7 +403,7 @@ export default {
const [datePart, timePart = '00:00:00'] = String(dateTimeStr).trim().split(/[T\s]+/) const [datePart, timePart = '00:00:00'] = String(dateTimeStr).trim().split(/[T\s]+/)
const [y, m, d] = datePart.split('-').map(n => parseInt(n, 10)) const [y, m, d] = datePart.split('-').map(n => parseInt(n, 10))
const [hh = 0, mm = 0, ss = 0] = timePart.split(':').map(n => parseInt(n, 10)) const [hh = 0, mm = 0, ss = 0] = timePart.split(':').map(n => parseInt(n, 10))
// / // ,/
return new Date(y, (m || 1) - 1, d || 1, hh || 0, mm || 0, ss || 0) return new Date(y, (m || 1) - 1, d || 1, hh || 0, mm || 0, ss || 0)
} }
} }

@ -25,9 +25,21 @@
<u-icon name="order" class="title-icon"></u-icon> <u-icon name="order" class="title-icon"></u-icon>
当前其他可签到课程 当前其他可签到课程
</h6> </h6>
<view v-for="item in courseContentList" class="history-list"> <view v-for="item in courseContentList" :key="item.id" class="course-card">
<view class="history-item"> <view class="course-title">{{ item.theme || '' }}</view>
<text>{{ item.theme }}</text> <view class="course-info">
<view class="info-item" v-if="item.date || item.period">
<u-icon name="calendar-fill" class="info-icon"></u-icon>
<text>{{ item.date || '' }} - {{ item.period || '' }}</text>
</view>
<view class="info-item" v-if="item.address">
<u-icon name="map-fill" class="info-icon"></u-icon>
<text>{{ item.address }}</text>
</view>
<view class="info-item" v-if="item.teacher && item.teacher.name">
<u-icon name="account-fill" class="info-icon"></u-icon>
<text>{{ item.teacher.name }}</text>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -625,6 +637,32 @@ export default {
padding: 32rpx; padding: 32rpx;
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
/* 其他可签到课程中的课程卡片样式 */
.status-card .course-card {
padding: 24rpx;
margin-bottom: 20rpx;
border: 1rpx solid #e9ecef;
background: #f8f9fa;
}
.status-card .course-card:last-child {
margin-bottom: 0;
}
.status-card .course-card .course-title {
font-size: 32rpx;
margin-bottom: 20rpx;
}
.status-card .course-card .course-info {
gap: 12rpx;
}
.status-card .course-card .info-item {
padding: 10rpx;
font-size: 24rpx;
}
.course-title { .course-title {
font-size: 36rpx; font-size: 36rpx;
font-weight: 600; font-weight: 600;

Loading…
Cancel
Save