<integral show="{{show.integral}}" info="{{integralConfig}}" data-name="integral" bind:close="close" />
<address show="{{show.address}}" data="{{mailAddress}}" data-name="address" bind:submit="submitAddress"
  bind:close="close" />
<vouche show="{{show.vouche}}" info="{{voucheConfig}}" bind:change="changeVouche" data-name="vouche"
  bind:close="close" 
  status="{{optionsData.presellstatus}}"
  type="1"/>
<view class="sku-stepper-stock">
  <view class="font14">{{datas.title}}</view>
  <view class="buy-gray font12 mTop5">{{sku.sessions.name}}/{{sku.meals.policyName}} <text wx:if="{{optionsData.military==1}}">（{{optionsData.campsex==0?'仅女生可报':(optionsData.campsex==1?'仅男生可报':'不限性别')}}）</text></view>
  <view class="sku-stepper-container mTop5">
    <text class='subtitleColor font12 price'>￥<text class="font16">{{sku.meals.price}}</text></text>
    <text class='buy-gray font12 pLeft10 price' style="text-decoration:line-through"
      wx:if="{{sku.meals.originalPrice&&sku.meals.originalPrice!=sku.meals.price}}">￥{{sku.meals.originalPrice}}</text>
    <text wx:if="{{sku.meals.mpriceRemark}}" class="font14 pLeft10">(含{{sku.meals.mprice}}元{{sku.meals.mpriceRemark}})</text>
    <text wx:if="{{sku.meals.mpriceRemark}}" bindtap="openQuestion" class="font20 pLeft10 black icon icon-question"></text>
    <view class="stepper sku__stepper sku-tep">
      <view class="stepper__minus {{sku.quantity<=1?'stepper__minus__diabled':''}}" bindtap="numReduce"></view>
      <input type="number" value="{{sku.quantity}}" class="stepper__input" bindblur="numChange" />
      <view class="stepper__plus {{sku.quantity>=sku.quota?'stepper__plus__diabled':''}}" bindtap="numAdd"></view>
    </view>
  </view>
</view>
<view class="white-bg enlist-choose-child" wx:if="{{datas.needIdcard != 'no'&&atype==0}}">
  <view class="m-top10">
    <text class="font14">出行人信息</text><text class="font12 subtitleColor pLeft10">购买保险并生成旅游合同</text>
  </view>
  <view class="enlist-choose-child-button" wx:if="{{!idcards.ids || idcards.ids.length<=0}}">
    <button type="danger" size="small" round bindtap="chooseCard">请选择{{sku.quantity}}名出行人信息</button>
  </view>
  <view wx:else>
    <view class="card-list" bindtap="chooseCard">
      <view class="card-item" wx:for="{{idcards.ids}}" wx:key="unique">
        <text class="card-item-one">{{idcards.names[index]}}</text>
        <text class="card-item-two">{{idcards.idCards[index]}}</text>
        <text class="card-item-three" wx:if="{{idcards.parentNames[index] && datas.sparent==1}}">监护人：{{idcards.parentNames[index]}}</text>
      </view>
    </view>
  </view>
</view>
<view class="enlist mTop10">
  <view class="bottom bar-bottom buttons-row">
    <view class="leftBtn btn">总计：<text>{{total.price}}</text>元</view>
    <view bindtap="goPay" class="rightBtn btn">去付款</view>
  </view>
  <view class="content">
    <view class="column details" wx:if="{{atype==0}}">
      <!-- 预付折扣 -->
      <view class="member">
        <view class="col-line">
          <view class="line-title">预付减免</view>
          <view class="line-details subtitleColor">-{{sku.presellDeduction}}</view>
        </view>
      </view><!-- 会员折扣 -->
      <view class="member" wx:if="{{userInfo.role.level > 0 && total.mdiscount>0}}">
        <view class="col-line details-link" bindtap="integral">
          <view class="line-title">会员折扣</view>
          <view class="line-details subtitleColor">-{{total.mdiscount}}</view>
        </view>
      </view>
      <!-- 早鸟折扣 -->
      <view class="member" wx:if="{{datas.ldiscount > 0}}">
        <view class="col-line">
          <view class="line-title">早鸟折扣</view>
          <view class="line-details subtitleColor">-{{total.ldiscount}}</view>
        </view>
      </view>
      <!-- 现金券 -->
      <view class="member" bindtap="goCoupon">
        <view class="col-line details-link">
          <view class="line-title">现金券</view>
          <view class="line-details subtitleColor">-{{total.coupons}}</view>
        </view>
      </view>
      <!--  宝贝币  -->
      <view class="member" wx:if="{{total.sumUserCoin>0&&sku.meals.userCoin>0&&presellOpen==0}}">
        <view class="col-line">
          <view class="line-title">宝贝币 <text class="balance">{{total.sumUserCoin}}</text>个 可用<text class="subtitleColor">{{total.userCoin}}</text>个</view>
          <switch class="switch_wallet" bindchange="coinChange" />
        </view>
      </view>
      <!-- 可用钱包 -->
      <view class="member">
        <view class="col-line">
          <view class="line-title">抵用钱包<text class="balance">￥{{total.coin}}</text></view>
          <switch bindchange="switchChange" />
        </view>
      </view>
      <view class="member" wx:if="{{total.sumBalanceNum > 0}}">
        <view class="col-line">
          <view class="line-title">账户余额<text class="balance">￥{{total.sumBalance}}</text>
            <text class="padLeft10">可用<text class="balance">￥{{total.ableBalance}}</text></text></view>
          <switch bindchange="balanceChange" />
        </view>
      </view>
    </view>
    <view class="column details mTop10">
      <!-- 联系电话 -->
      <view class="col member" wx:if="{{datas.sphone != null && datas.sphone != 'no'}}">
        <view class="col-line">
          <view class="line-title">联系手机号码</view>
          <input class="line-details" value="{{phoneNum}}" name="phoneNum" style="text-align:right;" bindblur="phoneNum"
            bindconfirm="phoneNum" type="number" />
        </view>
      </view>
      <!-- 邮寄信息 -->
      <view class="col member" bindtap="chooseAddress" wx:if="{{datas.smailAddress != 'no' && atype== 0}}">
        <view class="col-line details-link">
          <view class="line-title">邮寄信息</view>
          <input class="line-details address" placeholder="请选择" value="{{mailAddress}}" name="mailAddress" disabled />
        </view>
      </view>
      <!-- 收货地址 -->
      <view class="col member" wx:if="{{datas.smailAddress == 'yes'  && atype== 1}}">
        <view class="remark-title mTop10">收货地址</view>
        <view class="col-line details-link ship-address" wx:if="{{shipAddress}}" bindtap="chooseAddress">
          <view>
            <view class="text-name mTop10"><text>{{shipAddress.userName}}</text><text
                class="mLeft10">{{shipAddress.telNumber}}</text></view>
            <view class="text-info">
              <text>{{shipAddress.provinceName}}{{shipAddress.cityName}}{{shipAddress.countyName}}</text><text
                class="mLeft10">{{shipAddress.detailInfo}}</text></view>
          </view>
        </view>
        <view class="buttons-row buttons-gutter content-pad" wx:if="{{!shipAddress}}">
          <button class='button button-weixin' bindtap="weixinAddress"><text
              class="icon icon-weixin"></text>从微信读取</button>
          <button class='button button-warn' bindtap="chooseAddress">+手工添加</button>
        </view>
      </view>
      <!-- 电子邮箱 -->
      <view class="col member" wx:if="{{datas.needEmail != 'no'}}">
        <view class="col-line">
          <view class="line-title">电子邮箱</view>
          <input class="line-details" value="{{email}}" placeholder="请填写邮箱以便接受电子合同" bindblur="email" name="email"
            style="width:400rpx;text-align:right;" placeholder-style="email" />
        </view>
      </view>
      <!-- 家委会 -->
      <view class="col member" wx:if="{{datas.familyCommittee !=0}}">
        <view class="col-line">
          <view class="line-title">家委会</view>
          <input class="line-details email" value="{{familyCommittee}}" placeholder="请输入是否为家委会" bindblur="familyCommittee" name="familyCommittee" style="width:400rpx;text-align:right;" placeholder-style="email" />
        </view>
      </view>
      <!-- 街道社区 -->
      <view class="col member" wx:if="{{streetStatus != 0}}">
        <view class="col-line">
          <view class="line-title">街道社区</view>
          <input class="line-details" value="{{street}}" placeholder="请填写社区以便安排活动事宜" bindblur="streetInput"
            name="street" style="width:400rpx;text-align:right;" placeholder-style="email" />
        </view>
      </view>
      <!-- 推荐人信息 -->
      <view class="col member" wx:if="{{recommenderShow}}">
        <view class="col-line">
          <view class="line-title">推荐人</view>
          <input class="line-details" value="{{recommender}}" placeholder="{{recommenderShowText}}"
            bindblur="recommender" name="recommender" style="width:400rpx;text-align:right;"
            placeholder-style="email" />
        </view>
      </view>
      <!-- 出行日期 -->
      <view class="col member" wx:if="{{datas.travelDates != 'no'}}">
        <view class="col-line">
          <view class="line-title">出行日期</view>
          <picker mode="date" value="{{travelDates}}" start="2018-01-01" bindchange="bindDateChange" name="travelDates">
            <view class="line-details" wx:if="{{travelDates != ''}}">
              {{travelDates}}
            </view>
            <view class="line-details" wx:if="{{travelDates == ''}}">请选择<text class="rightBit"></text></view>
          </picker>
        </view>
      </view>
      <view class="member" wx:if="{{datas.sremark != 'no'}}">
        <view class="remark-title mTop10">备注</view>
        <view class="col-line">
          <input class="textarea" placeholder="{{datas.remark}}" placeholder-class="placeholder" bindblur="textarea"
            bindconfirm="textarea" maxlength="100" name="textarea" value="{{textarea}}"/>
        </view>               
      </view>
    </view>
    <!-- 合同 -->
    <view class="bottomBG">
      <view class="contract" wx:if="{{datas.agreement&&atype==0}}">
        <text hidden="{{!agreement}}" class="disagree agree" bindtap="agree"></text>
        <text hidden="{{agreement}}" class="disagree" bindtap="agree"></text>
        <text bindtap="agree">我已阅读并接受</text>
        <text class="conDetails"
          bindtap="openDoc">{{datas.agreement == 'default'?'《国家旅游局团队境内旅游合同》':(datas.agreement == 'foreign' ? '《国家旅游局团队境外旅游合同》':(datas.agreement == 'within' ? '《沐童旅行社境内旅游合同》':(datas.agreement == 'leave' ?'《沐童旅行社出境旅游合同》': (datas.agreement == 'bicycleAbroad' ?'《沐童旅行社出境旅游合同 (含骑行)》': (datas.agreement == 'bicycleDomestic' ?'《沐童旅行社境内旅游合同 (含骑行)》': (datas.agreement == 'within1'?'《境内旅游合同 (沐童旅行社单日版)》':(datas.agreement == 'within1_bicycle'?'《境内旅游合同 (沐童旅行社单日骑行版)》':(datas.agreement == 'within3'?'《境内旅游合同 (沐童旅行社多日版)》':(datas.agreement == 'within3_bicycle'?'《境内旅游合同 (沐童旅行社多日骑行版)》':'《知识付费服务支付协议》')))))))))}}</text>
      </view>
    </view>
  </view>
</view>
<progress percent="{{percent}}" active active-mode="forwards" class="progress" wx:if="{{percent>0 && percent<100}}" />
<view class="mask" bindtap="close" wx:if="{{maskShow}}">
  <view class="maskBox">
    <view class="maskContent">
      <view class="maskTitle">费用说明</view>
      <view class="maskTit">会员、现金券等所有优惠，仅限活动费；不含交通费、写真费、服装租赁费等。</view>
    </view>
    <button class="maskBtn button button-white" catchtap="maskClose">确定</button>
  </view>
</view>