addressManager.ttml 3.22 KB

<view tt="container">
  <view tt="my-address-page">
    <view tt="page-wrap clearfix">
        <block tt:if="{{showContainer}}">
          <view tt:if="{{showContainer}}" tt="address-container">
            <radio-group tt="radio-group" bindchange="">
                <label tt="radio" tt:for="{{items}}" tt:key="{{address_id}}" tt:for-index="index">
                    <view tt="address-item" bindtap="selectAddress" data-index='{{index}}'>
                      <image tt:if="{{currentMode != modeEdit && currentSelectedIndex == index}}" src='../../../images/current-select@3x.png' tt='current-select-image'></image>
                      <view tt='name-container'>
                        <view tt="name">{{item.consignee}}</view>
                        <view tt="tel">{{item.mobile}}</view>
                      </view>
                      <view tt="address-info">{{item.area + ' ' + item.address}}</view>
                      <view tt='separator'></view>
                      <view tt="action">
                        <view tt='left' catchtap="setDefaultButtonTapped" data-id="{{item.address_id}}">
                          <image src='{{item.is_default=="Y"?"images/default-select@3x.png":"images/default-normal@3x.png"}}' tt='select-image'></image>
                          <text tt='opt-text'>设为默认</text>
                        </view>
                        <view tt='right'>
                          <view catchtap="editButtonTapped" tt="edit" data-id="{{item.address_id}}" data-consignee="{{item.consignee}}" data-mobile="{{item.mobile}}" data-area_code="{{item.area_code}}" data-address="{{item.area}}" data-detail_address="{{item.address}}">
                          <image src='../../../images/edit@3x.png' tt='select-image'></image>
                          <text tt='opt-text'>编辑</text>
                        </view>
                        <view catchtap="deleteButtonTapped" tt="delete" data-id="{{item.address_id}}" data-index="{{index}}">
                          <image src='../../../images/delete@3x.png' tt='select-image'></image>
                          <text tt='opt-text'>删除</text>
                        </view>
                        </view>
                      </view>
                    </view>
                    <view tt="view-splite">
                    </view>
                </label>
            </radio-group>
          </view>
        </block>
        <block tt:else>
          <view tt='emptytt' style='width:100%;height:100%;margin-top:200rpx'>
            <image src="../../../images/noad@3x.png" style="width:143rpx;height:190rpx;margin-top:80rpx"></image>
            <view style="font-size:30rpx;text-align:center;margin-top:30rpx;color:#444444;">尚无地址,点击底部新增</view>
          </view>
        </block>
        <view tt="add-address" >
          <view tt='separator'></view>   
          <view catchtap="addButtonTapped" tt='add-addressButton'><image src="../../../images/add-normal@3x.png" ></image></view>
          <view tt='separator'></view>  
          <view catchtap="addFromWechatButtonTapped" tt='add-addressButton right'><image src="../../../images/add-wechat@3x.png" ></image></view>
          <view tt='separator'></view>  
        </view>
    </view>        
  </view>

</view>