<!--pages/address/address.wxml-->
<view class="page">
  <nav navName="地址管理"></nav>
  <scroll-view scroll-y="true" class="hasdata" bindrefresherrefresh="handleRefresher" refresher-triggered="{{isTriggered}}"	refresher-threshold="100"	refresher-enabled="true">
    <view  wx:if="{{addressList.length>0}}">
    <van-radio-group value="{{address_id}}" bind:change="onChange">
    <van-swipe-cell right-width="{{ 65 }}" wx:for="{{addressList}}" wx:key="address_id"  bind:close="onCloseAddress" data-id="{{item.address_id}}" async-close>
      <van-cell-group >
        <view class="list">
          <view class="cell" bindtap="selectAddress" data-id="{{item.address_id}}" data-name="{{item.consignee_name}}" data-phone="{{item.consignee_tel}}" 
          data-province="{{item.province}}"
          data-city="{{item.city}}"
          data-country="{{item.county}}"
          data-address="{{item.address}}"
         >
           <van-radio  wx:if="{{order_prescription_id}}" right="leftcon" name="{{item.address_id}}" checked-color="#3CC7C0;"></van-radio>
            <view class="radiowraper"   style="width:100%">
              <view class="namebox">
              <view class="name">{{item.consignee_name}}</view>
              <view class="phone">{{item.consignee_tel_mask}}</view>
              <view class="moren" wx:if="{{item.is_default==1}}">默认</view>
              <!-- 地址标签（1:家 2:公司 3:学校） -->
              <view class="type" wx:if="{{item.tag==1}}">家</view>
              <view class="type" wx:elif="{{item.tag==2}}">公司</view>
              <view class="type" wx:elif="{{item.tag==3}}">学校</view>
              <view class="type"wx:elif="{{item.tag==4}}">其他</view>
            </view>
            <view class="addbox">
              <view class="address">{{item.province}}{{item.city}}{{item.county}} {{item.address}}</view>
             <view class="editbox" catchtap="goEdit" data-id="{{item.address_id}}">
              <image src="{{img_host+'/bianji-2.png'}}" class="edit"  ></image></view>
            </view>
           </view>
          </view>
        </view>
      </van-cell-group>
      <view slot="right" class="van-swipe-cell__right" >删除</view>
    </van-swipe-cell>
  </van-radio-group>
  </view>
  <view class="nodata" wx:else>
    <image src="{{img_host+'/address.png'}}" class="address"></image>
    <view class="tips">暂无收货地址哦~</view>
  </view> 
  </scroll-view>
  
  <view class="btnbox">
    <view class="btn" bindtap="addAddresss">添加地址</view>
  </view>
</view>
<dialog bind:confirm="confirm" showDialog="{{show}}" message="{{message}}"></dialog>