Commit de894d034a78e83bb7e52eff4d3a4a5882d666f2

Authored by zhiyangdu
1 parent 59fde423

样式优化

src/pages/index/index.less
... ... @@ -4,8 +4,9 @@
4 4 div{
5 5 margin-top: -1px;
6 6 overflow: hidden;
  7 + display: block
7 8 }
8   - div:first-child{
  9 + .first_item{
9 10 width: 100%;
10 11 height: 836px;
11 12 background: #bd3325 url("../../../static/img/index/1.jpg") no-repeat center top;
... ... @@ -37,6 +38,11 @@
37 38 height: 806px;
38 39 background: #bd3325 url("../../../static/img/index/3.jpg") no-repeat center top;
39 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 47 div:nth-child(4){
42 48 width: 100%;
... ... @@ -124,3 +130,10 @@
124 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 1 <template>
2 2 <div>
3 3 <div class="box">
4   - <div></div>
  4 + <div class="first_item"></div>
5 5 <!--商品列表-->
6 6 <div class="item">
7 7 <div>
... ... @@ -12,6 +12,7 @@
12 12 </div>
13 13 <!--视频-->
14 14 <div>
  15 + <div class="video_box">
15 16 <video-player class="video-player vjs-custom-skin" @play="onPlayerPlay($event)"
16 17 ref="videoPlayer"
17 18 :playsinline="playsinline"
... ... @@ -19,6 +20,7 @@
19 20 x5-playsinline
20 21 webkit-playsinline>
21 22 </video-player>
  23 + </div>
22 24 </div>
23 25  
24 26 <div></div>
... ... @@ -79,7 +81,7 @@
79 81 fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。
80 82 sources: [],
81 83 hls: true, // 启用hls?
82   - poster: '../../../static/img/index/15.jpg', // 你的封面地址
  84 + poster: '../../../static/img/index/video1.png', // 你的封面地址
83 85 width: document.documentElement.clientWidth || document.body.clientWidth,
84 86 notSupportedMessage: '此视频暂无法播放,请稍后再试' // 允许覆盖Video.js无法播放媒体源时显示的默认信息。
85 87 },
... ... @@ -99,7 +101,8 @@
99 101 onPlayerPlay($event) {
100 102 if(this.isiPhone.value && window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.CNDSPlayer) {
101 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 106 isLive: 0 // 0录播1直播
104 107 }});
105 108 }
... ... @@ -110,5 +113,5 @@
110 113  
111 114 <!-- Add "scoped" attribute to limit CSS to this component only -->
112 115 <style rel="stylesheet/less" lang="less" scoped>
113   - @import "./index";
  116 + @import "index";
114 117 </style>
... ...