<view class="goods_order">
	<view class="content" wx:if="{{!diyShow}}">
		<view class="ul detail_a">
			<view class="li">{{title}}</view>
			<view class="li">{{start_time}}-{{end_time}} 共{{night_day}}晚</view>
		</view>
		<view class="ul detail_b">
			<view class="li b_room">
				<view class="span">房间数</view>
				<van-stepper value="{{total}}" bind:change="addTotal" />
			</view>
			<view class="li">
				<van-cell-group>
					<van-field label="入住人" value="{{name}}" placeholder="请填写入住姓名" border="{{ false }}" bind:blur="nameinp" />
				</van-cell-group>
			</view>
			<view class="li">
				<van-cell-group>
					<van-field type="number" label="联系手机" value="{{mobil}}" placeholder="请填写入住人电话" border="{{false}}" bind:blur="mobilinp" />
				</van-cell-group>
			</view>
		</view>
		<view class="ul detail_c">
			<view class="li c_invoice">
				<view class="span">是否需要发票</view>
				<van-checkbox checked-color="#f15353" shape="square" value="{{isInvoice}}" bind:change="invoiceChange"></van-checkbox>
			</view>
			<view class="li c_type" wx:if="{{isInvoice}}">
				<van-radio-group value="{{ el_invoice }}" bind:change="eInvoiceChange">
					<van-radio name="1" checked-color="#f15353">电子发票</van-radio>
					<van-radio name="2" checked-color="#f15353">纸质发票</van-radio>
				</van-radio-group>
			</view>
			<view class="li c_type" wx:if="{{isInvoice}}">
				<van-radio-group value="{{invoice_type}}" bind:change="typeChange">
					<van-radio name="1" checked-color="#f15353">个人</van-radio>
					<van-radio name="2" checked-color="#f15353">公司</van-radio>
				</van-radio-group>
			</view>
			<view class="li" wx:if="{{isInvoice && invoice_type == '1'}}">
				<van-cell-group>
					<van-field value="{{fp_tt}}" placeholder="输入发票抬头" border="{{false}}" bind:blur="fp_ttinp" />
				</van-cell-group>
			</view>
			<view class="li" wx:if="{{isInvoice && invoice_type == '2'}}">
				<van-cell-group>
					<van-field value="{{company_name}}" placeholder="请填写单位名称" border="{{false}}" bind:blur="company_nameinp" />
				</van-cell-group>
			</view>
			<view class="li" wx:if="{{isInvoice && invoice_type == '2'}}">
				<van-cell-group>
					<van-field value="{{sbxd}}" placeholder="请填写纳税识别号" border="{{false}}" bind:blur="sbxdinp" />
				</van-cell-group>
			</view>
			<view class="li" style="font-size: 30rpx;color: #ff2424" catchtap="showDiy" wx:if="{{hasGoodOpenDF && !diyform.diyform_data_id}}">
				点击填写表单
			</view>
			<view class="li" style="font-size: 30rpx;color: #ff2424" catchtap="showDiy" wx:if="{{hasGoodOpenDF && diyform.diyform_data_id}}">
				点击修改表单
			</view>
			<!-- <view class="li">
				<van-cell-group>
					<van-field value="{{bz}}" placeholder="买家备注" border="{{false}}" bind:blur="bzinp" />
				</van-cell-group>
			</view> -->
		</view>
		<view class="tbs coupon-list" catchtap="showCoupon" wx:if="{{isShowCoupon}}">
			<view class="list">
				<view class="left">
					优惠券
					<text class="font">{{coupon_size}}张可用</text>
				</view>
				<view class="right">
					<view class="font red">
						<text class="span">{{(use_coupon_size==0) ? "未使用":"已使用"+use_coupon_size+"张"}}</text>
					</view>
				</view>
			</view>
		</view>

		<view class="tbs" wx:for="{{order_info.orders}}">
			<block wx:if="{{item.order_deductions}}">
          <view class="score list" wx:for="{{item.order_deductions}}" wx:for-item="d" wx:for-index="dindex" wx:key="{{dindex}}">
            <view class="left">
              可用{{d.coin}}{{d.name || integral}}
              <text class="span">抵扣{{d.amount}}{{language['元']}}</text>
            </view>
            <view class="right">
              <van-switch data-orindex="{{orindex}}" loading="{{clicktag == 1}}" data-dindex="{{dindex}}" checked="{{d.checked}}" bind:change="discountHandle" />
            </view>
          </view>
        </block>
        <blcok wx:if="{{item.order_coin_exchanges}}">
          <view class="score list" wx:for-item="d" wx:for-index="dindex" wx:key="{{dindex}}" wx:for="{{item.order_coin_exchanges}}">
            <view class="left ">
              {{ d.coin }}{{ d.name || integral }}
              <text class="span">抵扣{{ d.amount }}{{language['元']}}</text>
            </view>
            <view class="right">
            </view>
          </view>
        </blcok>
		</view>

		<view class="ul detail_d">
			<view class="li" wx:for="{{order_info.amount_items}}" wx:key="{{index}}">
				<view class="span">{{item.name}}</view>
				<view class="span">{{language['money']}}<text wx:if="{{item.code=='total_deduction_price'}}">-</text>{{item.amount}}</view>
			</view>
		</view>

		<view class="ul detail_d" wx:if="{{order_info.discount_amount_items && order_info.discount_amount_items.length > 0}}">
			<view class="li" wx:for="{{order_info.discount_amount_items}}" wx:key="{{index}}">
				<view class="span">{{item.name}}</view>
				<view class="span">{{language['money']}}{{item.amount}}</view>
			</view>
		</view>

		<view class="explain" wx:if="{{false}}">
			<view class="h1">预定说明</view>
			<view class="p"> 订单确认后不可被取消；赠送双早；入住时需出示身份证；
				如需续住请提前一天预定；退房时可在前台以实际支付金额
				开具发票。</view>
		</view>
		<view class="foot">
			<view class="ul foot_a">
				<view class="li">合计：<view class="span">{{language['money']}}<text class="font">{{order_info.total_price}}</text></view>
				</view>
			</view>
			<view class="button" catchtap="submit">提交订单</view>
		</view>
	</view>
	<van-popup bind:click-overlay="couponclose" show="{{popupCouponSpecs}}" position="bottom" overlay="{{true}}">
		<view class="add-info">
			<view class="coupon-list-info" wx:for="{{coupons}}" wx:key="{{index}}" wx:for-item="coupon" wx:for-index="index">
				<view class="checkList" wx:if="{{cup_notice}}">
					<van-checkbox data-item="{{coupon}}" data-index="{{index}}" disabled="{{!coupon.valid}}" value="{{coupon.checked}}"
					 bind:change="selectCoupon" shape="square"></van-checkbox>
				</view>
				<view class="{{coupon.valid?'coupon_voucher_main':''}} {{!coupon.valid?'coupon_voucher_gray':''}}">
					<view class="coupon_voucher_left">
						<view wx:if="{{coupon.belongs_to_coupon.coupon_method==1}}">
							<view class="p coupon_voucher_amount type_large">
								{{coupon.belongs_to_coupon.deduct}}
							</view>
							<view class="p coupon_voucher_limit">满{{coupon.belongs_to_coupon.enough}}立减</view>
						</view>
						<view wx:else>
							<view class="p coupon_voucher_amount type_large">
								{{coupon.belongs_to_coupon.discount}}折
							</view>
							<view class="p coupon_voucher_limit">满{{coupon.belongs_to_coupon.enough}}立享</view>
						</view>
					</view>
					<view class="coupon_voucher_hr"></view>
					<view class="coupon_voucher_right">
						<view class="p coupon_voucher_range">{{coupon.belongs_to_coupon.name}}</view>
						<view class="p coupon_voucher_period">{{coupon.time_start}}-{{coupon.time_end}}</view>
					</view>
				</view>
			</view>
		</view>
		<view class="coubtngroup">
			<view class="btn sure" bindtap="couponclose">确认</view>
			<view class="btn close" bindtap="couponclose">取消</view>
		</view>
	</van-popup>

	<!--自定义表单-->
  <block class="diy-from-box" wx:if="{{diyShow}}">
    <van-nav-bar title="填写表单" left-text="" right-text="" left-arrow bind:click-left="showDiyClose" />
    <dsfrom datas="{{diyform}}" modeType="single"  params="{{'order'}}" bind:traCheckedData="traCheckedData"></dsfrom>
  </block>
</view>
