默认提交
Showing
3 changed files
with
12 additions
and
6 deletions
| 1 | import { | 1 | import { |
| 2 | getBindtapData, | 2 | getBindtapData, |
| 3 | pxToRpx | 3 | pxToRpx, |
| 4 | getLastScreenHeight | ||
| 4 | } from '../../utils/util'; | 5 | } from '../../utils/util'; |
| 5 | 6 | ||
| 6 | let app = getApp(); | 7 | let app = getApp(); |
| ... | @@ -177,10 +178,15 @@ Page({ | ... | @@ -177,10 +178,15 @@ Page({ |
| 177 | height | 178 | height |
| 178 | } = result; | 179 | } = result; |
| 179 | let vidHeight = (height / width) * 750; | 180 | let vidHeight = (height / width) * 750; |
| 180 | if (vidHeight < 320) { | 181 | if (vidHeight < 800) { |
| 181 | vidHeight = 320; | 182 | vidHeight = 800; |
| 183 | } else { | ||
| 184 | vidHeight = getLastScreenHeight(132); | ||
| 182 | } | 185 | } |
| 183 | vidHeight = pxToRpx(vidHeight); | 186 | console.log("vidHeight:", vidHeight); |
| 187 | // vidHeight = pxToRpx(vidHeight); | ||
| 188 | // let vidHeight = getLastScreenHeight(132); | ||
| 189 | |||
| 184 | this.setData({ | 190 | this.setData({ |
| 185 | vidHeight: vidHeight, | 191 | vidHeight: vidHeight, |
| 186 | }); | 192 | }); | ... | ... |
| ... | @@ -6,7 +6,7 @@ | ... | @@ -6,7 +6,7 @@ |
| 6 | <view class="content"> | 6 | <view class="content"> |
| 7 | <!-- 视频详情 --> | 7 | <!-- 视频详情 --> |
| 8 | <view class="detail"> | 8 | <view class="detail"> |
| 9 | <view class="vid-wrap" style='height: {{vidHeight}}px;'> | 9 | <view class="vid-wrap" style='height: {{vidHeight}}rpx;'> |
| 10 | <video wx:if="{{!isVideoEnded}}" id="vid" bindended="onVideoEndedHandler" objectFit="contain" class="vid" poster="{{detailData.thumbnail}}" src="{{detailData.videoUrl}}" /> | 10 | <video wx:if="{{!isVideoEnded}}" id="vid" bindended="onVideoEndedHandler" objectFit="contain" class="vid" poster="{{detailData.thumbnail}}" src="{{detailData.videoUrl}}" /> |
| 11 | <view wx:else class="btn-wrap"> | 11 | <view wx:else class="btn-wrap"> |
| 12 | <button bindtap="onReplayHandler" class="btn"> | 12 | <button bindtap="onReplayHandler" class="btn"> | ... | ... |
-
Please register or sign in to post a comment