<view class='page'>
	<include src='/components/common/common'></include>
	<include src='/components/header/header'></include>
	<block wx:if='{{isPageShow}}'>
		<view class='body after-navber'>
			<view style='overflow-x: hidden'>
				<view class='status-bar'>
					<image mode='aspectFill' src='{{__wxapp_img.store.order_status_bar.url}}'></image><text>{{order.status}}</text>
				</view>
				<block wx:if='{{ (order.express_no && order.is_send == 1) }}'>
					<navigator class='block flex-row' url='/pages/express-detail/express-detail?id={{order.order_id}}&order_type={{order.order_type}}'>
						<view class='flex-grow-1'>
							<view class='mb-10'>快递公司：{{order.express}}</view>
							<view class=''>快递单号：{{order.express_no}}</view>
						</view>
						<view class='flex-grow-0 flex-y-center'>
							<image src='{{__wxapp_img.store.jiantou_r.url}}' style='width: 12rpx;height: 22rpx'></image>
						</view>
						<block wx:if='{{false}}'>
							<view class='block-row flex-row'>
								<view class='flex-grow-1'>快递单号：{{order.express_no}}</view>
								<view class='flex-grow-0'><text bindtap='copyText' class='copy-text-btn' data-text='{{order.express_no}}'>复制</text></view>
							</view>
						</block>
					</navigator>
				</block>

				<block wx:if="{{order.is_virtual == 0 ? true:false}}">
					<view class='block'>
						<view class='flex-row block-row'>
							<view class='flex-grow-1'> {{(order.is_offline == 0?"联系人：":"收货人：")}}{{order.name}} </view>
							<view class='flex-grow-0'> {{order.mobile}} </view>
						</view>
						<block wx:if='{{order.address}}'>
							<view>收货地址：{{order.address}}</view>
						</block>
					</view>
				</block>

				<block wx:if='{{order.is_offline == 1}}'>
					<view class='block flex-row'>
						<view class='flex-grow-1'>
							<view class='flex-grow-1'>门店名称：{{order.shop.name}}</view>
							<view class='flex-grow-1'>联系电话：{{order.shop.mobile}}</view>
							<view class='flex-grow-1'>门店地址：{{order.shop.address}}</view>
						</view>
						<block wx:if='{{order.shop.longitude}}'>
							<view class='flex-grow-0 flex-y-center'><text bindtap='location' class='copy-text-btn'>导航</text></view>
						</block>
					</view>
				</block>


				<view class='block'>
					<view class='block-row flex-row'>
						<view class='flex-grow-1'>订单编号：{{order.order_no}}</view>
						<view class='flex-grow-0'><text bindtap='copyText' class='copy-text-btn' data-text='{{order.order_no}}'>复制</text></view>
					</view>
					<view>下单时间：{{order.addtime}}</view>
					<view class='pay-type'>{{order.pay_type_text}}</view>
				</view>
				<view class='block'>
					<view class='flex-row block-row'>
						<view class='flex-grow-1'>商品总额</view>
						<block wx:if='{{order}}'>
							<view class='flex-grow-0'>￥{{order.goods_total_price}}</view>
						</block>
						<block wx:else>
							<view class='flex-grow-0'>￥0.00</view>
						</block>
					</view>
					<view class='flex-row block-row'>
						<view class='flex-grow-1'>商品数量</view>
						<view class='flex-grow-0'>×{{order.num}}</view>
					</view>
					<block wx:if='{{user_coupon_id}}'>
						<view class='flex-row block-row'>
							<view class='flex-grow-1'>优惠券优惠</view>
							<view class='flex-grow-0'>-￥{{order.coupon_sub_price}}</view>
						</view>
					</block>
					<block wx:if='{{ (order.integral && order.integral.forehead > 0) }}'>
						<view class='flex-row block-row'>
							<view class='flex-grow-1'>积分抵扣</view>
							<view class='flex-grow-0'>-￥{{order.integral.forehead}}</view>
						</view>
					</block>
					<block wx:if='{{ (order.discount < 10 && order.discount) }}'>
						<view class='flex-row block-row'>
							<view class='flex-grow-1'>会员折扣</view>
							<view class='flex-grow-0'>{{order.discount}}折</view>
						</view>
					</block>
					<block wx:if='{{order.before_update}}'>
						<view class='flex-row block-row'>
							<view class='flex-grow-1'>{{order.before_update}}</view>
							<view class='flex-grow-0'>￥{{order.money}}</view>
						</view>
					</block>
					<block wx:if='{{order.colonel}}'>
						<view class='flex-row block-row'>
							<view class='flex-grow-1'>团长优惠</view>
							<view class='flex-grow-0'>￥{{order.colonel}}</view>
						</view>
					</block>
					<view class='flex-row block-row'>
						<view class='flex-grow-1'>运费</view>
						<view class='flex-grow-0'>￥{{order.express_price}}</view>
					</view>
					<block wx:if='{{order.content}}'>
						<view>
							<view>买家留言</view>
							<view style='width:100%;overflow:auto;word-wrap:break-word;'>{{order.content}}</view>
						</view>
					</block>
					<block wx:if='{{order.words}}'>
						<view>
							<view>商家留言</view>
							<view class='fs-sm' style='width:100%;overflow:auto;word-wrap:break-word;'>{{order.words}}</view>
						</view>
					</block>
					<view class='block-footer'>合计： <text style='color: #ff4544'>￥{{order.pay_price}}</text></view>
				</view>

				<block wx:if="{{order.car_appoint}}">
					<view class='block'>
						<view class='block-row flex-row'>
							<view class='flex-grow-1'>预约人：{{order.car_appoint.name}}</view>
						</view>
						<view class='block-row flex-row'>
							<view class='flex-grow-1'>电话：{{order.car_appoint.phone}}</view>
						</view>
						<view class='block-row flex-row'>
							<view class='flex-grow-1'>车牌号：{{order.car_appoint.license_number}}</view>
						</view>
						<view class='block-row flex-row'>
							<view class='flex-grow-1'>车辆型号：{{order.car_appoint.car_model}}</view>
						</view>
						<view class='block-row flex-row'>
							<view class='flex-grow-1'>预约时间：{{order.car_appoint.appoint_time}}</view>
						</view>
						<view class='block-row flex-row'>
							<view class='flex-grow-1'>预约日期：{{order.car_appoint.appoint_date}}</view>
						</view>
						<view class="pay-type"></view>
					</view>
					</block>

				<block wx:if="{{order.is_virtual == 1 ? true:false}}">
					<view class='block'>
						<block wx:for="{{order.goods_list}}" wx:item="item" wx:index="index" wx:key="{{item.id}}">
							<view class='block-row flex-row'>
								<block wx:for='{{item.attr}}' wx:for-item='attr' wx:for-index='index' wx:key='{{attr.id}}'>
									<view class='flex-grow-1'>
										<text class="font-w">规格：</text> 
										{{attr.attr_group_name}}：{{attr.attr_name}}
									</view>
								</block>
							</view>
							
							<block wx:for="{{item.virtual_data}}" wx:for-item="virtual_data" wx:for-index="virtual_index" wx:key="index">
								<block wx:if="{{(virtual_data.virtual_name || virtual_data.virtual_time_limit_text) == '' ? false:true}}">
									<view class='block-row flex-row'>
										<view class='flex-grow-1'>
											<text class="font-w">{{virtual_data.virtual_name != '' ? virtual_data.virtual_name:'暂无卷码名称'}}</text> 
										</view>
										<view class='flex-grow-0'>
											<text>{{virtual_data.virtual_time_limit_text != '' ? virtual_data.virtual_time_limit_text:'暂无有效期'}}</text>
										</view>
									</view>
								</block>

								<block wx:if="{{virtual_data.virtual_code == ''? false:true}}">
									<view class='block-row flex-row'>
											<view class='flex-grow-1'>
												<text class="font-w">券码：</text> 
													{{virtual_data.virtual_code != ''? virtual_data.virtual_code:'暂无卷码数据'}}
											</view>
									</view>	
								</block>

								<block >
									<view class='block-row flex-row'>
										<view class='flex-grow-1 flex-y-center'>
											<text class="font-w">二维码</text> 
										</view>
										<view class='flex-grow-0'>
											<!-- <text bindtap='viewImg' class='copy-text-btn' data-qrUrl='{{virtual_data.virtual_code_qr}}'>查看</text> -->
											<!-- <block wx:if='{{ ( ( ( (order.is_pay == 1 || order.pay_type == 2)  && (order.is_offline == 1 || order.is_offline == 0))  && order.is_confirm == 0)  && order.apply_delete == 0) && order.is_virtual == 1 }}'> -->
												<view class='flex-row' wx:if="{{virtual_data.is_check == 0}}">
													<view class='flex-grow-1 flex-y-center'></view>
													<view class='flex-grow-0'>
														<view bindtap='orderQrcode' class='order-option-btn clerk flex-y-center' data-goodlist-id="{{index}}" data-index='{{virtual_index}}'>
															<image data-goodlist-id="{{index}}" data-index='{{virtual_index}}' src='{{__wxapp_img.store.clerk.url}}' style='width:26rpx;height:26rpx;margin-right:10rpx'></image>
															核销码
														</view>
													</view>
												</view>
												<view class='flex-row' wx:else>
													<view class='flex-grow-1 flex-y-center'></view>
													<view class='flex-grow-0'>已核销</view>
												</view>
											<!-- </block> -->
										</view>
									</view>	
								</block>
								
								<block wx:if="{{virtual_data.virtual_remark == ''? false:true}}">
									<view class='block-row'>
										<view class='flex-grow-1'>
											<text class="font-w">使用说明：</text>
										</view>
										<view class="indent-title">
											{{virtual_data.virtual_remark}}
										</view>
									</view>	
								</block>
							</block>

							<view class='pay-type'></view>	
						</block>
					</view>
				</block>

				<view class='block'>
					<block wx:for='{{order.goods_list}}' wx:for-item='item' wx:for-index='index' wx:key='{{item.id}}'>
						<view class='flex-row goods-item'>
							<view class='flex-grow-0'>
								<navigator style='font-size: 0' url='/pages/goods/goods?id={{item.goods_id}}'>
									<image mode='aspectFill' src='{{item.goods_pic}}' style='width: 156rpx;height: 156rpx'></image>
								</navigator>
							</view>
							<view class='flex-grow-1' style='padding-left: 20rpx'>
								<view style='margin-bottom: 10rpx'>
									<navigator url='/pages/goods/goods?id={{item.goods_id}}'>{{item.name}}</navigator>
								</view>
								<view class='flex-row'>
									<view class='flex-grow-1'>
										<block wx:for='{{item.attr}}' wx:for-item='attr' wx:for-index='index' wx:key='{{attr.id}}'>
											<view style='font-size: 9pt;color: #888;margin-right: 20rpx;display: inline-block'> {{attr.attr_group_name}}：{{attr.attr_name}} </view>
										</block>
									</view>
									<view class='flex-grow-0' style='text-align: right'>
										<view>×{{item.num}}</view>
										<view style='color: #ff4544'>￥：{{item.total_price}}</view>
									</view>
								</view>
								<block wx:if='{{ (item.is_level && item.is_level == 1) }}'>
									<view style='color:#ff4544;text-align:right;font-size:9pt'>享受会员折扣</view>
								</block>
								<block wx:if='{{item.order_refund_enable == 1}}'>
									<block wx:if='{{item.is_virtual == 0 ? true:false}}'>
										<view>
											<block wx:if='{{item.is_order_refund == 0}}'>
												<navigator class='flex-y-center refund-btn' url='/pages/order-refund/order-refund?id={{item.order_detail_id}}'>申请售后 </navigator>
											</block>
											<block wx:if='{{item.is_order_refund == 1}}'><text class='refund-text'>已申请售后</text></block>
										</view>
									</block>
								</block>
							</view>
						</view>

					</block>
				</view>
				<block wx:if='{{ (order.is_send == 0 && order.apply_delete == 1) }}'>
					<view class='order-footer flex-y-center flex-x-right flex-row'>
						<view>退款申请中</view>
					</view>
				</block>
				<block wx:if='{{ ( (order.is_send == 0 && order.is_pay == 1)  && order.apply_delete == 0) }}'>
					<block wx:if="{{order.is_virtual == 0 ? true:false}}">
						<view class='order-footer flex-y-center flex-x-right flex-row'>
							<view class='play-btn'>
								<view bindtap='orderRevoke' data-id='{{order.order_id}}'>申请退款 </view>
							</view>
						</view>
					</block>
				</block>
			</view>
		</view>
		<view bindtap='hide' class='flex-row flex-y-center modal {{(hide == 1?"hide":"")}}'>
			<view class='flex-y-center' style='width:100%;height:800rpx;padding:100rpx;'>
				<view style='background-color:#fff;width:100%;height:100%;border-radius:10rpx;padding:0 50rpx;'>
					<view class='flex-x-center' style='width:100%;height:50rpx;margin-top:50rpx;font-size:13pt;margin-bottom:20rpx'>核销二维码</view>
					<image src='{{qrcode}}' style='width:450rpx;height:450rpx;'></image>
				</view>
			</view>
		</view>
	</block>
	<include src='/components/footer/footer'></include>
</view>