1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <!--pages/address/index.wxml-->
- <page-meta page-style="{{ addressShow || showArea ? 'overflow: hidden;' : '' }} overscroll-behavior: none;" style="height: 100vh;">
- <view class="container">
- <navigation-bar title="收货地址"></navigation-bar>
- <scroll-view class="record-list" type="list" scroll-y="{{ addressShow || showArea ? false : true }}">
- <view class="address-list">
- <view class="empty-box" wx:if="{{ addressList.length <= 0 }}">
- <image src="https://oss.dayaedu.com/ktyq/1731839238916.png"></image>
- <view class="empty-text">暂无收货地址</view>
- </view>
- <view wx:for="{{ addressList }}" wx:key="index" class="address-item {{ item.id === id ? 'active' : '' }}" bind:tap="onSelectAddress" data-id="{{ item.id }}">
- <view class="item-title">
- {{ item.provinceName }}{{ item.cityName }}{{ item.regionName }}
- </view>
- <view class="detailAddress">
- {{ item.detailAddress }}
- </view>
- <view class="item-users">
- <view class="item-user">
- <text>{{ item.name }}</text>
- <text>{{ item.phoneNumber }}</text>
- </view>
- </view>
- <view class="item-btn-group">
- <button class="btn del-btn" catch:tap="onRemoveAddress" data-id="{{ item.id }}">删除</button>
- <button class="btn update-btn" catch:tap="onUpdateAddress" data-id="{{ item.id }}">编辑</button>
- </view>
- </view>
- </view>
- </scroll-view>
- <view class="pop-btn-list">
- <button class="submit-btn" bind:tap="onShowAddress">新建收货地址</button>
- </view>
- <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">
- <!-- -->
- <view class="addressContainer" wx:if="{{ !addressAfterLeave }}">
- <image src="./image/icon-close1.png" class="icon-close" bind:tap="onCloseAddress" />
- <view class="pop-address-title">
- {{ selectAddressId ? '编辑收货地址' : '新建收货地址' }}
- </view>
- <van-cell-group border="{{ false }}" class="cell-group">
- <van-field model:value="{{ name }}" label="收货人" placeholder="请填写收货人姓名" placeholder-style="color: #bbb" maxlength="50" />
- <van-field model:value="{{ phoneNumber }}" label="电话号码" type="number" placeholder-style="color: #bbb" placeholder="请输入手机号码" maxlength="11" />
- <van-field value="{{ provinceName ? provinceName + '/' + cityName + (regionName ? '/' + regionName : '' ) : '' }}" label="选择地区" placeholder-style="color: #bbb" placeholder="请选择省/市/区" readonly is-link bind:tap="onShowAreaList" />
- <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 }}" />
- </van-cell-group>
- <view class="pop-btn-group">
- <button class="submit-btn" bind:tap="onOperationAddress">确认</button>
- </view>
- </view>
- </van-popup>
- <!-- 地区 -->
- <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">
- <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" />
- </van-popup>
- <van-popup round lock-scroll="{{true}}" z-index="{{102}}" show="{{showDialog}}">
- <view class="dialog-section">
- <view class="dialog-title">删除地址</view>
- <view class="dialog-content">确认要删除该收货地址吗?</view>
- <view class="dialog-btn-group">
- <view class="btn" bind:tap="onDialogClose">取消</view>
- <view class="btn del-btn" bind:tap="onDialogConfirm">确认</view>
- </view>
- </view>
- </van-popup>
- </view>
- </page-meta>
|