index.wxml 4.3 KB

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