定位提示

dev
lion 3 months ago
parent d230ce71b1
commit be81295257

@ -47,7 +47,7 @@ export default {
type: Array,
default: () => []
},
// rpx
// , rpx
rowHeightRpx: {
type: Number,
default: 140
@ -76,7 +76,7 @@ export default {
data() {
return {
FIRST_DOW: 0, // 0=Sunday
// rpx 使 rpx
// rpx ,使 rpx
cellHeight: this.rowHeightRpx,
headerHeight: this.headerHeightRpx,
weekHeaderHeight: this.weekHeaderHeightRpx,
@ -214,7 +214,7 @@ export default {
segs.push({
...ev,
weekStartISO: weekStart.toISOString(),
// ISO/
// , ISO/
segStartMs: segStart.getTime(),
segEndMs: segEnd.getTime(),
startCol,
@ -226,7 +226,7 @@ export default {
}
})
// lane
// lane,
const byWeek = {}
segs.forEach(s => {
const key = s.weekStartISO
@ -270,7 +270,7 @@ export default {
segs.forEach(seg => {
const segStart = new Date(seg.segStartMs)
// weeks
// weeks ,
const startStr = `${segStart.getFullYear()}-${this.pad2(segStart.getMonth()+1)}-${this.pad2(segStart.getDate())}`
let row = 0
let col = seg.startCol
@ -288,7 +288,7 @@ export default {
const leftPct = col * cellWidthPct
const widthPct = seg.spanCols * cellWidthPct
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
seg._style = {
@ -313,14 +313,14 @@ export default {
formatTitle(title) {
const raw = (title == null ? '' : String(title)).trim()
if (!raw) return ''
// |-
// |,-
if (raw.includes('') || raw.includes('|')) {
const pipeParts = raw.split(/[|]/).map(s => s.trim()).filter(Boolean)
const afterPipe = pipeParts.length ? pipeParts[pipeParts.length - 1] : raw
const core = afterPipe.split(/\s*[-—–-]\s*/)[0]
return core.trim()
}
//
// ,
const dashParts = raw.split(/\s*[-—–-]\s*/).map(s => s.trim()).filter(Boolean)
if (dashParts.length >= 3) {
// - -
@ -388,7 +388,7 @@ export default {
const s = 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)
//
// ,
const isMulti = ev.end_time && (s.getTime() !== e.getTime())
if (isMulti) return false
return d0.getTime() === s.getTime()
@ -403,7 +403,7 @@ export default {
const [datePart, timePart = '00:00:00'] = String(dateTimeStr).trim().split(/[T\s]+/)
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))
// /
// ,/
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>
当前其他可签到课程
</h6>
<view v-for="item in courseContentList" class="history-list">
<view class="history-item">
<text>{{ item.theme }}</text>
<view v-for="item in courseContentList" :key="item.id" class="course-card">
<view class="course-title">{{ item.theme || '' }}</view>
<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>
@ -625,6 +637,32 @@ export default {
padding: 32rpx;
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 {
font-size: 36rpx;
font-weight: 600;

Loading…
Cancel
Save