Commit c93ff171 authored by 罗超's avatar 罗超

1

parent a4c577fc
......@@ -12,14 +12,13 @@
v-for="(item, index) in dataList"
:key="index"
class="list-item"
@click="jumpPage(item.FeedBackId)"
>
<view class="feedback-info flex flex_start_center">
<image :src="item.TeacherIcon" class="info-headimg" />
<view class="grow">
<view class="teacher-name" v-if="item.TeacherName">{{
<view class="teacher-name one_line" v-if="item.TeacherName">{{
item.TeacherName
}}</view>
}} {{item.CourseName}}</view>
<view class="rate">
<van-rate
:value="item.Score"
......@@ -29,7 +28,7 @@
/>
</view>
</view>
<view class="feedback-all"> {{ item.CreatetimeStr }} </view>
<view class="feedback-all"> {{ item.ClassDateStr }} {{item.StartTime}}</view>
</view>
<view class="feedback-text"> {{ item.Comment }}</view>
<view class="flex flex_wrap">
......@@ -38,14 +37,31 @@
:key="index1"
class="feedback-img"
v-if="index1 === 0 || index1 === 1 || index1 === 2"
@click="previewImage(item.PhotoList, index1)"
>
<image
:src="item1"
style="width: 100%; height: 100%"
mode="aspectFill"
v-if="index1 === 0 || index1 === 1 || index1 === 2"
/>
<view style="width: 100%; height: 100%;position: relative;" v-if="index1 === 0 || index1 === 1 || index1 === 2">
<image
:src="item1"
style="width: 100%; height: 100%"
mode="aspectFill"
v-if="item1.indexOf('mp4')===-1"
@click="previewImage(item.PhotoList, index1)"
/>
<video :id="'myVideo'+index1" :src="item1" style="width: 100%; height: 100%"
:controls='controls'
:show-center-play-btn='false'
:show-fullscreen-btn='false'
@fullscreenchange='videoControl'
v-if="item1.indexOf('mp4')!=-1"
></video>
<view @click="enlarge(index1)" v-if="item1.indexOf('mp4')!=-1"
style="position: absolute;left: 50%;top: 50%;margin-top: -49rpx;margin-left: -49rpx;width: 98rpx;height: 98rpx;border-radius: 20rpx;background-color: rgba(255,255,255,.4);display: flex;align-items: center;justify-content: center;">
<!-- 播放按钮 -->
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1616471847000_345.png"
style="width: 37rpx;height: 44rpx;" mode=""></image>
</view>
</view>
<view
class="layer"
v-if="item.PhotoList.length > 3 && index1 === 2"
......@@ -89,6 +105,8 @@ export default {
pageState: "more",
pageCount: 0,
timer: null, //防抖
controls:false,//显示默认控件
videoContext:null
});
let methods = {
async getList() {
......@@ -133,6 +151,21 @@ export default {
},
});
},
enlarge(i) {
// 全屏
data.videoContext = uni.createVideoContext('myVideo'+i);
data.videoContext.requestFullScreen({direction: 0})
},
videoControl(e){
console.log(156,e)
if(e.detail.fullScreen==false){
data.videoContext.stop()
data.controls=false
}else{
data.videoContext.play()
data.controls=true
}
},
};
let that = methods;
onMounted(() => {
......@@ -176,6 +209,7 @@ export default {
margin-right: 20rpx;
}
.teacher-name {
max-width: 400rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
......
......@@ -48,11 +48,12 @@
@click="calendarActive(item)"
v-show="item"
>
<view class="" :class="{ 'calendar-active': activeDay === item.day }">
<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"
......@@ -66,11 +67,12 @@
@click="calendarActive(item), sliceWeek(item)"
v-show="item"
>
<view class="" :class="{ 'calendar-active': activeDay === item.day }">
<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">
......@@ -145,18 +147,19 @@ export default {
activeDay.value = 1;
let curdate = new Date(val.detail);
getCurrentDate.value = val.detail;
currentDate.value =
curdate.getFullYear() +
"-" +
(curdate.getMonth() < 9
? "0" + (curdate.getMonth() + 1)
: curdate.getMonth() + 1);
let year= curdate.getFullYear();
let month=curdate.getMonth() < 9 ? "0" + (curdate.getMonth() + 1) : curdate.getMonth() + 1
currentDate.value =year +"-" +month
getcalendar(curdate.getFullYear(), curdate.getMonth() + 1);
let newArr = calendar.value.slice(emptyArr.length, calendar.value.length);
sliceWeek(newArr[0]);
data.msg.StartTime = currentDate.value + "-01";
data.msg.EndTime = currentDate.value + "-01";
that.getData();
let maxDay= new Date(year,month,"0").getDate();
data.msg.EndTime = currentDate.value + '-' +maxDay;
that.getAllData()
};
//获取当月日历数组
let calendar = ref([]);
......@@ -164,10 +167,11 @@ export default {
let activeDay = ref(1);
//切换选中日期
let calendarActive = (item) => {
activeDay.value = item.day;
let day = item.day < 10 ? "0" + item.day : item.day;
activeDay.value = item.$orig.day;
let day = item.$orig.day < 10 ? "0" + item.$orig.day : item.$orig.day;
data.msg.StartTime = currentDate.value + "-" + day;
data.msg.EndTime = currentDate.value + "-" + day;
console.log(172,item,item.$orig.day, day)
that.getData();
};
let emptyArr = []; //日历补空
......@@ -204,6 +208,8 @@ export default {
},
statusBarHeight: 0,
dataList: [],
allData:[],
});
let methods = {
async getData() {
......@@ -212,6 +218,12 @@ export default {
data.dataList = res.Data;
}
},
async getAllData() {
let res = await getStundentPlanStatistical(data.msg);
if (res) {
data.allData = res.Data;
}
},
jumpPage(url) {
uni.navigateTo({
url: url,
......@@ -220,6 +232,52 @@ export default {
back() {
uni.navigateBack();
},
getHaveCourse(item){
let date=currentDate.value+'-'+(item.day<10?'0'+item.day:item.day)
let res = false
let find= data.allData.find((e)=>{
return e.ClassDateStr===date
})
if(find){
res=true
}
return res
},
// 请假
isLeave(item){
let date=currentDate.value+'-'+(item.day<10?'0'+item.day:item.day)
let res = false
let find= data.allData.find((e)=>{
return e.ClassDateStr===date
})
if(find){
let res1= find.PlanTimeList.some(e=>{
return e.IsLeave === 1 && e.IsCheck == 2
})
if(res1){
res=true
}
}
return res
},
// 缺勤
isLeave2(item){
let date=currentDate.value+'-'+(item.day<10?'0'+item.day:item.day)
let res = false
let find= data.allData.find((e)=>{
return e.ClassDateStr===date
})
if(find){
let res1= find.PlanTimeList.some(e=>{
return e.IsCheck === 1
})
if(res1){
res=true
}
}
return res
}
};
onMounted(() => {
getcalendar(new Date().getFullYear(), new Date().getMonth() + 1);
......@@ -253,9 +311,10 @@ export default {
};
},
onLoad(options) {
this.msg.ClassId = JSON.parse(options.classId);
this.getAllData()
this.msg.StartTime = getToday();
this.msg.EndTime = getToday();
this.msg.ClassId = JSON.parse(options.classId);
this.getData();
},
};
......@@ -293,6 +352,7 @@ export default {
width: 98.5rpx;
height: 80rpx;
text-align: center;
position: relative;
}
.calendar-week {
......@@ -311,6 +371,7 @@ export default {
font-weight: 500;
line-height: 48rpx;
color: #111111;
}
.isToday {
......@@ -326,6 +387,18 @@ export default {
background-color: rgba(0, 172, 249, 0.38) !important;
border-radius: 50%;
}
.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%;
......@@ -345,4 +418,13 @@ export default {
/deep/.van-divider {
margin: 0 auto;
}
.haveCourse{
width: 10rpx;
height: 10rpx;
border-radius: 50%;
background-color: #FF0000;
position: absolute;
top: 10rpx;
right: 10rpx;
}
</style>
......@@ -78,9 +78,9 @@
/>
<view class="grow">
<view
class="teacher-name"
class="teacher-name one_line"
v-if="indexData.FeedBackList[0].TeacherName"
>{{ indexData.FeedBackList[0].TeacherName }}</view
>{{ indexData.FeedBackList[0].TeacherName }} {{indexData.FeedBackList[0].CourseName}} {{indexData.FeedBackList[0].CreateTime.replace('T','&nbsp;')}}</view
>
<view class="rate">
<van-rate
......@@ -781,6 +781,7 @@ export default {
}
.teacher-name {
max-width: 500rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
......
//请求教育接口
let host = ''
if (process.env.NODE_ENV === "development") {
host = 'http://192.168.20.17:8017/api'
// host = 'http://192.168.20.17:8017/api'
// host = 'http://192.168.20.24:8300/api'
// host = 'https://eduapi.oytour.com/api'
host = 'https://eduapi.oytour.com/api'
} else {
host = 'https://eduapi.oytour.com/api'
}
......@@ -34,6 +34,12 @@ let request = (param) => {
uni.reLaunch({
url: '/pages/login/login'
});
} else {
if (res.data.Message.indexOf('用户凭证为空') != -1 || res.data.Message.indexOf('用户凭证失效') != -1) {
uni.reLaunch({
url: '/pages/login/login'
});
}
}
},
});
......
......@@ -37,10 +37,16 @@ let request = (param) => {
type: 'fail',
message: res.data.message,
onClose: () => {
if (res.data.resultCode === 10001 || res.data.resultCode === 10000) {
if (res.data.resultCode === 10001 || res.data.resultCode === 10000 || res.data.resultCode === 10002 || res.data.resultCode === 10003) {
uni.reLaunch({
url: '/pages/login/login'
});
} else {
if (res.data.message.indexOf('用户凭证为空') != -1 || res.data.message.indexOf('用户凭证失效') != -1) {
uni.reLaunch({
url: '/pages/login/login'
});
}
}
},
});
......
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