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