index.wxml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <!--pages/address/index.wxml-->
  2. <view class="container">
  3. <navigation-bar title="收货地址"></navigation-bar>
  4. <scroll-view class="record-list" type="list" scroll-y>
  5. <view class="address-list">
  6. <view class="empty-box" wx:if="{{ addressList.length <= 0 }}">
  7. <image src="https://oss.dayaedu.com/ktyq/1731839238916.png"></image>
  8. <view class="empty-text">暂无收货地址</view>
  9. </view>
  10. <view wx:for="{{ addressList }}" wx:key="index">
  11. <view class="address-item {{ item.id === id ? 'active' : '' }}" bind:tap="onSelectAddress" data-id="{{ item.id }}">
  12. <view class="item-title">
  13. {{ item.provinceName }}{{ item.cityName }}{{ item.regionName }}
  14. </view>
  15. <view class="detailAddress">
  16. {{ item.detailAddress }}
  17. </view>
  18. <view class="item-users">
  19. <view class="item-user">
  20. <text>{{ item.name }}</text>
  21. <text>{{ item.phoneNumber }}</text>
  22. </view>
  23. </view>
  24. <view class="item-btn-group">
  25. <button class="btn del-btn" catch:tap="onRemoveAddress" data-id="{{ item.id }}">删除</button>
  26. <button class="btn update-btn" catch:tap="onUpdateAddress" data-id="{{ item.id }}">编辑</button>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </scroll-view>
  32. <view class="pop-btn-list">
  33. <button class="submit-btn" bind:tap="onShowAddress">新建收货地址</button>
  34. </view>
  35. <van-popup show="{{ addressShow }}" safe-area-inset-bottom="{{false}}" lock-scroll="{{true}}" bind:close="onCloseAddress" position="bottom" round z-index="101" bind:after-leave="onAddressAfterLeave">
  36. <view class="addressContainer" wx:if="{{ !addressAfterLeave }}">
  37. <image src="./image/icon-close1.png" class="icon-close" bind:tap="onCloseAddress" />
  38. <view class="pop-address-title">
  39. {{ selectAddressId ? '修改收货地址' : '新建收货地址' }}
  40. </view>
  41. <van-cell-group border="{{ false }}" class="cell-group">
  42. <van-field model:value="{{ name }}" label="收货人" placeholder="请填写收货人姓名" placeholder-style="color: #bbb" />
  43. <van-field model:value="{{ phoneNumber }}" label="电话号码" type="number" placeholder-style="color: #bbb" placeholder="请输入手机号码" maxlength="11" />
  44. <van-field value="{{ provinceName ? provinceName + '/' + cityName + (regionName ? '/' + regionName : '' ) : '' }}" label="选择地区" placeholder-style="color: #bbb" placeholder="请选择省/市/区" readonly is-link bind:tap="onShowAreaList" />
  45. <van-field model:value="{{ detailAddress }}" label="详细地址" type="textarea" placeholder-style="color: #bbb" placeholder="请填写小区/楼号/单元/门牌号" input-class="textarea" autosize />
  46. </van-cell-group>
  47. <view class="pop-btn-group">
  48. <button class="submit-btn" bind:tap="onOperationAddress">确认</button>
  49. </view>
  50. </view>
  51. </van-popup>
  52. <!-- 地区 -->
  53. <van-popup round="{{true}}" lock-scroll="{{true}}" z-index="{{103}}" show="{{showArea}}" position="bottom" safe-area-inset-bottom="{{false}}" bind:close="onCloseAreaList">
  54. <van-area id='area1' areaList="{{areaList}}" visible-item-count="9" item-height="46" value="{{ regionCode }}" bind:cancel="onCloseAreaList" bind:confirm="submitArea" />
  55. </van-popup>
  56. <van-popup round lock-scroll="{{true}}" z-index="{{102}}" show="{{showDialog}}">
  57. <view class="dialog-section">
  58. <view class="dialog-title">删除地址</view>
  59. <view class="dialog-content">确认要删除该收货地址吗?</view>
  60. <view class="dialog-btn-group">
  61. <view class="btn" bind:tap="onDialogClose">取消</view>
  62. <view class="btn del-btn" bind:tap="onDialogConfirm">确认</view>
  63. </view>
  64. </view>
  65. </van-popup>
  66. </view>