scenicList.vue 2.82 KB
Newer Older
zhoucong's avatar
zhoucong committed
1
<template>
zhoucong's avatar
zhoucong committed
2 3
	<view class="content">
		<view style="padding-top: 30rpx;">
zhoucong's avatar
zhoucong committed
4
			<block>
5 6 7 8 9
				<view class="item" v-if="merchantName">
					<video class="video" id="myVideo" :poster="thumbImageUrl" :src="productUrl" play-btn-position="center" 
					@error="error" object-fit="fill" @play="playVideo()">

					</video>
zhoucong's avatar
zhoucong committed
10
					<view class="title">
11
						<text>[ {{merchantName || ""}} ]</text>
zhoucong's avatar
zhoucong committed
12
						<view>
13
							<u-icon name="eye-fill" class="icon" color="#ffffff" size="40rpx"></u-icon><text style="color: #ffffff;" space>1000+</text>
zhoucong's avatar
zhoucong committed
14
						</view>
zhoucong's avatar
zhoucong committed
15
					</view>
zhoucong's avatar
zhoucong committed
16
				</view>
zhoucong's avatar
zhoucong committed
17
			</block>
zhoucong's avatar
zhoucong committed
18 19 20 21 22 23
		</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>
24
					<view style="width: 100%;text-align: center;margin-top:10rpx;color: #FFFFFF;">获取Vlog</view>
zhoucong's avatar
zhoucong committed
25 26 27
				</view>
			</navigator>
		</view>
zhoucong's avatar
zhoucong committed
28 29 30 31 32 33 34
	</view>
</template>

<script>
	export default {
		data() {
			return {
35 36 37 38
				productUrl: "", //视频地址
				thumbImageUrl: "", //图片地址
				merchantName: "", //景区名称
				videoContext:""
zhoucong's avatar
zhoucong committed
39 40
			}
		},
41 42
		onReady() { //代替 vue 里面的 mounted
			
zhoucong's avatar
zhoucong committed
43
		},
44 45 46 47
		onLoad(option) { //代替 vue 里面的 created
			this.productUrl = option.productUrl
			this.thumbImageUrl = option.thumbImageUrl
			this.merchantName = option.merchantName
zhoucong's avatar
zhoucong committed
48
		},
zhoucong's avatar
zhoucong committed
49
		methods: {
50 51 52 53 54 55 56 57 58 59 60
			playVideo(){
				// 获取 video 上下文 videoContext 对象
				this.videoContext = uni.createVideoContext('myVideo',this);
				// 进入全屏状态
				this.videoContext.requestFullScreen({direction:-90})
			},
			error(e) { //视频播放出错
				uni.showModal({
					content: e.target.errMsg,
					showCancel: false
				})
zhoucong's avatar
zhoucong committed
61
			},
zhoucong's avatar
zhoucong committed
62 63 64 65
		}
	}
</script>

zhoucong's avatar
zhoucong committed
66
<style lang="scss" scoped>
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
	.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;
				}
zhoucong's avatar
zhoucong committed
105
			}
zhoucong's avatar
zhoucong committed
106
		}
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135

		.bottom {
			width: 100%;
			position: fixed;
			bottom: 0;
			right: 0rpx;

			image {
				width: 100%;
				height: 100rpx;
				position: fixed;
				bottom: 0;
			}

			.paizhao {
				z-index: 1;
				position: absolute;
				bottom: 15rpx;
				width: 100%;
				display: flex;
				justify-content: center;
				flex-wrap: wrap;

				image {
					height: 160rpx;
					width: 160rpx;
					position: relative;
					top: 20rpx;
				}
zhoucong's avatar
zhoucong committed
136 137 138
			}
		}
	}
zhoucong's avatar
zhoucong committed
139
</style>