<!--pages/me/vip/index.wxml-->
<wxs src="../../../pages/common.wxs" module="common"></wxs>

<view class='card-box'>
  <image src="/images/background-{{user.is_vip==1?'':'no'}}vip.png"></image>
  <text> {{user.is_vip==1?'过期时间：' + user.vip_endtime:''}}</text>
  <text wx:if="{{user.is_vip==1}}" class="vip-umber">{{user.vip_number}}</text>
</view>

<view class='calculation-box'>
  <i-row class='height'>
    <i-col span="6" offset='1' i-class="col-class">{{user.is_vip==1?'续费':'购买'}}会员</i-col>
    <i-col span="4" i-class="col-class color-orange">￥{{vip_price}}</i-col>
    <i-col span="12" offset='1' i-class="col-class">
      <i-input-number i-class="vip_num_input" value="{{ value1 }}" min="1" max="10" bindchange="handleChange1" />
    </i-col>
  </i-row>
</view>

<view class='vip_intro'>
  会员卡说明:用户购买一次会员卡后，增加一年的会员时限，多次购买则在先有的基础上延长时间,单次以1年为标准，已购卡会员请添加美行客服微信(mxkf00)，邀请进会员群。
</view>

<!-- 用户输入的信息 -->
<i-input title="姓名" bindchange="handleName" type="text" right="true" value="{{ user.name }}" placeholder="请输入姓名" maxlength="50" />

<view class='phoneGive' wx:if="{{!user.phone}}">
  <text>手机号</text>
  <button bindtap='openAlert'>填写手机号</button>
</view>

<i-input wx:else title="手机号" type="text" right="true" value="{{ user.phone }}" placeholder="请输入手机号" disabled/>

<i-input bindchange="handleWx" title="微信号" type="text" right="true" value="{{ user.wx_number }}" placeholder="请输入微信号" maxlength="50" />

<i-input bindchange="handleAddress" value="{{ user.address }}" right="true" type="text" title="地址" placeholder="请输入地址" maxlength="50" />

<i-row class='height'>
  <i-col span="20" offset='2' i-class="col-class">
    <i-button bind:click="handleClick" type="primary" shape="circle" size="small">立即{{user.is_vip==1?'续费':'购买'}} ￥{{common.numFixed(vip_price*value1, 2)}}</i-button>
  </i-col>
</i-row>

<!-- toast弹窗 -->
<i-toast id="toast"  class="alert-index" />

<!-- <i-modal visible="{{ visible2 }}" bind:ok="modelCancel" title="温馨提示" show-cancel="{{false}}">
  <view class="modelCancel">系统已自动关联您在其他平台购买的美行者VIP会员,请点击确定查看详情</view>
</i-modal> -->
<!-- 手机号授权框 -->
<i-modal title="填写手机号" visible="{{ visible }}" bind:ok="savePhone" bind:cancel="alertClose">
    <i-input error="{{ errMsg }}" value="{{ value }}" type="number" bindchange='handlePhone' title="手机号" placeholder="请输入手机号" />
  <view class="color-red">{{ errMessage }}</view>
</i-modal>