diff --git a/hybrid/html/local.html b/hybrid/html/local.html
index 9a21210..0cf488f 100644
--- a/hybrid/html/local.html
+++ b/hybrid/html/local.html
@@ -28,10 +28,18 @@
padding: 10px;
color: #999999;
}
+ .tip {
+ font-size: 50px;
+ position: fixed;
+ top: 50px;
+ right: 0;
+ z-index: 99999999;
+ }
web-view 组件加载本地 html 示例,仅在 App 环境下生效。点击下列按钮,跳转至其它页面。
+ 你看看
@@ -44,7 +52,8 @@
-
+
+
+
diff --git a/pages/YNEduApp/learnProj/pdfStudy.vue b/pages/YNEduApp/learnProj/pdfStudy.vue
index 3d321ff..4f3314a 100644
--- a/pages/YNEduApp/learnProj/pdfStudy.vue
+++ b/pages/YNEduApp/learnProj/pdfStudy.vue
@@ -17,7 +17,9 @@ export default {
isShow: true,
path: '',
params: {},
- timer: null
+ timer: null,
+ // 剩余时间
+ surplusTime: null
}
},
onLoad(opt) {
@@ -26,25 +28,29 @@ export default {
this.params = JSON.parse(JSON.stringify(opt))
this.params.studyDuration = Number(opt.studyDuration)
this.params.allStudyDuration = Number(opt.allStudyDuration)
- // 如果路径中带有http或者https则直接使用路径,否则拼接路径
- if (opt.path.indexOf('http') !== -1) {
- this.path = opt.path
- } else {
- this.path = config.fileUrl + opt.path
- }
- console.log('🚀 ~ onLoad ~ this.params:', this.path)
- console.log('🚀 ~ onLoad ~ this.params:', Number(opt.studyDuration), Number(opt.allStudyDuration))
if (Number(opt.studyDuration) < Number(opt.allStudyDuration)) {
+ this.surplusTime = Number(opt.allStudyDuration) - Number(opt.studyDuration)
+ console.log('🚀 ~ onLoad ~ surplusTime:', this.surplusTime)
setTimeout(() => {
this.countDown()
- }, 1000)
+ }, 1300)
} else {
+ this.surplusTime = 0
// 提示-学习时长已满
uni.showToast({
title: '学习时长已满, 随时可以结束学习',
icon: 'none'
})
}
+ // 如果路径中带有http或者https则直接使用路径,否则拼接路径
+ if (opt.path.indexOf('http') !== -1) {
+ this.path = opt.path + '?surplusTime=' + JSON.stringify(this.surplusTime)
+ } else {
+ this.path = config.fileUrl + opt.path + '?surplusTime=' + JSON.stringify(this.surplusTime)
+ }
+ console.log('🚀 ~ onLoad ~ this.params:', this.path)
+ console.log('🚀 ~ onLoad ~ this.params:', Number(opt.studyDuration), Number(opt.allStudyDuration))
+
},
onHide() {
clearInterval(this.timer)