<template>
	<view class="content">
		<view style="padding-top: 30rpx;">
			<block>
				<view class="item" v-if="scenic.name">
					<video class="video" :poster="scenic.coverImgUrl" :src="scenic.showVideoUrl" play-btn-position="center"  @error="error" controls></video>
					<view class="title">
						<text>[ {{scenic.name || ""}} ]</text>
						<view>
							<u-icon name="eye-fill" class="icon" color="#ffffff" size="40rpx"></u-icon><text style="color: #ffffff;" space>10W  +</text>
						</view>
					</view>
				</view>
			</block>
		</view>
		<view class="bottom">
			<image src="../../../static/img/vlog/icon/bottom.png"></image>
			<navigator url="../vlogface/vlogface">
				<view class="paizhao">
					<image src="../../../static/img/vlog/icon/icon_scan.png"></image>
				</view>
			</navigator>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				scenic:{},//景区详情
			}
		},
		onReady() {//代替 vue 里面的 mounted
		},
		onLoad(res){//代替 vue 里面的 created
			let caseId=res.caseId
			this.$request("distribution/vlog/getScenicInfo",{caseId}).then(res=>{
				if(res.code==="00"){
					console.log(res);
					this.scenic=res.data;
					uni.setNavigationBarTitle({title:this.scenic.name})
				}
			})
		},
		methods: {
			error(e){//视频播放出错
				uni.showModal({content: e.target.errMsg,showCancel: false})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.content{padding: 0 20rpx;min-height: 100%;width: 100%;background-color: #192033;
		.item{padding: 0 10rpx;border-radius: 10rpx;background-color: #192033;margin-bottom:30rpx;text-align: center;
			.video{height: 350rpx;border-radius: 10rpx;width: 100%;}
			.title{height: 60rpx;margin-top: 20rpx;
				text{float: left;height: 60rpx;line-height: 60rpx;color: #FFE600;font-weight: bold;}
				view{float: right;height: 60rpx;line-height: 60rpx;align-items: center;display: flex;}
			}
		}
		.bottom{height: 150rpx;width: 100%;position: relative;position: fixed;bottom: 0;right:0rpx;
			image{width: 100%;height: 100rpx;position: relative;position: fixed;bottom: 0;}
			.paizhao{height: 160rpx;width: 160rpx;z-index: 1;position: absolute;left:50%;top:22%;transform: translate(-50%, -50%);
				image{height: 100%;width: 100%;}
			}
		}
	}

</style>
