Merge branch 'lsf-dev'

master
李神峰 2024-06-07 16:22:15 +08:00
commit af2d660144
4 changed files with 101 additions and 15 deletions

View File

@ -68,6 +68,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.rain-detail-box{ .rain-detail-box{
position: relative;
.nav-bar{ .nav-bar{
display: flex; display: flex;
justify-content: center; justify-content: center;

View File

@ -11,7 +11,7 @@
</view> </view>
<view class="video-box" v-if="this.list.length"> <view class="video-box" v-if="this.list.length">
<!-- <web-view :src="webURL" style="height: 400px;"></web-view> --> <!-- <web-view :src="webURL" style="height: 400px;"></web-view> -->
<iframe :src="webURL" style="height: 300px;width:380px" frameborder="0" :allowfullscreen="true"></iframe> <iframe :src="webURL" :class="{'normal': show == 0,'active': show == 1}" frameborder="0" ref="videoFrame" :allowfullscreen="true"></iframe>
</view> </view>
</view> </view>
</template> </template>
@ -27,9 +27,13 @@
value: "", value: "",
list:[], list:[],
webURL:'', webURL:'',
show:0
} }
}, },
methods: { methods: {
receiveRenderData(e){
this.show = e.data
},
async getList(){ async getList(){
try{ try{
const {data} = await uni.$http.get( const {data} = await uni.$http.get(
@ -72,10 +76,52 @@
} }
</script> </script>
<script module="renderModal" lang="renderjs">
export default {
data() {
return {
dom: '',
}
},
mounted() {
this.dom = document.getElementById('iframe')
// iframe
window.addEventListener('message', (e)=> {
var data = e.data;
this.emitData(data)
});
},
methods: {
emitData(e) {
this.$ownerInstance.callMethod('receiveRenderData',e)
},
},
}
</script>
<style lang="scss" scoped> <style lang="scss" scoped>
.spjk-box{ .spjk-box{
.select-bar{ .select-bar{
margin: 10px 15px; margin: 10px 15px;
} }
.video-box{
.normal{
position: absolute;
// width: 370px;
// height: 300px;
top: 170px;
left: 0;
width: 100vw;
height: 100vh;
}
.active{
position: absolute;
width: 100vw;
height: 100vh;
top: -30px;
left: 0;
}
}
} }
</style> </style>

View File

@ -10,7 +10,7 @@
</uni-data-select> </uni-data-select>
</view> </view>
<view class="video-box" > <view class="video-box" >
<iframe :src="webURL" style="height: 300px;width:370px;" frameborder="0" ref="videoFrame"></iframe> <iframe :src="webURL" :class="{'normal': show == 0,'active': show == 1}" frameborder="0" ref="videoFrame" :allowfullscreen="true"></iframe>
</view> </view>
<!-- <u-overlay :show="show" @click="show = false"> <!-- <u-overlay :show="show" @click="show = false">
<view class="warp" style="position:relative;"> <view class="warp" style="position:relative;">
@ -20,7 +20,7 @@
</view> </view>
</view> </view>
</u-overlay> --> </u-overlay> -->
<!-- <button @click="show=true"></button> --> <!-- <button @click="handler"></button> -->
</view> </view>
</template> </template>
@ -36,13 +36,15 @@
value: "", value: "",
list:[], list:[],
webURL:'', webURL:'',
show:false show:0
} }
}, },
methods: { methods: {
// handleMessage(){ receiveRenderData(e){
// console.log(111111111111111); //
// }, console.log("3333",e.data)
this.show = e.data
},
async getList(){ async getList(){
try{ try{
const {data} = await uni.$http.get( const {data} = await uni.$http.get(
@ -75,14 +77,29 @@
}, },
mounted() { mounted() {
this.getList() this.getList()
// // 退
// document.addEventListener('fullscreenchange', this.exitFullScreen);
// document.addEventListener('webkitfullscreenchange', this.exitFullScreen);
// document.addEventListener('mozfullscreenchange', this.exitFullScreen);
// document.addEventListener('MSFullscreenChange', this.exitFullScreen);
}, },
onLoad() { }
window.addEventListener('message', (e)=>{console.log("eeee",e);}); </script>
<script module="renderModal" lang="renderjs">
export default {
data() {
return {
dom: '',
}
},
mounted() {
this.dom = document.getElementById('iframe')
// iframe
window.addEventListener('message', (e)=> {
var data = e.data;
this.emitData(data)
});
},
methods: {
emitData(e) {
this.$ownerInstance.callMethod('receiveRenderData',e)
},
}, },
} }
</script> </script>
@ -92,5 +109,23 @@
.select-bar{ .select-bar{
margin: 10px 15px; margin: 10px 15px;
} }
.video-box{
.normal{
position: absolute;
// width: 370px;
// height: 300px;
top: 170px;
left: 0;
width: 100vw;
height: 100vh;
}
.active{
position: absolute;
width: 100vw;
height: 100vh;
top: -30px;
left: 0;
}
}
} }
</style> </style>

View File

@ -70,8 +70,12 @@
myPlugin.JS_SetWindowControlCallback({ myPlugin.JS_SetWindowControlCallback({
windowFullCcreenChange: function (bFull) { //全屏切换回调 windowFullCcreenChange: function (bFull) { //全屏切换回调
console.log('fullScreen callback: ', bFull); console.log('fullScreen callback: ', bFull);
window.parent.postMessage("childLoaded", "*"); let info = {
data:bFull ? 1 : 0
}
window.parent.postMessage(info, '*');
}, },
}) })
// wholeFullScreen() // wholeFullScreen()