index.wxml 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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" 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. </scroll-view>
  31. <view class="pop-btn-list">
  32. <button class="submit-btn" bind:tap="onShowAddress">新建收货地址</button>
  33. </view>
  34. <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">
  35. <!-- -->
  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" maxlength="50" />
  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 wx:if="{{ showTextarea }}" model:value="{{ detailAddress }}" label="详细地址" type="textarea" placeholder-style="color: #bbb" placeholder="请填写小区/楼号/单元/门牌号" cursor="{{ cursor }}" autosize="{{ { maxHeight: 80, minHeight: 30 } }}" maxlength="100" border="{{ false }}" />
  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" bind:after-leave="onAreaAfterLeave" bind:before-enter="onAreaBeforeEnter">
  54. <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" />
  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>
  67. </page-meta>