video.wxml
2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<view class="videoContainer">
<!-- 头部区域 -->
<view class="header">
<image src="/static/images/video/video.jpg"></image>
<view class="search" bindtap="toSearch">
음악 검색
</view>
<image src="/static/images/logo.png"></image>
</view>
<!-- 导航区域 -->
<scroll-view
scroll-x
class="navScroll"
enable-flex
scroll-into-view="{{'scroll' + navId}}"
scroll-with-animation
>
<view id="{{'scroll' + item.id}}" class="navItem" wx:for="{{videoGroupList}}" wx:key="id">
<view class="navContent {{navId === item.id?'active': ''}}" bindtap="changeNav" id="{{item.id}}" data-id="{{item.id}}">
{{item.name}}
</view>
</view>
</scroll-view>
<!-- 视频列表区域 -->
<scroll-view
scroll-y
class="videoScroll"
refresher-enabled
bindrefresherrefresh="handleRefresher"
refresher-triggered="{{isTriggered}}"
bindscrolltolower="handleToLower"
>
<view class="videoItem" wx:for="{{videoList}}" wx:key="id">
<video
src="{{item.data.urlInfo.url}}"
bindplay="handlePlay"
id="{{item.data.vid}}"
poster="{{item.data.coverUrl}}"
class="common"
object-fit="cover"
wx:if='{{videoId === item.data.vid}}'
bindtimeupdate="handleTimeUpdate"
bindended="handleEnded"
></video>
<!-- 性能优化:使用image图片代替video标签 -->
<image wx:else bindtap="handlePlay" id="{{item.data.vid}}" class="common" src="{{item.data.coverUrl}}"></image>
<view class="content">{{item.data.title}}</view>
<view class="footer">
<image class="avatar" src="{{item.data.creator.avatarUrl}}"></image>
<text class="nickName">{{item.data.creator.nickname}}</text>
<view class="comments_praised">
<text class="item">
<text class="iconfont icon-buoumaotubiao15"></text>
<text class="count">{{item.data.praisedCount}}</text>
</text>
<text class="item">
<text class="iconfont icon-pinglun1"></text>
<text class="count">{{item.data.commentCount}}</text>
</text>
<button open-type="share" class="item btn">
<text class="iconfont icon-gengduo"></text>
</button>
</view>
</view>
</view>
</scroll-view>
</view>