Commit 337c8164 authored by 罗超's avatar 罗超

2

parent 92d2c7ad
...@@ -187,7 +187,9 @@ ...@@ -187,7 +187,9 @@
res.Data.Account = data.obj.phoneNum; res.Data.Account = data.obj.phoneNum;
uni.setStorageSync("userInfo", res.Data); uni.setStorageSync("userInfo", res.Data);
Toast.success("登录成功"); Toast.success("登录成功");
emit('success') setTimeout(()=>{
emit('success')
},1000)
data.showPhone = false data.showPhone = false
uni.showTabBar() uni.showTabBar()
} else { } else {
...@@ -198,13 +200,11 @@ ...@@ -198,13 +200,11 @@
} }
uni.hideLoading(); uni.hideLoading();
if (res.Data.Error == -1) { //如果没找到电话号码 就跳入登录 if (res.Data.Error == -1) { //如果没找到电话号码 就跳入登录
// setTimeout(() => { // setTimeout(() => {
// uni.reLaunch({ // uni.reLaunch({
// url: '/pages/login/login' // url: '/pages/login/login'
// }); // });
// }, 1000); // }, 1000);
} }
} }
......
...@@ -107,14 +107,15 @@ ...@@ -107,14 +107,15 @@
</style> </style>
<template> <template>
<view class="studyCourse"> <view class="studyCourse">
<div class="loading" v-if="isShowLoad">
<van-loading type="spinner" color="#fff" />
</div>
<template v-if="ChapterList.length>0"> <template v-if="ChapterList.length>0">
<view class="Course_Top"> <view class="Course_Top">
<view class="CourseBan">{{CourseName}}</view> <view class="CourseBan">{{CourseName}}</view>
<view class="CourseTotal" v-if="TotalHours>0">{{TotalHours}}</view> <view class="CourseTotal" v-if="TotalHours>0">{{TotalHours}}</view>
</view> </view>
<div class="loading" v-if="isShowLoad">
<van-loading type="spinner" color="#fff" />
</div>
<view class="Course_Bottom"> <view class="Course_Bottom">
<view class="Course_List" v-for="(item,index) in ChapterList" :key="index"> <view class="Course_List" v-for="(item,index) in ChapterList" :key="index">
<view class="CourseList_One" @click="getReview(index)"> <view class="CourseList_One" @click="getReview(index)">
...@@ -216,6 +217,8 @@ ...@@ -216,6 +217,8 @@
x.isShow = false x.isShow = false
}) })
} }
}).catch(err=>{
data.isShowLoad = false;
}); });
}, },
getSpeed(score) { getSpeed(score) {
......
...@@ -6,7 +6,15 @@ ...@@ -6,7 +6,15 @@
:key="index" :key="index"
> >
<view class="flex flex_start_center title-row"> <view class="flex flex_start_center title-row">
<view class="class-time">{{ item.StartTime }} </view> <view class="class-time">
<view class="" style="font-size: 22rpx;font-weight: 400;color: #111111;">
{{data.DateMonth}}-{{data.DateDay}}
</view>
<view class="">
{{ item.StartTime }}
</view>
</view>
<view class="circle"></view> <view class="circle"></view>
<view class="class-title one_line flex"> <view class="class-title one_line flex">
{{ data.ClassName }} {{ data.ClassName }}
...@@ -65,7 +73,7 @@ import { ...@@ -65,7 +73,7 @@ import {
} from "vue"; } from "vue";
export default { export default {
name: "", name: "",
props: { data: Object }, props: { data: Object},
components: {}, components: {},
setup(props) { setup(props) {
let methods = { let methods = {
......
<template> <template>
<view class="" :style="{ 'padding-top': `${statusBarHeight}px` }"> <view class="" :style="{ 'padding-top': `${statusBarHeight}px` }">
<view style="height: 100rpx"></view> <view style="height: 100rpx"></view>
<view class="navbar"> <view class="navbar">
<van-nav-bar title="课表" fixed title-class="navTitle"> <van-nav-bar title="课表" fixed title-class="navTitle">
<view slot="left" class="chooseDate flex flex_start_center"> <view slot="left" class="chooseDate flex flex_start_center">
<!-- <van-icon <!-- <van-icon
name="arrow-left" name="arrow-left"
size="36rpx" size="36rpx"
style="margin-right: 10rpx" style="margin-right: 10rpx"
@click="back" @click="back"
/> --> /> -->
<view @click="showdatetime">{{ currentDate }}</view> <view @click="showdatetime">{{ currentDate }}</view>
</view> </view>
</van-nav-bar> </van-nav-bar>
</view> </view>
<van-popup <van-popup :show="showPopup" round position="bottom" custom-style="height: 50%" @close="onClose">
:show="showPopup" <van-datetime-picker type="year-month" :value="getCurrentDate" @cancel="onClose" @confirm="onConfirm" />
round </van-popup>
position="bottom" <view class="calendar flex flex_wrap">
custom-style="height: 50%" <view v-for="(item, index) in weekArr" :key="index" class="calendar-week-item no_shrink">
@close="onClose" <view class="calendar-week">{{ item }}</view>
> </view>
<van-datetime-picker <view v-for="(item, index) in sliceWeekArr" :key="index" class="calendar-item no_shrink"
type="year-month" v-if="!isShowAllDay">
:value="getCurrentDate" <view class="calendar-day flex flex_center_center" ref="calendarDay" @click="calendarActive(item)"
@cancel="onClose" v-show="item">
@confirm="onConfirm" <view class=""
/> :class="{ 'calendar-active': activeDay === item.day ,'calendar-leave':isLeave(item),'calendar-leave2':isLeave2(item)}">
</van-popup> {{ item.day }}
<view class="calendar flex flex_wrap"> </view>
<view </view>
v-for="(item, index) in weekArr" <view class="isToday" v-if="item.isToday === 1">今天</view>
:key="index" <view class="haveCourse" v-if="getHaveCourse(item)"></view>
class="calendar-week-item no_shrink" </view>
> <view v-for="(item, index) in calendar" :key="index" class="calendar-item no_shrink" v-if="isShowAllDay">
<view class="calendar-week">{{ item }}</view> <view class="calendar-day flex flex_center_center" ref="calendarDay"
</view> @click="calendarActive(item), sliceWeek(item)" v-show="item">
<view <view class=""
v-for="(item, index) in sliceWeekArr" :class="{ 'calendar-active': activeDay === item.day,'calendar-leave':isLeave(item),'calendar-leave2':isLeave2(item) }">
:key="index" {{ item.day }}
class="calendar-item no_shrink" </view>
v-if="!isShowAllDay" </view>
> <view class="isToday" v-if="item.isToday === 1">今天</view>
<view <view class="haveCourse" v-if="getHaveCourse(item)"></view>
class="calendar-day flex flex_center_center" </view>
ref="calendarDay"
@click="calendarActive(item)"
v-show="item"
>
<view class="" :class="{ 'calendar-active': activeDay === item.day ,'calendar-leave':isLeave(item),'calendar-leave2':isLeave2(item)}" >
{{ item.day }}
</view>
</view>
<view class="isToday" v-if="item.isToday === 1">今天</view>
<view class="haveCourse" v-if="getHaveCourse(item)"></view>
</view>
<view
v-for="(item, index) in calendar"
:key="index"
class="calendar-item no_shrink"
v-if="isShowAllDay"
>
<view
class="calendar-day flex flex_center_center"
ref="calendarDay"
@click="calendarActive(item), sliceWeek(item)"
v-show="item"
>
<view class="" :class="{ 'calendar-active': activeDay === item.day,'calendar-leave':isLeave(item),'calendar-leave2':isLeave2(item) }">
{{ item.day }}
</view>
</view>
<view class="isToday" v-if="item.isToday === 1">今天</view>
<view class="haveCourse" v-if="getHaveCourse(item)"></view>
</view>
<view class="openorclose flex flex_center_center"> <view class="openorclose flex flex_center_center">
<van-divider <van-divider contentPosition="center" style="width: 90%" v-if="isShowAllDay">
contentPosition="center" <van-icon name="arrow-up" size="40rpx" color="#0000ff" @click="changeCalendar" />
style="width: 90%" </van-divider>
v-if="isShowAllDay" <van-divider contentPosition="center" style="width: 90%" v-if="!isShowAllDay">
> <van-icon name="arrow-down" size="40rpx" color="#0000ff" @click="changeCalendar" />
<van-icon name="arrow-up" size="40rpx" color="#0000ff" @click="changeCalendar"/> </van-divider>
</van-divider> </view>
<van-divider </view>
contentPosition="center" <view class="Timetable-box">
style="width: 90%" <view class="flex flex_center_center" v-if="loading">
v-if="!isShowAllDay" <van-loading size="48rpx" type="spinner">加载中...</van-loading>
> </view>
<van-icon name="arrow-down" size="40rpx" color="#0000ff" @click="changeCalendar"/> <van-empty description="暂无课程" v-if="dataList.length === 0" />
</van-divider> <view v-for="(item, index) in dataList" :key="index" v-if="dataList.length > 0">
</view> <Item :data="item"/>
</view> </view>
<view class="Timetable-box">
<view class="flex flex_center_center" v-if="loading">
<van-loading size="48rpx" type="spinner">加载中...</van-loading>
</view> </view>
<van-empty description="暂无课程" v-if="dataList.length === 0" /> <van-toast id="van-toast" />
<view </view>
v-for="(item, index) in dataList"
:key="index"
v-if="dataList.length > 0"
>
<Item :data="item" />
</view>
</view>
<van-toast id="van-toast" />
</view>
</template> </template>
<script> <script>
import Item from "./timeTable-item.vue"; import Item from "./timeTable-item.vue";
import { import {
ref, ref,
reactive, reactive,
toRefs, toRefs,
toRef, toRef,
getCurrentInstance, getCurrentInstance,
watch, watch,
computed, computed,
onMounted, onMounted,
nextTick, nextTick,
} from "vue"; } from "vue";
import { getWeek, getToday } from "../../utils/date.js"; import {
import { getStundentPlanStatistical } from "../../api/index"; getWeek,
export default { getToday,
name: "", getMonthMaxDay,
props: {}, } from "../../utils/date.js";
components: { Item }, import {
setup(props) { getStundentPlanStatistical
let weekArr = ["日", "一", "二", "三", "四", "五", "六"]; } from "../../api/index";
//年月选择 export default {
let currentDate = ref(0); name: "",
currentDate.value = getToday("y", "m"); props: {},
let getCurrentDate = ref(0); components: {
getCurrentDate.value = new Date().getTime(); Item
//弹出层 },
let showPopup = ref(false); setup(props) {
let showdatetime = () => { let weekArr = ["日", "一", "二", "三", "四", "五", "六"];
showPopup.value = true; //年月选择
}; let currentDate = ref(0);
let onClose = () => { currentDate.value = getToday("y", "m");
showPopup.value = false; let getCurrentDate = ref(0);
}; getCurrentDate.value = new Date().getTime();
//选择月份 //弹出层
let onConfirm = (val) => { let showPopup = ref(false);
showPopup.value = false; let showdatetime = () => {
isShowAllDay.value = true; showPopup.value = true;
activeDay.value = 1; };
let curdate = new Date(val.detail); let onClose = () => {
getCurrentDate.value = val.detail; showPopup.value = false;
let year= curdate.getFullYear(); };
let month=curdate.getMonth() < 9 ? "0" + (curdate.getMonth() + 1) : curdate.getMonth() + 1 //选择月份
currentDate.value =year +"-" +month let onConfirm = (val) => {
getcalendar(curdate.getFullYear(), curdate.getMonth() + 1); showPopup.value = false;
let newArr = calendar.value.slice(emptyArr.length, calendar.value.length); isShowAllDay.value = true;
sliceWeek(newArr[0]); activeDay.value = 1;
data.msg.StartTime = currentDate.value + "-01"; let curdate = new Date(val.detail);
data.msg.EndTime = currentDate.value + "-01"; getCurrentDate.value = val.detail;
that.getData(); let year = curdate.getFullYear();
let maxDay= new Date(year,month,"0").getDate(); let month = curdate.getMonth() < 9 ? "0" + (curdate.getMonth() + 1) : curdate.getMonth() + 1
data.msg.EndTime = currentDate.value + '-' +maxDay; currentDate.value = year + "-" + month
that.getAllData() getcalendar(curdate.getFullYear(), curdate.getMonth() + 1);
let newArr = calendar.value.slice(emptyArr.length, calendar.value.length);
}; sliceWeek(newArr[0]);
//获取当月日历数组 data.msg.EndTime = currentDate.value + '-' + getMonthMaxDay(year, month);
let calendar = ref([]); that.getData()
//默认选中 that.getAllData()
let activeDay = ref(1);
//切换选中日期 };
let calendarActive = (item) => { //获取当月日历数组
let d = item.$orig?.day||item.day let calendar = ref([]);
activeDay.value = d ; //默认选中
let day = d < 10 ? "0" + d : d; let activeDay = ref(1);
data.msg.StartTime = currentDate.value + "-" + day; //切换选中日期
data.msg.EndTime = currentDate.value + "-" + day; let calendarActive = (item) => {
that.getData(); let d = item.$orig?.day || item.day
}; activeDay.value = d;
let emptyArr = []; //日历补空 let day = d < 10 ? "0" + d : d;
let getcalendar = (y, m) => { data.msg.StartTime = currentDate.value + "-" + day;
calendar.value = getWeek(y, m); data.msg.EndTime = currentDate.value + "-" + day;
emptyArr.length = calendar.value[0].week; that.getData();
if (calendar.value[0].week > 0) { };
emptyArr.fill({ week: "", day: "" }); let emptyArr = []; //日历补空
calendar.value.unshift(...emptyArr); let getcalendar = (y, m) => {
} calendar.value = getWeek(y, m);
}; emptyArr.length = calendar.value[0].week;
//截取最近一周 if (calendar.value[0].week > 0) {
let isShowAllDay = ref(false); emptyArr.fill({
let sliceWeekArr = ref([]); week: "",
let sliceWeek = (item) => { day: ""
let w =item.$orig?.week||item.week });
let d =item.$orig?.day||item.day calendar.value.unshift(...emptyArr);
let newArr = calendar.value.slice(emptyArr.length, calendar.value.length); }
let s = d - (w + 1) <= 0 ? 0 : d - (w + 1); };
let e = d + (6 - w); //截取最近一周
sliceWeekArr.value = newArr.slice(s, e); let isShowAllDay = ref(false);
if (s === 0) { let sliceWeekArr = ref([]);
sliceWeekArr.value.unshift(...emptyArr); let sliceWeek = (item) => {
} let w = item.$orig?.week || item.week
}; let d = item.$orig?.day || item.day
//切换日历展示模式 let newArr = calendar.value.slice(emptyArr.length, calendar.value.length);
let changeCalendar = () => { let s = d - (w + 1) <= 0 ? 0 : d - (w + 1);
isShowAllDay.value = !isShowAllDay.value; let e = d + (6 - w);
}; sliceWeekArr.value = newArr.slice(s, e);
//-------------------上边日历部分--------------------------------------- if (s === 0) {
let data = reactive({ sliceWeekArr.value.unshift(...emptyArr);
msg: { }
ClassId: 0, };
StartTime: "", //切换日历展示模式
EndTime: "", let changeCalendar = () => {
}, isShowAllDay.value = !isShowAllDay.value;
statusBarHeight: 0, };
dataList: [], //-------------------上边日历部分---------------------------------------
allData:[], let data = reactive({
loading:false, msg: {
ClassId: 0,
}); StartTime: "",
let methods = { EndTime: "",
// 获取当天数据 },
async getData() { statusBarHeight: 0,
data.loading=true dataList: [],
let res = await getStundentPlanStatistical(data.msg); allData: [],
data.loading=false loading: false,
if (res) {
data.dataList = res.Data; });
} let methods = {
}, // 获取当天数据
//获取当月数据 async getData() {
async getAllData() { data.loading = true
let res = await getStundentPlanStatistical(data.msg); let res = await getStundentPlanStatistical(data.msg);
if (res) { data.loading = false
data.allData = res.Data; if (res) {
} data.dataList = res.Data;
}, }
jumpPage(url) { },
uni.navigateTo({ //获取当月数据
url: url, async getAllData() {
}); let res = await getStundentPlanStatistical(data.msg);
}, if (res) {
back() { data.allData = res.Data;
uni.navigateBack(); }
}, },
getHaveCourse(item){ jumpPage(url) {
let date=currentDate.value+'-'+(item.day<10?'0'+item.day:item.day) uni.navigateTo({
let res = false url: url,
let find= data.allData.find((e)=>{ });
return e.ClassDateStr===date },
}) back() {
if(find){ uni.navigateBack();
res=true },
} getHaveCourse(item) {
return res let date = currentDate.value + '-' + (item.day < 10 ? '0' + item.day : item.day)
}, let res = false
// 请假 let find = data.allData.find((e) => {
isLeave(item){ return e.ClassDateStr === date
let date=currentDate.value+'-'+(item.day<10?'0'+item.day:item.day) })
let res = false if (find) {
let find= data.allData.find((e)=>{ res = true
return e.ClassDateStr===date }
}) return res
},
if(find){ // 请假
let res1= find.PlanTimeList.some(e=>{ isLeave(item) {
return e.IsLeave === 1 && e.IsCheck == 2 let date = currentDate.value + '-' + (item.day < 10 ? '0' + item.day : item.day)
}) let res = false
if(res1){ let find = data.allData.find((e) => {
res=true return e.ClassDateStr === date
} })
}
return res if (find) {
}, let res1 = find.PlanTimeList.some(e => {
// 缺勤 return e.IsLeave === 1 && e.IsCheck == 2
isLeave2(item){ })
let date=currentDate.value+'-'+(item.day<10?'0'+item.day:item.day) if (res1) {
let res = false res = true
let find= data.allData.find((e)=>{ }
return e.ClassDateStr===date }
}) return res
if(find){ },
let res1= find.PlanTimeList.some(e=>{ // 缺勤
return e.IsCheck === 1 isLeave2(item) {
}) let date = currentDate.value + '-' + (item.day < 10 ? '0' + item.day : item.day)
if(res1){ let res = false
res=true let find = data.allData.find((e) => {
} return e.ClassDateStr === date
} })
return res if (find) {
} let res1 = find.PlanTimeList.some(e => {
}; return e.IsCheck === 1
onMounted(() => { })
getcalendar(new Date().getFullYear(), new Date().getMonth() + 1); if (res1) {
let today = calendar.value.find((e) => { res = true
return e.isToday === 1; }
}); }
if (today) { return res
activeDay.value = today.day; }
} };
sliceWeek(today); onMounted(() => {
data.statusBarHeight = uni.getSystemInfoSync().statusBarHeight; getcalendar(new Date().getFullYear(), new Date().getMonth() + 1);
}); let today = calendar.value.find((e) => {
let that = methods; return e.isToday === 1;
return { });
currentDate, if (today) {
getCurrentDate, activeDay.value = today.day;
showPopup, }
showdatetime, sliceWeek(today);
onClose, data.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
onConfirm, });
calendar, let that = methods;
activeDay, return {
calendarActive, currentDate,
weekArr, getCurrentDate,
sliceWeekArr, showPopup,
sliceWeek, showdatetime,
isShowAllDay, onClose,
changeCalendar, onConfirm,
...toRefs(data), calendar,
...methods, activeDay,
}; calendarActive,
}, weekArr,
onLoad(options) { sliceWeekArr,
const indexData=uni.getStorageSync('indexData') sliceWeek,
// this.msg.ClassId = JSON.parse(options.classId); isShowAllDay,
this.msg.ClassId = indexData.ClassId changeCalendar,
this.msg.StartTime = getToday(); ...toRefs(data),
this.msg.EndTime = getToday(); ...methods,
if(this.$isLogin()){ };
this.getAllData() },
this.getData(); onShow() {
} const indexData = uni.getStorageSync('indexData')
}, this.msg.ClassId = indexData.ClassId
}; this.msg.StartTime = getToday('y', 'm') + '-01';
this.msg.EndTime = getToday('y', 'm') + '-'+ getMonthMaxDay();
if (this.$isLogin()) {
this.getData()
this.getAllData()
}
},
};
</script> </script>
<style scoped> <style scoped>
.chooseDate { .chooseDate {
font-size: 24rpx; font-size: 24rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #111111; color: #111111;
} }
.calendar {
width: 690rpx;
/* height: 120rpx; */
background-color: #f5f6f7;
border-radius: 20rpx;
margin: 0 auto;
/* overflow-x: auto; */
margin-bottom: 38rpx;
}
.calendar-week-item {
width: 98.5rpx;
height: 60rpx;
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
text-align: center;
}
.calendar-item {
width: 98.5rpx;
height: 80rpx;
text-align: center;
position: relative;
}
.calendar-week {
height: 60rpx;
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
line-height: 58rpx;
color: #999999;
}
.calendar { .calendar-day {
width: 690rpx; /* height: 50rpx; */
/* height: 120rpx; */ font-size: 24rpx;
background-color: #f5f6f7; font-family: PingFang SC;
border-radius: 20rpx; font-weight: 500;
margin: 0 auto; line-height: 48rpx;
/* overflow-x: auto; */ color: #111111;
margin-bottom: 38rpx;
}
.calendar-week-item { }
width: 98.5rpx;
height: 60rpx;
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
text-align: center;
}
.calendar-item { .isToday {
width: 98.5rpx; font-size: 18rpx;
height: 80rpx; font-family: PingFang SC;
text-align: center; font-weight: 500;
position: relative; color: #999999;
} }
.calendar-week { .calendar-active {
height: 60rpx; width: 50rpx;
font-size: 24rpx; height: 50rpx;
font-family: PingFang SC; background-color: rgba(0, 0, 255, 0.9) !important;
font-weight: 500; border-radius: 50%;
line-height: 58rpx; color: #FFFFFF !important;
color: #999999; }
}
.calendar-day { .calendar-leave {
/* height: 50rpx; */ width: 50rpx;
font-size: 24rpx; height: 50rpx;
font-family: PingFang SC; background-color: #E6A23C;
font-weight: 500; border-radius: 50%;
line-height: 48rpx; }
color: #111111;
.calendar-leave2 {
} width: 50rpx;
height: 50rpx;
background-color: #F56C6C;
border-radius: 50%;
}
.isToday { .calendar .openorclose {
font-size: 18rpx; margin-bottom: 17rpx;
font-family: PingFang SC; width: 100%;
font-weight: 500; }
color: #999999;
}
.calendar-active { .Timetable-box {
width: 50rpx; box-sizing: border-box;
height: 50rpx; /* padding-left: 30rpx;
background-color: rgba(0, 0, 255, 0.9) !important;
border-radius: 50%;
color:#FFFFFF !important;
}
.calendar-leave {
width: 50rpx;
height: 50rpx;
background-color:#E6A23C;
border-radius: 50%;
}
.calendar-leave2 {
width: 50rpx;
height: 50rpx;
background-color:#F56C6C;
border-radius: 50%;
}
.calendar .openorclose {
margin-bottom: 17rpx;
width: 100%;
}
.Timetable-box {
box-sizing: border-box;
/* padding-left: 30rpx;
text-align: center; */ text-align: center; */
} }
/deep/.navTitle {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 800;
color: #111111;
}
/deep/.navTitle { /deep/.van-divider {
font-size: 32rpx; margin: 0 auto;
font-family: PingFang SC; }
font-weight: 800;
color: #111111; .haveCourse {
} width: 10rpx;
/deep/.van-divider { height: 10rpx;
margin: 0 auto; border-radius: 50%;
} background-color: #FF0000;
.haveCourse{ position: absolute;
width: 10rpx; top: 10rpx;
height: 10rpx; right: 10rpx;
border-radius: 50%; }
background-color: #FF0000;
position: absolute;
top: 10rpx;
right: 10rpx;
}
</style> </style>
<template> <template>
<view class="word"> <view class="word">
<swiper class="swiper" next-margin="60rpx" @change="swiperChange" :current="current"> <van-skeleton title row="10" v-if="loading" />
<van-empty description="暂无数据" v-if="nodata"/>
<swiper class="swiper" next-margin="60rpx" @change="swiperChange" :current="current" v-if="!loading&&!nodata">
<swiper-item v-for="(item,index) in StudyList" v-if="Type==2" :key="index" class="swiper-item"> <swiper-item v-for="(item,index) in StudyList" v-if="Type==2" :key="index" class="swiper-item">
<Pronunciation :item="item" :cur="index+1" :total="StudyList.length"></Pronunciation> <Pronunciation :item="item" :cur="index+1" :total="StudyList.length"></Pronunciation>
</swiper-item> </swiper-item>
...@@ -57,14 +59,24 @@ ...@@ -57,14 +59,24 @@
}, },
Type:1, //1复习 2 单词 Type:1, //1复习 2 单词
TotalHours:0, TotalHours:0,
CourseName:'' CourseName:'',
loading: false,
nodata: false,
}) })
let methods = { let methods = {
getData() { getData() {
data.loading=true
proxy.$request('/AppletWords/GetStudyWords', data.msg).then(res => { proxy.$request('/AppletWords/GetStudyWords', data.msg).then(res => {
data.loading=false
data.StudyList = res.Data.StudyList data.StudyList = res.Data.StudyList
data.ReviewList = res.Data.ReviewList; data.ReviewList = res.Data.ReviewList;
data.current = 0 data.current = 0
if (data.StudyList.length === 0 && data.ReviewList.length == 0) {
data.nodata = true
}
}).catch(err=>{
data.loading=false
data.nodata = true
}) })
}, },
swiperChange(val) { swiperChange(val) {
......
...@@ -24,6 +24,16 @@ export let getWeek = (year, month) => { ...@@ -24,6 +24,16 @@ export let getWeek = (year, month) => {
return arr return arr
} }
export let getMonthMaxDay = (y, m) => {
let maxDay = 30
if(y&&m){
maxDay= new Date(y, m, "0").getDate();
}else{
const d=new Date()
maxDay= new Date( d.getFullYear(),d.getMonth()+1,0).getDate();
}
return maxDay
}
export let getToday = (y, m, d) => { export let getToday = (y, m, d) => {
let date = new Date() let date = new Date()
let year = date.getFullYear() let year = date.getFullYear()
......
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