Commit 87ea7956 authored by lvtz's avatar lvtz

fix

parent c1fa6358
......@@ -132,26 +132,14 @@ Page({
code,
data
} = res;
const {
start_time,
end_time
} = data;
const startDate = start_time.split(' ')[0];
const endDate = end_time.split(' ')[0];
const starttime = start_time.split(' ')[1];
const endtime = end_time.split(' ')[1];
const week = ['日', '一', '二', '三', '四', '五', '六'];
data.showTime = {
year: Number(startDate.split('-')[0]),
month: Number(startDate.split('-')[1]),
day: Number(startDate.split('-')[2]),
week: week[new Date(startDate).getDay()],
starttime: starttime.slice(0, 5),
endtime: starttime.slice(0, 5),
if(code==200){
const startDate = data.start_time.split(' ')[0];
const week = ['日', '一', '二', '三', '四', '五', '六'];
data.showWeek = week[new Date(startDate).getDay()]
this.setData({
schedulesDetail: data
})
}
this.setData({
schedulesDetail: data
})
}).catch((res) => {
})
},
......
......@@ -3,7 +3,7 @@
<view class="schedules-info">
<view class="header-box">
<view class="header-title">上课时间</view>
<view class="time-box">周{{schedulesDetail.showTime.week}} {{schedulesDetail.showTime.year}}年{{schedulesDetail.showTime.month}}月{{schedulesDetail.showTime.day}}日</view>
<view class="time-box"><text>周{{schedulesDetail.showWeek}}</text>{{schedulesDetail.start_time&&filter.matchTime(schedulesDetail.start_time,'month')}}{{schedulesDetail.start_time&&filter.matchTime(schedulesDetail.start_time,'hour')}}-{{schedulesDetail.end_time&&filter.matchTime(schedulesDetail.end_time,'hour')}}</view>
</view>
<view class="content-box">
<view class="list-item">
......
......@@ -24,12 +24,31 @@ page{
}
.schedules-info .header-box .time-box{
font-size:36rpx;
font-family:PingFang SC;
font-weight:bold;
color:rgba(0,0,0,1);
line-height:1;
text-align: center;
padding: 30rpx 0 42rpx 0;
display: flex;
align-items: center;
justify-content: center;
}
.schedules-info .header-box .time-box text{
padding-right: 24rpx;
font-size: 36rpx;
color: #000;
font-weight: bold;
position: relative;
}
.schedules-info .header-box .time-box text::after{
content: '';
width: 1px;
height: 30rpx;
background: rgba(0,0,0,.5);
position: absolute;
top: 50%;
right: 12rpx;
transform: translateY(-50%);
}
.schedules-info .content-box{
padding: 8rpx 36rpx 32rpx 36rpx;
......
......@@ -108,20 +108,12 @@ Page({
if (code != 200) { // 失败的处理
} else {
const {start_time} = data;
const startDate = start_time.split(' ')[0];
const startDate = data.start_time.split(' ')[0];
const week = ['日', '一', '二', '三', '四', '五', '六'];
data.showTime = {
year: Number(startDate.split('-')[0]),
month: Number(startDate.split('-')[1]),
day: Number(startDate.split('-')[2]),
week: week[new Date(startDate).getDay()],
// starttime: starttime.slice(0, 5),
// endtime: starttime.slice(0, 5),
}
data.showWeek = week[new Date(startDate).getDay()]
this.setData({
courseDetail: res.data,
nowDate: res.datetime
courseDetail: data,
// nowDate: res.datetime
})
}
}).catch((e) => {
......
......@@ -4,7 +4,7 @@
<view class="schedule-detail">
<view class="time-box">
<view class="label">上课时间</view>
<view class="time"><text>周{{courseDetail.showTime.week}}</text> {{courseDetail.showTime.year}}年{{courseDetail.showTime.month}}月{{courseDetail.showTime.day}}日</view>
<view class="time"><text>周{{courseDetail.showWeek}}</text>{{courseDetail.start_time&&filter.matchTime(courseDetail.start_time,'month')}}{{courseDetail.start_time&&filter.matchTime(courseDetail.start_time,'hour')}}-{{courseDetail.end_time&&filter.matchTime(courseDetail.end_time,'hour')}}</view>
</view>
<view class="item-box">
<view class="line-item">
......
......@@ -43,6 +43,17 @@ page{
font-size: 36rpx;
color: #000;
font-weight: bold;
position: relative;
}
.schedule-detail .time-box .time text::after{
content: '';
width: 1px;
height: 30rpx;
background: rgba(0,0,0,.5);
position: absolute;
top: 50%;
right: 12rpx;
transform: translateY(-50%);
}
.schedule-detail .item-box{
padding: 22rpx 26rpx 18rpx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment