lion 2 months ago
parent 1b8397f475
commit 3754a3e791

@ -17,7 +17,33 @@
<view class="cell" v-for="cell in row" :key="cell.fullDate" :style="'height:'+cellHeight+'rpx'" @tap="onDayClick(cell.fullDate)">
<text class="date-num" :class="{ dim: !cell.inMonth }">{{ cell.date }}</text>
<view class="cell-events" :style="'padding-top:'+getCellPadding(cell.fullDate)+'rpx'">
<view v-for="ev in eventsForDate(cell.fullDate)" :key="ev.id" class="event-chip" :class="['event-type-' + (ev.type || 'default'), { 'single-line-open': isSingleEvent(cell.fullDate), 'conflict': hasSpanConflict(cell.fullDate), 'has-multi-day': hasSpanConflict(cell.fullDate) }]" :style="'background:' + ((ev && ev.color) ? ev.color : '#ddba99') + ';' + (hasSpanConflict(cell.fullDate) ? 'transform: translateY(10px) !important; padding-top: 10px !important;' : '')" @tap="onEventClick(ev)">
<view
v-for="ev in eventsForDate(cell.fullDate)"
:key="ev.id"
class="event-chip"
:class="[
'event-type-' + (ev.type || 'default'),
{
'single-line-open': isSingleEvent(cell.fullDate) && !hasOtherEvents(cell.fullDate),
'has-other-events': hasOtherEvents(cell.fullDate),
'conflict': hasSpanConflict(cell.fullDate),
// has-multi-day padding-top:10px !important
'has-multi-day': hasSpanConflict(cell.fullDate) && !hasMultiDayCover(cell.fullDate)
}
]"
:style="[
{ background: (ev && ev.color) ? ev.color : '#ddba99' },
//
hasSpanConflict(cell.fullDate)
? { transform: 'translateY(10px)', paddingTop: '10px' }
: {},
//
hasMultiDayCover(cell.fullDate)
? { position: 'absolute', bottom: '10px', left: 0, right: 0, paddingTop: '0px', transform: 'none', '-webkit-line-clamp': 1, 'line-clamp': 1 }
: {}
]"
@tap.stop="onEventClick(ev)"
>
{{ formatTitle(ev.title) }}
</view>
</view>
@ -26,7 +52,7 @@
<!-- 跨天覆盖层 -->
<view class="overlay">
<view v-for="(seg, si) in continuousSegments" :key="si" class="continuous-bar" :style="'left:'+seg._style.left+';width:'+seg._style.width+';top:'+seg._style.top+';height:'+seg._style.height+';'+(seg._isOnlyOne ? '' : ('line-height:'+seg._style.height+';'))+(seg.color?('background:'+seg.color+';'):'background:#ddba99;')" :class="['event-type-' + (seg.type || 'default'), { 'nobreak': seg._isOnlyOne } ]" @tap="onSegmentClick(seg)">
<view v-for="(seg, si) in continuousSegments" :key="si" class="continuous-bar" :style="'left:'+seg._style.left+';width:'+seg._style.width+';top:'+seg._style.top+';height:'+seg._style.height+';'+(seg._isOnlyOne ? '' : ('line-height:'+seg._style.height+';'))+(seg.color?('background:'+seg.color+';'):'background:#ddba99;')" :class="['event-type-' + (seg.type || 'default'), { 'nobreak': seg._isOnlyOne } ]" @tap.stop="onSegmentClick(seg)">
{{ formatTitle(seg.title) }}
</view>
</view>
@ -349,6 +375,15 @@ export default {
this.laneCountByDate = laneCountByDate
this.segCountByDate = segCountByDate
//
console.log('segCountByDate 统计结果:', segCountByDate)
console.log('所有跨天分段:', segs.map(seg => ({
id: seg.id,
title: seg.title,
start: new Date(seg.segStartMs).toISOString().split('T')[0],
end: new Date(seg.segEndMs).toISOString().split('T')[0]
})))
return segs
}
},
@ -381,6 +416,40 @@ export default {
return result
},
hasMultiDayCover(fullDate) {
//
try {
const target = new Date(fullDate)
target.setHours(0,0,0,0)
const tMs = target.getTime()
const segs = this.continuousSegments || []
for (let i = 0; i < segs.length; i += 1) {
const s = segs[i]
if (tMs >= s.segStartMs && tMs <= s.segEndMs) return true
}
return false
} catch (_) {
return false
}
},
hasOtherEvents(fullDate) {
//
const singleEvents = this.eventsForDate(fullDate) || []
const hasMultiDay = !!(this.segCountByDate && this.segCountByDate[fullDate] > 0)
const result = singleEvents.length > 1 || hasMultiDay
//
if (fullDate.includes('25')) {
console.log(`日期 ${fullDate} 检查其他事件:`, {
singleEvents: singleEvents.length,
hasMultiDay,
segCount: this.segCountByDate ? this.segCountByDate[fullDate] : 'undefined',
result
})
}
return result
},
onEventClick(ev) {
this.$emit('eventClick', ev)
},
@ -471,12 +540,6 @@ export default {
if (isMulti) return false
return d0.getTime() === s.getTime()
})
//
if (result.length > 0) {
console.log(`日期 ${fullDate} 的单天事件:`, result)
}
return result
},
pad2(n) {
@ -583,7 +646,6 @@ export default {
font-weight: 600;
color: #333;
position: relative;
z-index: 3;
text-align: center;
width: 100%;
margin-bottom: 4px;
@ -593,7 +655,6 @@ export default {
}
.cell-events {
position: relative;
z-index: 2; /* 让跨天条位于其上方 */
width: 100%;
overflow: hidden;
}
@ -605,10 +666,11 @@ export default {
color: #fff;
border-radius: 16rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 100%;
box-sizing: border-box;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.event-chip.event-type-1 { background: #67C23A; }
.event-chip.event-type-2 { background: #409EFF; }
@ -618,19 +680,20 @@ export default {
.event-chip.event-type-default { background: #ddba99; }
/* 当天只有一条单天事件时,允许换行不省略 */
.event-chip.single-line-open {
white-space: normal;
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3; /* 最多三行 */
-webkit-box-orient: vertical;
overflow: hidden;
}
/* 当天有其他事件时(多条单天事件或跨天事件),单条数据定位在底部 */
.event-chip.single-line-open.has-other-events {
-webkit-line-clamp: 1; /* 强制一行 */
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
/* 与跨天冲突时,单日事件强制一行省略 */
.event-chip.conflict {
white-space: nowrap !important;
overflow: hidden !important;
text-overflow: ellipsis !important;
-webkit-line-clamp: 1 !important;
}
/* 当有跨天事件时,单天事件需要更多上边距 */
@ -645,12 +708,10 @@ export default {
right: 0;
bottom: 0;
pointer-events: none;
z-index: 4; /* 置于单日事件之上,避免被遮挡 */
}
.continuous-bar {
position: absolute;
pointer-events: auto;
z-index: 2;
color: #fff;
font-size: 11px;
line-height: 18px;

@ -150,53 +150,63 @@ export default {
//
showCourseDetail(ev) {
//
// type=1
// type=3
// type=4 webview
//
// -
// -
const type = ev.type
//
if (type === 1) {
if (ev.course_id) {
uni.navigateTo({ url: `/packages/course/detail?id=${ev.course_id}` })
return
}
// course_id
// course_id
const hasDetail = !!(ev.start_time || ev.location)
if (!hasDetail) return
uni.showModal({
title: ev.title || '课程详情',
content: `时间:${ev.start_time}\n地点${ev.location || '待定'}`,
content: `时间:${ev.start_time || '待定'}\n地点${ev.location || '待定'}`,
showCancel: false
})
return
}
// content
if (type === 3) {
const hasDetail = !!(ev.content && String(ev.content).trim())
if (!hasDetail) return
uni.showModal({
title: ev.title || '事件详情',
content: ev.content || '暂无详细信息',
content: ev.content,
showCancel: false
})
return
}
// url content
if (type === 4) {
if (ev.url) {
const encoded = ev.url
uni.navigateTo({ url: `/packages/webview/index?type=3&url=${encoded}` })
return
}
// url
const hasDetail = !!(ev.content && String(ev.content).trim())
if (!hasDetail) return
uni.showModal({
title: ev.title || '资讯详情',
content: ev.content || '暂无详细信息',
content: ev.content,
showCancel: false
})
return
}
//
// content
const hasDetail = !!(ev.content && String(ev.content).trim())
if (!hasDetail) return
uni.showModal({
title: ev.title || '详情',
content: ev.content || '暂无详细信息',
content: ev.content,
showCancel: false
})
}

@ -3,7 +3,7 @@
<!-- 当前头像展示 -->
<view class="avatar-section">
<view class="current-avatar" @click="chooseImage">
<image :src="croppedImage?croppedImage:base.imgHost('login-user.png')" />
<image :src="croppedImage?croppedImage:base.imgHost('logo-user.png')" />
<!-- <view v-else class="avatar-placeholder">
<text class="iconfont icon-user"></text>
</view> -->

@ -266,8 +266,8 @@
justify-content: space-between;
image {
width: 539rpx;
height: 88rpx;
width: 455rpx;
height: 87rpx;
display: block;
}

@ -5,7 +5,7 @@
<!-- 头像 -->
<view style="display:flex;justify-content:center;align-items:center;padding: 30rpx 0;">
<view @click="changeAvatar" style="width:140rpx;height:140rpx;border-radius:140rpx;overflow:hidden;">
<image style="width:100%;height:100%;" :src="userAvatar?userAvatar:base.imgHost('login-add.png')"></image>
<image style="width:100%;height:100%;" :src="userAvatar?userAvatar:base.imgHost('logo-add.png')"></image>
</view>
</view>
<u-form :model="form" :label-width="140" ref="uForm" :label-align="'left'" :error-type="['message']">

@ -425,7 +425,7 @@
// top: 110rpx;
// right: 20rpx;
z-index: 999;
background-color: #b89155;
background-color: #EB0432;
padding: 15rpx 20rpx;
border-radius: 40rpx;
display: flex;
@ -435,6 +435,7 @@
}
.map-setting{
width:30%;
background-color: #b89155;
}
.map-text{
font-size: 28rpx;

@ -10,14 +10,14 @@
<image mode="widthFix" :src="base.imgHost('login-logo.png')"></image>
<view class="userinfo">
<view class="userinfo-img" @click="changeAvatar">
<image :src="userAvatar?userAvatar:base.imgHost('login-add.png')"></image>
<image :src="userAvatar?userAvatar:base.imgHost('logo-add.png')"></image>
</view>
<view>
<view class="usersigns">
<text>姓名</text>
<text>{{userInfo.username?userInfo.username:'-'}}</text>
</view>
<view class="usersigns">
<view class="usersigns" v-if="userInfo.no">
<text>学号</text>
<text>{{userInfo.no?userInfo.no:'-'}}</text>
</view>
@ -30,7 +30,7 @@
</view>
</view>
</view>
<view class="me-name-right usercode" @click="showBigCode=true">
<view v-if="myQrcode" class="me-name-right usercode" @click="showBigCode=true">
<uqrcode v-if="myQrcode" ref="uqrcode" canvas-id="qrcode" :value="myQrcode"
:sizeUnit="'rpx'" :size="160"
:options="{
@ -128,7 +128,7 @@
</view>
<view class="modal-xyk-item modal-xyk-name">
<view class="modal-xyk-name-img">
<image :src="userAvatar?userAvatar:base.imgHost('login-user.png')"></image>
<image :src="userAvatar?userAvatar:base.imgHost('logo-user.png')"></image>
</view>
<view class="modal-xyk-name-course">
<text>姓名</text>

Loading…
Cancel
Save