<template>
	<view class="column" style="height: 100%;">
		<view class="top-content ">
			<view class="status_bar bgf" :style="{height: statusBarHeight}"></view>
			<!-- 这里是状态栏 -->
			<view class="top-title">企业理念</view>
		</view>
		<view class="flex-1 scrolly ">
			
			<view class="imgbox column">
				<image :src="enterpriseimg[0]"  mode="widthFix"></image>
				<!-- <image :src="enterpriseimg[2]"  mode="widthFix"></image>
				<image :src="enterpriseimg[1]"  mode="widthFix"></image> -->
			</view>
			<view class="p20 ">
				<video id="myVideo" :src='enterpriseurl'
				show-mute-btn='true' @fullscreenchange='changvideo'
				vslide-gesture-in-fullscreen='true' :muted='muted' loop='true'
				@error="videoErrorCallback"  enable-danmu  controls  autoplay="true"
				class="videotop"></video>
			</view>
		</view>
		<!-- <tabbar :actindex="1"></tabbar> -->
	</view>
</template>

<script>
	import{getenterprise} from '@/api/index.js'
	export default {
		data() {
			return {
				statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
				enterpriseurl:'',
				enterpriseimg:'',
				muted:true,
			}
		},
		mounted() {
			this.getenterprise()
		},
		methods: {
			changvideo(e){
				if(e.target.fullScreen==true){
					this.muted=false
				}else{
					this.muted=true
				}
				e.target.fullScreen
			},
			getenterprise(){
				getenterprise().then(res=>{
					this.enterpriseurl=res.data.videoUrl
					this.enterpriseimg=res.data.images
					const url=this.enterpriseimg.split(',')
					this.enterpriseimg=url
					// uni.setStorageSync('enterpriseurl',this.enterpriseurl)
					console.log(this.enterpriseimg)
				})
			},
			videoErrorCallback: function(e) {
				
			},
		}
	}
</script>

<style lang="scss" scoped>
	page{
		background-color: #FFFFFF;
	}
.top-content {
	width: 100%;
	z-index: 10;

	.top-title {
		height: 88upx;
		line-height: 88upx;
		font-size: 42upx;
		font-family: Source Han Sans CN;
		font-weight: bold;
		color: #222222;
		padding-left: 41upx;
		background-color: #FFFFFF;
	}
}
.imgbox{
	image{
		width: 100%;
	}
}
.videotop{
	width: 100%;
	border-radius: 20rpx;
}
</style>
