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