<!-- 导航栏 -->
<t-navbar title="地址管理" left-arrow />
<!-- 搜索框 -->
<view class="search-bar">
  <t-input
    placeholder="快速搜索你要找的地址"
    prefix-icon="search"
    clearable
    bind:change="onSearchChange"
    value="{{searchValue}}"
    class="serch-input"
    
  />
</view>

<!-- 地址列表 -->
<scroll-view class="address-list" scroll-y>
  <view wx:if="{{noResult}}" class="no-result-tip">
    <t-empty icon="info-circle-filled" description="暂无数据" />
  </view>
  <block wx:else>
    <view wx:for="{{addressList}}" wx:key="id" class="address-item" bindtap="selectAddress" data-item="{{item}}" >
      <view class="address-header">
        <text class="name">{{item.liaison}}</text>
        <text class="phone">{{item.phone}}</text>
        <t-tag theme="primary" wx:if="{{item.isDefault==='Y'}}" class="default-tag">默认</t-tag>
        <t-tag theme="primary" variant="outline" wx:if="{{item.tag}}">{{item.tag}}</t-tag>
      </view>
      <view class="address-detail">{{item.fullAddress}}</view>
      <t-icon name="edit" class="edit-icon" catchtap="onEdit" data-id="{{item.id}}"  />
    </view>
  </block>
</scroll-view>

<!-- 底部操作栏 -->
<view class="footer">
  <t-button theme="default" shape="round" class="wechat-btn" bind:tap="onImportWechatAddress">
    <view class="wechat-btn-content">
      <t-icon name="logo-wechat-stroke" class="wechat-icon" />
      <text>微信导入</text>
    </view>
  </t-button>
  <t-button theme="primary" shape="round" class="add-btn" bind:tap="onAddress">
    新增收货地址
  </t-button>
</view>
