mySwiper.wxml
1.77 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
<view class='swiper-wrapper'>
<swiper
class="swiper-content"
style="height:{{swiperProps.swiperHeight}}"
circular="{{swiperProps.circular}}"
next-margin="{{swiperProps.nextMargin}}"
previous-margin="{{swiperProps.prevMargin}}"
indicator-dots="{{swiperProps.indicatorDots}}"
autoplay="{{swiperProps.autoplay}}"
interval="{{swiperProps.interval}}"
duration="{{swiperProps.duration}}">
<block wx:for="{{swiperItem}}" wx:key="id">
<swiper-item class="swiper-item" style="padding: {{swiperProps.padding}}" data-id="{{item.id}}">
<!-- 正常显示:图片+标签 -->
<view
wx:if="{{!item.showLive}}"
class="swiper-item-content"
data-id="{{item.id}}"
bindtap="tapItem">
<image class="swiper-img" src="{{item.url}}" />
<label labelProps="{{labelProps}}" title="{{item.label}}" wx:if="{{item.label}}" />
</view>
<!-- 特殊显示:直播(微信slot渲染顺序问题解决方案) -->
<view
wx:else
class="swiper-item-content"
data-roomId="{{item.roomId}}"
bindtap="tapLiveItem">
<view class="live-share">
<image src="../../pages/tab/resources/images/live.png" class='icon image' />
<image class="swiper-img image" src="{{item.shareImg}}" data-item="{{item}}" />
</view>
<view class="live-btn" wx:if='{{otherSwiperProps.liveStatus == 101}}' data-item='{{item}}'>
立即观看
</view>
<subscribe wx:if='{{otherSwiperProps.liveStatus == 102}}' room-id="{{item.roomId}}" />
<label wx:if='{{otherSwiperProps.liveStatus == 103 || otherSwiperProps.liveStatus == 105}}' labelProps="{{labelProps}}" title="已结束" />
</view>
</swiper-item>
</block>
</swiper>
</view>