list.wxml
2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<import src="./template/editor/editor.wxml"/>
<view wx:if="{{showEditAddrPage}}" class="container">
<template is="addressEditer" data="{{...editAddrPageData, areaPicker, pickerProvice, pickerCity, pickerArea, areaValue}}"/>
</view>
<view wx:else class="container">
<view wx:if="{{addressEmpty}}" class="empty-address">
<image src="https://cdn.yoho.cn/yoho-brand-shop/assets/img/home/location.png" class="empty-img"></image>
<view>尚无地址,点击底部新增</view>
</view>
<view wx:for="{{addressList}}" wx:key="{{item.address_id}}" class="addr-item" data-key="{{index}}" bindtap="chooseAddr">
<view wx:if="{{item.address_id === selectedId}}" class="selected"><text class="iconfont icon-duihao"></text></view>
<view class="info">
<text class="name">{{item.consignee}}</text>
<text class="phone">{{item.mobile}}</text>
<text class="direction">{{item.area + ' ' + item.address}}</text>
</view>
<view class="options">
<block wx:if="{{item.is_default === 'Y'}}">
<text class="iconfont icon-round-checked left-icon"></text>
<text class="left-icon"> 默认地址</text>
</block>
<block wx:else>
<text class="iconfont icon-round left-icon" data-key="{{index}}" catchtap="setDefaultAddr"></text>
<text class="left-icon" data-key="{{index}}" catchtap="setDefaultAddr"> 设为默认</text>
</block>
<text class="iconfont icon-delete right-icon" data-key="{{index}}" data-id="{{item.address_id}}" catchtap="deleteAddr"> 删除</text>
<text class="iconfont icon-edit right-icon" data-key="{{index}}" catchtap="showEditAddrPage"> 编辑</text>
</view>
</view>
<view class="option-wrap">
<button bindtap="showEditAddrPage" class="enter-address-btn">
<text class="iconfont icon-plus"></text>
手动添加
</button>
<button bindtap="addWechatAddr" class="wechat-address-btn">
<text class="iconfont icon-wechat"></text>
微信添加
</button>
</view>
</view>