<!--pages/confirmOrder/confirmOrder.wxml-->

<view class="order">
  <!--商品清单  -->
  <view class="goods_list">
    <block wx:for="{{goodsList}}" wx:key="goodsList" wx:if="{{index < showLimit}}">
      <view class="goods_item">
        <view class="goods_image">
          <image src="{{item.img}}" mode="aspectFill"></image>
        </view>
        <view class="goods_info">
          <view class="goods_title">{{item.title}}<text decode='true'>&nbsp;&nbsp;</text>({{cart[index].atitle}})</view>
          <block >
          <view class="goods_price">￥ {{cart[index].price}}</view>
          </block>
        </view>
        <view class="goods_count">x {{item.count}}</view>
      </view>
    </block>
    <view class="show_more" bindtap="viewMore" wx:if="{{goodsList.length > 3}}">{{showLimit > 3?'隐藏':'显示更多'}}</view>
    <view wx:if="{{orderType==2}}" class="row" style="font-weight:normal">
      <text class="row_title">{{checkHack.packageName}}:</text>
      <text class="pirce">￥ {{storeInfo.boxes}}</text>
    </view>
    <view wx:if="{{orderType==2}}" class="row" style="font-weight:normal">
      <text class="row_title">{{checkHack.deliveryName}}:</text>
      <text class="pirce">￥ {{storeInfo.delivery}}</text>
    </view>
    <view class="totol_pirce">
      <text>Total price:</text>
       <!-- <text class="pirce">￥ {{orderType==1?totalPrice:dPrice}}</text>  -->
       <!-- <text class="pirce">￥ {{orderType==1?finalPrice:dPrice}}</text>  -->
      <!-- <text class="pirce">￥ {{endPrice || finalPrice}}</text> -->
      <block wx:if="{{!endPrice}}">
         <text class="pirce">￥ {{orderType==1 || orderType==3 ?finalPrice:dPrice}}</text>
      </block>
      <block wx:else>        
        <text class="pirce">￥ {{endPrice}}</text>
      </block>
    </view>
  

    <view class="tips" wx:if="{{!sendAble && storeInfo.is_on_waimai == 1}}">※ No choice of delivery price</view>
  </view>
  <view class='choose_cards'>
    <picker bindchange="bindPickerChange" value="{{index}}" range-key="{{'name'}}" range="{{cards}}">
      <text wx:if='{{chooseCards.name}}' style='font-size: 26rpx;color: #555;'>{{chooseCards.name}}</text>
      <text wx:else>Choose coupons</text>
      <text class="iconfont icon-more1 fr"></text>
    </picker>
  </view>
  <!-- 选择下单方式 -->
    <!-- <view class="selected_type" wx:if="{{sendAble}}">
    <text>店内就餐/外卖/上店自提</text>
    <switch type="switch" color="#d31944" bindchange="switchOrderType" />
  </view>   -->

  <!-- new 下单方式  -->
   <view class='new_select'>
    <view class='select_kind {{selcindex==0?"active":" "}}' bindtap='selctChange' data-selcid='0' data-orderid='1' >Eat here</view>
    <view class='select_kind {{selcindex==1?"active":" "}}' bindtap='selctChange' data-selcid='1' data-orderid='2'>Takeout</view>
    <view class='select_kind {{selcindex==2?"active":" "}}' bindtap='selctChange' data-selcid='2' data-orderid='3' >Self lifting

</view>
  </view> 

  <!-- 桌位信息  -->
  <!-- <block wx:if="{{orderType == 1}}"> -->
  <view class="order_info table {{orderType == 1?'active':'hide'}}">
    <form wx:if="{{orderType == 1}}" bindsubmit="submitOrder" report-submit="true">
      <!-- <view class="order_title">Please choose your seat</view> -->
      <picker range="{{floorList}}" value="{{floorIndex}}" bindchange="selectFloor">
        <view class="row">
          <view class="row_title">floor :</view>
          <view class="row_content">{{floorList[floorIndex]}}
            <text class="iconfont icon-more1"></text>
          </view>
        </view>
      </picker>
      <picker range="{{seatList[floorIndex]}}" value="{{seatIndex}}" bindchange="selectSeat">
        <view class="row">
          <view class="row_title">table :</view>
          <view class="row_content">{{seatList[floorIndex][seatIndex]}}
            <text class="iconfont icon-more1"></text>
          </view>
        </view>
      </picker>
      <view class="row" wx:if="{{checkHack.showPersonNum}}">
        <view class="row_title">number :</view>
        <view class="row_content">
          <input type="number" bindinput="syncDelivery" data-attr="meals_num" placeholder="Enter Number of meals" value="{{meals_num}}" maxlength="2" />
        </view>
      </view>
      <view class="tips">
        <view class="tips_header">remark :</view>
        <view class="row_content">
          <textarea bindinput="syncRemarks" maxlength="200" />
        </view>
      </view>
            <!-- 余额支付 -->
<view class='pay_content' >
    <view class="yuepay {{ hui== true ?  'pay_glay' : ''}}" bindtap='yuepay' data-pay_type='2' >
        <view>
            <text class="payicon iconfont rpx40 {{ pay1== true ?  'icon-yixuanze' :  'icon-weixuanze '}}"></text>
        </view>
        <view class='pay_text'>Balance payment</view>
        <view class='price-red rpx30' style='margin-left:100rpx;'>剩余{{balanceInfo.balance}}</view>
    </view>
    <view class='yuepay' bindtap='weixin' data-pay_type='1' >
        <view class='weipay' >
            <text class="payicon iconfont rpx40 {{ pay2== true ?  'icon-yixuanze' :  'icon-weixuanze '}}"></text>
        </view>
        <view class='pay_text'>WeChat Pay</view>
    </view>
</view>
      <button class="pay_btn" formType="submit">Eat here</button>
    </form>
  </view>
  <!-- </block> -->
  <!-- 外卖信息 -->
  <!-- <block wx:else> -->
  <view class="order_info takeaway {{orderType == 2 || orderType == 3 ?'active':'hide'}}">
    <form wx:if="{{orderType == 2 || orderType == 3 }}" bindsubmit="submitOrder" report-submit="true">
      <!-- <view class="order_title">Delivery information</view> -->
      <!-- <view class="row ">
        <view class="row_title">上门自提 :</view>
        <view class="row_content">
          <view class='check_box' bindtap='showGoStore' wx:if="{{!gostore}}">
            <image src='/images/icon/right.png'></image>
          </view>
          <view class='check_box' bindtap='showGoStore' wx:if="{{gostore}}">
            <image src='/images/icon/right_active.png'></image>
          </view>
        </view>
      </view> -->

      <view class="row ">
        <view class="row_title">name :</view>
        <view class="row_content">
          <input type="text" bindinput="syncDelivery" data-attr="name" placeholder="Enter Your Name" value="{{name_info}}" maxlength="30" />
        </view>
      </view>
      <view class="row">
        <view class="row_title">phone :</view>
        <view class="row_content">
          <input type="number" bindinput="syncDelivery" data-attr="phone" placeholder="Enter Your Phone" value="{{phone_info}}" maxlength="11" />
        </view>
      </view>
      <block wx:if="{{orderType == 2}}">
      <view class="row">
        <view class="row_title">address :</view>
        <view class="row_content">
          <input type="text" bindinput="syncDelivery" data-attr="address" placeholder="Enter Your address" value="{{address_info}}" />
        </view>
      </view>
      </block>
      <!-- <block wx:if="{{gostore}}">
      <view class="row">
        <view class="row_title">门店地址 :</view>
        <view class="row_content">
          <input type="text" bindinput="syncDelivery" data-attr="address" placeholder="请输入您的详细地址" value="{{address_info}}" />
        </view>
      </view>
      </block> -->
      <block wx:if="{{orderType == 2}}">
      <picker mode="time" start="{{startTime}}" end="24:00" bindchange="selectTime" value="{{targetTime}}">
        <view class="row">
          <view class="row_title">arrival:</view>
          <view class="row_content">
            <text style="color:#4183c4;margin-right:20rpx">today</text>{{targetTime}}
            <text class="iconfont icon-more1"></text>
          </view>
        </view>
      </picker>
      </block>
       <block wx:if="{{orderType == 3}}">
      <picker mode="time" start="{{startTime}}" end="24:00" bindchange="getMealTime" value="{{qucanTime}}">
        <view class="row">
          <view class="row_title">meal time :</view>
          <view class="row_content">
            <text style="color:#4183c4;margin-right:20rpx">today</text>{{targetTime}}
            <text class="iconfont icon-more1"></text>
          </view>
        </view>
      </picker>
      </block> 
      <view class="row" wx:if="{{checkHack.showPersonNum}}">
        <view class="row_title">number :</view>
        <view class="row_content">
          <input type="number" bindinput="syncDelivery" data-attr="meals_num" placeholder="Enter Number of meals" value="{{meals_num}}" maxlength="2" />
        </view>
      </view>
      <view class="tips">
        <view class="tips_header">remark :</view>
        <view class="row_content">
          <textarea bindinput="syncRemarks" maxlength="150" value="{{mark}}" />
        </view>
      </view>
      <view class='pay_content' >
    <view class="yuepay {{ hui== true ?  'pay_glay' : ''}}" bindtap='yuepay' data-pay_type='2' >
        <view>
            <text class="payicon iconfont rpx40 {{ pay1== true ?  'icon-yixuanze' :  'icon-weixuanze '}}"></text>
        </view>
        <view class='pay_text'>Balance payment</view>
        <view class='price-red rpx30' style='margin-left:100rpx;'>balance:{{balanceInfo.balance}}</view>
    </view>
    <view class='yuepay' bindtap='weixin' data-pay_type='1' >
        <view class='weipay' >
            <text class="payicon iconfont rpx40 {{ pay2== true ?  'icon-yixuanze' :  'icon-weixuanze '}}"></text>
        </view>
        <view class='pay_text'>WeChat payment</view>
    </view>
</view>
       <!-- <button class="pay_btn" formType="submit">{{checkHack.btnName[1]}}</button>  -->
       <button class="pay_btn" formType="submit" >{{orderType == 2 ? 'Takeout' : 'Self lifting' }}</button>
    </form>
  </view>
  <!-- </block> -->
</view>



