<!--packageD/auction/auction/auction_good/auction_good.wxml-->
<wxs module="util">
  var inOf = function (val) { if (val) { return val.toString().slice(0,1) }};
  module.exports.inOf = inOf;
</wxs>
<view class="goodsdetail">
	<view class="ithumb">
		<swiper indicator-dots="{{true}}" autoplay="{{false}}" circular="{{true}}" indicator-active-color="#007aff">
			<block wx:for="{{auction.thumb_url}}" wx:key="index" wx:for-item="ithumb" wx:for-index="index">
				<swiper-item>
					<image src="{{ithumb}}" mode='widthFix' />
				</swiper-item>
			</block>
			<block wx:if="{{auction.thumb_url.length == 0}}">
				<swiper-item>
					<image src="{{auction.thumb}}" mode='widthFix' />
				</swiper-item>
			</block>
		</swiper>
		<view class="auction_time_end" wx:if="{{now >= auction.end_shooting || isEnd}}">
			<view class="auction_time_left_end">本场拍卖活动已结束</view>
		</view>
		<view class="auction_time" wx:if="{{now<auction.start_shooting && !isEnd}}">
			<view class="auction_time_left">
				<icon class="iconfont icon-fontclass-liulan"></icon>
			距离开拍时间</view>
			<van-count-down use-slot millisecond time="{{ ( auction.start_shooting - now) * 1000 }}" bind:change="onChange" bind:finish="finished">
					<view class="auction_time_right">
						<view class="munbox" style="margin-right:5rpx;" wx:if="{{timeData.days}}" >{{ timeData.days }}</view>
						<view class="muntext" style="margin:0rpx;" wx:if="{{timeData.days}}">天</view>
						<view class="munbox" style="margin-left:5rpx;" wx:if="{{timeData.hours}}">{{timeData.hours}}</view>
						<view class="muntext" wx:if="{{timeData.hours}}" >时</view>
						<view class="munbox" wx:if="{{timeData.minutes}}">{{timeData.minutes}}</view>
						<view class="muntext" wx:if="{{timeData.minutes}}">分</view>
						<view class="munbox" wx:if="{{timeData.seconds}}">{{timeData.seconds}}</view>
						<view class="muntext" wx:if="{{timeData.seconds}}">秒</view>
						<view class="munbox">0{{ util.inOf(timeData.milliseconds)}}</view>
					</view>
				</van-count-down>
		</view>
		<view class="auction_time" wx:if="{{auction.start_shooting<=now && now<auction.end_shooting && !isEnd}}">
			<view class="auction_time_left">
				<icon class="iconfont icon-fontclass-liulan"></icon>
				正在进行
			</view>
				<van-count-down use-slot millisecond time="{{ (auction.end_shooting - now) * 1000 }}" bind:change="onChange" bind:finish="finished_start">
					<view class="auction_time_right">
						<view class="munbox" style="margin-right:5rpx;" wx:if="{{timeData.days}}" >{{ timeData.days }}</view>
						<view class="muntext" style="margin:0rpx;" wx:if="{{timeData.days}}">天</view>
						<view class="munbox" style="margin-left:5rpx;" wx:if="{{timeData.hours}}">{{timeData.hours < 10 ? '0'+timeData.hours : timeData.hours}}</view>
						<view class="muntext" wx:if="{{timeData.hours}}" >时</view>
						<view class="munbox" wx:if="{{timeData.minutes}}">{{timeData.minutes < 10 ? '0'+timeData.minutes : timeData.minutes}}</view>
						<view class="muntext" wx:if="{{timeData.minutes}}">分</view>
						<view class="munbox">{{ timeData.seconds < 10 ? '0'+timeData.seconds : timeData.seconds }}</view>
						<view class="muntext" >秒</view>
						<view class="munbox">0{{ util.inOf(timeData.milliseconds)}}</view>
					</view>
				</van-count-down>
		</view>
	</view>
	<view class="goodsInfo">
		<view class="infoBox">
			<view class="infoBox_fir">
				<view class="infoBox_fir_left">
					<view class="{{now<auction.start_shooting||now>auction.end_shooting?'fir_end':'fir'}}">起拍价</view>
					<view class="fir_price" style="color:{{now<auction.start_shooting||now>auction.end_shooting?'#999999':'#ed0606'}}">
						<view class="{{now<auction.start_shooting||now>auction.end_shooting?'des_end':'des'}}">￥</view>{{auction.start_price}}
					</view>
					<view class="cel_price">原价 ￥{{auction.market_price}}</view>
				</view>
				<view class="infoBox_fir_right">
					<icon class="iconfont icon-life-code" style="font-size: 50rpx;margin-top: 9rpx;color: #999999;padding-right:48rpx;" catchtap="posterimgTap"></icon>
					<view style="position: relative;">
						<icon class="iconfont icon-bc_share_card" style="font-size: 50rpx;margin-top: 9rpx;color: #999999;"></icon>
						<button style="position:absolute;width:100%;height:100%;opacity:0;top: 0;right: 0;" open-type="share"></button>
					</view>

				</view>
			</view>
			<view class="infoBox_two">{{auction.title}}</view>
			<view class="infoBox_thr">
				<view>浏览{{auction.browse_times}}次</view>
				<view>参拍{{auction.participants_num}}人</view>
			</view>
		</view>
	</view>
	<view class="jilu" catchtap="toRecord">
		<view class="goRecord">
			<view class="goRecord_left">拍卖记录
				<view class="co">({{record.length}})</view>
			</view>
			<view class="goRecord_right">
				<van-icon name='arrow' size="36rpx" style="margin-top: 10rpx;"></van-icon>
			</view>
		</view>
		<view class="content">
			<view class="record-list">
				<view class="list" wx:for="{{record}}" wx:key="index">
					<view class="item-top">
						<view class="name">
							<view class="avator" wx:if="{{item.has_one_member}}">
								<image src="{{item.has_one_member.avatar}}"></image>
							</view>
							<view class="nick">
								{{item.has_one_member.nickname}}
							</view>
						</view>
						<view style="color: #f22121;flex:1;text-align: center;" wx:if="{{item.status==1}}">当前最高</view>
						<view style="color: #999999;flex:1;text-align: center;" wx:if="{{item.status==-1}}">出局</view>
						<view style="flex: 0 0 8rem;text-align: center;"><span>{{item.created_at}}</span></view>
					</view>
					<view class="item-bottom">
						<view style="color: #f22121;flex:1;text-align: left;">￥{{item.price}}</view>
						<view style="flex:1;text-align: right;" wx:if="{{item.status==1}}">{{item.number}}次出价</view>
						<view style="flex:1;color: #999999;text-align: right;" wx:if="{{item.status==-1}}">{{item.number}}次出价</view>
					</view>
				</view>
			</view>
		</view>
	</view>

	<view class="infoDetail">
		<view class="detail_list">
			<view class="left">
				<view class="text">起拍价</view>
				<view class="mun">￥{{auction.start_price}}</view>
			</view>
			<view class="right">
				<view class="text">加一口</view>
				<view class="mun">￥{{auction.mini_markup}}</view>
			</view>
		</view>
		<view class="detail_list">
			<view class="left">
				<view class="text">保证金</view>
				<view class="mun">￥{{auction.prepayment}}</view>
			</view>
			<view class="right">
				<view class="text">保留价</view>
				<view class="mun">￥{{auction.mini_deal}}</view>
			</view>
		</view>
		<view class="detail_list">
			<view class="left">
				<view class="text">开拍时间</view>
				<view class="mun" style="font-size:12px;">{{startTime}}</view>
			</view>
			<view class="right">
				<view class="text">结束时间</view>
				<view class="mun" style="font-size:12px;">{{endTime}}</view>
			</view>
		</view>
		<view class="detail_list" wx:if="{{auction.delay_plan.enabled}}" style="padding: 31rpx 24rpx;">
			<view class="text">周期延时时间：{{auction.delay_plan.delay_cycle_minute}}分钟/次</view>
		</view>
		<view class="detail_list">
			<view class="left">
				<view class="text">一口价</view>
				<view class="mun">￥{{auction.fixed_price}}</view>
			</view>
			<view class="right">
				<!-- <view class="text">代言费</view>
        <view class="mun">￥120</view> -->
			</view>
		</view>
	</view>
	<!-- <view class="goRecord ase">
    <view class="goRecord_left">活动</view>
    <view class="goRecord_right">
      <van-icon name='arrow' size="36rpx" style="margin-top: 10rpx;"></van-icon>
    </view>
  </view>
  <view class="goRecord resa">
    <view class="goRecord_left">活动参数</view>
    <view class="goRecord_right">
      <van-icon name='arrow' size="36rpx" style="margin-top: 10rpx;"></van-icon>
    </view>
  </view> -->
	<view class="shopList">
		<view class="shopList_box">
			<view class="nat">
				<view class="img">
					<image src="{{auctioneer.avarat}}"></image>
				</view>
				<view class="shopName">
					<view>{{auctioneer.nick_name || ''}}</view>
					<view class="shopName_bot">
						<icon class="iconfont icon-pm_auction_certification" style="margin-bottom: 10rpx;color:#ff6333;"></icon>
						{{auctioneer.type_status}}
						<view style="margin-left: 20rpx;">拍品:{{auctioneer.lot_num || 0}}</view>
					</view>
				</view>
			</view>
			<view class="ant">
				<view class="shouc" wx:if="{{auctioneer.is_collection == 0 && auctioneer.type == 1}}" catchtap="toCollect">收藏</view>
				<view class="shouc" wx:if="{{auctioneer.is_collection == 1 && auctioneer.type == 1}}" catchtap="toCollect">已收藏</view>
				<view class="tapIn" wx:if="{{auctioneer.auctioneer_id}}" catchtap="gomyshop">进店逛逛</view>
			</view>
		</view>
	</view>
	<view class="particulars" style="padding:24rpx 0;">
		<view class="particulars_titile">拍品描述</view>
		<view class="particulars_contens">{{auction.describe || '暂无描述'}}</view>
	</view>
	<view class="particulars">
		<view class="particulars_titile">拍卖详情</view>
		<view class="particulars_contens" wx:if="{{auction.content}}">
			<rich-text nodes="{{auction.content}}"></rich-text>
		</view>
		<view class="particulars_contens" wx:else>
			<view>暂无详情</view>
		</view>
	</view>
</view>


<view class="bottom_btn">
	<view class="mybtn ismybtn" catchtap="goMybtn">
		<icon class="iconfont icon-home-line6"></icon>
		<view>我的</view>
	</view>
	<view class="mybtn" catchtap="gomyshop" wx:if="{{auctioneer.auctioneer_id}}">
		<icon class="iconfont icon-dianpu"></icon>
		<view>店铺</view>
	</view>
	<view class="is_come runs" wx:if="{{auction.start_shooting<=now && now<auction.end_shooting && !isEnd}}" catchtap="bid">
		<view>立即出价</view>
		<view wx:if="{{auction.is_prepay==0}}">￥({{auction.prepayment}})</view>
	</view>
	<view class="is_come_end runs" wx:if="{{now<auction.start_shooting || now>auction.end_shooting || isEnd}}">
		<view>立即出价</view>
	</view>
	<view wx:if="{{auction.start_shooting<=now&&now<auction.end_shooting&& !isEnd}}" class='is_come_one' catchtap="toBuy">一口价</view>
	<view wx:if="{{now<auction.start_shooting || now>auction.end_shooting || isEnd}}" class='is_come_one' style="background-color: #999999!important;">
		一口价
	</view>

</view>
<!-- 店铺密码弹窗 -->
<van-popup show='{{showone}}' bind:click-overlay="isCoverLayer_passwork" position="bottom" class="one">
	<view class="showbtn">
		<view class="showbtn_txt">请输入店铺密码</view>
		<view class="showbtn_mima">密码</view>
		<input type="text" placeholder="请输入密码" bindinput="is_password"></input>
		<view class="is_sure" catchtap="confirm">确认</view>
	</view>
</van-popup>
<!-- 保证金弹窗 -->
<van-popup show='{{showtwo}}' bind:click-overlay="isCoverLayer" class="two">
	<view class="showtwo_btn">
		<view class="title">商家设置了出价保护，本次出价需缴纳保证金，如违约，保证金将扣除并赔偿给卖家 。</view>
		<view class="btn_bottom">
			<view catchtap="celquxiao">取消</view>
			<view catchtap="gotoPay">去支付</view>
		</view>
	</view>
</van-popup>
<!-- 出价弹窗 -->
<van-popup show='{{showthr}}' bind:click-overlay="isCoverLayer" position="bottom" class="one">
	<view class="showthr_btn">
		<view class="showthr_top">当前价格：￥{{auction.now_price}}</view>
		<view class="showthr_price">
			<view class="showthr_del" catchtap="showthr_del" data-ind="1">-</view>
			<!-- <view> -->
			<input class="showthr_inp" value="{{price}}" bindinput="isprice" disabled="{{true}}"></input>
			<!-- </view> -->
			<view class="showthr_add" catchtap="showthr_add">+</view>
		</view>
		<view class="showthr_txt">您将出价{{price}}元</view>
		<view class="showthr_cjbtn" catchtap="bidTo">出价</view>
	</view>
</van-popup>
<!-- 绑定手机弹窗 -->
<van-popup show='{{showphone}}' bind:click-overlay="isCoverLayer" class="two">
	<view class="showtwo_btns">
		<view class="title" style="text-align: center;">参加拍卖需绑定手机</view>
		<view class="btn_bottom">
			<view catchtap="celquxiao">取消</view>
			<view catchtap="gotoPay">去绑定</view>
		</view>
	</view>
</van-popup>
<!-- 海报 -->
<van-popup show="{{posterShow}}" bind:close="posterClose">
	<view class="code_box">
		<image wx:if="{{posterImg}}" catchtap='saveImg' src="{{'data:'+posterImg.mime+';base64,'+posterImg.base64Image}}" mode='widthFix' />
		<image wx:if="{{!posterImg}}" src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/img_default.png" mode='widthFix' />
		<!-- 关闭图标 -->
		<view class="icon_close" catchtap="posterClose">
			<icon class="iconfont icon-close11"></icon>
		</view>
	</view>
</van-popup>
<!-- 支付弹窗 -->
<van-popup show="{{rewardPayshow}}" bind:close="posterClose_reward" position="bottom">
	<view class="reward">
		<view class="rewardLine" wx:for="{{btnData}}" wx:key="index" data-value="{{item.value}}" data-btn="{{item}}" catchtap="payBtn">
			{{item.name}}
		</view>
		<view style="width:100%;height:20rpx;background:#f2f2f2;"></view>
		<view class="rewardLine" catchtap="posterClose_reward">
			取消
		</view>
	</view>
</van-popup>

<view id="hoid" catchtap="goto">
	<view id="back">
		<van-icon name='arrow-left'></van-icon>
	</view>
</view>
<view id="cart" catchtap="gotoCart">
	<view id="back">
		<icon class="iconfont icon-ai-home"></icon>
	</view>
</view>
<view id="member" catchtap="gotoCart">
	<view id="back">
		<icon class="iconfont icon-wode-wode"></icon>
	</view>
</view>
