You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
git/scr/miniprogram-2/pages/usercenter/address/edit/index.wxml

147 lines
4.0 KiB

<view class="address-detail">
<view class="divider-line" />
<t-location
title="获取微信收获地址"
isCustomStyle
t-class="address-detail-wx-location"
bind:change="getWeixinAddress"
>
<t-icon
class="address-detail-wx-arrow"
name="arrow_forward"
prefix="wr"
color="#bbb"
size="32rpx"
/>
</t-location>
<view class="divider-line" />
<view class="form-address">
<form class="form-content">
<t-cell-group>
<t-cell t-class-left="t-cell-left" t-class-title="t-cell-title" title="收货人">
<t-input
class="t-input"
slot="note"
t-class="field-text"
data-item="name"
maxlength="20"
type="text"
value="{{locationState.name}}"
placeholder="您的姓名"
bind:change="onInputValue"
/>
</t-cell>
<t-cell t-class-left="t-cell-left" t-class-title="t-cell-title" title="手机号">
<t-input
slot="note"
class="t-input"
t-class="field-text"
type="number"
value="{{locationState.phone}}"
maxlength="11"
placeholder="联系您的手机号"
bind:change="onInputValue"
data-item="phone"
/>
</t-cell>
<t-cell t-class-left="t-cell-left" t-class-title="t-cell-title" title="地区">
<t-input
slot="note"
class="t-input"
t-class="field-text"
placeholder="省/市/区"
data-item="address"
value="{{locationState.provinceName ? locationState.provinceName+'/':'' }}{{locationState.cityName ? locationState.cityName+'/':''}}{{locationState.districtName}}"
catch:tap="onPickArea"
disabled
/>
<t-icon
slot="right-icon"
t-class="map"
prefix="wr"
name="location"
catch:tap="onSearchAddress"
/>
</t-cell>
<t-cell
t-class-left="t-cell-left"
t-class-title="t-cell-title"
t-class-note="t-textarea-cell-note"
title="详细地址"
>
<t-textarea
slot="note"
class="t-input"
type="text"
value="{{locationState.detailAddress}}"
placeholder="门牌号等(例如:10栋1001号)"
autosize
bind:change="onInputValue"
data-item="detailAddress"
/>
</t-cell>
<view class="divider-line" />
<t-cell
t-class-left="t-cell-left"
t-class-note="t-cell-note"
t-class-title="t-cell-title"
title="标签"
>
<view class="t-input address-flex-box" slot="note">
<t-button
wx:for="{{labels}}"
wx:for-item="label"
wx:key="index"
t-class="label-list {{locationState.labelIndex === index ? 'active-btn':''}}"
bindtap="onPickLabels"
data-item="{{index}}"
>
{{label.name}}
</t-button>
<t-button t-class="label-list" bindtap="addLabels">
<t-icon name="add" size="40rpx" color="#bbb" />
</t-button>
</view>
</t-cell>
<view class="divider-line" />
<t-cell t-class-left="t-cell-left" title="设置为默认收货地址">
<t-switch
value="{{locationState.isDefault}}"
slot="note"
colors="{{['#0ABF5B', '#c6c6c6']}}"
bind:change="onCheckDefaultAddress"
/>
</t-cell>
</t-cell-group>
<view class="submit">
<t-button t-class="btn-submit-address {{submitActive ? 'theme-wrapper-class' : 'disabled'}}" bind:tap="formSubmit">
保存
</t-button>
</view>
</form>
</view>
<t-area-picker
show="{{areaPickerVisible}}"
value="{{locationState.districtCode}}"
area-data="{{areaData}}"
title="选择地区"
columns="{{columns}}"
bind:confirm="onInputValue"
data-item="address"
data-type="1"
/>
</view>
<t-dialog
visible="{{visible}}"
t-class-confirm="dialog__button-confirm"
title="填写标签名称"
confirm-btn="确定"
cancel-btn="取消"
bind:confirm="confirmHandle"
bind:cancel="cancelHandle"
>
<t-input slot="content" model:value="{{labelValue}}" placeholder="请输入标签名称" borderless />
</t-dialog>
<t-toast id="t-toast" />