<!--pages/liveStream/liveStream.wxml-->
<wxs src="../../../utils/filter.wxs" module="filter"></wxs>
<view>
  <!-- 即将开始 -->
  <!-- <block wx:if="{{livetoBegin.pageData.length > 0}}">
		<view class="title">即将开始</view>
		<view class="list">
			<block wx:for="{{livetoBegin.pageData}}" wx:key="item">
				<view class="list-item" data-id="{{item.id}}" data-live="toBegin" catchtap="clickItem">
					<view class="list-item-left">
						<image src="{{item.share_img}}" class="item-pic" mode="aspectFit"></image>
					</view>
					<view class="list-item-right">
						<view>
							<view class="item-title">{{item.name}}</view>
							<view class="item-time">{{filter.format_time(item.start_time, 2)}} 开始</view>
							<view class="item-anchor">主播：{{item['anchor_name']}}</view>
						</view>
						<subscribe room-id="{{item.roomid}}" stopPropagation="{{true}}"></subscribe>
					</view>
				</view>
			
			</block>
		</view>
	</block> -->



  <block wx:if="{{ad_data}}">
    <view style="z-index: 1;">
      <swiper class="swiper" circular="true" autoplay="true" indicator-dots="true" interval="2500" style="height:{{max_sw_height}}rpx">
        <block wx:for="{{ad_data}}">

          <navigator url="{{item.ad_weapplink}}" class="s1_gk_a1" wx:if="{{g_filter.has_char(item.ad_weapplink,'plugin')>=0}}">
            <swiper-item>
              <image src="{{item.ad_code}}" style="width: 100%;" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true" />
            </swiper-item>
          </navigator>

          <view data-url="{{item.ad_weapplink}}" class="s1_gk_a1" bindtap="go_url" wx:else>
            <swiper-item>
              <image src="{{item.ad_code}}" style="width: 100%;" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" lazy-load="true" />
            </swiper-item>
          </view>

        </block>
      </swiper>
    </view>


  </block>
  <!-- <block wx:else>
    <image class="xc-top-img" src="{{url}}/miniapp/images/seckill_top_img.jpg"></image>
  </block> -->

  <view style="width: 100%;height: 100rpx;background-color: #eee;border-radius: 25rpx;position: absolute;top: 290rpx;">

  </view>

  <!-- 直播中 -->
  <block wx:if="{{living.pageData.length > 0}}">
    <!-- <view class="title">直播中</view> -->
    <view class="list" style="margin-top: 23rpx;">
      <block wx:for="{{living.pageData}}" wx:key="item">
        <view class="list-item" data-id="{{item.id}}" data-live="ing" style="display: block;margin-top: 23rpx;margin: 20rpx 4%; border-radius: 25rpx;;background-color: white;">
          <view class="list-item-left" catchtap="clickItem" data-id="{{item.id}}"  data-live="{{item.live_status}}">
            <view class="item-btn" catchtap="clickLive" data-roomid="{{item.roomid}}" wx:if="{{item.live_status==101}}">正在直播</view>
            <view class="item-btnjjkb" catchtap="clickLive" data-roomid="{{item.roomid}}" wx:if="{{item.live_status==102}}">即将开播</view>
            <view class="item-btnhf" catchtap="clickLive" data-roomid="{{item.roomid}}" wx:if="{{item.live_status==103}}">回放</view>
            <view class="item-btnhf" catchtap="clickLive" data-roomid="{{item.roomid}}" wx:if="{{item.live_status==107}}">已失效</view>
            <view class="item-btnld" catchtap="clickLive" data-roomid="{{item.roomid}}"></view>
            <view class="item-btnxcx xcx-image" catchtap="clickLive" data-roomid="{{item.roomid}}"></view>
            <view class="item-btnldt" catchtap="clickLive" data-roomid="{{item.roomid}}">
              小程序直播</view>
            <image src="{{item.share_img}}" class="item-pic" mode="aspectFill" style="width: 690rpx;height: 360rpx;"></image>
          </view>

          <view class="list-item-right">
            <view style="display: flex;">
              <view style="display: block;width: 70%;" catchtap="clickItem" data-id="{{item.id}}"  data-live="{{item.live_status}}">
                <view class="item-title">{{item.name}}</view>
                <view class="item-anchor">
                <image src="../../images/bar/user_on.png" mode="" style="width: 25rpx;height: 25rpx;"/>
                
                {{item['anchor_name']}}</view>
              </view>
              <view  wx:if="{{isLogin}}" style="width: 30%;height: 90rpx;align-items: center;justify-items: center;">
                <view bindtap="clickShare" data-sharimg="{{item.share_img}}"  data-id="{{item.id}}" data-shartitle="{{item.name}}"  data-anchorname="{{item['anchor_name']}}"  class="display: flex;" style="width: 70%;border-radius: 25rpx;border: 1rpx solid #fc6247;height: 46rpx;margin-top: 25rpx;margin-left: 30rpx;">
                  <view class="share-image"></view>
                  <view class="fs26" style="color: #fc6247;margin-left: 10rpx;line-height: 46rpx;"> 分享 </view>
                </view>
              </view>
            </view>

          </view>
        </view>
      </block>

      <view style="width: 100%;height: 30rpx;">
        
      </view>
    </view>
  </block>


  <!-- 精彩回放 -->
  <!-- <block wx:if="{{liveOver.pageData.length > 0}}">
		<view class="title">精彩回放</view>
		<view class="list">
			<block wx:for="{{liveOver.pageData}}"  wx:key="item">
				<view class="list-item" bindtap="clickItem" data-id="{{item.id}}"  data-live="over">
					<view class="list-item-left">
						<image src="{{item.share_img}}" class="item-pic" mode="aspectFit"></image>
					</view>
					<view class="list-item-right">
						<view>
							<view class="item-title">{{item.name}}</view>
							<view class="item-time">{{filter.format_time(item.end_time, 2)}} 结束</view>
							<view class="item-anchor">主播：{{item['anchor_name']}}</view>
						</view>
						<view class="item-btn" catchtap="clickLive" data-roomid="{{item.roomid}}">观看回放</view>
					</view>
				</view>
			</block>
		</view>
	</block> -->



  <!-- actionSheet -->
  <view class="{{showActionSheet ? 'share-actionSheet':'share-actionSheet active'}}" hidden="{{showActionSheet}}">
    <view class="share-actionSheet-title">分享</view>
    <view class="share-actionSheet-list">
      <view class="share-actionSheet-item" hover-class="active">
        <button open-type="share">
          <image src="/packageA/images/liveStreamDetails/friend.jpg" class="share-actionSheet-pic"></image>
          <text class="share-actionSheet-desc">发送给朋友</text>
        </button>
      </view>
      <view class="share-actionSheet-item" hover-class="active" bindtap="createPlaybill">
        <image src="/packageA/images/liveStreamDetails/circle.jpg" class="share-actionSheet-pic"></image>
        <text class="share-actionSheet-desc">生成分享海报</text>
      </view>
    </view>
    <view class="share-actionSheet-cancle" bindtap="hiddenActionSheet">取消</view>
  </view>

  <!-- 生成海报 -->
  <view class="{{showPlaybill ? 'playbill':'playbill active'}}" hidden="{{showPlaybill}}">
    <image src="{{canvasToImgPath}}" class="playbill-pic" mode="widthFix" bindtap="closeWin"></image>
    <!-- style="width:{{windowWidth}}px;height:{{windowHeight}}px;" -->
    <view class="playbill-save" bindtap="onSaveToPhone">保存至相册</view>
  </view>

  <!-- <canvas canvas-id="myCanvas" class="" catchtouchmove="true" style="width:{{windowWidth}}px;height:{{windowHeight}}px;"></canvas> -->

  <!-- mask -->
  <!-- 这里mask必须强制放在actionsheet和playbill的后面 -->
  <view class="mask" bindtap="hiddenActionSheet" catchtouchmove="true"></view>


  <nodata nodataContainer="t-c" wx:if="{{livetoBegin.pageData.length == 0 && liveing.pageData.length == 0 && liveOver.pageData.length == 0}}"></nodata>
  <view class="no-more" hidden="{{!noMore}}" wx:if="{{living.pageData.length != 0 && livetoBegin.pageData.length == 0 && liveO.pageData.length == 0}}">- 没有更多了 -</view>
  <view class="no-more" hidden="{{!noMore}}" wx:if="{{living.pageData.length == 0 && livetoBegin.pageData.length != 0 && liveO.pageData.length == 0}}">- 没有更多了 -</view>
  <view class="no-more" hidden="{{!noMore}}" wx:if="{{living.pageData.length == 0 && livetoBegin.pageData.length == 0 && liveO.pageData.length != 0}}">- 没有更多了 -</view>
</view>
<canvas canvas-id="myCanvas" catchtouchmove="true" style="width:480px;height:738px;position:absolute;left:-9999px;"></canvas>