Merge pull request '视频播放' (#290) from xbx-new into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/290
This commit is contained in:
commit
0d96af99e1
44
pageB/playVideo/index.nvue
Normal file
44
pageB/playVideo/index.nvue
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<template>
|
||||||
|
<view style="width:750rpx" :style="{'height':height}">
|
||||||
|
<image @click="calose()" style="width:30rpx;height:30rpx;position: fixed;top:80rpx;right:30rpx;" src="/static/image/clons.png"></image>
|
||||||
|
<video :src="url" class="video" :style="{'padding-top':top,'height': width}" :autoplay="true"></video>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<style>
|
||||||
|
.video{
|
||||||
|
width: 750rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name:"video",
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
url:"",
|
||||||
|
top:0,
|
||||||
|
height:0,
|
||||||
|
width:0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(a){
|
||||||
|
const res = uni.getSystemInfoSync();
|
||||||
|
let height = res.windowHeight
|
||||||
|
let width = res.windowWidth
|
||||||
|
this.width = width + ( (height - width) / 2) + 'px'
|
||||||
|
console.log(this.width)
|
||||||
|
this.top = (height - width) / 2+ 'px'
|
||||||
|
console.log(this.top)
|
||||||
|
this.height = height + 'px';
|
||||||
|
console.log(a)
|
||||||
|
this.url = a.url
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
calose(){
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
@ -79,6 +79,13 @@
|
|||||||
{
|
{
|
||||||
"root": "pageB",
|
"root": "pageB",
|
||||||
"pages": [
|
"pages": [
|
||||||
|
{
|
||||||
|
"path": "playVideo/index",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle":"custom",
|
||||||
|
"backgroundColor":"#000000"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "follow/index",
|
"path": "follow/index",
|
||||||
"style": {
|
"style": {
|
||||||
|
BIN
static/image/clons.png
Normal file
BIN
static/image/clons.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Loading…
Reference in New Issue
Block a user