lion 4 weeks 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> -->

@ -77,13 +77,13 @@
</view>
<view class="big-info">
<view @click="getUser"></view>
<view>预约时间{{formatTime(myQrcode.start_time,myQrcode.end_time)}}</view>
<view>预约场地
<block v-if="myQrcode.site_detail && myQrcode.site_detail.length>0">
<block v-for="(site,index) in myQrcode.site_detail">
{{site.real_name}}<block v-if="index+1<myQrcode.site_detail.length">,</block>
</block>
</block>
<view>预约时间{{formatTime(myQrcode.start_time,myQrcode.end_time)}}</view>
<view>预约场地
<block v-if="myQrcode.site_detail && myQrcode.site_detail.length>0">
<block v-for="(site,index) in myQrcode.site_detail">
{{site.real_name}}<block v-if="index+1<myQrcode.site_detail.length">,</block>
</block>
</block>
</view>
</view>
</view>
@ -153,19 +153,19 @@
getSites() {
this.$u.api.otherConfig().then(res => {
this.siteList = this.base.deepCopy(res.appointment_type)
this.siteList = this.siteList.sort((a, b) => a['sort'] - b['sort'])
this.siteList = this.siteList.sort((a, b) => a['sort'] - b['sort'])
this.siteList = this.siteList.filter(item=>{return item.is_show===1})
})
},
formatTime(val1,val2) {
let val1Day = this.$moment(val1)
let val2Day = this.$moment(val2)
console.log("123",val1Day,val2Day)
if(val1Day.isSame(val2Day,'days')){
return val1Day.format("YYYY-MM-DD") + ' ' + this.$moment(val1).format("HH:mm")+'-' + this.$moment(val2).format("HH:mm")
}else{
return val1 + '至' + val2
}
},
formatTime(val1,val2) {
let val1Day = this.$moment(val1)
let val2Day = this.$moment(val2)
console.log("123",val1Day,val2Day)
if(val1Day.isSame(val2Day,'days')){
return val1Day.format("YYYY-MM-DD") + ' ' + this.$moment(val1).format("HH:mm")+'-' + this.$moment(val2).format("HH:mm")
}else{
return val1 + '至' + val2
}
},
//
isCurrentDateGreaterOrEqual(targetDate) {
@ -183,11 +183,11 @@
this.can_appointment = true
} else {
this.can_appointment = false
}
if(res.door_appointments){
if (this.isCurrentDateGreaterOrEqual(res.door_appointments.start_time)) {
this.myQrcode = res.door_appointments
}
}
if(res.door_appointments){
if (this.isCurrentDateGreaterOrEqual(res.door_appointments.start_time)) {
this.myQrcode = res.door_appointments
}
}
this.$u.vuex('vuex_user', res.user)
})
@ -266,8 +266,8 @@
justify-content: space-between;
image {
width: 539rpx;
height: 88rpx;
width: 455rpx;
height: 87rpx;
display: block;
}
@ -411,7 +411,7 @@
text-align: center;
width:100%;
&>view {
margin-top: 20rpx;
margin-top: 20rpx;
text-align: left;
}
}

@ -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,16 +10,16 @@
<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">
<text>学号</text>
<text>{{userInfo.no?userInfo.no:'-'}}</text>
</view>
<view class="usersigns" v-if="userInfo.no">
<text>学号</text>
<text>{{userInfo.no?userInfo.no:'-'}}</text>
</view>
<view class="usersigns" v-if="course_signs.length>0">
<block v-if="course_signs[0]['course']">
@ -30,9 +30,9 @@
</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"
:sizeUnit="'rpx'" :size="160"
:options="{
margin: 10,
foregroundImageSrc: '/static/index_icon1.png',
@ -56,13 +56,13 @@
<text>我的课程</text>
</view>
<u-icon name="arrow-right" size="32" color="#666" style="margin-left:40rpx"></u-icon>
</view>
<!-- <view @click="toUrl(6)">
<view>
<image :src="base.imgHost('me-icon1.png')" style="width:52rpx;height:48rpx;"></image>
<text>学院日程</text>
</view>
<u-icon name="arrow-right" size="32" color="#666" style="margin-left:40rpx"></u-icon>
</view>
<!-- <view @click="toUrl(6)">
<view>
<image :src="base.imgHost('me-icon1.png')" style="width:52rpx;height:48rpx;"></image>
<text>学院日程</text>
</view>
<u-icon name="arrow-right" size="32" color="#666" style="margin-left:40rpx"></u-icon>
</view> -->
<view @click="toUrl(3)">
<view>
@ -120,23 +120,23 @@
margin: 10,
foregroundImageSrc: '/static/index_icon1.png',
}"></uqrcode>
</view>
<view class="modal-xyk-item-reload" @click="getQrCode" v-if="myQrcode">
<image :src="base.imgHost('me-reload.png')"></image>
<view>点击二维码刷新</view>
</view>
<view class="modal-xyk-item-reload" @click="getQrCode" v-if="myQrcode">
<image :src="base.imgHost('me-reload.png')"></image>
<view>点击二维码刷新</view>
</view>
</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>
<view class="modal-xyk-item modal-xyk-name">
<view class="modal-xyk-name-img">
<image :src="userAvatar?userAvatar:base.imgHost('logo-user.png')"></image>
</view>
<view class="modal-xyk-name-course">
<text>姓名</text>
<text>{{userInfo.username}}</text>
</view>
<view class="modal-xyk-name-course">
<text>学号</text>
<text>{{userInfo.no?userInfo.no:'-'}}</text>
</view>
<view class="modal-xyk-name-course">
<text>学号</text>
<text>{{userInfo.no?userInfo.no:'-'}}</text>
</view>
<view class="modal-xyk-name-course" v-if="course_signs.length>0">
<block v-if="course_signs[0]['course']">
@ -203,7 +203,7 @@
},
data() {
return {
showRegister: false,
showRegister: false,
userAvatar:'',
type: 'register',
showGzh: false,
@ -265,11 +265,11 @@
bigCode() {
this.showCard = false
this.showBigCode = true
},
changeAvatar(){
uni.navigateTo({
url:'/packages/avatarUpload/index'
})
},
changeAvatar(){
uni.navigateTo({
url:'/packages/avatarUpload/index'
})
},
toUrl(type) {
if (type === 1 || type === 2 || type === 3) {
@ -311,7 +311,7 @@
this.$u.vuex('vuex_user', res.user)
this.userInfo = res.user
this.course_signs = res.user.course_signs ? res.user.course_signs : []
this.myQrcode = res.course_signs ? res.course_signs.qrcode : 'STBC'
this.myQrcode = res.course_signs ? res.course_signs.qrcode : 'STBC'
this.userAvatar = res.user.headimgurl?res.user.headimgurl:''
if (this.base.isNull(res.user.mobile)) {
this.showRegister = true
@ -398,13 +398,13 @@
align-items: flex-start;
justify-content: space-between;
&-left {
width:100%;
&>image {
width: 200rpx;
margin-bottom: 30rpx;
// height: 110rpx;
// margin-right: 20rpx;
&-left {
width:100%;
&>image {
width: 200rpx;
margin-bottom: 30rpx;
// height: 110rpx;
// margin-right: 20rpx;
}
.userinfo {
line-height: 1.5;
@ -430,9 +430,9 @@
width: calc(100% - 100rpx);
}
}
}
.usercode {
width: 160rpx;
}
.usercode {
width: 160rpx;
}
}
}
@ -571,7 +571,7 @@
display: flex;
justify-content: space-between;
align-items: flex-start;
padding: 20rpx 60rpx;
padding: 20rpx 60rpx;
padding-left:30rpx;
}
@ -583,8 +583,8 @@
&-reload {
display: flex;
align-items: center;
// padding: 10rpx 40rpx;
justify-content: center;
// padding: 10rpx 40rpx;
justify-content: center;
margin-top: 20rpx;
font-size: 24rpx;
image {
@ -594,11 +594,11 @@
}
}
}
&-code{
width: 270rpx;
/* margin-right: 10rpx; */
border-right: 1rpx solid rgba(255,255,255,0.2);
padding-right: 30rpx;
&-code{
width: 270rpx;
/* margin-right: 10rpx; */
border-right: 1rpx solid rgba(255,255,255,0.2);
padding-right: 30rpx;
}
&-name {
width: calc(100% - 310rpx);
@ -608,14 +608,14 @@
text-align: left;
// margin-bottom: 20rpx;
}
&-img{
image{
width: 100rpx;
height: 100rpx;
margin-left: 30rpx;
margin-bottom:10rpx;
border-radius: 100%;
}
&-img{
image{
width: 100rpx;
height: 100rpx;
margin-left: 30rpx;
margin-bottom:10rpx;
border-radius: 100%;
}
}
&-course {
display: flex;

Loading…
Cancel
Save