Commit f6d49063 authored by 刘用法's avatar 刘用法
parents ab15a158 35736ce0
...@@ -426,10 +426,10 @@ ...@@ -426,10 +426,10 @@
} }
canvas.fillText(title.substr(0, 14), 10, canvasHeight - txtHeight * h++ - titleHeight / 2 + 10); canvas.fillText(title.substr(0, 14), 10, canvasHeight - txtHeight * h++ - titleHeight / 2 + 10);
} }
if (this.waterSetting && this.waterSetting.mid_text) { // if (this.waterSetting && this.waterSetting.mid_text) {
//加入 水印图片 //加入 水印图片
canvas.drawImage(this.tempImgs.markImage, canvasWidth / 2 - 100, canvasHeight / 2 - 25, 200, 50) canvas.drawImage(this.tempImgs.markImage, canvasWidth / 2 - 100, canvasHeight / 2 - 25, 200, 50)
} // }
// canvas.drawImage(this.tempImgs.markImage, canvasWidth / 2 - 100, canvasHeight / 2 - 25, 200, 50) // canvas.drawImage(this.tempImgs.markImage, canvasWidth / 2 - 100, canvasHeight / 2 - 25, 200, 50)
canvas.draw(false, canvas.draw(false,
setTimeout(() => { setTimeout(() => {
......
...@@ -94,14 +94,14 @@ ...@@ -94,14 +94,14 @@
"path": "news-details", "path": "news-details",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"navigationStyle":"default" "navigationStyle":"custom"
} }
}, },
{ {
"path":"section", "path":"section",
"style" :{ "style" :{
"navigationBarTitleText": "", "navigationBarTitleText": "",
"navigationStyle":"default" "navigationStyle":"custom"
} }
}, },
{ {
......
...@@ -23,7 +23,10 @@ ...@@ -23,7 +23,10 @@
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
<swiper-item @touchmove.stop.prevent="stopTouchMove" v-show="current == 1"> <swiper-item @touchmove.stop.prevent="stopTouchMove" v-show="current == 1">
<scroll-view scroll-y style="height:100%;width:100%;" @scrolltolower="onreachBottom"> <scroll-view scroll-y style="height:100%;width:100%;" @scrolltolower="onreachBottom"
scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered"
:refresher-threshold="100" @refresherpulling="onPulling" @refresherrefresh="onRefresh"
@refresherrestore="onRestore" @refresherabort="onAbort">
<view v-for="item in list" :key="item.id" class="notice" @click="bbb(item)"> <view v-for="item in list" :key="item.id" class="notice" @click="bbb(item)">
<view class="n-head"> <view class="n-head">
{{item.title}} {{item.title}}
...@@ -258,7 +261,7 @@ ...@@ -258,7 +261,7 @@
desc: '通过本认证,是接单的必要条件', desc: '通过本认证,是接单的必要条件',
condition: '随机20题,及格20题', condition: '随机20题,及格20题',
status: '', status: '',
pic: process.uniEnv.qn_base_url + "guifan1@3x.png", pic: process.uniEnv.qn_base_url + "fwgf-e-3x.png",
id: 2, id: 2,
examId: '', examId: '',
examStatus: '', examStatus: '',
...@@ -269,7 +272,7 @@ ...@@ -269,7 +272,7 @@
desc: '快速认证,是否具备接单操作能力', desc: '快速认证,是否具备接单操作能力',
condition: '随机20题,及格16题', condition: '随机20题,及格16题',
status: '', status: '',
pic: process.uniEnv.qn_base_url + "guifan2@3x.png", pic: process.uniEnv.qn_base_url + "jdgf-e-3x.png",
id: 2, id: 2,
examId: '', examId: '',
examStatus: '', examStatus: '',
...@@ -281,7 +284,7 @@ ...@@ -281,7 +284,7 @@
desc: '通过本认证,是接单的必要条件', desc: '通过本认证,是接单的必要条件',
condition: '随机10题,及格10题', condition: '随机10题,及格10题',
status: '', status: '',
pic: process.uniEnv.qn_base_url + "guifan1@3x.png", pic: process.uniEnv.qn_base_url + "fwgf-e-3x.png",
id: 3, id: 3,
examId: '', examId: '',
examStatus: '', examStatus: '',
...@@ -292,7 +295,7 @@ ...@@ -292,7 +295,7 @@
desc: '快速认证,是否具备接单操作能力', desc: '快速认证,是否具备接单操作能力',
condition: '随机4题,及格4题', condition: '随机4题,及格4题',
status: '', status: '',
pic: process.uniEnv.qn_base_url + "guifan2@3x.png", pic: process.uniEnv.qn_base_url + "jdgf-e-3x.png",
id: 4, id: 4,
examId: '', examId: '',
examStatus: '', examStatus: '',
...@@ -304,7 +307,7 @@ ...@@ -304,7 +307,7 @@
desc: '通过本认证,是接单的必要条件', desc: '通过本认证,是接单的必要条件',
condition: '随机20题,及格20题', condition: '随机20题,及格20题',
status: '', status: '',
pic: process.uniEnv.qn_base_url + "guifan1@3x.png", pic: process.uniEnv.qn_base_url + "fwgf-e-3x.png",
id: 3, id: 3,
examId: '', examId: '',
examStatus: '', examStatus: '',
...@@ -315,7 +318,7 @@ ...@@ -315,7 +318,7 @@
desc: '快速认证,是否具备接单操作能力', desc: '快速认证,是否具备接单操作能力',
condition: '随机20题,及格16题', condition: '随机20题,及格16题',
status: '', status: '',
pic: process.uniEnv.qn_base_url + "guifan2@3x.png", pic: process.uniEnv.qn_base_url + "jdgf-e-3x.png",
id: 4, id: 4,
examId: '', examId: '',
examStatus: '', examStatus: '',
...@@ -359,7 +362,7 @@ ...@@ -359,7 +362,7 @@
desc: courseListJson[0].desc, desc: courseListJson[0].desc,
percent: courseListJson[0].percent, percent: courseListJson[0].percent,
status: courseListJson[0].status, status: courseListJson[0].status,
pic: process.uniEnv.qn_base_url + "fwgf@3x.png", pic: process.uniEnv.qn_base_url + "fwgf-3x.png",
id: courseListJson[0].id, id: courseListJson[0].id,
sectionId: courseListJson[0].sectionId sectionId: courseListJson[0].sectionId
}, },
...@@ -368,7 +371,7 @@ ...@@ -368,7 +371,7 @@
desc: courseListJson[1].desc, desc: courseListJson[1].desc,
percent: courseListJson[1].percent, percent: courseListJson[1].percent,
status: courseListJson[1].status, status: courseListJson[1].status,
pic: process.uniEnv.qn_base_url + "jdgf@3x.png", pic: process.uniEnv.qn_base_url + "jdgf-3x.png",
id: courseListJson[1].id, id: courseListJson[1].id,
sectionId: courseListJson[1].sectionId sectionId: courseListJson[1].sectionId
}, },
...@@ -377,7 +380,7 @@ ...@@ -377,7 +380,7 @@
desc: courseListJson[2].desc, desc: courseListJson[2].desc,
percent: courseListJson[2].percent, percent: courseListJson[2].percent,
status: courseListJson[2].status, status: courseListJson[2].status,
pic: process.uniEnv.qn_base_url + "cdz@3x.png", pic: process.uniEnv.qn_base_url + "cdz-3x.png",
id: courseListJson[2].id, id: courseListJson[2].id,
sectionId: courseListJson[2].sectionId, sectionId: courseListJson[2].sectionId,
} }
...@@ -420,12 +423,17 @@ ...@@ -420,12 +423,17 @@
loadStatus: "loading", loadStatus: "loading",
isLoadMore: false, isLoadMore: false,
exam: null, exam: null,
jianBianImg: process.uniEnv.qn_base_url + "jianbian@3x_bak1.png" jianBianImg: process.uniEnv.qn_base_url + "jianbian@3x_bak1.png",
isReflesh: true,
triggered: false,
_freshing: false,
new:{
isTopReflesh:false
}
}; };
}, },
onLoad(param) { onLoad(param) {
console.log('--node_env--'); var that = this;
console.log(process.uniEnv.node_env);
try { try {
if (param.tabs) { if (param.tabs) {
this.current = param.tabs; this.current = param.tabs;
...@@ -438,19 +446,48 @@ ...@@ -438,19 +446,48 @@
return process.uniEnv.qn_base_url + "banner-xx@3x.png"; return process.uniEnv.qn_base_url + "banner-xx@3x.png";
}, },
}, },
onShow: function() { onShow: function(param) {
if(this.current == 2 || this.current == 3){
this.tabsChange(this.current); this.tabsChange(this.current);
console.log('--返回也可以执行--'); }
}, },
methods: { methods: {
stopPull() {
let that = this;
setTimeout(function(){
that.triggered = false;
that._freshing = false;
}, 1000)
},
onPulling(e) {
return true
console.log("onpulling", e);
},
onRefresh() {
if (this._freshing) return;
this.triggered = true;
this._freshing = true;
this.isLoadMore = false;
this.loadStatus = "loading";
this.loadNews();
},
onRestore() {
this.triggered = 'restore'; // 需要重置
console.log("onRestore");
},
onAbort() {
console.log("onAbort");
},
stopTouchMove() { stopTouchMove() {
return false; return false;
}, },
getList() { getList() {
let that = this;
this.$u.api this.$u.api
.getTrainingNoticeList(this.params) .getTrainingNoticeList(this.params)
.then((res) => { .then((res) => {
this.timeFormat(); that.stopPull();
that.timeFormat();
if (res.code == 200) { if (res.code == 200) {
if (res.data) { if (res.data) {
let length = res.data.length; let length = res.data.length;
...@@ -458,18 +495,18 @@ ...@@ -458,18 +495,18 @@
res.data[i].create_at = this.timeFormat(res.data[i].create_at, res.data[i].create_at = this.timeFormat(res.data[i].create_at,
'yyyy.MM.dd hh:mm'); 'yyyy.MM.dd hh:mm');
} }
this.list = this.list.concat(res.data); that.list = that.list.concat(res.data);
if (res.data.length < 5) { if (res.data.length < 5) {
//判断接口返回数据量小于请求数据量,则表示此为最后一页 //判断接口返回数据量小于请求数据量,则表示此为最后一页
this.isLoadMore = true; that.isLoadMore = true;
this.loadStatus = "nomore"; that.loadStatus = "nomore";
} else { } else {
this.isLoadMore = false; that.isLoadMore = false;
} }
} else { } else {
this.isLoadMore = true; that.isLoadMore = true;
this.loadStatus = "nomore"; that.loadStatus = "nomore";
} }
} else { } else {
//接口请求失败的处理 //接口请求失败的处理
...@@ -477,9 +514,9 @@ ...@@ -477,9 +514,9 @@
title: res.message, title: res.message,
icon: "none", icon: "none",
}); });
this.isLoadMore = false; that.isLoadMore = false;
if (this.params.start > 0) { if (that.params.start > 0) {
this.page -= 5; that.page -= 5;
} }
} }
}) })
...@@ -488,9 +525,9 @@ ...@@ -488,9 +525,9 @@
title: err, title: err,
icon: "none", icon: "none",
}); });
this.isLoadMore = false; that.isLoadMore = false;
if (this.params.start > 0) { if (that.params.start > 0) {
this.page -= 5; that.page -= 5;
} }
}); });
}, },
...@@ -555,19 +592,21 @@ ...@@ -555,19 +592,21 @@
this.swiperCurrent = index; this.swiperCurrent = index;
switch (index) { switch (index) {
case 1: case 1:
this.params.start = 0; this.loadNews()
this.list = [];
this.getList();
break; break;
case 2: case 2:
this.getCourseList(); this.getCourseList();
console.log('重新加载学习进度');
break; break;
case 3: case 3:
this.getUserExamInfo(); this.getUserExamInfo();
break; break;
} }
}, },
loadNews() {
this.params.start = 0;
this.list = [];
this.getList();
},
animationfinish(e) { animationfinish(e) {
let current = e.detail.current; let current = e.detail.current;
this.$refs.uTabs.setFinishCurrent(current); this.$refs.uTabs.setFinishCurrent(current);
...@@ -576,7 +615,6 @@ ...@@ -576,7 +615,6 @@
}, },
//scroll-view到底部加载更多 //scroll-view到底部加载更多
onreachBottom() { onreachBottom() {
console.log("上拉触底函数");
//上拉触底函数 //上拉触底函数
if (!this.isLoadMore) { if (!this.isLoadMore) {
this.isLoadMore = true; this.isLoadMore = true;
...@@ -586,6 +624,9 @@ ...@@ -586,6 +624,9 @@
} }
} }
}, },
refleshNews() {
this.loadNews()
},
//跳转到拍照小程序首页 //跳转到拍照小程序首页
goToPrint() { goToPrint() {
console.log("111111"); console.log("111111");
...@@ -695,6 +736,7 @@ ...@@ -695,6 +736,7 @@
body: e.body, body: e.body,
title: e.title title: e.title
}; };
let that = this;
wx.navigateTo({ wx.navigateTo({
url: '/pages/learn/news-details', url: '/pages/learn/news-details',
success: function(res) { success: function(res) {
......
<template> <template>
<view> <view>
<u-navbar
back-icon-color="#000000"
:background="background"
title-color="#000000"
:border-bottom="false">
</u-navbar>
<view class="title"> <view class="title">
{{ title }} {{ title }}
</view> </view>
......
<template> <template>
<view class=""> <view class="">
<view class="learn-vedio" v-if="isShowVideo"> <view class="learn-vedio" v-if="isShowVideo">
<u-navbar
back-icon-color="#000000"
:background="background"
title-color="#000000"
:border-bottom="false">
</u-navbar>
<view class="uni-padding-wrap uni-common-mt"> <view class="uni-padding-wrap uni-common-mt">
<view><video object-fit="cover" class="course-video" id="courseVideo" :src="courseSrc" <view><video object-fit="cover" class="course-video" id="courseVideo" :src="courseSrc"
:options="playerOptions" :playsinline="true" @play="playCourse" @error="videoErrorCallback" :options="playerOptions" :playsinline="true" @play="playCourse" @error="videoErrorCallback"
...@@ -137,9 +143,9 @@ ...@@ -137,9 +143,9 @@
}, },
gklog: '', gklog: '',
videoTotalTime: 0, videoTotalTime: 0,
howTimeToUpdateLearnedStatus: 5, //设置几秒提交一次状态 howTimeToUpdateLearnedStatus: 10, //设置几秒提交一次状态
status: 1, //是否已学习默认1已学习 status: 1, //是否已学习默认1已学习
howLongIsLearned: this.videoTotalTime / 2, //默认设置观看1/2就是已学 isLearned: false, //默认设置观看1/2就是已学
}; };
}, },
computed: { computed: {
...@@ -185,19 +191,21 @@ ...@@ -185,19 +191,21 @@
this.videoContext = uni.createVideoContext("courseVideo"); this.videoContext = uni.createVideoContext("courseVideo");
// #endif // #endif
}, },
onUnload() {
wx.reLaunch({
url: '/pages/index/learn?tabs=2'
});
},
methods: { methods: {
goNext(info) { goNext(info) {
uni.navigateTo({ uni.navigateTo({
url: "./section?section_id=" + info.id + "&course_id=" + info.course_id url: "/pages/learn/section?section_id=" + info.id + "&course_id=" + info.course_id
}); });
}, },
onPlayerTimeupdate(player) { onPlayerTimeupdate(player) {
console.log('-----onplay----');
console.log(player);
let intCurrentTime = parseInt(player.detail.currentTime); let intCurrentTime = parseInt(player.detail.currentTime);
this.updateLearnedStatus(intCurrentTime); this.updateLearnedStatus(intCurrentTime);
this.gklog = intCurrentTime; this.gklog = intCurrentTime;
console.log(' onPlayerTimeupdate!', this.gklog)
}, },
videoErrorCallback: function(e) { videoErrorCallback: function(e) {
uni.showModal({ uni.showModal({
...@@ -220,7 +228,6 @@ ...@@ -220,7 +228,6 @@
} }
}, },
playerReadied(player) { playerReadied(player) {
console.log('i go to playerReadied gklog:' + this.gklog)
player.currentTime(this.gklog) player.currentTime(this.gklog)
}, },
getCourseSection(param) { getCourseSection(param) {
...@@ -240,7 +247,7 @@ ...@@ -240,7 +247,7 @@
this.section_content = res.data.content; this.section_content = res.data.content;
this.teacher.name = res.data.teachers[0].name; this.teacher.name = res.data.teachers[0].name;
this.teacherImage = res.data.teachers[0].avatar; this.teacherImage = res.data.teachers[0].avatar;
this.teacherIntro = res.data.teachers[0].intro.replace(/<p.*?>|<\/p>/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;
if (this.isShowVideo) { if (this.isShowVideo) {
let coureWareList = res.data.courseware; let coureWareList = res.data.courseware;
...@@ -254,8 +261,6 @@ ...@@ -254,8 +261,6 @@
} }
}) })
.catch((err) => { .catch((err) => {
console.log('--------settttt---------');
console.log(err);
uni.showToast({ uni.showToast({
title: err, title: err,
icon: "none", icon: "none",
...@@ -272,10 +277,7 @@ ...@@ -272,10 +277,7 @@
status: 1, status: 1,
}; };
this.$u.api.updateLearnCourses(param).then((res) => { this.$u.api.updateLearnCourses(param).then((res) => {
// console.log('--' + this.howTimeToUpdateLearnedStatus + '更新一次观看状态--time:' + nowTime);
}).catch((err) => { }).catch((err) => {
console.log('--------updateLearnedStatusForText---------');
console.log(err);
uni.showToast({ uni.showToast({
title: err, title: err,
icon: "none", icon: "none",
...@@ -284,11 +286,13 @@ ...@@ -284,11 +286,13 @@
}, },
updateLearnedStatus(nowTime) { updateLearnedStatus(nowTime) {
if (this.gklog != nowTime && nowTime % this.howTimeToUpdateLearnedStatus == 0) { if (this.gklog != nowTime && nowTime % this.howTimeToUpdateLearnedStatus == 0) {
if (nowTime < this.howLongIsLearned) { let howLongIsLearned = parseInt(this.videoTotalTime / 2);
if (nowTime < howLongIsLearned) {
this.status = 0; this.status = 0;
} else if(this.isLearned){
return;
} else { } else {
this.status = 1; this.status = 1;
console.log('--大于规定时间标记为已学习--');
} }
let param = { let param = {
...@@ -297,20 +301,13 @@ ...@@ -297,20 +301,13 @@
status: this.status, status: this.status,
}; };
this.$u.api.updateLearnCourses(param).then((res) => { this.$u.api.updateLearnCourses(param).then((res) => {
console.log('--' + this.howTimeToUpdateLearnedStatus + '更新一次观看状态--time:' + nowTime);
}).catch((err) => { }).catch((err) => {
console.log('--------updateLearnedStatus---------');
console.log(err); console.log(err);
uni.showToast({
title: err,
icon: "none",
});
}); });
} }
}, },
//获取章节详情 //获取章节详情
getCapterDetails() { getCapterDetails() {
console.log('获取章节详情')
this.$u.api this.$u.api
.ChapterDetails(this.params) .ChapterDetails(this.params)
.then((res) => { .then((res) => {
...@@ -325,8 +322,6 @@ ...@@ -325,8 +322,6 @@
this.list[i].isActive = this.active_section_id == this.list[i].id ? true : this.list[i].isActive = this.active_section_id == this.list[i].id ? true :
false; false;
} }
console.log('--select-list--')
console.log(this.list)
} }
} else { } else {
//接口请求失败的处理 //接口请求失败的处理
...@@ -493,7 +488,7 @@ ...@@ -493,7 +488,7 @@
} }
.color-teacher { .color-teacher {
color: #999999; color: #000000;
} }
.catalogue { .catalogue {
......
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