<wxs module="filter" src="../../../utils/filter.wxs"></wxs>

<view class="main">
	<view class="bg-white pdh20 bdr12">
		<block wx:for="{{details.list}}">
			<!-- 门店名称栏 -->
			<view class="flex jc_sb ai_c pdv20">
				<view class="ellipsis-1 pdr40 fs30"><text class="iconfont icon-shop c-red pdr10"></text>{{item.pickup_name}}</view>
				<!-- 订单状态 -->
				<block>
					<text class="c-red shrink0 fs26" wx:if="{{details.order_status<2 && details.pay_status==0 }}">
						<block wx:if="{{details.prom_type==6}}">
							<block wx:if="{{details.pt_status==0}}" >未支付</block>
							<block wx:if="{{details.pt_status==1}}" >组团中</block>
							<block wx:if="{{details.pt_status==2 && details.pt_tail_money>0}}">待支付尾款</block>
						</block>
						<block wx:else>
							待支付
						</block>
					</text>
					<text class="c-red shrink0 fs26" wx:if="{{details.order_status == 1 && details.pay_status==1}}">待评价</text>
					<text class="c-red shrink0 fs26" wx:if="{{details.order_status == 2}}">已评价</text>
					<text class="c-red shrink0 fs26" wx:if="{{details.order_status == 3}}">已取消</text>
					<text class="c-red shrink0 fs26" wx:if="{{details.order_status == 5}}">已作废</text>
				</block>
			</view>
			
			<!-- 列表栏 -->
			<view>
				<!-- <view class="flex pdv20" wx:for="{{details.list}}" bindtap="viewDetails" data-gid="{{item.card_id}}"> -->
				<view class="flex pdv20" bindtap="viewDetails" data-gid="{{item.card_id}}">
					<view class="pic-box shrink0">
						<image class="img-block" src="{{imghost + item.img_url}}" binderror="bind_bnerr" lazy-load="{{true}}" data-errorimg="details.list[{{index}}].img_url"></image>
					</view>
					<view class="pdl20 f1">
						<view class="flex jc_sb ai_c">
							<view class="title ellipsis-2 pdr40">{{item.service_name}}</view>
							<text class="rmb c-6">{{item.price}}</text>
						</view>
						<view class="flex jc_sb ai_c c-9 fs24">
							<!-- <text>10个/蓝色</text> -->
							<text>x{{item.qty}}</text>
						</view>
					</view>
				</view>
			</view>
		</block>
		
		
		<!-- 统计栏 -->
		<view class="t-r bdt pdv20">
			共{{filter.count(details.list)}}件商品，合计：<text class="rmb c-red bold fs30">{{filter.toFix(details.account+details.pt_tail_money,2) }}</text>
		</view>
	</view>
	
	
	<view class="bg-white pdh20 mgt20 bdr12">
		<!-- 订单信息栏 -->
		<view class="pdv20">订单信息</view>
		
		<view class="flex jc_sb pdb20 ai_c">
			<view><text class="c-9">订单编号：</text>{{details.order_sn}}</view>
			<text class="btn-copy" bindtap="copy">复制</text>
		</view>
		<view class="pdb20"><text class="c-9">下单时间：</text>{{filter.format_time(details.ctime, 1)}}</view>
		
		<!-- 联系客服栏 -->
		<view class="flex t-c bdt">
			<!-- 客服 -->
			<block>
				<button class="f1" wx:if="{{sys_switch.weapp_customertype == 1}}" hover-class="none" open-type="contact" bindtap="click_contact"
			 session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"><text class="iconfont icon-kefu c29f pdr10 fs36"></text>联系客服</button>
				<view class="f1 pd20" wx:elif="{{sys_switch.weapp_customertype== 2}}" bindtap="contact_wx"><text class="iconfont icon-kefu c29f pdr10 fs36"></text>联系客服</view>
				<view class="f1 pd20" wx:else bindtap="contactService"><text class="iconfont icon-kefu c29f pdr10 fs36"></text>联系客服</view>
			</block>
			<!-- 卡项同步先不做 -->
			<!-- <view class="f1 pd20 separator"><text class="iconfont icon-tongbu c-orange pdr20"></text>卡项同步</view> -->
		</view>
	</view>
	
	<!-- 底部按钮栏 -->
	<view class="btn-bar t-r bg-white pd20" hidden="{{details.pt_status == 1 && details.order_status<2 }}">
		<!-- 待支付 -->
		<block wx:if="{{details.pay_status == 0 && details.order_status==0 && details.prom_type!=6  }}">
			<text class="btn btn-border" bindtap="cancle">取消订单</text>
			<text class="btn bg-red white mgl20" bindtap="pay">
				<block wx:if="{{is_summit_ing}}">支付中</block>
				<block wx:else>立即支付</block>
			</text>
		</block>

		<block wx:if="{{details.pt_status == 0 && details.order_status<2 && details.prom_type==6  }}">
			<text class="btn btn-border" bindtap="cancle">取消订单</text>
			<text class="btn bg-red white mgl20" bindtap="pay">
				<block wx:if="{{is_summit_ing}}">支付中</block>
				<block wx:else>立即支付</block>
			</text>
		</block>

		<block wx:if="{{details.pt_status == 2 && details.order_status<2 && details.prom_type==6 && details.pt_tail_money>0 }}">
			<text class="btn bg-red white mgl20" bindtap="pay2">支付尾款</text>
		</block>

		<!-- 已支付/未评价 -->
		<block wx:if="{{details.order_status == 1 && details.pay_status == 1 }}">
			<text class="btn bg-orange white" bindtap="buy2">再来一单</text>
			<text class="btn bg-red white mgl20" bindtap="access">立即评价</text>
		</block>
		<!-- 已评价 -->
		<block wx:if="{{details.order_status == 2}}">
			<text class="btn bg-orange white" bindtap="buy2">再来一单</text>
			<text class="btn bg-red white mgl20" bindtap="viewComment">查看评价</text>
		</block>
	</view>
</view>
