Commit 7a0232ca authored by youjie's avatar youjie

no message

parent 01018a2c
......@@ -12,7 +12,7 @@
<view>{{i.DateStr.slice(8,10)}}</view>
</view>
<view class="time-text">
{{i.Week}}
{{getDateData(i.DateStr)}}
</view>
</view>
</view>
......@@ -27,7 +27,7 @@
:disabled="true">
<view class="content-text-box">
<view class="right-box">
<view v-for="(item,index) in i.SubList"
<view v-for="(item,index) in i.SubList.sort((a,b)=>{a-b})"
:key="index"
class="Festival-box activeOne"
:class="{'activeOne':item.StartTime=='09:30','activeTwo':item.StartTime=='11:10',
......@@ -77,7 +77,36 @@
})
const methods = {
// 获取日期
getDateData(d) {
let date = new Date(d)
let week = date.getDay()
let weekStr = ""
switch (week) {
case 0:
weekStr = '星期日';
break;
case 1:
weekStr = '星期一';
break;
case 2:
weekStr = '星期二';
break;
case 3:
weekStr = '星期三';
break;
case 4:
weekStr = '星期四';
break;
case 5:
weekStr = '星期五';
break;
case 6:
weekStr = '星期六';
break;
}
return weekStr
},
}
onMounted(() => {
......
......@@ -10,7 +10,7 @@
<view></view>
</view>
</view>
<view v-for="(item,index) in titleList"
<view v-for="(item,index) in titleList" :key="index"
class="header-week">
<view>{{item.num}}</view>
<view>{{item.name}}</view>
......@@ -28,14 +28,14 @@
</view>
<view class="text-right">
<view class="status-box border0">
<view v-for="i in 7"
<view v-for="(i,index) in 7" :key="index"
class="text-img">
&nbsp;&nbsp;
</view>
</view>
</view>
</view>
<view class="content-text" v-for="item in classList">
<view class="content-text" v-for="(item,index) in classList" :key="index">
<view class="text-left">
<view class="left-num">
<view>{{item.name}}</view>
......@@ -45,7 +45,7 @@
<view class="text-right"
:class="{'border0':item.id==6}">
<view class="status-box">
<view v-for="(i,indexs) in item.list"
<view v-for="(i,indexs) in item.list" :key="indexs"
class="text-img"
:class="{'activeOne':item.id==1&&i.DetailsId,
'activeTwo':item.id==2&&i.DetailsId,
......@@ -61,7 +61,7 @@
<view v-if="item.id!=6" class="height30">&nbsp;&nbsp;</view>
</view>
</view>
<view class="content-text" v-for="(i,index) in 2">
<view class="content-text" v-for="(i,index) in 2" :key="index">
<view class="text-left">
<view class="left-num">
<view></view>
......@@ -70,7 +70,7 @@
</view>
<view class="text-right">
<view class="status-box border0">
<view v-for="i in 7"
<view v-for="(i,keys) in 7" :key="keys"
class="text-img">
&nbsp;&nbsp;
</view>
......@@ -371,7 +371,7 @@
margin-left: 2rpx;
}
.header-week{
width: 90rpx;
width: 89rpx;
flex-shrink: 0;
display: flex;
flex-direction: column;
......
......@@ -3,60 +3,12 @@
<view class="titleHeader">
<view class="titleHeader-year">
<view>{{year}}{{month}}</view>
<!-- <view>本周</view> -->
<view>计划 {{total}}节课</view>
</view>
<!-- 滑动查看上周本周 -->
<!-- <swiper :style="{height:!isShowAllDay?'220rpx':'620rpx'}" circular :current="1"
@change="changeSwiper($event,preSwiperId)">
<swiper-item :key="Sindex" v-for="i in 2">
<view class="titleHeader-dateStr">
<view v-for="item in titleList"
class="titleHeader-content">
<view class="titleHeader-name">{{item.name}}</view>
<view class="titleHeader-num">{{item.num}}</view>
<view class="titleHeader-mark" v-if="dataList.length>0">
<view v-for="(items,index) in item.listNum" :key="index"
:class="{'activeOne':items.StartTime=='09:30','activeTwo':items.StartTime=='11:10',
'activeThree':items.StartTime=='13:30','activeFour':items.StartTime=='15:10',
'activeFive':items.StartTime=='16:50','activeSix':item.StartTime=='19:00'}"></view>
<lxCalendar @chang="getData" :titleList="titleList"></lxCalendar>
</view>
</view>
</view>
</swiper-item>
</swiper> -->
<!-- 按钮切换上周下周本周 -->
<view class="titleHeader-dateStr">
<view v-if="weekShow" class="week" @click="getMonday(0)">
本周
</view>
<view class="position clickLeft" @click="getMonday(-1)">
<van-icon
name="arrow-left"
size="28rpx"
color="#333333"
></van-icon>
</view>
<view v-for="item in titleList"
class="titleHeader-content">
<view class="titleHeader-name">{{item.name}}</view>
<view class="titleHeader-num">{{item.num.slice(8,10)}}</view>
<view class="titleHeader-mark" v-if="item.listNum.length>0">
<view v-for="(items,index) in item.listNum" :key="index"
:class="{'activeOne':items.StartTime=='09:30','activeTwo':items.StartTime=='11:10',
'activeThree':items.StartTime=='13:30','activeFour':items.StartTime=='15:10',
'activeFive':items.StartTime=='16:50','activeSix':items.StartTime=='19:00'}"></view>
</view>
</view>
<view class="position clickRight" @click="getMonday(1)">
<van-icon
name="arrow"
size="28rpx"
color="#333333"
></van-icon>
</view>
</view>
</view>
<view class="content-box" v-if="dataList.length>0">
<view class="content-box" v-if="dataList.length>0&&total>0">
<scroll-view scroll-y="true" style="width:100%;height: 100%;">
<classList :classList="dataList"></classList>
</scroll-view>
......@@ -93,10 +45,12 @@
} from '../../utils/date.js'
import Navbar from '../../components/navbar.vue'
import classList from '../../components/bookAclass/classList.vue'
import lxCalendar from './lx-calendar/lx-calendar.vue'
export default {
components: {
Navbar,
classList
classList,
lxCalendar
},
props: ['day'],
setup(props) {
......@@ -119,32 +73,19 @@
total:0,
dataList:[],
titleList:[
{name:'星期一',num:'',listNum:[]},
{name:'星期二',num:'',listNum:[]},
{name:'星期三',num:'',listNum:[]},
{name:'星期四',num:'',listNum:[]},
{name:'星期五',num:'',listNum:[]},
{name:'星期六',num:'',listNum:[]},
{name:'星期日',num:'',listNum:[]},
{date:'',list:[]},
{date:'',list:[]},
{date:'',list:[]},
{date:'',list:[]},
{date:'',list:[]},
{date:'',list:[]},
{date:'',list:[]},
],
currentSwiper: 1,
preSwiperId: 1,
weekType: 0,
weekShow:false,
weekList:[]
})
const methods = {
changeSwiper(val, PreId) {
let CurId = val.detail.current
// 上周
if(CurId==0){
methods.getMonday(-1)
}
// 本周
if(CurId==1){
methods.getMonday(0)
}
},
addPlan(){
uni.navigateTo({
url: '/pages/bookAclass/addPlan',
......@@ -192,6 +133,7 @@
},
// 实现方法
getMonday(dates) {
return
data.weekType = dates
let arr = [],weekOne='';
let todayTimeStr = new Date(new Date().toLocaleDateString()).getTime();
......@@ -244,7 +186,15 @@
methods.getList()
return arr;
},
getData(arr){
data.year = arr[0].date.slice(0,4)
data.month = arr[0].date.slice(5,6)<10?arr[0].date.slice(5,6):arr[0].date.slice(5,7)
data.msg.StartDate = arr[0].date
data.msg.EndDate = arr[6].date
methods.getList()
},
getList(){
data.dataList = []
if(data.msg.StartDate){
uni.showLoading({
title: '加载中...'
......@@ -252,35 +202,40 @@
proxy.$request("/LeaveStudent/GetStuPlanAppointment", data.msg).then(res => {
if(res.Code ==1){
data.titleList.forEach((i,indexs)=>{
i.listNum = []
i.list = []
})
let arr = []
data.dataList = res.Data
if(res.Data.length>0){
data.dataList.forEach((item,index)=>{
item.SubList.sort((a,b)=>a.Sort-b.Sort)
item.SubList.forEach(i=>{
arr.push(i)
})
data.titleList.forEach((i,indexs)=>{
if(item.DateStr===i.num){
item.Week = i.name
i.listNum = item.SubList
if(index==indexs){
i.date = item.DateStr.slice(8,10)
if(item.SubList.length>0){
i.list = item.SubList
}else{
i.list = []
}
}
})
})
}
data.total = arr.length
uni.hideLoading()
}
})
}
}
},
}
onMounted(() => {
methods.getMonday(0);
methods.getDateData()
methods.getList()
})
return {
...toRefs(data),
......@@ -335,7 +290,7 @@
top: 0;
left: 0;
right: 0;
padding: 0 36rpx;
/* padding: 0 36rpx; */
}
.titleHeader-year{
display: flex;
......
This diff is collapsed.
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