Commit de894d034a78e83bb7e52eff4d3a4a5882d666f2
1 parent
59fde423
样式优化
Showing
2 changed files
with
21 additions
and
5 deletions
src/pages/index/index.less
| @@ -4,8 +4,9 @@ | @@ -4,8 +4,9 @@ | ||
| 4 | div{ | 4 | div{ |
| 5 | margin-top: -1px; | 5 | margin-top: -1px; |
| 6 | overflow: hidden; | 6 | overflow: hidden; |
| 7 | + display: block | ||
| 7 | } | 8 | } |
| 8 | - div:first-child{ | 9 | + .first_item{ |
| 9 | width: 100%; | 10 | width: 100%; |
| 10 | height: 836px; | 11 | height: 836px; |
| 11 | background: #bd3325 url("../../../static/img/index/1.jpg") no-repeat center top; | 12 | background: #bd3325 url("../../../static/img/index/1.jpg") no-repeat center top; |
| @@ -37,6 +38,11 @@ | @@ -37,6 +38,11 @@ | ||
| 37 | height: 806px; | 38 | height: 806px; |
| 38 | background: #bd3325 url("../../../static/img/index/3.jpg") no-repeat center top; | 39 | background: #bd3325 url("../../../static/img/index/3.jpg") no-repeat center top; |
| 39 | background-size: 100%; | 40 | background-size: 100%; |
| 41 | + .video_box{ | ||
| 42 | + width: 713px !important; | ||
| 43 | + height: 401px !important; | ||
| 44 | + margin: 85px 18px 0 18px; | ||
| 45 | + } | ||
| 40 | } | 46 | } |
| 41 | div:nth-child(4){ | 47 | div:nth-child(4){ |
| 42 | width: 100%; | 48 | width: 100%; |
| @@ -124,3 +130,10 @@ | @@ -124,3 +130,10 @@ | ||
| 124 | background-size: 100%; | 130 | background-size: 100%; |
| 125 | } | 131 | } |
| 126 | } | 132 | } |
| 133 | +// 设置播放器的背景颜色 | ||
| 134 | +.vjs-poster{ | ||
| 135 | + background-color: transparent !important; | ||
| 136 | + //.vjs-poster{ | ||
| 137 | + // background-color: transparent; | ||
| 138 | + //} | ||
| 139 | +} |
src/pages/index/index.vue
| 1 | <template> | 1 | <template> |
| 2 | <div> | 2 | <div> |
| 3 | <div class="box"> | 3 | <div class="box"> |
| 4 | - <div></div> | 4 | + <div class="first_item"></div> |
| 5 | <!--商品列表--> | 5 | <!--商品列表--> |
| 6 | <div class="item"> | 6 | <div class="item"> |
| 7 | <div> | 7 | <div> |
| @@ -12,6 +12,7 @@ | @@ -12,6 +12,7 @@ | ||
| 12 | </div> | 12 | </div> |
| 13 | <!--视频--> | 13 | <!--视频--> |
| 14 | <div> | 14 | <div> |
| 15 | + <div class="video_box"> | ||
| 15 | <video-player class="video-player vjs-custom-skin" @play="onPlayerPlay($event)" | 16 | <video-player class="video-player vjs-custom-skin" @play="onPlayerPlay($event)" |
| 16 | ref="videoPlayer" | 17 | ref="videoPlayer" |
| 17 | :playsinline="playsinline" | 18 | :playsinline="playsinline" |
| @@ -19,6 +20,7 @@ | @@ -19,6 +20,7 @@ | ||
| 19 | x5-playsinline | 20 | x5-playsinline |
| 20 | webkit-playsinline> | 21 | webkit-playsinline> |
| 21 | </video-player> | 22 | </video-player> |
| 23 | + </div> | ||
| 22 | </div> | 24 | </div> |
| 23 | 25 | ||
| 24 | <div></div> | 26 | <div></div> |
| @@ -79,7 +81,7 @@ | @@ -79,7 +81,7 @@ | ||
| 79 | fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。 | 81 | fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。 |
| 80 | sources: [], | 82 | sources: [], |
| 81 | hls: true, // 启用hls? | 83 | hls: true, // 启用hls? |
| 82 | - poster: '../../../static/img/index/15.jpg', // 你的封面地址 | 84 | + poster: '../../../static/img/index/video1.png', // 你的封面地址 |
| 83 | width: document.documentElement.clientWidth || document.body.clientWidth, | 85 | width: document.documentElement.clientWidth || document.body.clientWidth, |
| 84 | notSupportedMessage: '此视频暂无法播放,请稍后再试' // 允许覆盖Video.js无法播放媒体源时显示的默认信息。 | 86 | notSupportedMessage: '此视频暂无法播放,请稍后再试' // 允许覆盖Video.js无法播放媒体源时显示的默认信息。 |
| 85 | }, | 87 | }, |
| @@ -99,7 +101,8 @@ | @@ -99,7 +101,8 @@ | ||
| 99 | onPlayerPlay($event) { | 101 | onPlayerPlay($event) { |
| 100 | if(this.isiPhone.value && window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.CNDSPlayer) { | 102 | if(this.isiPhone.value && window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.CNDSPlayer) { |
| 101 | window.webkit.messageHandlers.CNDSPlayer.postMessage({body: { | 103 | window.webkit.messageHandlers.CNDSPlayer.postMessage({body: { |
| 102 | - playUrl: this.playerOptions.sources[0].src, // 视频URL | 104 | + playUrl:"https://v.youku.com/v_show/id_XNDQyOTAxNjE2MA==.html?s=e438e14b3fa94613a1bb&scm=20140719.manual.15319.show_e438e14b3fa94613a1bb", |
| 105 | +// playUrl: this.playerOptions.sources[0].src, // 视频URL | ||
| 103 | isLive: 0 // 0录播1直播 | 106 | isLive: 0 // 0录播1直播 |
| 104 | }}); | 107 | }}); |
| 105 | } | 108 | } |
| @@ -110,5 +113,5 @@ | @@ -110,5 +113,5 @@ | ||
| 110 | 113 | ||
| 111 | <!-- Add "scoped" attribute to limit CSS to this component only --> | 114 | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| 112 | <style rel="stylesheet/less" lang="less" scoped> | 115 | <style rel="stylesheet/less" lang="less" scoped> |
| 113 | - @import "./index"; | 116 | + @import "index"; |
| 114 | </style> | 117 | </style> |