<!--pages/createorder/index.wxml-->
<view>
  <swiper indicator-dots="{{true}}" indicator-color="rgba(255,255,255,0.5)" indicator-active-color="#ffffff" autoplay
    circular interval="4000" class="my-swipe" centeredSlides="true" autoHeight="true">
    <block wx:for="{{images}}" wx:key="index">
      <swiper-item class="item">
        <image src="{{item}}" class="img" mode="scaleToFill" data-previewurl='{{images}}' data-currenturl='{{item}}'>
        </image>
      </swiper-item>
    </block>
  </swiper>
  <view class="box">
    <view class="h3">
      选择油枪 | <text class="small" wx:if="{{gas != 0}}">已选择{{gas}}号油枪</text>
      <text class="small2" wx:if="{{gas == 0}}">选择所加油枪号</text>
      <text class="span" bindtap="clickMore">更多></text>
    </view>
    <van-notice-bar left-icon="volume-o" text="{{notice}}"></van-notice-bar>
    <van-row gutter="10">
      <van-col span="8" wx:for="{{gasarr}}" wx:key="index" class="gas">
        <van-button type="{{gas==item.oilGunNo?'primary':'default'}}" block data-index="{{item.oilGunNo}}"
          data-oilname="{{item.oilName}}" data-oilprice="{{item.oilPrice}}" data-guntype="{{item.oilGunType}}" bindtap="selectGas">
          {{item.oilGunNo}}号油枪
          <view>{{item.oilName}}</view>
        </van-button>
      </van-col>
    </van-row>
    <view class="h3">输入金额 | <text class="small2">建议询问加油员后输入</text></view>
    <view class="input-box">
      <input  type='text' model:value="{{account}}" class="my-input" bindinput="bindKeyInput"  confirm-type="done"/>
      <text class="input-left">￥</text>
      <text class="input-right">(元)</text>
    </view>
    <van-row gutter="10">
      <van-col span="6" wx:for="{{money}}" wx:key="index">
        <van-button type="{{account==item?'primary':'default'}}" block data-money="{{item}}" bindtap="clickAccount">
          {{item}}
        </van-button>
      </van-col>
    </van-row>
    <view class="center tips">
      <van-icon name="warning-o" /> <text class="span">请勿在油机旁使用手机</text></view>
    <van-popup show="{{showPopup}}" closeable round position="bottom" z-index="9999" bind:close="onClose"
      safe-area-inset-bottom safe-area-inset-top>
      <view class="center">
        <view class="h3">选择油枪号</view>
      </view>
      <van-row gutter="10">
        <van-col span="8" wx:for="{{gasallarr}}" wx:key="index" class="gas">
          <van-button type="{{gas==item.oilGunNo?'primary':'default'}}" block data-index="{{index}}" data-oilname="{{item.oilName}}"
            data-num="{{item.oilGunNo}}" data-oilprice="{{item.oilPrice}}" data-guntype="{{item.oilGunType}}" bindtap="selectGasAll">
            {{item.oilGunNo}}号油枪
            <view>{{item.oilName}}</view>
          </van-button>
        </van-col>
      </van-row>
      <view class="h3"></view>
    </van-popup>
    <van-goods-action>
      <van-goods-action-button type="primary" text="去结算" wx:if="{{gas>0 && account>0}}" bindtap="toConfirm"
        data-stationName="{{item.stationName}}" data-oilGunNum="{{item.oilGunNum}}" data-oilName="{{item.oilName}}" />
      <van-goods-action-button text="去结算" color="#cdcbce" wx:else bindtap="toastMsg" />
    </van-goods-action>
    <van-toast id="van-toast" />
  </view>
</view>

<!--授权登录获取用户信息弹窗-->
<view class="modal-mask" catchtouchmove="preventTouchMove" wx:if="{{showModal}}"></view>
<view class="modal-dialog" wx:if="{{showModal}}">
  <view class="modal-content">
    <view>
      <icon class="icon-box-img" type="info" size="80"></icon>
    </view>
    <view>请先授权</view>
    <view>请先授权获取昵称等信息后再进行此操作</view>
    <button open-type="getUserInfo" bindgetuserinfo="getUserInfo">授权获取用户信息</button>
  </view>
</view>

<!--授权获取微信绑定手机号弹窗-->
<view class="modal-mask" catchtouchmove="preventTouchMove" wx:if="{{showModalPhone}}"></view>
  <view class="modal-dialog" wx:if="{{showModalPhone}}">
  <view class="modal-content">
    <view><icon class="icon-box-img" type="info" size="80"></icon></view>
    <view>绑定手机号</view>
    <view>请先绑定手机号进行登录后，再进行此操作</view>  
    <button open-type='getPhoneNumber' bindgetphonenumber="getPhoneNumber">手机号绑定登录</button>
  </view>
</view>