Commit 58d2a288 authored by 刘用法's avatar 刘用法
parents 24a5c243 87b1a945
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</view> --> </view> -->
<view class="pics u-flex u-flex-wrap"> <view class="pics u-flex u-flex-wrap">
<view class="img-list" v-for="(item,index) in imgList" :key="index"> <view class="img-list" v-for="(item,index) in imgList" :key="index">
<u-image class="pic" width="160" height="160" :src="item.path" :border-radius="10" @click.stop="prviewImage(item.path,index)"></u-image> <u-image class="pic" width="160" height="160" :src="item.path ? item.path : item.src + '?imageView2/1/w/100/h/100/q/75'" :border-radius="10" @click.stop="prviewImage(item.path,index)"></u-image>
<view class="icon-del-box" @click.stop="delFile(index)"> <view class="icon-del-box" @click.stop="delFile(index)">
<view class="icon-del"></view> <view class="icon-del"></view>
<view class="icon-del rotate"></view> <view class="icon-del rotate"></view>
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
mounted() { mounted() {
if(this.value){ if(this.value){
this.imgList = this.value.map(img =>{ this.imgList = this.value.map(img =>{
return {path: img, src:img} return {src:img}
}) })
this.setValue() this.setValue()
} }
...@@ -157,10 +157,10 @@ ...@@ -157,10 +157,10 @@
this.$u.api.orderStandardItem(param).then((res)=>{ this.$u.api.orderStandardItem(param).then((res)=>{
if (res.code == 200 && res.data.length>0) { if (res.code == 200 && res.data.length>0) {
self.currentItemDate = res.data[0] self.currentItemDate = res.data[0]
self.takeStatus = true
}else{ }else{
console.log("获取完工项的拍照标准异常",res.data.message) console.log("获取完工项的拍照标准异常",res.data.message)
} }
self.takeStatus = true
}) })
}, },
getWatermark(){ getWatermark(){
......
...@@ -411,7 +411,8 @@ export default { ...@@ -411,7 +411,8 @@ export default {
console.log( console.log(
"endTime:" + this.endTime, "endTime:" + this.endTime,
"everyTime:" + this.everyTime, "everyTime:" + this.everyTime,
"currentTime:" + this.currentTime "currentTime:" + this.currentTime,
"答案:" + this.userAnswerIds
); );
} else { } else {
clearTimeout(this.timer); clearTimeout(this.timer);
...@@ -563,7 +564,8 @@ export default { ...@@ -563,7 +564,8 @@ export default {
} else { } else {
// if(this.userAnswerIds.length == 1) // if(this.userAnswerIds.length == 1)
this.userAnswerIds = this.userAnswerIds =
item.id + "," + this.userAnswerIds; this.userAnswerIds + "," + item.id;
console.log(this.userAnswerIds, "答案答案");
} }
//*/ //*/
} else { } else {
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<view class="scroll_box"> <view class="scroll_box">
<scroll-view scroll-x @scroll="scroll" :scroll-left="scrollValue"> <scroll-view scroll-x @scroll="scroll" :scroll-left="scrollValue">
<view class="item_list" :class="{'item_list_active': item.isActive}" <view class="item_list" :class="{'item_list_active': item.isActive}"
v-for="(item, index) in sectionList" :key="index" @click="goNext(item, $event)"> v-for="(item, index) in sectionList" :key="index" @click="goNext(item)">
<view class="" style="font-size: 24rpx;">{{ item.title }}</view> <view class="" style="font-size: 24rpx;">{{ item.title }}</view>
<view class="" style="font-size: 26rpx;margin-top: 16rpx;"> <view class="" style="font-size: 26rpx;margin-top: 16rpx;">
{{ item.intro }} {{ item.intro }}
...@@ -93,13 +93,14 @@ ...@@ -93,13 +93,14 @@
}, },
gklog: '', gklog: '',
videoTotalTime: 0, videoTotalTime: 0,
howTimeToUpdateLearnedStatus: 10, //设置几秒提交一次状态 howTimeToUpdateLearnedStatus: 5, //设置几秒提交一次状态
status: 1, //是否已学习默认1已学习 status: 0, //是否已学习默认1已学习
isLearned: false, //默认设置观看1/2就是已学 isLearned: false, //默认设置观看1/2就是已学
old: { old: {
scrollTop: null scrollTop: null
}, },
scrollValue: 0 scrollValue: 0,
nowTime: 0
}; };
}, },
computed: { computed: {
...@@ -110,10 +111,10 @@ ...@@ -110,10 +111,10 @@
onLoad(e) { onLoad(e) {
this.section_id = e.section_id this.section_id = e.section_id
this.params.course_id = e.course_id this.params.course_id = e.course_id
this.getCapterDetails()
this.getSectionInfo({ this.getSectionInfo({
section_id: e.section_id section_id: e.section_id
}) })
this.getCapterDetails()
}, },
onReady: function(res) { onReady: function(res) {
this.videoContext = uni.createVideoContext("courseVideo"); this.videoContext = uni.createVideoContext("courseVideo");
...@@ -124,7 +125,10 @@ ...@@ -124,7 +125,10 @@
console.log(e) console.log(e)
this.old.scrollTop = e.detail.scrollTop this.old.scrollTop = e.detail.scrollTop
}, },
goNext(info, e) { goNext(info) {
if(this.status == 1){
console.log('已学');
}
//切换成下一个 //切换成下一个
this.getSectionInfo({ this.getSectionInfo({
section_id: info.id section_id: info.id
...@@ -170,6 +174,42 @@ ...@@ -170,6 +174,42 @@
playerReadied(player) { playerReadied(player) {
player.currentTime(this.gklog) player.currentTime(this.gklog)
}, },
//获取章节详情
getCapterDetails() {
let that = this
this.$u.api
.ChapterDetails(this.params)
.then((res) => {
if (res.code != 200) {
uni.showToast({
title: res.message,
icon: "none"
})
}
if (res.data) {
that.sectionList = res.data[0].section
that.courseTotal = that.sectionList.length
let length = that.sectionList.length
for (let i = 0; i < length; i++) {
that.sectionList[i].title = "第" + (i + 1) + "节"
that.sectionList[i].intro = that.sectionList[i].name
that.sectionList[i].isActive = that.section_id == that.sectionList[i].id
? true : false
}
this.changeActiveAction()
}
})
.catch((err) => {
uni.showToast({
title: err,
icon: "none"
})
that.isLoadMore = false
if (that.params.start > 0) {
that.page -= 5
}
})
},
getSectionInfo(param) { getSectionInfo(param) {
this.$u.api this.$u.api
.CourseSection(param) .CourseSection(param)
...@@ -184,6 +224,7 @@ ...@@ -184,6 +224,7 @@
this.sectionInfo = res.data this.sectionInfo = res.data
console.log("----节信息----") console.log("----节信息----")
console.log(this.sectionInfo) console.log(this.sectionInfo)
this.nextSectionId = this.sectionInfo.nextSectionId
let wareVal = this.sectionInfo.ware let wareVal = this.sectionInfo.ware
this.courseTitle = res.data.name this.courseTitle = res.data.name
this.courseDesc = res.data.content.replace(/<p.*?>|<\/p>/ig, "") this.courseDesc = res.data.content.replace(/<p.*?>|<\/p>/ig, "")
...@@ -193,11 +234,10 @@ ...@@ -193,11 +234,10 @@
this.teacherImage = res.data.teachers[0].avatar this.teacherImage = res.data.teachers[0].avatar
this.teacherIntro = res.data.teachers[0].intro.replace(/<.*?>|<\/.*?>/ig, "") this.teacherIntro = res.data.teachers[0].intro.replace(/<.*?>|<\/.*?>/ig, "")
this.params.course_id = res.data.course_id this.params.course_id = res.data.course_id
this.nextSectionId = this.sectionInfo.nextSectionId
if (wareVal == "0") { if (wareVal == "0") {
let coureWareList = res.data.courseware let coureWareList = res.data.courseware
this.courseSrc = coureWareList[0].src this.courseSrc = coureWareList[0].src
this.videoTotalTime = parseInt(JSON.parse(coureWareList[0].info).time) this.videoTotalTime = parseInt(JSON.parse(coureWareList[0].info).time) - 1;
console.log('视频时长信息:' + this.videoTotalTime) console.log('视频时长信息:' + this.videoTotalTime)
} }
} }
...@@ -210,61 +250,27 @@ ...@@ -210,61 +250,27 @@
}) })
}, },
updateLearnedStatus(nowTime) { updateLearnedStatus(nowTime) {
if (this.gklog != nowTime && nowTime % this.howTimeToUpdateLearnedStatus == 0) { let param = {
let howLongIsLearned = parseInt(this.videoTotalTime / 2) section_id: this.section_id,
if (nowTime < howLongIsLearned) { video_time: nowTime,
this.status = 0 status: this.status
} else if (this.isLearned) { };
return nowTime = parseInt(nowTime);
} else { if(nowTime == this.nowTime){
this.status = 1 return
}
let param = {
section_id: this.section_id,
video_time: nowTime,
status: this.status
};
this.$u.api.updateLearnCourses(param).then((res) => {}).catch((err) => {
console.log(err)
});
} }
}, this.nowTime = nowTime;
//获取章节详情 if(this.status == 1 || nowTime < 5){
getCapterDetails() { return
let that = this }
this.$u.api if(nowTime == this.videoTotalTime){
.ChapterDetails(this.params) param.status = this.status = 1
.then((res) => { }else if(nowTime % this.howTimeToUpdateLearnedStatus != 0){
if (res.code != 200) { return
uni.showToast({ }
title: res.message, this.$u.api.updateLearnCourses(param).then((res) => {}).catch((err) => {
icon: "none" console.log(err)
}) });
}
if (res.data) {
that.sectionList = res.data[0].section
that.courseTotal = that.sectionList.length
let length = that.sectionList.length
for (let i = 0; i < length; i++) {
that.sectionList[i].title = "第" + (i + 1) + "节"
that.sectionList[i].intro = that.sectionList[i].name
that.sectionList[i].isActive = that.section_id == that.sectionList[i].id
? true : false
}
this.changeActiveAction()
}
})
.catch((err) => {
uni.showToast({
title: err,
icon: "none"
})
that.isLoadMore = false
if (that.params.start > 0) {
that.page -= 5
}
})
}, },
}, },
} }
......
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
}, },
toDetail(key) { toDetail(key) {
let data = this.list[key].data; let data = this.list[key].data;
if(!data.isUpload){ if(data.status != 1){
return; return;
} }
wx.navigateTo({ wx.navigateTo({
......
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