<view class='page'>
	<include src='/components/common/common'></include>
	<include src='/components/header/header'></include>
	<view class='body after-navber'>
		<block wx:if='{{ (is_area == 1 && offline == 0) }}'>
			<view class='bottom-bar flex-row'>
				<view class='is_area'>所选地区暂时无货</view>
			</view>
		</block>
		<block wx:else>
			<form bindsubmit='orderSubmit' reportSubmit='true'>
				<view class='bottom-bar flex-row'>
					<view class='flex-y-center flex-grow-1' style='padding: 0 24rpx'>
						<block wx:if='{{ ( (pond_id || scratch_id)  || lottery_id) }}'>
							<view class='flex-grow-1' style='color:#ff4544 '> 总计：￥{{express_price}} </view>
						</block>
						<block wx:elif='{{step_id}}'>
							<view class='flex-grow-1' style='color:#ff4544 '> 总计：{{total_price}}{{(store.option.step.currency_name?store.option.step.currency_name:"活力币")}}
								<block wx:if='{{offline == 0}}'><text>+￥{{express_price}}</text></block>
							</view>
						</block>
						<block wx:else>
							<view class='flex-grow-1' style='color:#ff4544 '> 总计：￥{{new_total_price}} </view>
						</block>
					</view>
					<block wx:if='{{ ( ( (pond_id || scratch_id)  || lottery_id)  || step_id) }}'><button class='flex-y-center flex-grow-0 flex-x-center submit-btn' formType='submit'>提交</button></block>
					<block wx:else>
						<block wx:if='{{ ( (offer_rule && offer_rule.is_allowed == 1)  && offline == 0) }}'>
							<view class='flex-y-center flex-grow-0 flex-x-center submit-btn' style='background-color:#ccc;'>{{offer_rule.msg}}</view>
						</block>
						<block wx:else><button class='flex-y-center flex-grow-0 flex-x-center submit-btn' formType='submit'>提交</button></block>
					</block>
				</view>
			</form>
		</block>
		<view class='{{(show_card?"no-scroll":"")}} {{( ( (show_shop || show_coupon_picker)  || show_card) ?"hidden":"")}}' style='padding-bottom: 129rpx'>
			<block wx:if='{{offline == 0}}'>
				<navigator class='flex-row address-picker' url='/pages/address-picker/address-picker'>
					<block wx:if='{{address}}'>
						<view class='flex-grow-1'>
							<view class='flex-row' style='margin-bottom: 20rpx'>
								<view class='flex-grow-1'>收货人：{{address.name}}</view>
								<view class='flex-grow-0'>{{address.mobile}}</view>
							</view>
							<view style='white-space: nowrap;overflow: hidden;text-overflow: ellipsis'>收货地址：{{address.province}}{{address.city}}{{address.district}}{{address.detail}}</view>
						</view>
					</block>
					<block wx:else>
						<view class='flex-grow-1'>
							<view style='color:#ff4544'>请选择收货地址</view>
						</view>
					</block>
					<view class='flex-grow-0 flex-y-center'>
						<image src='{{__wxapp_img.store.jiantou_r.url}}' style='width: 12rpx; height: 22rpx;margin-left: 24rpx'></image>
					</view>
				</navigator>
			</block>
			<view bindtap='showPayment' class='flex-row flex-y-center' style='background: #fff;padding: 0 24rpx;height: 90rpx;border-bottom: 1rpx solid #e3e3e3;margin-bottom: 20rpx;'>
				<view class='flex-grow-1'>支付方式</view>
				<block wx:if='{{payment == 0}}'>
					<view class='flex-grow-0'>线上支付</view>
				</block>
				<block wx:if='{{payment == 2}}'>
					<view class='flex-grow-0'>货到付款</view>
				</block>
				<block wx:if='{{payment == 3}}'>
					<view class='flex-grow-0'>账户余额支付</view>
				</block>
				<view class='flex-grow-0'>
					<image src='{{__wxapp_img.store.jiantou_r.url}}' style='width: 12rpx;height: 22rpx;margin-left: 12rpx'></image>
				</view>
			</view>
			<block wx:if='{{ (goods_list && goods_list.length > 0) }}'>
				<view class='mch-item'>
					<view class='mch-header'>平台自营</view>
					<view class='cart-list'>
						<block wx:for='{{goods_list}}' wx:for-item='item' wx:for-index='index' wx:key='{{index}}'>
							<view class='flex-col '>
								<view class='cart-item flex-row border-bottom'>
									<view class='flex-grow-0'>
										<image class='goods-pic' mode='aspectFill' src='{{item.goods_pic}}'></image>
									</view>
									<view class='flex-grow-1 flex-col'>
										<view class='flex-grow-1'>
											<view class='goods-name'>{{item.goods_name}}</view>
											<view class='attr-list'>
												<block wx:for='{{item.attr_list}}' wx:for-item='attr' wx:for-index='index' wx:key='{{index}}'>
													<view class='attr-item'> {{attr.attr_group_name}}:{{attr.attr_name}} </view>
												</block>
											</view>
										</view>
										<view class='flex-grow-0 flex-row'>
											<view class='flex-grow-1 num'>×{{item.num}}</view>
											<block wx:if='{{ ( ( (!(pond_id) && !(scratch_id))  && !(lottery_id))  && !(step_id)) }}'>
												<view class='flex-grow-0 price'>￥:{{item.price}}</view>
											</block>
										</view>
									</view>
								</view>
								<block wx:if='{{ (item.give > 0 &&  ( ( (!(pond_id) && !(scratch_id))  && !(lottery_id))  && !(step_id)) ) }}'>
									<view class='goods-intrgral flex-row'>
										<view class='flex-y-center'> 订单完成返回</view>
										<view class='flex-y-center' style='color:#ff4544'>{{item.give}}</view>
										<view class='flex-y-center'>积分</view>
									</view>
								</block>
							</view>
						</block>
					</view>
					<block wx:if='{{send_type == 0}}'>
						<view class='flex flex-row flex-y-center border-bottom' style='background-color:#fff;padding:0 24rpx;height:90rpx;'>
							<view class='flex-grow-1'>配送方式</view>
							<view class='flex-grow-0 flex-row'>
								<view bindtap='getOffline' class='flex-y-center flex-row {{(offline == 0?"active":"")}}' data-index='0' style='height:100%;'>
									<view class='check-icon'></view>
									<view>快递配送</view>
								</view>
								<view bindtap='getOffline' class='flex-y-center flex-row {{(offline == 1?"active":"")}}' data-index='1' style='height:100%;margin-left: 32rpx'>
									<view class='check-icon'></view>
									<view>到店自提</view>
								</view>
							</view>
						</view>
					</block>
					<block wx:if='{{offline == 1}}'>
						<view class='flex-row flex-y-center border-bottom' style='padding: 0 24rpx;height: 90rpx;background: #fff'>
							<view class='flex-grow-1'>
								<view class='flex-row'>
									<view class='flex-grow-0'>联系人：</view>
									<view class='flex-grow-1' style='padding-left: 24rpx'><input bindinput='KeyName' placeholder='请填写姓名' style='width: 300rpx' value='{{name}}'></input></view>
								</view>
							</view>
							<view class='flex-grow-0'><input bindinput='KeyMobile' placeholder='请填写电话' style='width: 300rpx;text-align: right' value='{{mobile}}'></input></view>
						</view>
						<view bindtap='{{(shop_list.length > 1?"showShop":"")}}' class='flex-row border-bottom' style='background: #fff;padding: 24rpx'>
							<view class='flex-grow-1'>
								<view class='flex-row' style='margin-bottom: 20rpx'>
									<view class='flex-grow-1'>门店名称：{{shop.name}}</view>
								</view>
								<view class='flex-row' style='margin-bottom: 20rpx'>
									<view class='flex-grow-1'>门店电话：{{shop.mobile}}</view>
								</view>
								<view>门店地址：{{shop.address}}</view>
							</view>
							<block wx:if='{{shop_list.length > 1}}'>
								<view class='flex-grow-0 flex-y-center'>
									<block wx:if='{{!(shop)}}'>
										<view>请选择门店</view>
									</block>
									<image src='{{__wxapp_img.store.jiantou_r.url}}' style='width: 12rpx;height: 22rpx;margin-left: 12rpx'></image>
								</view>
							</block>
							<block wx:else>
								<view class='flex-grow-0 flex-y-center'>暂无门店</view>
							</block>
						</view>
					</block>
					<block wx:if='{{ ( ( (!(pond_id) && !(scratch_id))  && !(lottery_id))  && !(step_id)) }}'>
						<view bindtap='showCouponPicker' class='flex-row flex-y-center border-bottom' style='background: #fff;padding: 0 24rpx;height: 90rpx;'>
							<view class='flex-grow-1'>优惠券</view>
							<view class='flex-grow-0'>
								<block wx:if='{{ (!(coupon_list) || coupon_list.length == 0) }}'>
									<view style='color: #888'>目前无可用优惠券</view>
								</block>
								<block wx:else>
									<block wx:if='{{picker_coupon}}'>
										<view style='color: #ff4544'>-{{picker_coupon.sub_price}}元</view>
									</block>
									<block wx:else>
										<view style='color: #ff4544'>有{{coupon_list.length}}张优惠券可以使用</view>
									</block>
								</block>
							</view>
							<view class='flex-grow-0'>
								<image src='{{__wxapp_img.store.jiantou_r.url}}' style='width: 12rpx;height: 22rpx;margin-left: 12rpx'></image>
							</view>
						</view>
					</block>
					<block wx:if='{{ (integral.forehead_integral > 0 &&  ( ( (!(pond_id) && !(scratch_id))  && !(lottery_id))  && !(step_id)) ) }}'>
						<view class='flex-row flex-y-center border-bottom' style='background: #fff;padding: 0 24rpx;height: 90rpx;border-bottom: 1rpx solid #e3e3e3;'>
							<view class='flex-grow-1 flex-y-center'>
								<view class='flex-y-center'>使用{{integral.forehead_integral}}积分抵扣</view>
								<view class='flex-y-center' style='color:#ff4544'>{{integral.forehead}}</view>
								<view class='flex-y-center'>元</view>
								<view bindtap='integration' class='flex-y-center'>
									<image src='{{__wxapp_img.store.ntegration.url}}' style='width: 36rpx;height: 36rpx;margin-left: 12rpx'></image>
								</view>
							</view>
							<view class='flex-grow-0 flex-y-center integral-switch' data-index='{{integral_radio}}'>
								<switch checked='{{true}}' bindchange='integralSwitchChange' class='flex-y-center' style='height:44rpx'></switch>
							</view>
						</view>
					</block>
					<block wx:if='{{ (level &&  ( ( (!(pond_id) && !(scratch_id))  && !(lottery_id))  && !(step_id)) ) }}'>
						<view class='flex-row flex-y-center border-bottom' style='background: #fff;padding: 0 24rpx;height: 90rpx'>
							<view class='flex-grow-1'>会员折扣</view>
							<view class='flex-grow-0'>
								<view style='color:#ff4544'>{{level.discount}}折</view>
							</view>
						</view>
					</block>
					<view class='flex-row flex-y-center border-bottom' style='background: #fff;padding: 0 24rpx;height: 90rpx'>
						<view class='flex-grow-1'>运费</view>
						<view class='flex-grow-0'>
							<block wx:if='{{offline == 0}}'>
								<block wx:if='{{address}}'>
									<view style='color:#ff4544'>￥{{express_price}}</view>
								</block>
								<block wx:else>
									<view style='color:#888'>请先选择收货地址</view>
								</block>
							</block>
							<block wx:elif='{{offline == 1}}'>
								<view style='color:#ff4544'>￥0</view>
							</block>
						</view>
					</view>
					<block wx:if='{{form.is_form == 0}}'>
						<view class='flex flex-row flex-y-center border-bottom' style='background: #fff;padding: 0 24rpx;height: 90rpx'>
							<view class='flex-grow-0'>买家留言</view>
							<view class='flex-grow-0' style='padding-left: 24rpx'><input bindinput='bindkeyinput' data-mch-index='-1' name='content' placeholder='请填写备注' style='width:100%;' value='{{content}}'></input></view>
						</view>
					</block>
					<block wx:if='{{ ( (form.is_form == 1 && form.list.length > 0)  && !(step_id)) }}'>
						<view class='address-picker' style='padding:0 24rpx;'>
							<view class='form-title text-more'>{{(form.name?form.name:"表单信息")}}</view>
							<view class='form-list'>
								<block wx:for='{{form.list}}' wx:for-item='item' wx:for-index='index' wx:key='{{index}}'>
									<view class='form-one flex-row'>
										<view class='flex-grow-0 list-name {{(item.type == "text"?"flex-y-center":"")}} {{(item.required == 1?"required":"")}}'>{{item.name}}</view>
										<block wx:if='{{item.type == "text"}}'>
											<view class='flex-grow-1 flex-y-center'><input bindConfirm='formInput' bindInput='formInput' bindblur='formInput' data-index='{{index}}' placeholder='{{item.tip}}' type='text' value='{{item.default}}'></input></view>
										</block>
										<block wx:if='{{item.type == "textarea"}}'>
											<view class='flex-grow-1'><textarea autoHeight='true' bindConfirm='formInput' bindInput='formInput' bindblur='formInput' data-index='{{index}}' placeholder='{{item.tip}}' style='width:auto;max-height:400rpx;height:auto' value='{{item.default}}'></textarea></view>
										</block>
										<block wx:if='{{item.type == "time"}}'>
											<view class='flex-grow-1' style='justify-content:flex-end;text-align:right;'>
												<picker bindchange='formInput' data-index='{{index}}' end='23:59' mode='time' start='00:00' value='{{(item.default?item.default:"00:00")}}'>
													<view>{{(item.default?item.default:"00:00")}}</view>
												</picker>
											</view>
											<view class='flex-grow-0'>
												<image class='right-jiantou' src='{{__wxapp_img.store.jiantou_r.url}}'></image>
											</view>
										</block>
										<block wx:if='{{item.type == "date"}}'>
											<view class='flex-grow-1' style='justify-content:flex-end;text-align:right;'>
												<picker bindchange='formInput' data-index='{{index}}' mode='date' start='{{time}}' value='{{(item.default?item.default:time)}}'>
													<view>{{(item.default?item.default:time)}}</view>
												</picker>
											</view>
											<view class='flex-grow-0'>
												<image class='right-jiantou' src='{{__wxapp_img.store.jiantou_r.url}}'></image>
											</view>
										</block>
										<block wx:if='{{item.type == "radio"}}'>
											<view class='flex-grow-1 flex-row' style='flex-wrap:wrap'>
												<block wx:for='{{item.default_list}}' wx:for-item='v' wx:for-index='k' wx:key='{{k}}'>
													<view bindtap='selectForm' class='default {{(v.is_selected == 1?"d-active":"")}}' data-index='{{index}}' data-k='{{k}}'>{{v.name}}</view>
												</block>
											</view>
										</block>
										<block wx:if='{{item.type == "checkbox"}}'>
											<view class='flex-grow-1 flex-row' style='flex-wrap:wrap'>
												<block wx:for='{{item.default_list}}' wx:for-item='v' wx:for-index='k' wx:key='{{k}}'>
													<view bindtap='selectForm' class='default {{(v.is_selected == 1?"d-active":"")}}' data-index='{{index}}' data-k='{{k}}' style='border-radius:0'>{{v.name}}</view>
												</block>
											</view>
										</block>
										<block wx:if='{{item.type == "uploadImg"}}'>
											<view bindtap='uploadImg' class='flex-grow-1 flex-y-center' data-index='{{index}}'>
												<block wx:if='{{item.default}}'>
													<view style='text-align:right;width:100%;font-size:0'>
														<image mode='aspectFit' src='{{item.default}}' style='width:88rpx;height:96rpx'></image>
													</view>
												</block>
												<block wx:else>
													<view style='text-align:right;width:100%;color:#c9c9c9;'>
														<view>{{(item.tip?item.tip:"请选择图片")}}</view>
													</view>
												</block>
											</view>
											<view class='flex-grow-0 flex-y-center'>
												<image src='{{__wxapp_img.balance.right.url}}' style='width:12rpx;height:18rpx;margin-left:18rpx;'></image>
											</view>
										</block>
									</view>
								</block>
							</view>
						</view>
					</block>
				</view>
			</block>
			<block wx:if='{{ (mch_list && mch_list.length > 0) }}'>
				<block wx:for='{{mch_list}}' wx:for-item='mch' wx:for-index='mch_index' wx:key='{{mch_index}}'>
					<view class='mch-item'>
						<view class='mch-header'>{{mch.name}}</view>
						<view class='cart-list'>
							<block wx:for='{{mch.list}}' wx:for-item='item' wx:for-index='index' wx:key='{{index}}'>
								<view class='flex-col '>
									<view class='cart-item flex-row border-bottom'>
										<view class='flex-grow-0'>
											<image class='goods-pic' mode='aspectFill' src='{{item.goods_pic}}'></image>
										</view>
										<view class='flex-grow-1 flex-col'>
											<view class='flex-grow-1'>
												<view class='goods-name'>{{item.goods_name}}</view>
												<view class='attr-list'>
													<block wx:for='{{item.attr_list}}' wx:for-item='attr' wx:for-index='index' wx:key='{{index}}'>
														<view class='attr-item'> {{attr.attr_group_name}}:{{attr.attr_name}} </view>
													</block>
												</view>
											</view>
											<view class='flex-grow-0 flex-row'>
												<view class='flex-grow-1 num'>×{{item.num}}</view>
												<view class='flex-grow-0 price'>￥:{{item.price}}</view>
											</view>
										</view>
									</view>
									<block wx:if='{{item.give > 0}}'>
										<view class='goods-intrgral flex-row'>
											<view class='flex-y-center'> 订单完成返回</view>
											<view class='flex-y-center' style='color:#ff4544'>{{item.give}}</view>
											<view class='flex-y-center'>积分</view>
										</view>
									</block>
								</view>
							</block>
						</view>
						<view class='flex-row flex-y-center border-bottom' style='background: #fff;padding: 0 24rpx;height: 90rpx'>
							<view class='flex-grow-1'>运费</view>
							<view class='flex-grow-0'>
								<block wx:if='{{address}}'>
									<view style='color:#ff4544'>￥{{mch.express_price}}</view>
								</block>
								<block wx:else>
									<view style='color:#888'>请先选择收货地址</view>
								</block>
							</view>
						</view>
						<view class='flex flex-row flex-y-center border-bottom' style='background: #fff;padding: 0 24rpx;height: 90rpx'>
							<view class='flex-grow-0'>买家留言</view>
							<view class='flex-grow-0' style='padding-left: 24rpx'><input bindinput='bindkeyinput' data-mch-index='{{mch_index}}' name='content' placeholder='请填写备注' style='width:100%;' value='{{mch.content}}'></input></view>
						</view>
					</view>
				</block>
			</block>
		</view>
		<block wx:if='{{show_coupon_picker}}'>
			<view class='coupon-picker'>
				<scroll-view class='coupon-list' scrollY='true' style='height: 100%'>
					<view style='color: #888;font-size: 9pt;margin-bottom: 20rpx;line-height: 1.35'> 注：优惠券只能抵消商品金额，不能抵消运费，商品金额最多优惠到0.01元 </view>
					<view bindtap='pickCoupon' class='flex-y-center flex-x-center' data-index='-1' style='height: 80rpx;margin-bottom: 24rpx;color: #888;border: 1rpx solid #e3e3e3;border-radius: 10rpx'>不使用优惠券 </view>
					<block wx:for='{{coupon_list}}' wx:for-item='item' wx:for-index='index' wx:key='{{index}}'>
						<view bindtap='pickCoupon' class='coupon-item coupon-status-{{item.status}} {{( (picker_coupon && item.user_coupon_id == picker_coupon.user_coupon_id) ?"active":"")}}' data-index='{{index}}'>
							<image class='coupon-bg' src='/images/img-coupon-bg-{{(item.status == 0?0:1)}}.png'></image>
							<block wx:if='{{item.status != 0}}'>
								<image class='coupon-status-icon' src='/images/img-coupon-status-icon-{{item.status}}.png'></image>
							</block>
							<view class='flex-row' style='height: 100%;overflow: hidden'>
								<view class='flex-grow-0 flex-col flex-y-center flex-x-center coupon-left'>
									<view class='flex-row flex-y-bottom'>
										<view style='font-size: 9pt'>￥</view>
										<view style='font-size: {{(item.sub_price.length > 4?13:19)}}pt;line-height: .9'> {{item.sub_price}} </view>
									</view>
									<view style='font-size: 8pt;margin-top: 10rpx'>{{item.min_price_desc}}</view>
								</view>
								<view class='flex-grow-1 flex-y-center coupon-right'>
									<view style='width: 100%'>
										<view class='flex-row flex-y-center mb-10'>
											<view class='flex-grow-1' style='font-size: 13pt;font-weight: bold'>{{item.event_desc}} </view>
											<view class='flex-grow-0' style='font-size: 9pt'></view>
										</view>
										<view style='font-size: 8pt;color: #888'>{{item.begin_time}} ~ {{item.end_time}}</view>
									</view>
								</view>
							</view>
						</view>
					</block>
				</scroll-view>
			</view>
		</block>
		<block wx:if='{{show_shop}}'>
			<view class='coupon-picker' style='background-color:#f7f7f7;'>
				<scroll-view class='coupon-list' scrollY='true' style='height: 100%;padding:0;'>
					<view class='shop-block flex-y-center'>当前地址</view>
					<view class='shop-address flex-row flex-y-center'>
						<view class='flex-grow-1'>{{location}}</view>
						<view bindtap='dingwei' class='flex-grow-0 flex-y-center'>
							<image src='{{__wxapp_img.shop.dingwei.url}}' style='width:32rpx;height:32rpx;margin-right:2rpx;'></image><text style='color:#2495ff'>手动定位</text>
						</view>
					</view>
					<view class='shop-block flex-y-center'>门店列表（仅展示您最近的30家门店）</view>
					<block wx:for='{{shop_list}}' wx:for-item='item' wx:for-index='index' wx:key='{{index}}'>
						<view bindtap='pickShop' class='flex-row address-picker' data-index='{{index}}' style='margin:0;'>
							<view class='flex-grow-0 flex-y-center'>
								<image src='{{(item.id == shop.id?"/images/icon-shop-checked.png":"/images/icon-shop-un.png")}}' style='width: 40rpx;height: 40rpx;margin-right: 20rpx'></image>
							</view>
							<view class='flex-grow-1'>
								<view class='flex-row' style='margin-bottom: 20rpx'>
									<view class='flex-grow-1' style='font-weight:bold;{{(item.id == shop.id?"color:#ff4544":"")}}'> {{item.name}} </view>
									<block wx:if='{{item.distance != - 1}}'>
										<view class='flex-grow-0'>{{item.distance}}</view>
									</block>
								</view>
								<view class='flex-row' style='margin-bottom: 20rpx'>
									<view class='flex-grow-1'>电话：{{item.mobile}}</view>
								</view>
								<view>地址：{{item.address}}</view>
							</view>
						</view>
					</block>
				</scroll-view>
			</view>
		</block>
		<block wx:if='{{show_payment}}'>
			<view class='payment'>
				<view class='pay-modal'>
					<view class='pay-head flex-x-center flex-y-center'>请选择支付方式</view>
					<block wx:for='{{pay_type_list}}' wx:for-item='item' wx:for-index='index' wx:key='{{index}}'>
						<view bindtap='payPicker' class='pay-block flex-row flex-y-center' data-index='{{item.payment}}'>
							<view class='flex-grow-0'>
								<image src='{{item.icon}}' style='width:72rpx;height:72rpx;margin-right:30rpx;'></image>
							</view>
							<view class='flex-grow-1 {{(payment == item.payment?"red":"")}}'>{{item.name}}</view>
							<block wx:if='{{payment == item.payment}}'>
								<view class='flex-grow-0'>
									<image src='{{__wxapp_img.store.pay_right.url}}' style='width:34rpx;height:24rpx;'></image>
								</view>
							</block>
						</view>
					</block>
					<view bindtap='payClose' class='pay-footer flex-x-center flex-y-center hidden'>关闭</view>
				</view>
			</view>
		</block>
		<include src='./../../components/get-card/get-card.wxml'></include>
	</view>
	<include src='/components/footer/footer'></include>
</view>