select-address.wxml 4.1 KB
<!--pages/select-address/select-address.wxml-->
<view class="container">

  <view class="addressBox" wx:for="{{list}}" data-id="{{item.id}}" data-index="{{index}}">
    <view class="left" catchtap="selectAdd" data-id="{{item.id}}" data-index="{{index}}">
      <view class="userInfo">
        <view class="name">{{item.name}}</view>
        <view class="tell">{{item.phone}}</view>
        <view class="lable" wx:if="{{item.delFlag==1}}">默认</view>
      </view>
      <view class="address">{{item.area}}{{item.address}}</view>
      <!-- 默认状态 -->
      <view data-select="{{defaultType}}">
        <view class="selectDefault" bindtap="defaultEvent" data-delFlag="{{item.delFlag}}" data-id="{{item.id}}"
          data-index="{{index}}">
          <view class="defaultPic">
            <image src='{{item.delFlag=="1"?"/images/04-05/default.png":"/images/04-05/undefault.png"}}'></image>
          </view>
          <view class='{{item.delFlag=="1"?"defaultText":"unDefaultText"}}'>{{item.delFlag=="1"?"取消默认":"设为默认"}}</view>
        </view>
        <!-- <view class="selectDefault" wx:if="{{item.delFlag==0}}" bindtap="defaultEvent" >
          <view class="unDefaultPic">
            <image src="/images/04-05/undefault.png"></image>
          </view>
          <view class="unDefaultText"></view>
        </view> -->
      </view>
    </view>
    <view class="right">
      <view class="edit" bindtap="editEvent" data-id="{{item.id}}" data-index="{{index}}">
        <view class="editIcon">
          <image src="/images/04-05/edit.png"></image>
        </view>
        <view class="editText" data-id="{{item.id}}">编辑</view>
      </view>
      <view class="del" bindtap="delEvent" data-id="{{item.id}}" data-index="{{index}}">
        <view class="delIcon">
          <image src="/images/04-05/del.png"></image>
        </view>
        <view class="delText">删除</view>
      </view>
    </view>
  </view>
  <view class="noData" wx:if="{{list.length==0}}">
    <view class="noDataPic">
      <image src="/images/message@2x.png"></image>
    </view>
    <view class="noDataTop">一个地址都没有</view>
    <view class="noDataBottom">快去添加收货地址,买买买吧~</view>
  </view>
  <!-- 超出配送范围 -->
  <!-- <view class="exceedRange" wx:if="{{exceedRange}}">
    <view class="exceedText">以下超出配送范围</view>
    <view>
      <view class="addressBox" wx:for="{{exceedArray}}">
        <view class="left">
          <view class="userInfo">
            <view class="name">{{item.name}}</view>
            <view class="tell">{{item.tell}}</view>
            <view class="lable" wx:if="{{default}}">默认</view>
          </view>
          <view class="address">{{item.address}}</view>
          默认状态
          <view data-select="{{defaultType}}" data-index="index">
            <view class="selectDefault" wx:if="{{item.defaultType==1}}" bindtap="defaultEvent">
              <view class="defaultPic">
                <image src="/images/04-05/default.png"></image>
              </view>
              <view class="defaultText">取消默认</view>
            </view>
            <view class="selectDefault" wx:if="{{item.defaultType==0}}" bindtap="defaultEvent">
              <view class="unDefaultPic">
                <image src="/images/04-05/undefault.png"></image>
              </view>
              <view class="unDefaultText">设为默认</view>
            </view>
          </view>
        </view>
        <view class="right">
          <view class="edit" bindtap="editEvent">
            <view class="editIcon">
              <image src="/images/04-05/edit.png"></image>
            </view>
            <view class="editText">编辑</view>
          </view>
          <view class="del" bindtap="delEvent" data-id="{{item.id}}" data-index="{{index}}">
            <view class="delIcon">
              <image src="/images/04-05/del.png"></image>
            </view>
            <view class="delText">删除</view>
          </view>
        </view>
      </view>
    </view>
  </view> -->
  <!-- 新增地址 -->
  <view class="bottom">
    <view class="addAdress" bindtap="addAddress">
      新增地址
    </view>
  </view>
</view>