From f7d8c163222518ac8c39b5162f056e7c4c4bceb6 Mon Sep 17 00:00:00 2001
From: zzyuan <781948537@qq.com>
Date: Mon, 9 Dec 2024 17:28:12 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E5=88=B6IOS=E7=A6=85?=
=?UTF-8?q?=E9=81=93bug=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/realName/components/PdfView.vue | 29 +-
.../electronicContract/contractVideo.vue | 2 +-
pages/realName/workbench/exam/train.vue | 7 +-
pages/realName/workbench/workPlan/index.vue | 415 +++++++++---------
4 files changed, 243 insertions(+), 210 deletions(-)
diff --git a/pages/realName/components/PdfView.vue b/pages/realName/components/PdfView.vue
index 75721aa..22ee299 100644
--- a/pages/realName/components/PdfView.vue
+++ b/pages/realName/components/PdfView.vue
@@ -1,6 +1,6 @@
-
+
@@ -36,9 +36,10 @@ export default {
left:'10',
right:'10',
},
+ localPath:'',
+ viewerUrlWithParams:''
}
},
-
onLoad(options) {
// console.log('页面信息:', options)
// this.fileUrl = options.url
@@ -49,14 +50,14 @@ export default {
// /* 初始页面 */
// this.pageInt() //获取pdfs数据
},
-
mounted() {
console.log('mounted-pdfView', this.path)
+ this.localPath = this.path
/* H5页面通信方式 */
// #ifdef H5
window.addEventListener('message', this.ReceiveMessage)
// #endif
- this.fileUrl = this.path
+ this.fileUrl = this.localPath
/* 设置标题 */
uni.setNavigationBarTitle({
title: 'PDF预览'
@@ -64,7 +65,6 @@ export default {
/* 初始页面 */
this.pageInt() //获取pdfs数据
},
-
//页面销毁前
beforeDestroy() {
uni.removeStorage({
@@ -75,12 +75,25 @@ export default {
}
})
},
-
methods: {
//页面初始化
pageInt() {
- this.url = `${this.viewerUrl}?file=${encodeURIComponent(this.fileUrl)}&page=` + this.currentPage
- },
+ console.log(this.viewerUrlWithParams)
+ // #ifdef H5
+ this.url = `${this.viewerUrl}?file=${encodeURIComponent(this.fileUrl)}&page=`+this.currentPage
+ console.log(this.viewerUrlWithParams)
+ // #endif
+ // #ifdef APP-PLUS
+ if(plus.os.name=="Android"){
+ this.viewerUrlWithParams = `${this.viewerUrl}?file=${encodeURIComponent(this.fileUrl)}&page=`+this.currentPage
+ console.log(this.viewerUrlWithParams)
+ }else{
+ this.viewerUrlWithParams = this.fileUrl
+ console.log(this.viewerUrlWithParams)
+ }
+ // #endif
+ console.log(this.viewerUrlWithParams)
+ },
/*
* 做成监听滚动条判断更好
*
diff --git a/pages/realName/workbench/electronicContract/contractVideo.vue b/pages/realName/workbench/electronicContract/contractVideo.vue
index 1910dc7..935c3d3 100644
--- a/pages/realName/workbench/electronicContract/contractVideo.vue
+++ b/pages/realName/workbench/electronicContract/contractVideo.vue
@@ -5,7 +5,7 @@
合同视频
-
+
确认视频无误,进行下一步签订
diff --git a/pages/realName/workbench/exam/train.vue b/pages/realName/workbench/exam/train.vue
index 670b9bd..4328990 100644
--- a/pages/realName/workbench/exam/train.vue
+++ b/pages/realName/workbench/exam/train.vue
@@ -53,7 +53,7 @@
考试
-
+
@@ -168,9 +168,8 @@ export default {
console.log(res)
res = res.data;
if(res.code==200){
- this.trainBean=res.data.trainBean;
- this.examBean=res.data.examBean;
-
+ this.trainBean=res.data.trainBean||[];
+ this.examBean=res.data.examBean||{};
}
console.log(this.examBean)
},
diff --git a/pages/realName/workbench/workPlan/index.vue b/pages/realName/workbench/workPlan/index.vue
index e013bc7..5403fb0 100644
--- a/pages/realName/workbench/workPlan/index.vue
+++ b/pages/realName/workbench/workPlan/index.vue
@@ -1,200 +1,221 @@
-
-
-
-
- 分公司
-
-
-
- 项目
-
-
-
- 分包合同
-
-
-
- 分包商
-
-
-
-
-
-
-
-
-
-
- 横屏
- 竖屏
-
-
-
-
-
-
+ this.getScal()//开启缩放
+ }
+ },
+ onLoad() {
+ },
+ onShow() {
+ //打开横屏
+ // #ifdef APP-PLUS
+ uni.showLoading({
+ title: "加载中..."
+ })
+ setTimeout(() => {
+ plus.screen.unlockOrientation();
+ plus.screen.lockOrientation('default');
+ uni.hideLoading();
+ }, 200)
+ //#endif
+ //开启缩放
+ this.getScal()
+
+ },
+ onUnload() {
+ // #ifdef APP-PLUS
+ plus.screen.lockOrientation('portrait-primary');
+ // #endif
+ },
+ methods: {
+ handleMessage1(e){
+ console.log(e)
+ this.hIndex=2
+ },
+ handleMessage2(e){
+ // console.log(e)
+ this.hIndex=3
+ },
+ // 横屏
+ // this.lockOrientation('landscape')
+ // 竖屏
+ //this.lockOrientation('portrait')
+ lockOrientation(orientation) {
+ if(orientation=='landscape'){
+ this.screenType=1
+ }else if(orientation=='portrait'){
+ this.screenType=2
+
+ }
+ if (typeof plus !== 'undefined' && typeof plus.screen !== 'undefined') {
+ plus.screen.lockOrientation(orientation)
+ }
+ this.webviewStyles = {
+ progress: false,
+ width:'90%',
+ height:'240',
+ zIndex:'999',
+ top:'150',
+ left:'10',
+ right:'10',
+ }
+ this.getScal()//开启缩放
+ },
+ getScal(){
+ // #ifdef APP-PLUS
+ const currentWebview = this.$scope.$getAppWebview() //获取当前页面的webview对象
+ setTimeout(()=> {
+ let wv = currentWebview.children()[0]
+ wv.setStyle({scalable:true})
+ }, 1000); //如果是页面初始化调用时,需要延时一下
+ // #endif
+ },
+ // 返回
+ leftClick() {
+ console.log('返回')
+ uni.navigateBack({
+ delta: 1 // 返回
+ });
+ }
+ },
+
+ }
+
+
+
+
\ No newline at end of file