实名制IOS禅道bug修改

This commit is contained in:
zzyuan 2024-12-09 17:28:12 +08:00
parent f6a39e5a6b
commit f7d8c16322
4 changed files with 243 additions and 210 deletions

View File

@ -1,6 +1,6 @@
<template>
<view class="content">
<web-view :src="url" @message="handlePostMessage" :webview-styles="webviewStyles1" style="margin-bottom: 200rpx;"></web-view>
<web-view :src="viewerUrlWithParams" @message="handlePostMessage" :webview-styles="webviewStyles1" style="margin-bottom: 200rpx;"></web-view>
</view>
</template>
@ -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)
},
/*
* 做成监听滚动条判断更好
*

View File

@ -5,7 +5,7 @@
<view style="margin: 20rpx;font-weight: bold;">
合同视频
</view>
<video :src="videoSrc" controls :autoplay="autoPlay" style="width: 100%;height: 600rpx;" v-if="!showPopup"></video>
<video :src="videoSrc" controls="false" :autoplay="autoPlay" style="width: 100%;height: 600rpx;" v-if="!showPopup"></video>
<view style="margin: 20rpx;font-weight: bold;color: red;">
确认视频无误进行下一步签订

View File

@ -53,7 +53,7 @@
考试
</view>
<view class="exam-view">
<view class="exam-item" v-if="examBean.name">
<view class="exam-item" v-if="examBean.name&&examBean.name!=''">
<view style="width: 62%;display: flex;align-items: center;word-break: break-all;">
<view style="margin-right: 20rpx;">
<image src="../../../../static/realName/exam_icon.png" style="width: 48rpx;height: 48rpx;" mode="" ></image>
@ -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)
},

View File

@ -1,200 +1,221 @@
<template>
<view class="page">
<u-navbar class="u-navbar" title="作业计划与实名制管控情况" placeholder @leftClick="leftClick" leftIconColor="#fff" bgColor="#00337A" :titleStyle="{ color: '#FFF', fontSize: '32rpx' }"/>
<scroll-view class="scroll-view" scroll-x="true">
<view class="scroll-view-item" :class="hIndex == 1 ? 'active' : ''" @click="hIndex = 1">
分公司
<view class="activeLine" v-if="hIndex == 1"></view>
</view>
<view class="scroll-view-item" :class="hIndex == 2 ? 'active' : ''" >
项目
<view class="activeLine" v-if="hIndex == 2"></view>
</view>
<view class="scroll-view-item" :class="hIndex == 3 ? 'active' : ''" >
分包合同
<view class="activeLine" v-if="hIndex == 3"></view>
</view>
<view class="scroll-view-item" :class="hIndex == 4 ? 'active' : ''" @click="hIndex = 4">
分包商
<view class="activeLine" v-if="hIndex == 4"></view>
</view>
</scroll-view>
<view>
<web-view :src="webUrl1" v-if="hIndex==1" :fullscreen="false" :webview-styles="webviewStyles" @message="handleMessage1" style="overflow: auto;margin-top: 400rpx;"></web-view>
<web-view :src="webUrl2" v-if="hIndex==2" :fullscreen="false" :webview-styles="webviewStyles" @message="handleMessage2" style="overflow: auto;margin-top: 400rpx;"></web-view>
<web-view :src="webUrl3" v-if="hIndex==3" :fullscreen="false" :webview-styles="webviewStyles" style="overflow: auto;margin-top: 400rpx;"></web-view>
<web-view :src="webUrl4" v-if="hIndex==4" :fullscreen="false" :webview-styles="webviewStyles" style="overflow: auto;margin-top: 400rpx;"></web-view>
</view>
<view class="screen-btn" v-if="screenType==2" @click="lockOrientation('landscape')">横屏</view>
<view class="screen-btn" v-if="screenType==1" @click="lockOrientation('portrait')">竖屏</view>
</view>
</template>
<script>
import config from '@/config'
export default {
data() {
return {
idNumber:uni.getStorageSync('realNameUser').idNumber,
hIndex:1,
webUrl1:"/hybrid/html/planAndRealName/planAndRealName.html",
webUrl2:"/hybrid/html/planAndRealName/planAndRealNameTwo.html",
webUrl3:"/hybrid/html/planAndRealName/planAndRealNameThree.html",
webUrl4:"/hybrid/html/planAndRealName/planAndRealNameFour.html",
webviewStyles: {
progress: false,
width:'92%',
height:'220',
zIndex:'999',
top:'140',
left:'10',
right:'10',
},
screenType:2, //1-2-
}
},
watch: {
hIndex: function(newVal, oldVal) {
this.getScal()//
}
},
onLoad() {
},
onShow() {
//
// #ifdef APP-PLUS
uni.showLoading({
title: "加载中..."
})
setTimeout(() => {
plus.screen.unlockOrientation();
plus.screen.lockOrientation('default');
uni.hideLoading();
}, 200)
//#endif
//
this.getScal()
<view class="page">
<u-navbar class="u-navbar" title="作业计划与实名制管控情况" placeholder @leftClick="leftClick" leftIconColor="#fff" bgColor="#00337A" :titleStyle="{ color: '#FFF', fontSize: '32rpx' }"/>
<scroll-view class="scroll-view" scroll-x="true">
<view class="scroll-view-item" :class="hIndex == 1 ? 'active' : ''" @click="hIndex = 1">
分公司
<view class="activeLine" v-if="hIndex == 1"></view>
</view>
<view class="scroll-view-item" :class="hIndex == 2 ? 'active' : ''" >
项目
<view class="activeLine" v-if="hIndex == 2"></view>
</view>
<view class="scroll-view-item" :class="hIndex == 3 ? 'active' : ''" >
分包合同
<view class="activeLine" v-if="hIndex == 3"></view>
</view>
<view class="scroll-view-item" :class="hIndex == 4 ? 'active' : ''" @click="hIndex = 4">
分包商
<view class="activeLine" v-if="hIndex == 4"></view>
</view>
</scroll-view>
<view>
<web-view :src="webUrl1" v-if="hIndex==1" :fullscreen="false" :webview-styles="webviewStyles" @message="handleMessage1" style="overflow: auto;margin-top: 400rpx;"></web-view>
<web-view :src="webUrl2" v-if="hIndex==2" :fullscreen="false" :webview-styles="webviewStyles" @message="handleMessage2" style="overflow: auto;margin-top: 400rpx;"></web-view>
<web-view :src="webUrl3" v-if="hIndex==3" :fullscreen="false" :webview-styles="webviewStyles" style="overflow: auto;margin-top: 400rpx;"></web-view>
<web-view :src="webUrl4" v-if="hIndex==4" :fullscreen="false" :webview-styles="webviewStyles" style="overflow: auto;margin-top: 400rpx;"></web-view>
</view>
<view class="screen-btn" v-if="screenType==2" @click="lockOrientation('landscape')">横屏</view>
<view class="screen-btn" v-if="screenType==1" @click="lockOrientation('portrait')">竖屏</view>
</view>
</template>
<script>
import config from '@/config'
export default {
data() {
return {
idNumber:uni.getStorageSync('realNameUser').idNumber,
hIndex:1,
webUrl1:"/hybrid/html/planAndRealName/planAndRealName.html",
webUrl2:"/hybrid/html/planAndRealName/planAndRealNameTwo.html",
webUrl3:"/hybrid/html/planAndRealName/planAndRealNameThree.html",
webUrl4:"/hybrid/html/planAndRealName/planAndRealNameFour.html",
webviewStyles: {
progress: false,
width:'90%',
height:'240',
zIndex:'999',
top:'150',
left:'10',
right:'10',
},
screenType:2, //1-2-
}
},
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)
watch: {
hIndex: function(newVal, oldVal) {
this.webviewStyles = {
progress: false,
width:'90%',
height:'240',
zIndex:'999',
top:'150',
left:'10',
right:'10',
}
},
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 //
});
}
},
}
</script>
<style lang="scss">
.scroll-view {
white-space: nowrap;
width: 100%;
background: #FFF;
}
.scroll-view-item {
display: inline-block;
width: 160rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
.activeLine{
background: #00337A;
border-radius: 10upx;
width: 160rpx;
height: 6upx;
}
}
.active {
color: #333;
font-weight: bolder;
font-size: 32rpx;
}
.page {
width: 100vw;
height:100vh;
background-color: #EFEFEF;
box-sizing: border-box;
position: relative;
.content{
width: 100%;
height: 80vh;
padding-top: 20rpx;
background: #EFEFEF;
.view-box{
width: 96%;
height: auto;
margin: 0rpx auto;
background-color: #FFF;
border-radius: 10rpx;
padding-top: 20rpx;
.title-view{
font-size: 32rpx;
font-weight: 600;
margin-left: 20rpx;
}
}
}
.screen-btn{
width: 100rpx;
height: 60rpx;
line-height: 60rpx;
background: #00337A;
color: #fff;
border-radius: 10rpx;
text-align: center;
position: fixed;
bottom: 20rpx;
right: 20rpx;
z-index: 999999;
}
}
</style>
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 //
});
}
},
}
</script>
<style lang="scss">
.scroll-view {
white-space: nowrap;
width: 100%;
background: #FFF;
position: absolute;
top: 160rpx;
}
.scroll-view-item {
display: inline-block;
width: 160rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
.activeLine{
background: #00337A;
border-radius: 10upx;
width: 160rpx;
height: 6upx;
}
}
.active {
color: #333;
font-weight: bolder;
font-size: 32rpx;
}
.page {
width: 100vw;
height:100vh;
background-color: #EFEFEF;
box-sizing: border-box;
position: relative;
.content{
width: 100%;
height: 80vh;
padding-top: 20rpx;
background: #EFEFEF;
.view-box{
width: 96%;
height: auto;
margin: 0rpx auto;
background-color: #FFF;
border-radius: 10rpx;
padding-top: 20rpx;
.title-view{
font-size: 32rpx;
font-weight: 600;
margin-left: 20rpx;
}
}
}
.screen-btn{
width: 100rpx;
height: 60rpx;
line-height: 60rpx;
background: #00337A;
color: #fff;
border-radius: 10rpx;
text-align: center;
position: fixed;
bottom: 20rpx;
right: 20rpx;
z-index: 999999;
}
}
</style>