<!--pages/live/live.wxml-->
<!-- 引入wxs -->
<wxs module="filters" src="./live.wxs"></wxs>
<!-- 控制介绍 -->
<view wx:if="{{auction}}" class="auction">
  {{contentText}}
</view>
<!-- 视频 -->
<view wx:if="{{!auction}}">
<live-player id="liveplay" style="height:{{pageHeight}}px" src="{{liveUrl}}" mode="live" autoplay="true" orientation="vertical" object-fit="fillCrop" bindstatechange="getLiveState" bindnetstatus="getNetworkState"> 
  <!-- 遮罩 --> 
   <cover-view class="cover" animation="{{animationData}}"> 
    <!-- 商品列表 -->
    <cover-view class="goods-detail" style="width:{{pageWidth}}px">
      <cover-view class="goods-detail-content">
        <cover-view wx:for="{{listData}}" wx:key="{{item.kid}}">
        <cover-view class="goods-list" bindtap="selectGood" data-kid="{{item.kid}}" data-ind="{{index}}" data-price="{{item.price_bidder}}">
          <cover-image class="goods-img" src="{{prodUrl}}web-cp-all/img_pm/img/{{item.bid_file_id}}" mode=""></cover-image>
          <cover-view class="content">
            <cover-view class="title" style="{{item.bid_opening === '已开拍'?'color:#fb752c;font-weight:600':''}}">
              <cover-view class="goods-status" style="{{index === selectIndex ? 'color:#fb752c' : 'color:#999'}}">{{item.item_name}}</cover-view>
               <cover-view class="goods-status_right" wx:if="{{item.bid_opening === '未开拍'}}" style="text-align:right;font-size:12px;color:#999">即将开始</cover-view>
              <cover-view class="goods-status_right" wx:if="{{item.bid_opening === '已开拍'}}" style="text-align:right;font-size:12px;color:#999">正在竞卖</cover-view>
              <cover-view class="goods-status_right" wx:if="{{item.bid_opening === '已结束'}}" style="text-align:right;font-size:12px;color:#999">已成交</cover-view>
            </cover-view>
            <cover-view class="goods-info">
              <cover-view class="price">
                <cover-view style="padding-top:14rpx;" wx:if="{{item.bid_opening === '未开拍'}}">起始价：</cover-view>
                <cover-view style="padding-top:14rpx;" wx:elif="{{item.bid_opening === '已开拍'}}">当前价：</cover-view>
                <cover-view style="padding-top:14rpx;" wx:elif="{{item.bid_opening === '已结束'}}">成交价：</cover-view>
                <cover-view style="color:#e22;font-size:40rpx;margin:0" wx:if="{{item.bid_opening === '未开拍'}}">{{item.price_start}}元</cover-view>
                <cover-view style="color:#e22;font-size:40rpx;margin:0" wx:elif="{{item.bid_opening === '已开拍'}}">{{item.price_bidder == '0'? '等待出价':item.price_bidder + '元'}}</cover-view>
                <cover-view style="color:#e22;font-size:40rpx;margin:0" wx:if="{{item.bid_opening === '已结束'}}">{{item.price_end}}元</cover-view>
              </cover-view>
              <cover-view class="goods-status" >
                <cover-image src="../../images/zhankan.png" id="zhankan_img" bindtap="opDetail" data-ind="{{index}}" wx:if="{{!item.bool}}" ></cover-image>
              </cover-view>
            </cover-view>
          </cover-view>
        </cover-view>
         <cover-view class="product" wx:if="{{item.bool}}">
            <cover-view class="content_bid">{{item.bid_content}}</cover-view>
            <cover-image src="../../images/shouqi.png" id="shouqi_img" bindtap="closeDetail" data-ind="{{index}}"></cover-image>
          </cover-view>
         </cover-view> 
         <cover-view  class="load" bindtap="loadMore">{{textTitle}}</cover-view>
      </cover-view>
      <cover-view class="goods-detail-btn" bindtap='openDetail'>
        <cover-view>{{detailOpen?'关':'打'}}</cover-view>
        <cover-view>{{detailOpen?'闭':'开'}}</cover-view>
        <cover-view>商</cover-view>
        <cover-view>品</cover-view>
        <cover-view>详</cover-view>
        <cover-view>请</cover-view>
      </cover-view>
    </cover-view> 
    <!-- 出价 -->
     <cover-view class="goods-bidding" style="width:{{pageWidth}}px">
      <cover-view class="goods-bidding-btn" bindtap='openBidding'>
        <cover-view>我</cover-view>
        <cover-view>要</cover-view>
        <cover-view>出</cover-view>
        <cover-view>价</cover-view>
      </cover-view>
      <cover-view class="goods-bidding-content">
        <cover-view class="goods-bidding-price">
          <cover-view class="goods-bidding-title">
            <cover-view>{{openData.item_name}}</cover-view>
          </cover-view>
          <cover-view class="goods-bidding-info">
            <cover-view wx:if="{{openData.bid_opening === '已开拍' && openData.price_bidder == '0'}}">当前无人出价</cover-view>
            <cover-view wx:elif="{{openData.bid_opening === '已开拍' && openData.price_bidder > '0'}}">当前最高报价：￥</cover-view>
            <cover-view wx:elif="{{openData.bid_opening === '已结束'}}">成交价：￥</cover-view>
            <cover-view wx:elif="{{openData.bid_opening === '未开拍'}}">竞买未开始</cover-view>
            <cover-view style="color:#e22;font-size:45rpx;margin:0;" wx:if="{{openData.price_bidder != '0'}}">{{openData.price_bidder}}</cover-view>
            <cover-view wx:if="{{openData.price_bidder != '0'}}">元 </cover-view>
            <cover-view style="color:#e22;float:right;font-size:45rpx;margin:0">{{record[0].code}}</cover-view>
            <cover-view  style="float:right" wx:if="{{record[0].code}}">竞买号 : </cover-view>
          </cover-view>
          <cover-view class="goods-bidding-extra">
            <cover-view class="goods-bidding-enter">{{apply}}人报名</cover-view>
            <cover-view class="liens"></cover-view>
            <cover-view class="goods-bidding-watch">{{21 + onlineCount}}人围观拍卖会</cover-view>
            <!-- <cover-view class="goods-bidding-watch">{{}}人报名参与</cover-view> -->
            <cover-view class="goods-bidding-serial">我的竞买号：{{code}}</cover-view>
          </cover-view>
        </cover-view>
        <cover-view class="goods-parameter">
          <cover-view class="goods-parameter-title">
            <cover-view>
              <!-- <cover-image src=""></cover-image>--> 商品参数</cover-view> 
          </cover-view>
          <cover-view class="goods-parameter-content" style="overflow-y:scroll;">
            <cover-view class="goods-parameter-left">
              <cover-view class="goods-parameter-left-list">
                <cover-view>起始价：</cover-view>
                <cover-view>￥{{openData.price_start}}元</cover-view>
              </cover-view>
              <cover-view class="goods-parameter-left-list">
                <cover-view>加价幅度：</cover-view>
                <cover-view>￥{{openData.price_add}}元</cover-view>
              </cover-view>
              <cover-view class="goods-parameter-left-list">
                <cover-view>保证金：</cover-view>
                <cover-view>￥{{openData.price_guarantee}}元</cover-view>
              </cover-view>
              <!-- <cover-view class="goods-parameter-left-list" style="width:100%">
                <cover-view class="product">产品介绍 : {{contentText}}</cover-view>
              </cover-view> -->
            </cover-view>
          </cover-view>
        </cover-view>
        <cover-view class="bid-record">
          <cover-view class="bid-record-title">
            <cover-view>出价记录</cover-view>
          </cover-view>
          <cover-view class="bid-record-content">
            <cover-view class="bid-record-list" wx:if="{{!record}}">
              <cover-view style="width:100%;line-height:100rpx;">暂无出价记录</cover-view>
            </cover-view>
            <cover-view class="bid-record-list" wx:for="{{record}}" wx:key="{{item.kid}}">
              <cover-view class="list-serial">竞买号：{{item.code}}</cover-view>
              <cover-view class="list-state">{{index === 0 ? '领先':'淘汰'}}</cover-view>
              <cover-view class="list-date">{{item.created}}</cover-view>
              <cover-view class="list-price">￥{{item.price_bidder}}</cover-view>
            </cover-view>
          </cover-view>
        </cover-view>
        <cover-view class="notice">
          <cover-view class="notice-title">
            <cover-view>竞卖须知</cover-view>
          </cover-view>
          <cover-view class="notice-content">
            <cover-view class="title-h1">一、保证金的缴纳：</cover-view>
            <cover-view>保证金是竞买人参加竞买的凭证，如用户有意参加相关商品竞买活动，则须缴纳卖家设置的参与竞买活动的保证金。</cover-view>
            <cover-view class="title-h2">缴纳次数：</cover-view>
            <cover-view>如参加升价竞买，每次拍卖会竞买人只需要缴纳一次保证金；</cover-view>
            <cover-view>如参加降价竞买，每出价一次都需要缴纳一次保证金，并且每次出价只可以竞买一件商品。</cover-view>
            <cover-view class="title-h1">二、保证金的返还：</cover-view>
            <cover-view class="title-h2">在符合以下条件时将原路退还用户保证金：</cover-view>
            <cover-view>1.用户未成功竞买商品：例如在竞买过程中始终未出价、在竞买过程中放弃加价等情况；</cover-view>
            <cover-view>2.用户竞买成功后，商家主动关闭交易或未履约发货或因商家其他原因导致交易未完成的；</cover-view>
            <cover-view>竞买结束后，系统会自动在1-15个工作日内将款项内退还到支付账号中，如您缴纳的竞买保证金符合退还条件，但是系统未予退还，您可以联系云买卖客服400-609-9105，我们会尽快帮您处理。</cover-view>
            <cover-view class="title-h1">三、保证金的扣除：</cover-view>
            <cover-view>1.在升价竞买成功之时起的72小时内未照成交价格支付商品货款的；在降价竞买成功之时起的24小时内未按照成交价格支付商品货款的。</cover-view>
            <cover-view>2.在竞买成功且付款后，竞买人申请退款（卖家提供7天无理由退货服务的除外）。</cover-view>
            <cover-view>如因卖家原因导致竞买人不付款，竞买人可在交易关闭的15天内联系云买卖客服400-609-9105，逾期保证金申诉不给予受理。</cover-view>
          </cover-view>
        </cover-view>
        <cover-view class="bidding">
          <cover-view class="deposit" bindtap='subDeposit' wx:if="{{!payDeposit}}" style="z-index:999">
            交保证金报名
          </cover-view>
          <cover-view class="bidding-control" wx:elif="{{payDeposit && openData.bid_opening === '未开拍'}}">
            <cover-view class="bidding-input" style="">您已报名，请等待开始</cover-view>
          </cover-view>
          <cover-view class="bidding-control" wx:elif="{{payDeposit && openData.bid_opening === '已开拍'}}" style="padding:10rpx;">
            <cover-view class="bidding-control-input">
              <cover-view class="reduce" bindtap='reducePrice'>-</cover-view>
              <cover-view class="input-box">{{filters.toFix( new_bidder) }}</cover-view>
              <cover-view class="rise" bindtap='reduceIncrease'>+</cover-view>
            </cover-view>
            <cover-view class="submit">
              <button bindtap='bid'>出价</button>
            </cover-view>
          </cover-view>
          <cover-view class="bidding-control-end" wx:elif="{{openData.bid_opening === '已结束'}}">
            <cover-view class="bidding-input" style="background:#ccc;width:100%;color:#000;text-align: center;line-height:100rpx;">竞买已结束</cover-view>
          </cover-view>
        </cover-view>
      </cover-view>
    </cover-view> 
    <!-- 分享 -->
     <!-- <cover-view class="rotate-camera">
      <cover-view class="btn-box">
        <button open-type="share" class='btn' bindtap='btn'></button>
      </cover-view>
      <cover-image src="./images/share.png"></cover-image>
    </cover-view>  -->
    <!-- 聊天框 -->
      <cover-view class="chat-box" style="width:{{pageWidth}}px;margin-left:-{{pageWidth/2}}px;" scroll-top="{{scrollTop}}" wx:if="{{chatBool}}">
        <cover-view class="chat-ul" scroll-top="{{scrollTop}}">
          <cover-view class="chat-list" wx:for="{{chatList}}" wx:key="{{index}}">
            <cover-image class="userhade" src="{{item.avatarUrl}}"></cover-image>
            <cover-view class="chat-content">{{item.content}}</cover-view>
          </cover-view>
        </cover-view>
      </cover-view>
       <cover-view class="detection" wx:if="{{notPlay}}">
        <cover-image src="https://www.eqbidding.com/web-cp-all/img_pm/img/1248459664857894912"></cover-image>
        
    </cover-view>
  </cover-view> 
  <!-- 倒计时 -->
  <cover-view class="end-time" wx:if="{{endTimeShow}}">
    <cover-view class="num">
      {{endTimeText}}
    </cover-view>
    <cover-view class="text">
      秒后结束竞买
    </cover-view>
   
  </cover-view>
  <!-- 检测拍卖状态 -->
    
</live-player> 
<!-- 发送聊天框 -->
<view class="chat">
  <input placeholder="说点什么吧~" bindinput="chatText" value="{{chatText}}"></input>
  <button bindtap='send'>发送</button>
  <!-- <button open-type="share" class='btn' bindtap='btn'>
    <image src="../../images/share.png"></image>
  </button> -->
</view>
<cover-image wx:if="{{isshare}}" bindtap='backHome' class='d-back-home' src='http://p8e12hdcc.bkt.clouddn.com/icon-Return%20to%20the%20home%20page.png' lazy-load></cover-image>
<!-- 聊天 -->
<!-- <scroll-view  class="chatbox" scroll-y="true" scroll-top="{{scrollTop}}" wx:if="{{chatBool}}">
    <view class="scro"  wx:for="{{chatList}}" wx:key="{{index}}" >
      <view class=" talk" id="chat">
        <image src="{{item.avatarUrl}}" class="user_img"></image>
        <text class="user">{{item.content ?  item.content : ""}}</text>
      </view>
    </view>
</scroll-view> -->
</view>
<view class="mask" wx:if="{{mask}}">
  <view>
    <image src='images/win.png'></image>
    <button bindtap='gopay' class="pay">立即付款</button>
    <button bindtap='closePay' class="close">关闭</button>
  </view>
</view>
