Commit 7e136524 authored by Damon's avatar Damon
parents 40dcf1e5 58d2a288
......@@ -6,8 +6,8 @@
</u-navbar>
<view class="mine-content">
<view class="header-view">
<view :class="['head-image', {'has-image': avatar}]">
<u-avatar :src="headImageUrl" :size="headSize" mode="circle"></u-avatar>
<view class="head-image">
<image :style="headImageStyle" :src="headImageUrl"></image>
</view>
<view class="header-content">
<view class="name-view" @click="handleClickName">{{name || "点击登录"}}</view>
......@@ -121,6 +121,9 @@
placeholderImage() {
return this.qnPath + 'touxiang.png'
},
headImageStyle() {
return this.avatar ? 'width:136rpx; height:136rpx;border-radius:68rpx' : 'width:144rpx; height:144rpx;border-radius:72rpx'
},
headSize() {
return this.avatar ? 136 : 144
}
......@@ -192,11 +195,9 @@
height: 144rpx;
background-color: #FFFFFF;
border-radius: 72rpx;
&.has-image {
// border: 4rpx solid #FFFFFF;
padding: 4rpx;
}
display: flex;
align-items: center;
justify-content: center;
}
.header-content {
......
......@@ -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)
});
}
},
//获取章节详情
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
nowTime = parseInt(nowTime);
if(nowTime == this.nowTime){
return
}
this.changeActiveAction()
this.nowTime = nowTime;
if(this.status == 1 || nowTime < 5){
return
}
})
.catch((err) => {
uni.showToast({
title: err,
icon: "none"
})
that.isLoadMore = false
if (that.params.start > 0) {
that.page -= 5
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)
});
},
},
}
......
......@@ -104,12 +104,15 @@
},
onLoad(e) {},
onShow() {
/** 测试提了bug:ID1001079【首页-入驻-在线签约】:输入好各个字段信息,切换到其他APP再切换回来,会把已填的信息自动清空
不知道这一段当初为什么加,就屏蔽了
const refs = this.$refs
this.$nextTick(() => {
if (refs['radio'] && refs['radio'].length > 0) {
refs['radio'][0].setRadioCheckedStatus()
}
})
*/
this.startCounting()
this.getBaseInfo()
......
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