feat():水情

master
李神峰 2024-06-07 10:56:32 +08:00
parent b0ab11123a
commit 8657ff0de3
18 changed files with 134 additions and 160 deletions

View File

@ -12,6 +12,7 @@
<title></title> <title></title>
<!--preload-links--> <!--preload-links-->
<!--app-context--> <!--app-context-->
<script src="./static/h5Player/h5player.min.js"></script>
</head> </head>
<body> <body>
<div id="app"><!--app-html--></div> <div id="app"><!--app-html--></div>

View File

@ -13,13 +13,8 @@ $http.beforeRequest = function (options) {
uni.showLoading({ uni.showLoading({
title: '数据加载中' title: '数据加载中'
}) })
if (options.url.indexOf('/my/') !== -1) {
options.header = { if (options.url.indexOf('/doLogin') == -1) {
Authorization: store.state.address.token
}
console.log(options.header)
}
if (options.url.indexOf('/getLoginInfo') !== -1) {
options.header = { options.header = {
'gs-token': uni.getStorageSync('Gs-Token') 'gs-token': uni.getStorageSync('Gs-Token')
} }

View File

@ -16,7 +16,9 @@
"autoclose" : true, "autoclose" : true,
"delay" : 0 "delay" : 0
}, },
"modules" : {}, "modules" : {
"VideoPlayer" : {}
},
/* */ /* */
"distribute" : { "distribute" : {
/* */ /* */
@ -60,7 +62,7 @@
"usingComponents" : true "usingComponents" : true
}, },
"vueVersion" : "2", "vueVersion" : "2",
"h5": { "h5" : {
"template": "template.html" "template" : "template.html"
} }
} }

22
package-lock.json generated
View File

@ -7,10 +7,10 @@
"": { "": {
"dependencies": { "dependencies": {
"@escook/request-miniprogram": "^0.2.1", "@escook/request-miniprogram": "^0.2.1",
"crypto-js": "^4.2.0",
"echarts": "^4.9.0", "echarts": "^4.9.0",
"es6-promise": "^4.2.8", "es6-promise": "^4.2.8",
"flv.js": "^1.6.2", "flv.js": "^1.6.2",
"crypto-js": "^4.2.0",
"moment": "^2.30.1" "moment": "^2.30.1"
} }
}, },
@ -19,6 +19,11 @@
"resolved": "https://registry.npmmirror.com/@escook/request-miniprogram/-/request-miniprogram-0.2.1.tgz", "resolved": "https://registry.npmmirror.com/@escook/request-miniprogram/-/request-miniprogram-0.2.1.tgz",
"integrity": "sha512-ueWV5YsaEm/ycQZuEjMiA88GFMhfBQSjy9GrP9omy4xAQajkGTbYIlnhzsDfWzRPmRC1fKmAiKMrCVcgS+SHcQ==" "integrity": "sha512-ueWV5YsaEm/ycQZuEjMiA88GFMhfBQSjy9GrP9omy4xAQajkGTbYIlnhzsDfWzRPmRC1fKmAiKMrCVcgS+SHcQ=="
}, },
"node_modules/crypto-js": {
"version": "4.2.0",
"resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.2.0.tgz",
"integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q=="
},
"node_modules/echarts": { "node_modules/echarts": {
"version": "4.9.0", "version": "4.9.0",
"resolved": "https://registry.npmjs.org/echarts/-/echarts-4.9.0.tgz", "resolved": "https://registry.npmjs.org/echarts/-/echarts-4.9.0.tgz",
@ -41,11 +46,6 @@
"webworkify-webpack": "^2.1.5" "webworkify-webpack": "^2.1.5"
} }
}, },
"node_modules/crypto-js": {
"version": "4.2.0",
"resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.2.0.tgz",
"integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q=="
},
"node_modules/moment": { "node_modules/moment": {
"version": "2.30.1", "version": "2.30.1",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz",
@ -71,6 +71,11 @@
"resolved": "https://registry.npmmirror.com/@escook/request-miniprogram/-/request-miniprogram-0.2.1.tgz", "resolved": "https://registry.npmmirror.com/@escook/request-miniprogram/-/request-miniprogram-0.2.1.tgz",
"integrity": "sha512-ueWV5YsaEm/ycQZuEjMiA88GFMhfBQSjy9GrP9omy4xAQajkGTbYIlnhzsDfWzRPmRC1fKmAiKMrCVcgS+SHcQ==" "integrity": "sha512-ueWV5YsaEm/ycQZuEjMiA88GFMhfBQSjy9GrP9omy4xAQajkGTbYIlnhzsDfWzRPmRC1fKmAiKMrCVcgS+SHcQ=="
}, },
"crypto-js": {
"version": "4.2.0",
"resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.2.0.tgz",
"integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q=="
},
"echarts": { "echarts": {
"version": "4.9.0", "version": "4.9.0",
"resolved": "https://registry.npmjs.org/echarts/-/echarts-4.9.0.tgz", "resolved": "https://registry.npmjs.org/echarts/-/echarts-4.9.0.tgz",
@ -93,11 +98,6 @@
"webworkify-webpack": "^2.1.5" "webworkify-webpack": "^2.1.5"
} }
}, },
"crypto-js": {
"version": "4.2.0",
"resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.2.0.tgz",
"integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q=="
},
"moment": { "moment": {
"version": "2.30.1", "version": "2.30.1",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz",

View File

@ -4,12 +4,12 @@
}, },
"pages": [ "pages": [
{ {
"path": "pages/index/index", "path" : "pages/login/login",
"style": { "style" :
"navigationBarTitleText": "", {
"navigationStyle": "custom" "navigationBarTitleText" : ""
} }
}, },
{ {
"path": "pages/rain/rain", "path": "pages/rain/rain",
"style": { "style": {
@ -44,13 +44,7 @@
"navigationBarTitleText" : "" "navigationBarTitleText" : ""
} }
}, },
{
"path" : "pages/login/login",
"style" :
{
"navigationBarTitleText" : ""
}
},
{ {
"path" : "pages/forewarning/forewarning", "path" : "pages/forewarning/forewarning",
"style" : "style" :
@ -85,8 +79,8 @@
{ {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} },
"onMessage": "handleMessage"
}, },
{ {
"path" : "pages/rain/rain", "path" : "pages/rain/rain",
@ -125,32 +119,26 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
} }
}
], ],
"tabBar": { "tabBar": {
"color": "#333333", "color": "#333333",
"selectedColor": "#eb4450", "selectedColor": "#eb4450",
"list": [ "list": [
{
"pagePath": "pages/index/index",
"iconPath": "/static/tabs/my2_icon@2x.png",
"selectedIconPath": "static/tabs/my2_icon@2x.png",
"text": "pages"
},
{ {
"pagePath": "pages/homeIndex/index", "pagePath": "pages/homeIndex/index",
"iconPath": "/static/tabs/首页@2x.png", "iconPath": "/static/tabs/首页@2x.png",
"selectedIconPath": "static/tabs/首页2@2x.png", "selectedIconPath": "static/tabs/首页2@2x.png",
"text": "首页" "text": "首页"
}, },
{
"pagePath": "pages/addressBook/addressBook",
"iconPath": "/static/tabs/my2_icon@2x.png",
"selectedIconPath": "static/tabs/my2_icon@2x.png",
"text": "通讯录"
},
{ {
"pagePath": "pages/mypage/mypage", "pagePath": "pages/mypage/mypage",
"iconPath": "/static/images/my1.png", "iconPath": "/static/images/my1.png",

View File

@ -9,17 +9,13 @@
> >
</uni-data-select> </uni-data-select>
</view> </view>
<view <view class="video-box" v-if="this.list.length">
class="video-box" v-if="this.list.length"> <!-- <web-view :src="webURL" style="height: 400px;"></web-view> -->
<!-- <web-view :src="webURL" style="height: 500px;"></web-view> --> <iframe :src="webURL" style="height: 300px;width:380px" frameborder="0" :allowfullscreen="true"></iframe>
<video id="video-element" controls=""></video>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
// import flvjs from "@/node_modules/flv.js/dist/flv.min.js"
// import 'es6-promise/auto';
// import flvjs from "flv.js"
export default{ export default{
props:{ props:{
stcd:String, stcd:String,
@ -31,8 +27,6 @@
value: "", value: "",
list:[], list:[],
webURL:'', webURL:'',
urls:"",
flv:null
} }
}, },
methods: { methods: {
@ -60,11 +54,7 @@
const {data} = await uni.$http.get( const {data} = await uni.$http.get(
`/gunshiApp/xfflood/xfCctvB/preview/${id}`) `/gunshiApp/xfflood/xfCctvB/preview/${id}`)
if(data.code == 200){ if(data.code == 200){
console.log(data.data); this.webURL="./static/h5Player/webplayer.html?cameraIndexCode="+id+"&cameraUrl="+data.data
this.urls = data.data;
this.webURL="/static/h5Player/webplayer.html?cameraIndexCode="+id+"&cameraUrl="+data.data
this.flv.updateConfig({ url: data.data })
this.flv.load()
} }
}catch(e){ }catch(e){
uni.$showMsg() uni.$showMsg()
@ -74,18 +64,6 @@
console.log("e:", e); console.log("e:", e);
this.getVideoSrc(e) this.getVideoSrc(e)
}, },
creatFlvElement(){
const videoElement = document.getElementById('video-element'); //
const flvPlayer = flvjs.createPlayer({
type: 'flv',
url: '' // WebSocket
});
flvPlayer.attachMediaElement(videoElement); //
flvPlayer.load(); //
flvPlayer.play(); //
this.flv = flvPlayer;
}
}, },
mounted() { mounted() {
this.getList() this.getList()

View File

@ -24,7 +24,7 @@
</view> </view>
<!-- nav --> <!-- nav -->
<view class="navBar"> <view class="navBar">
<div class="navList" v-for="(item, index) in navList" :key="index"> <div class="navList" v-for="(item, index) in navList" :key="index">
<div @click="myNavigateTo(item.url)"> <div @click="myNavigateTo(item.url)">
<div class="navIcon"> <div class="navIcon">
<image <image
@ -33,7 +33,7 @@
mode="aspectFit" mode="aspectFit"
></image> ></image>
</div> </div>
<div class="navTxt">{{ item.value }}</div> <div class="navTxt">{{ item.value }}</div>
</div> </div>
</div> </div>
</view> </view>
@ -218,31 +218,31 @@ const navList = [
{ {
value: '雨情', value: '雨情',
key: 1, key: 1,
icon: '../../static/tabs/形状 1@2x.png', icon: '../../static/tabs/形状 1@2x.png',
url:'' url:"/pages/rain/rain"
}, },
{ {
value: '水情', value: '水情',
key: 2, key: 2,
icon: '../../static/tabs/water (1) 拷贝@2x.png', icon: '../../static/tabs/water (1) 拷贝@2x.png',
url:'' url:"/pages/water/water"
}, },
{ {
value: '工情灾情', value: '工情灾情',
key: 3, key: 3,
icon: '../../static/tabs/工情——icon@2x.png', icon: '../../static/tabs/工情——icon@2x.png',
url:'' url:''
}, },
{ {
value: '信息上报', value: '信息上报',
key: 4, key: 4,
icon: '../../static/tabs/xinxi_icon@2x.png', icon: '../../static/tabs/xinxi_icon@2x.png',
url:'' url:''
}, },
{ {
value: '预警', value: '预警',
key: 5, key: 5,
icon: '../../static/tabs/yujing_icon@2x.png', icon: '../../static/tabs/yujing_icon@2x.png',
url:'/pages/forewarning/forewarning' url:'/pages/forewarning/forewarning'
} }
] ]
@ -347,12 +347,12 @@ export default {
let h1 = moment().format('HH') >= 20 ? '20' : '08' let h1 = moment().format('HH') >= 20 ? '20' : '08'
this.tm = d1 + h1 this.tm = d1 + h1
}, },
myNavigateTo (url) { myNavigateTo (url) {
uni.navigateTo({ uni.navigateTo({
url: url // url: url //
}); });
} }
}, },
onLoad () { onLoad () {

View File

@ -1,41 +0,0 @@
<template>
<view class="container">
<view class="intro">本项目已包含uni ui组件测试测试测试无需import和注册可直接使用在代码区键入字母u即可通过代码助手列出所有可用组件光标置于组件名称处按F1即可查看组件文档</view>
<text class="intro">详见</text>
<uni-link :href="href" :text="href"></uni-link>
</view>
</template>
<script>
export default {
data() {
return {
href: 'https://uniapp.dcloud.io/component/README?id=uniui'
}
},
methods: {
async getSwiperList(){
try{
const res = await uni.$http.get(
"/gunshiApp/xfflood/xfProjectIncident/getList?_=1716880158438"
)
console.log(res)
}catch(e){
uni.$showMsg()
}
},
onLoad(){
this.getSwiperList()
}
}
}
</script>
<style>
.container {
padding: 20px;
font-size: 14px;
line-height: 24px;
}
</style>

View File

@ -79,6 +79,7 @@
if (res.data.data){ if (res.data.data){
uni.setStorageSync('Gs-Token', res.data.data) uni.setStorageSync('Gs-Token', res.data.data)
uni.$http.get('/gunshiApp/xfflood/getLoginInfo').then(res=>{ uni.$http.get('/gunshiApp/xfflood/getLoginInfo').then(res=>{
console.log("sss",res.data.data);
uni.setStorageSync('value', res.data.data) uni.setStorageSync('value', res.data.data)
}) })
} }

View File

@ -17,12 +17,13 @@
<!-- 搜索以及多级下拉 --> <!-- 搜索以及多级下拉 -->
<view class="search-box"> <view class="search-box">
<view class="search-item"> <view class="search-item">
<view style="display:flex" v-show="limit == 1">
<view class="" @click="handleClick" > <view class="" @click="handleClick" >
{{selecetItem.adnm == "全部" ? "咸丰县" : selecetItem.adnm || columns[0][0].adnm}} {{selecetItem.adnm == "全部" ? "咸丰县" : selecetItem.adnm || columns[0][0].adnm}}
</view> </view>
<u-icon name="arrow-down-fill" color="#000" size="20" v-show="switchIcon"></u-icon> <u-icon name="arrow-down-fill" color="#000" size="20" v-show="switchIcon"></u-icon>
<u-icon name="arrow-up-fill" color="#000" size="20" v-show="!switchIcon"></u-icon> <u-icon name="arrow-up-fill" color="#000" size="20" v-show="!switchIcon"></u-icon>
</view>
<view class="rain-input" style="width: 50%;"> <view class="rain-input" style="width: 50%;">
<u--input <u--input
placeholder="请输入站点" placeholder="请输入站点"
@ -32,11 +33,13 @@
:value="formData.stArg" :value="formData.stArg"
></u--input> ></u--input>
</view> </view>
<view style="display:flex" v-show="limit == 1">
<view class="" @click="handleClick1" > <view class="" @click="handleClick1" >
{{selecetItem1.basName == "全部" ? "流域" : selecetItem1.basName || "流域"}} {{selecetItem1.basName == "全部" ? "流域" : selecetItem1.basName || "流域"}}
</view> </view>
<u-icon name="arrow-down-fill" color="#000" size="20" v-show="switchIcon1"></u-icon> <u-icon name="arrow-down-fill" color="#000" size="20" v-show="switchIcon1"></u-icon>
<u-icon name="arrow-up-fill" color="#000" size="20" v-show="!switchIcon1"></u-icon> <u-icon name="arrow-up-fill" color="#000" size="20" v-show="!switchIcon1"></u-icon>
</view>
</view> </view>
</view> </view>
<!-- 单纯下拉 --> <!-- 单纯下拉 -->
@ -167,6 +170,9 @@
import Table from "./Table" import Table from "./Table"
import filter from "../../static/images/filter.png" import filter from "../../static/images/filter.png"
import moment from "moment" import moment from "moment"
import {disType} from "../utils/dicType.js"
const adcd = uni.getStorageSync('value').adcd
const type = disType(adcd)
export default { export default {
data() { data() {
return { return {
@ -206,7 +212,7 @@
etm:"",// etm:"",//
columns: // columns: //
[ [
[{"adnm": "咸丰县", "adcd": "422826100000000"}],[] [{"adnm": "咸丰县", "adcd":adcd }],[]
], ],
columnData: [[]], columnData: [[]],
columns1:[[]], //, columns1:[[]], //,
@ -216,6 +222,7 @@
basCode:'', basCode:'',
source:["SH","SW","QX","SK"], source:["SH","SW","QX","SK"],
stArg:'', stArg:'',
adcd:type == 1 ? undefined :adcd,
etm:moment().set({ hour: 8, minute: 0, second: 0, millisecond: 0 }).format("YYYY-MM-DD HH:mm"), etm:moment().set({ hour: 8, minute: 0, second: 0, millisecond: 0 }).format("YYYY-MM-DD HH:mm"),
stm:moment().subtract(1, 'day').set({ hour: 8, minute: 0, second: 0, millisecond: 0 }).format("YYYY-MM-DD HH:mm") stm:moment().subtract(1, 'day').set({ hour: 8, minute: 0, second: 0, millisecond: 0 }).format("YYYY-MM-DD HH:mm")
} }
@ -230,6 +237,9 @@
stm:moment().subtract(this.formData.timeType, 'hours').format("YYYY-MM-DD HH:mm"), stm:moment().subtract(this.formData.timeType, 'hours').format("YYYY-MM-DD HH:mm"),
etm:moment().format("YYYY-MM-DD HH:mm") etm:moment().format("YYYY-MM-DD HH:mm")
} }
},
limit(){
return disType(adcd)
} }
}, },
watch:{ watch:{

View File

@ -112,6 +112,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

@ -9,33 +9,40 @@
> >
</uni-data-select> </uni-data-select>
</view> </view>
<view class="video-box"> <view class="video-box" >
<!-- <video :src="videoObject.src" controls is-live="true"></video> --> <iframe :src="webURL" style="height: 300px;width:370px;" frameborder="0" ref="videoFrame"></iframe>
<!-- <HFivePlayer :wsUrl="videoObject" :size="1" :playerID="'111'"/> -->
</view> </view>
<!-- <u-overlay :show="show" @click="show = false">
<view class="warp" style="position:relative;">
<view class="rect" >
<iframe :src="webURL" style="height: 100vh;width:100vw" frameborder="0" ref="videoFrame"></iframe>
<image src="/static/images/m1.png" style="position:absolute; bottom:0,right:0"></image>
</view>
</view>
</u-overlay> -->
<!-- <button @click="show=true"></button> -->
</view> </view>
</template> </template>
<script> <script>
// import HFivePlayer from "../../../components/VideoPlay/videoPlay.vue"
export default { export default {
props:{ props:{
stcd:String, stcd:String,
source:String, source:String,
default:'' default:''
}, },
// components:{
// HFivePlayer
// },
data() { data() {
return { return {
value: "", value: "",
list:[], list:[],
videoObject:{}, webURL:'',
show:false
} }
}, },
methods: { methods: {
// handleMessage(){
// console.log(111111111111111);
// },
async getList(){ async getList(){
try{ try{
const {data} = await uni.$http.get( const {data} = await uni.$http.get(
@ -55,21 +62,12 @@
const {data} = await uni.$http.get( const {data} = await uni.$http.get(
`/gunshiApp/xfflood/xfCctvB/preview/${id}`) `/gunshiApp/xfflood/xfCctvB/preview/${id}`)
if(data.code == 200){ if(data.code == 200){
console.log(data.data); this.webURL="./static/h5Player/webplayer.html?cameraIndexCode="+id+"&cameraUrl="+data.data
this.videoObject = {src:data.data}
} }
}catch(e){ }catch(e){
uni.$showMsg() uni.$showMsg()
} }
}, },
playStatus(val){
if(val.type === 'success'){
console.log('播放成功');
}else{
console.log('播放失败')
console.log(val.msg)
}
},
change(e) { change(e) {
console.log("e:", e); console.log("e:", e);
this.getVideoSrc(e) this.getVideoSrc(e)
@ -77,7 +75,15 @@
}, },
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>

View File

@ -14,3 +14,14 @@ export function repDict(e) {
} }
return name return name
} }
// 县,乡镇判断
export function disType(e) {
let type;
if (e.endsWith('000000000')) {
type = 1;
} else if (e.endsWith('000000')) {
type = 0;
}
return type;
}

View File

@ -51,6 +51,9 @@
<script> <script>
import Table from "./table.vue" import Table from "./table.vue"
import {disType} from "../../utils/dicType.js"
const adcd = uni.getStorageSync('value').adcd
const type = disType(adcd)
export default { export default {
props:{ props:{
stcd:String, stcd:String,
@ -76,6 +79,7 @@
formData:{ formData:{
args:'', args:'',
sources:["SH","SW"], sources:["SH","SW"],
adcd:type == 1 ? undefined :adcd,
}, },
list:[], // list:[], //
saveList:[] // saveList:[] //
@ -98,6 +102,7 @@
this.getList() this.getList()
}, },
async getList(){ async getList(){
console.log(1111,this.formData);
try{ try{
const {data} = await uni.$http.post( const {data} = await uni.$http.post(
"/gunshiApp/xfflood/river/water/list",{...this.formData} "/gunshiApp/xfflood/river/water/list",{...this.formData}

View File

@ -51,6 +51,9 @@
<script> <script>
import Table from "./table.vue" import Table from "./table.vue"
import {disType} from "../../utils/dicType.js"
const adcd = uni.getStorageSync('value').adcd
const type = disType(adcd)
export default { export default {
props:{ props:{
stcd:String, stcd:String,
@ -77,6 +80,7 @@
formData:{ formData:{
args:'', args:'',
sources:["SW","SK"], sources:["SW","SK"],
adcd:type == 1 ? undefined :adcd,
}, },
list:[], // list:[], //
saveList:[] // saveList:[] //

View File

@ -3,7 +3,7 @@
<view class="nav-bar"> <view class="nav-bar">
<u-icon name="arrow-left" color="#000" size="28" @click="backTo"></u-icon> <u-icon name="arrow-left" color="#000" size="28" @click="backTo"></u-icon>
<view class="title"> <view class="title">
测试
</view> </view>
</view> </view>
<view class="tab-bar" > <view class="tab-bar" >

View File

@ -5,9 +5,9 @@
<script src="./h5player.min.js"></script> <script src="./h5player.min.js"></script>
<style type="text/css"> <style type="text/css">
.myplayer { .myplayer {
width: 90vw; width: 100%;
height: 28vh; height: 300px;
border-radius: 2vh; /* border-radius: 2vh; */
overflow: hidden; overflow: hidden;
/* background: #000; */ /* background: #000; */
} }
@ -20,7 +20,7 @@
// 初始化插件 // 初始化插件
var myPlugin = new JSPlugin({ var myPlugin = new JSPlugin({
szId: 'play_window', //需要英文字母开头 必填 szId: 'play_window', //需要英文字母开头 必填
szBasePath: './h5player.min.js', // 必填,引用H5player.min.js的js相对路径 szBasePath: './', // 必填,引用H5player.min.js的js相对路径
iCurrentSplit: 1, iCurrentSplit: 1,
}) })
// 获取视频播放流 // 获取视频播放流
@ -37,7 +37,6 @@
playURL, playURL,
mode: 1 mode: 1
}, curIndex).then(() => { }, curIndex).then(() => {
console.log("dsdsdsddsdsdsds1111111111111");
console.info('JS_Play success 播放成功'); console.info('JS_Play success 播放成功');
// do you want... // do you want...
// 抓图 // 抓图
@ -47,7 +46,7 @@
myPlugin.JS_CapturePicture(curIndex, fileName, fileType,imageData => { myPlugin.JS_CapturePicture(curIndex, fileName, fileType,imageData => {
console.info('JS_CapturePicture success 抓图成功'); //2.1.0开始全是base64之前的版本存在blob或者是base64 console.info('JS_CapturePicture success 抓图成功'); //2.1.0开始全是base64之前的版本存在blob或者是base64
// do you want... // do you want...
plus.storage.setItem(cameraIndexCode,imageData); // plus.storage.setItem(cameraIndexCode,imageData);
}) })
}, (err) => { }, (err) => {
console.info('JS_Play failed:', err); console.info('JS_Play failed:', err);
@ -62,6 +61,20 @@
if (r != null) return unescape(r[2]); if (r != null) return unescape(r[2]);
return null; return null;
} }
function wholeFullScreen(){
myPlugin.JS_FullScreenDisplay(true).then(
() => { console.log(`wholeFullScreen success`) },
e => { console.error(e) }
)
}
myPlugin.JS_SetWindowControlCallback({
windowFullCcreenChange: function (bFull) { //全屏切换回调
console.log('fullScreen callback: ', bFull);
window.parent.postMessage("childLoaded", "*");
},
})
// wholeFullScreen()
</script> </script>
</body> </body>
</html> </html>

View File

@ -15,7 +15,7 @@
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)')) var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />') document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script> </script>
<script src="static/h5Player/h5player.min.js"></script> <script src="../static/h5Player/h5player.min.js"></script>
<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" /> <link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
</head> </head>
<body> <body>