|
|
@ -13,9 +13,78 @@ |
|
|
|
<span class="icon">1</span> |
|
|
|
<span class="icon">1</span> |
|
|
|
<span class="text f_18">配送地址</span></div> |
|
|
|
<span class="text f_18">配送地址</span></div> |
|
|
|
<div class="form"> |
|
|
|
<div class="form"> |
|
|
|
<a-form layout="vertical"> |
|
|
|
<!-- <a-form layout="vertical">--> |
|
|
|
<a-form-item label="请选择您的配送方式"> |
|
|
|
<!-- <a-form-item label="请选择您的配送方式">--> |
|
|
|
<a-radio-group> |
|
|
|
<!-- <a-radio-group>--> |
|
|
|
|
|
|
|
<!-- <a-radio value="0">--> |
|
|
|
|
|
|
|
<!-- 送货上门--> |
|
|
|
|
|
|
|
<!-- </a-radio>--> |
|
|
|
|
|
|
|
<!-- <a-radio value="1">--> |
|
|
|
|
|
|
|
<!-- 门店自提--> |
|
|
|
|
|
|
|
<!-- </a-radio>--> |
|
|
|
|
|
|
|
<!-- </a-radio-group>--> |
|
|
|
|
|
|
|
<!-- </a-form-item>--> |
|
|
|
|
|
|
|
<!-- <a-form-item--> |
|
|
|
|
|
|
|
<!-- label="称呼"--> |
|
|
|
|
|
|
|
<!-- v-if="addr.length == 0"--> |
|
|
|
|
|
|
|
<!-- >--> |
|
|
|
|
|
|
|
<!-- <a-select placeholder="请选择称呼" :value="userSex1" style="width: 120px;margin-right:10px" @change="handleChange1">--> |
|
|
|
|
|
|
|
<!-- <a-select-option value="1">--> |
|
|
|
|
|
|
|
<!-- 先生--> |
|
|
|
|
|
|
|
<!-- </a-select-option>--> |
|
|
|
|
|
|
|
<!-- <a-select-option value="0">--> |
|
|
|
|
|
|
|
<!-- 女士--> |
|
|
|
|
|
|
|
<!-- </a-select-option>--> |
|
|
|
|
|
|
|
<!-- </a-select>--> |
|
|
|
|
|
|
|
<!-- <a-input style="width:300px" placeholder="请输入姓名" :value="userName1" prop="userName"/>--> |
|
|
|
|
|
|
|
<!-- </a-form-item>--> |
|
|
|
|
|
|
|
<!-- <a-form-item--> |
|
|
|
|
|
|
|
<!-- label="选择地址"--> |
|
|
|
|
|
|
|
<!-- v-if="addr.length == 0"--> |
|
|
|
|
|
|
|
<!-- >--> |
|
|
|
|
|
|
|
<!-- <j-area-linkage type="cascader" v-model="addr1" placeholder="请选择省市区"/>--> |
|
|
|
|
|
|
|
<!-- </a-form-item>--> |
|
|
|
|
|
|
|
<!-- <a-form-item--> |
|
|
|
|
|
|
|
<!-- label="详细地址"--> |
|
|
|
|
|
|
|
<!-- v-if="addr.length == 0"--> |
|
|
|
|
|
|
|
<!-- >--> |
|
|
|
|
|
|
|
<!-- <a-textarea v-model="detailed1" placeholder="请输入街道、门牌号码等详细地址" auto-size />--> |
|
|
|
|
|
|
|
<!-- </a-form-item>--> |
|
|
|
|
|
|
|
<!-- <a-form-item--> |
|
|
|
|
|
|
|
<!-- label="手机号码"--> |
|
|
|
|
|
|
|
<!-- v-if="addr.length == 0"--> |
|
|
|
|
|
|
|
<!-- >--> |
|
|
|
|
|
|
|
<!-- <a-input style="width:150px;margin-right:10px" placeholder="+86 中国大陆地区" disabled/>--> |
|
|
|
|
|
|
|
<!-- <a-input style="width:300px" placeholder="请输入手机号码" :value="phone1"/>--> |
|
|
|
|
|
|
|
<!-- </a-form-item>--> |
|
|
|
|
|
|
|
<!-- <a-form-item v-if="addr.length == 0">--> |
|
|
|
|
|
|
|
<!-- <a-checkbox @change="onChange1" :checked="save1">--> |
|
|
|
|
|
|
|
<!-- 保存该地址至地址簿--> |
|
|
|
|
|
|
|
<!-- </a-checkbox>--> |
|
|
|
|
|
|
|
<!-- </a-form-item>--> |
|
|
|
|
|
|
|
<!-- <a-form-item v-if="addr.length != 0">--> |
|
|
|
|
|
|
|
<!-- <p class="d-flex addrTitle">--> |
|
|
|
|
|
|
|
<!-- <span class="f_14 c_1B">地址</span>--> |
|
|
|
|
|
|
|
<!-- <span class="f_12 c_1B" @click="showModal"><a-icon type="plus" />添加新地址</span>--> |
|
|
|
|
|
|
|
<!-- </p>--> |
|
|
|
|
|
|
|
<!-- <div class="d-flex cardDiv">--> |
|
|
|
|
|
|
|
<!-- <div style="width: 370px" v-for="(item,index) in addr" :key="index" @click="handleCard" class="cardItem">--> |
|
|
|
|
|
|
|
<!-- <p class="d-flex f_12 c_1B" style="font-weight: 600;justify-content: space-between;"><span>{{item.name}}</span><span class="f_14" @click="showModal(item)">编辑</span></p>--> |
|
|
|
|
|
|
|
<!-- <p class="f_12 c_31" style="font-weight: 300">+86 {{item.phone}}</p>--> |
|
|
|
|
|
|
|
<!-- <p class="f_12 c_31">{{item.province}}{{item.city}}{{item.area}}{{item.detailed}}</p>--> |
|
|
|
|
|
|
|
<!-- <p class="f_12 c_1B" v-if="item.flag">默认地址</p>--> |
|
|
|
|
|
|
|
<!-- </div>--> |
|
|
|
|
|
|
|
<!-- </div>--> |
|
|
|
|
|
|
|
<!-- </a-form-item>--> |
|
|
|
|
|
|
|
<!-- </a-form>--> |
|
|
|
|
|
|
|
<template> |
|
|
|
|
|
|
|
<a-form-model |
|
|
|
|
|
|
|
ref="ruleForm1" |
|
|
|
|
|
|
|
:model="form1" |
|
|
|
|
|
|
|
:rules="rules" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<a-form-model-item label="请选择您的配送方式" prop="visit"> |
|
|
|
|
|
|
|
<a-radio-group v-model="form1.visit"> |
|
|
|
<a-radio value="0"> |
|
|
|
<a-radio value="0"> |
|
|
|
送货上门 |
|
|
|
送货上门 |
|
|
|
</a-radio> |
|
|
|
</a-radio> |
|
|
@ -23,60 +92,70 @@ |
|
|
|
门店自提 |
|
|
|
门店自提 |
|
|
|
</a-radio> |
|
|
|
</a-radio> |
|
|
|
</a-radio-group> |
|
|
|
</a-radio-group> |
|
|
|
</a-form-item> |
|
|
|
</a-form-model-item> |
|
|
|
<a-form-item |
|
|
|
<a-form-model-item label="称呼" v-if="addr.length == 0"> |
|
|
|
label="称呼" |
|
|
|
<a-select v-model="form1.sex" placeholder="请选择称呼" style="width:120px"> |
|
|
|
v-if="addr.length == 0" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<a-select placeholder="请选择称呼" :value="userSex1" style="width: 120px;margin-right:10px" @change="handleChange1"> |
|
|
|
|
|
|
|
<a-select-option value="1"> |
|
|
|
<a-select-option value="1"> |
|
|
|
先生 |
|
|
|
先生 |
|
|
|
</a-select-option> |
|
|
|
</a-select-option> |
|
|
|
<a-select-option value="0"> |
|
|
|
<a-select-option value="2"> |
|
|
|
女士 |
|
|
|
女士 |
|
|
|
</a-select-option> |
|
|
|
</a-select-option> |
|
|
|
</a-select> |
|
|
|
</a-select> |
|
|
|
<a-input style="width:300px" placeholder="请输入姓名" :value="userName"/> |
|
|
|
</a-form-model-item> |
|
|
|
</a-form-item> |
|
|
|
<a-form-model-item |
|
|
|
<a-form-item |
|
|
|
label="姓名" |
|
|
|
label="选择地址" |
|
|
|
prop="name" |
|
|
|
v-if="addr.length == 0" |
|
|
|
v-if="addr.length == 0" |
|
|
|
> |
|
|
|
> |
|
|
|
<j-area-linkage type="cascader" v-model="addr1" placeholder="请选择省市区"/> |
|
|
|
<a-input placeholder="请输入姓名" v-model="form1.name" /> |
|
|
|
</a-form-item> |
|
|
|
</a-form-model-item> |
|
|
|
<a-form-item |
|
|
|
<a-form-model-item |
|
|
|
label="详细地址" |
|
|
|
label="选择地址" |
|
|
|
|
|
|
|
prop="addr" |
|
|
|
v-if="addr.length == 0" |
|
|
|
v-if="addr.length == 0" |
|
|
|
> |
|
|
|
> |
|
|
|
<a-textarea v-model="detailed1" placeholder="请输入街道、门牌号码等详细地址" auto-size /> |
|
|
|
<j-area-linkage type="cascader" v-model="form1.addr" placeholder="请选择省市区"/> |
|
|
|
</a-form-item> |
|
|
|
</a-form-model-item> |
|
|
|
<a-form-item |
|
|
|
<a-form-model-item label="详细地址" prop="addr" v-if="addr.length == 0"> |
|
|
|
|
|
|
|
<a-input v-model="form1.detailed" type="textarea" /> |
|
|
|
|
|
|
|
</a-form-model-item> |
|
|
|
|
|
|
|
<a-form-model-item |
|
|
|
label="手机号码" |
|
|
|
label="手机号码" |
|
|
|
|
|
|
|
prop="phone" |
|
|
|
v-if="addr.length == 0" |
|
|
|
v-if="addr.length == 0" |
|
|
|
> |
|
|
|
> |
|
|
|
<a-input style="width:150px;margin-right:10px" placeholder="+86 中国大陆地区" disabled/> |
|
|
|
<a-input style="width:400px" placeholder="请输入手机号码" v-model="form1.phone"> |
|
|
|
<a-input style="width:300px" placeholder="请输入手机号码" :value="phone1"/> |
|
|
|
<template slot="addonBefore"> |
|
|
|
</a-form-item> |
|
|
|
<span>+86 中国大陆地区</span> |
|
|
|
<a-form-item v-if="addr.length == 0"> |
|
|
|
</template> |
|
|
|
<a-checkbox @change="onChange1"> |
|
|
|
</a-input> |
|
|
|
|
|
|
|
</a-form-model-item> |
|
|
|
|
|
|
|
<a-form-model-item v-if="addr.length == 0"> |
|
|
|
|
|
|
|
<a-checkbox @change="onChange1" v-model="form1.save"> |
|
|
|
保存该地址至地址簿 |
|
|
|
保存该地址至地址簿 |
|
|
|
</a-checkbox> |
|
|
|
</a-checkbox> |
|
|
|
</a-form-item> |
|
|
|
</a-form-model-item> |
|
|
|
<a-form-item v-if="addr.length != 0"> |
|
|
|
<a-form-model-item v-if="addr.length != 0"> |
|
|
|
<p class="d-flex addrTitle"> |
|
|
|
<p class="d-flex addrTitle"> |
|
|
|
<span class="f_14 c_1B">地址</span> |
|
|
|
<span class="f_14 c_1B">地址</span> |
|
|
|
<span class="f_12 c_1B" @click="showModal"><a-icon type="plus" />添加新地址</span> |
|
|
|
<span class="f_12 c_1B" @click="showModal"><a-icon type="plus" />添加新地址</span> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
<div class="d-flex cardDiv"> |
|
|
|
<div class="d-flex cardDiv"> |
|
|
|
<div style="width: 370px" v-for="(item,index) in addr" :key="index" @click="handleCard" class="cardItem"> |
|
|
|
<div style="width: 370px" v-for="(item,index) in addr" :key="index" @click="handleCard" class="cardItem"> |
|
|
|
<p class="d-flex f_12 c_1B" style="font-weight: 600;justify-content: space-between;"><span>{{item.name}}</span><span class="f_14" @click="showModal">编辑</span></p> |
|
|
|
<p class="d-flex f_12 c_1B" style="font-weight: 600;justify-content: space-between;"> |
|
|
|
|
|
|
|
<span>{{item.name}}</span> |
|
|
|
|
|
|
|
<span class="f_14" @click="handleEdit(item)">编辑</span> |
|
|
|
|
|
|
|
</p> |
|
|
|
<p class="f_12 c_31" style="font-weight: 300">+86 {{item.phone}}</p> |
|
|
|
<p class="f_12 c_31" style="font-weight: 300">+86 {{item.phone}}</p> |
|
|
|
<p class="f_12 c_31">{{item.province}}{{item.city}}{{item.area}}{{item.detailed}}</p> |
|
|
|
<p class="f_12 c_31" style="font-weight: 300"><j-area-linkage type="cascader" :value="item.addr" disabled/></p> |
|
|
|
|
|
|
|
<p class="f_12 c_31">{{item.detailed}}</p> |
|
|
|
<p class="f_12 c_1B" v-if="item.flag">默认地址</p> |
|
|
|
<p class="f_12 c_1B" v-if="item.flag">默认地址</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</a-form-item> |
|
|
|
</a-form-model-item> |
|
|
|
</a-form> |
|
|
|
</a-form-model> |
|
|
|
|
|
|
|
</template> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="addr"> |
|
|
|
<div class="addr"> |
|
|
@ -142,7 +221,7 @@ |
|
|
|
<span class="f_20 c_31">¥35,500</span> |
|
|
|
<span class="f_20 c_31">¥35,500</span> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
<div class="btnDiv"> |
|
|
|
<div class="btnDiv"> |
|
|
|
<div type="primary" class="dialogButton primary f_14">立即购买</div> |
|
|
|
<div type="primary" class="dialogButton primary f_14" @click="toBuy">立即购买</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<p class="explain f_12 c_999">说明</p> |
|
|
|
<p class="explain f_12 c_999">说明</p> |
|
|
|
<p class="f_12 c_999">在线支付订单提交之后15分钟内未付款,订单将被系统自动取消,请您尽快完成支付以确保商品能及时送达,避免取消订单带来不必要的麻烦。</p> |
|
|
|
<p class="f_12 c_999">在线支付订单提交之后15分钟内未付款,订单将被系统自动取消,请您尽快完成支付以确保商品能及时送达,避免取消订单带来不必要的麻烦。</p> |
|
|
@ -160,46 +239,62 @@ |
|
|
|
<a-modal |
|
|
|
<a-modal |
|
|
|
title="添加新地址" |
|
|
|
title="添加新地址" |
|
|
|
:visible="visible" |
|
|
|
:visible="visible" |
|
|
|
:confirm-loading="confirmLoading" |
|
|
|
|
|
|
|
@ok="handleOk" |
|
|
|
@ok="handleOk" |
|
|
|
@cancel="handleCancel" |
|
|
|
@cancel="handleCancel" |
|
|
|
> |
|
|
|
> |
|
|
|
<a-form layout="vertical"> |
|
|
|
<template> |
|
|
|
<a-form-item |
|
|
|
<a-form-model |
|
|
|
label="称呼" |
|
|
|
ref="ruleForm" |
|
|
|
|
|
|
|
:model="form" |
|
|
|
|
|
|
|
:rules="rules" |
|
|
|
> |
|
|
|
> |
|
|
|
<a-select placeholder="请选择称呼" :value="userSex2" style="width: 120px;margin-right:10px" @change="handleChange2"> |
|
|
|
<a-form-model-item label="称呼" > |
|
|
|
|
|
|
|
<a-select v-model="form.sex" placeholder="请选择称呼" style="width:120px"> |
|
|
|
<a-select-option value="1"> |
|
|
|
<a-select-option value="1"> |
|
|
|
先生 |
|
|
|
先生 |
|
|
|
</a-select-option> |
|
|
|
</a-select-option> |
|
|
|
<a-select-option value="0"> |
|
|
|
<a-select-option value="2"> |
|
|
|
女士 |
|
|
|
女士 |
|
|
|
</a-select-option> |
|
|
|
</a-select-option> |
|
|
|
</a-select> |
|
|
|
</a-select> |
|
|
|
<a-input style="width:300px" placeholder="请输入姓名" :value="userName"/> |
|
|
|
</a-form-model-item> |
|
|
|
</a-form-item> |
|
|
|
<a-form-model-item |
|
|
|
<a-form-item |
|
|
|
label="姓名" |
|
|
|
label="选择地址" |
|
|
|
prop="name" |
|
|
|
> |
|
|
|
> |
|
|
|
<j-area-linkage type="cascader" v-model="addr2" placeholder="请选择省市区"/> |
|
|
|
<a-input placeholder="请输入姓名" v-model="form.name" /> |
|
|
|
</a-form-item> |
|
|
|
</a-form-model-item> |
|
|
|
<a-form-item |
|
|
|
<a-form-model-item |
|
|
|
label="详细地址" |
|
|
|
label="选择地址" |
|
|
|
|
|
|
|
prop="addr" |
|
|
|
> |
|
|
|
> |
|
|
|
<a-textarea v-model="detailed2" placeholder="请输入街道、门牌号码等详细地址" auto-size /> |
|
|
|
<j-area-linkage type="cascader" v-model="form.addr" placeholder="请选择省市区"/> |
|
|
|
</a-form-item> |
|
|
|
</a-form-model-item> |
|
|
|
<a-form-item |
|
|
|
<a-form-model-item label="详细地址" prop="detailed"> |
|
|
|
|
|
|
|
<a-input v-model="form.detailed" type="textarea" /> |
|
|
|
|
|
|
|
</a-form-model-item> |
|
|
|
|
|
|
|
<a-form-model-item |
|
|
|
label="手机号码" |
|
|
|
label="手机号码" |
|
|
|
|
|
|
|
prop="phone" |
|
|
|
> |
|
|
|
> |
|
|
|
<a-input style="width:150px;margin-right:10px" placeholder="+86 中国大陆地区" disabled/> |
|
|
|
<a-input style="width:400px" placeholder="请输入手机号码" v-model="form.phone"> |
|
|
|
<a-input style="width:300px" placeholder="请输入手机号码" :value="phone2"/> |
|
|
|
<template slot="addonBefore"> |
|
|
|
</a-form-item> |
|
|
|
<span>+86 中国大陆地区</span> |
|
|
|
<a-form-item> |
|
|
|
</template> |
|
|
|
<a-checkbox @change="onChange4"> |
|
|
|
</a-input> |
|
|
|
|
|
|
|
</a-form-model-item> |
|
|
|
|
|
|
|
<a-form-model-item> |
|
|
|
|
|
|
|
<a-checkbox @change="onChange4" v-model="form.save"> |
|
|
|
保存该地址至地址簿 |
|
|
|
保存该地址至地址簿 |
|
|
|
</a-checkbox> |
|
|
|
</a-checkbox> |
|
|
|
</a-form-item> |
|
|
|
</a-form-model-item> |
|
|
|
</a-form> |
|
|
|
<a-form-model-item> |
|
|
|
|
|
|
|
<a-checkbox @change="onChange5" v-model="form.flag"> |
|
|
|
|
|
|
|
设置为默认地址 |
|
|
|
|
|
|
|
</a-checkbox> |
|
|
|
|
|
|
|
</a-form-model-item> |
|
|
|
|
|
|
|
</a-form-model> |
|
|
|
|
|
|
|
</template> |
|
|
|
</a-modal> |
|
|
|
</a-modal> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -207,62 +302,89 @@ |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
ModalText: 'Content of the modal', |
|
|
|
|
|
|
|
visible: false, |
|
|
|
visible: false, |
|
|
|
confirmLoading: false, |
|
|
|
|
|
|
|
formLayout: 'horizontal', |
|
|
|
formLayout: 'horizontal', |
|
|
|
delivery:'17719145652',//配送方式 |
|
|
|
delivery:'17719145652',//配送方式 |
|
|
|
visit:'0',//是否送货上门 |
|
|
|
visit:'0',//是否送货上门 |
|
|
|
phone:'17719145652',//电话 |
|
|
|
phone:'17719145652',//电话 |
|
|
|
userSex1:'',//性别1 |
|
|
|
|
|
|
|
userSex2:'',//性别2 |
|
|
|
|
|
|
|
userName:'',//姓名 |
|
|
|
|
|
|
|
phone1:'',//电话1 |
|
|
|
|
|
|
|
phone2:'',//电话2 |
|
|
|
|
|
|
|
addr:[ |
|
|
|
addr:[ |
|
|
|
// { |
|
|
|
{ |
|
|
|
// id:1, |
|
|
|
id:1, |
|
|
|
// name:'吴一', |
|
|
|
name:'吴一', |
|
|
|
// phone:'17777777777', |
|
|
|
sex:'1', |
|
|
|
// province:'河南省', |
|
|
|
phone:'17777777777', |
|
|
|
// city:'驻马店市', |
|
|
|
addr:'210521', |
|
|
|
// area:'驿城区', |
|
|
|
detailed:'黄淮学院北区', |
|
|
|
// detailed:'黄淮学院北区', |
|
|
|
flag:true,//是否是默认地址 |
|
|
|
// flag:true,//是否是默认地址 |
|
|
|
},//地址一 |
|
|
|
// },//地址一 |
|
|
|
{ |
|
|
|
// { |
|
|
|
id:2, |
|
|
|
// id:2, |
|
|
|
name:'吴二', |
|
|
|
// name:'吴二', |
|
|
|
sex:'2', |
|
|
|
// phone:'17777777777', |
|
|
|
phone:'17777777777', |
|
|
|
// province:'河南省', |
|
|
|
addr:'210521', |
|
|
|
// city:'驻马店市', |
|
|
|
detailed:'黄淮学院北区', |
|
|
|
// area:'驿城区', |
|
|
|
flag:false,//是否是默认地址 |
|
|
|
// detailed:'黄淮学院北区', |
|
|
|
},//地址二 |
|
|
|
// flag:false,//是否是默认地址 |
|
|
|
{ |
|
|
|
// },//地址二 |
|
|
|
id:3, |
|
|
|
// { |
|
|
|
name:'吴三', |
|
|
|
// id:3, |
|
|
|
sex:'1', |
|
|
|
// name:'吴三', |
|
|
|
phone:'17777777777', |
|
|
|
// phone:'17777777777', |
|
|
|
addr:'210521', |
|
|
|
// province:'河南省', |
|
|
|
detailed:'黄淮学院北区', |
|
|
|
// city:'驻马店市', |
|
|
|
flag:false,//是否是默认地址 |
|
|
|
// area:'驿城区', |
|
|
|
},//地址三 |
|
|
|
// detailed:'黄淮学院北区', |
|
|
|
|
|
|
|
// flag:false,//是否是默认地址 |
|
|
|
|
|
|
|
// },//地址三 |
|
|
|
|
|
|
|
],//地址列表 |
|
|
|
],//地址列表 |
|
|
|
addr1:'',//地址选择器1 |
|
|
|
|
|
|
|
addr2:'',//地址选择器2 |
|
|
|
|
|
|
|
detailed1:'',//详细地址1 |
|
|
|
|
|
|
|
detailed2:'',//详细地址2 |
|
|
|
|
|
|
|
save1:false,//是否保存到地址簿1 |
|
|
|
|
|
|
|
save2:false,//是否保存到地址簿2 |
|
|
|
|
|
|
|
value: 1, |
|
|
|
value: 1, |
|
|
|
paymentMode:'',//支付方式 |
|
|
|
paymentMode:'',//支付方式 |
|
|
|
bill:'',//是否需要电子发票 |
|
|
|
bill:'',//是否需要电子发票 |
|
|
|
chinaArea:[], |
|
|
|
|
|
|
|
num:1,//已选几件商品 |
|
|
|
num:1,//已选几件商品 |
|
|
|
}; |
|
|
|
form2:{ |
|
|
|
|
|
|
|
userSex2:'',//性别2(弹窗) |
|
|
|
|
|
|
|
userName2:'',//姓名2(弹窗) |
|
|
|
|
|
|
|
phone2:'',//电话2(弹窗) |
|
|
|
|
|
|
|
addr2:'',//地址选择器2(弹窗) |
|
|
|
|
|
|
|
detailed2:'',//详细地址2(弹窗) |
|
|
|
|
|
|
|
save2:true,//是否保存到地址簿2(弹窗) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//弹窗数据 |
|
|
|
|
|
|
|
form: { |
|
|
|
|
|
|
|
id:'', |
|
|
|
|
|
|
|
sex: undefined, |
|
|
|
|
|
|
|
name: '', |
|
|
|
|
|
|
|
addr: '', |
|
|
|
|
|
|
|
detailed: '', |
|
|
|
|
|
|
|
phone: '', |
|
|
|
|
|
|
|
save: true, |
|
|
|
|
|
|
|
flag:false//是否默认地址 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//外部添加地址数据 |
|
|
|
|
|
|
|
form1: { |
|
|
|
|
|
|
|
visit:'', |
|
|
|
|
|
|
|
sex: undefined, |
|
|
|
|
|
|
|
name: '', |
|
|
|
|
|
|
|
addr: '', |
|
|
|
|
|
|
|
detailed: '', |
|
|
|
|
|
|
|
phone: '', |
|
|
|
|
|
|
|
save: true, |
|
|
|
|
|
|
|
flag:false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
rules: { |
|
|
|
|
|
|
|
name: [ |
|
|
|
|
|
|
|
{ required: true, message: '请输入姓名', trigger: 'blur' }, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
visit: [ |
|
|
|
|
|
|
|
{ required: true, message: '请选择您的配送方式', trigger: 'change' }, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
addr: [{ required: true, message: '请选择地址', trigger: 'blur' }], |
|
|
|
|
|
|
|
detailed: [{ required: true, message: '请输入详细地址', trigger: 'blur' }], |
|
|
|
|
|
|
|
phone: [{ required: true, message: '请输入手机号码', trigger: 'blur' }, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
addrList:[ |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
|
formItemLayout() { |
|
|
|
formItemLayout() { |
|
|
@ -303,7 +425,7 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
onChange1(e) { |
|
|
|
onChange1(e) { |
|
|
|
console.log(`checked = ${e.target.checked}`); |
|
|
|
console.log(`checked = ${e.target.checked}`); |
|
|
|
this.save1 = !this.save1 |
|
|
|
this.form1.save = !this.form1.save |
|
|
|
}, |
|
|
|
}, |
|
|
|
onChange2(e) { |
|
|
|
onChange2(e) { |
|
|
|
console.log('radio checked', e.target.value); |
|
|
|
console.log('radio checked', e.target.value); |
|
|
@ -314,28 +436,90 @@ |
|
|
|
this.bill = e.target.checked |
|
|
|
this.bill = e.target.checked |
|
|
|
}, |
|
|
|
}, |
|
|
|
onChange4(e) { |
|
|
|
onChange4(e) { |
|
|
|
console.log('radio checked', e.target.value); |
|
|
|
console.log(`checked = ${e.target.checked}`); |
|
|
|
this.save2 = !this.save2 |
|
|
|
this.form.save = !this.form.save |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
onChange5(e) { |
|
|
|
|
|
|
|
console.log(`checked = ${e.target.checked}`); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 新增 |
|
|
|
showModal() { |
|
|
|
showModal() { |
|
|
|
this.visible = true; |
|
|
|
this.visible = true; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 编辑 |
|
|
|
|
|
|
|
handleEdit(item){ |
|
|
|
|
|
|
|
this.visible = true; |
|
|
|
|
|
|
|
console.log(item) |
|
|
|
|
|
|
|
// this.form.id = '' |
|
|
|
|
|
|
|
this.form.sex = item.sex |
|
|
|
|
|
|
|
this.form.name = item.name |
|
|
|
|
|
|
|
this.form.addr = item.addr |
|
|
|
|
|
|
|
this.form.phone = item.phone |
|
|
|
|
|
|
|
this.form.detailed = item.detailed |
|
|
|
|
|
|
|
this.form.flag = item.flag |
|
|
|
|
|
|
|
}, |
|
|
|
handleOk(e) { |
|
|
|
handleOk(e) { |
|
|
|
this.ModalText = 'The modal will be closed after two seconds'; |
|
|
|
//判断是添加地址还是修改地址 |
|
|
|
this.confirmLoading = true; |
|
|
|
let that = this |
|
|
|
setTimeout(() => { |
|
|
|
let newFlag = this.addr.some(function(item){ |
|
|
|
|
|
|
|
return item.id == that.form.id |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.$refs.ruleForm.validate(valid => { |
|
|
|
|
|
|
|
if (valid) { |
|
|
|
|
|
|
|
if(newFlag){//是修改 |
|
|
|
|
|
|
|
// this.addr. |
|
|
|
|
|
|
|
}else{//是新增 |
|
|
|
|
|
|
|
this.addr.push(this.form) |
|
|
|
|
|
|
|
console.log('this.addr') |
|
|
|
|
|
|
|
console.log(this.addr) |
|
|
|
|
|
|
|
} |
|
|
|
this.visible = false; |
|
|
|
this.visible = false; |
|
|
|
this.confirmLoading = false; |
|
|
|
} else { |
|
|
|
}, 2000); |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleCancel(e) { |
|
|
|
handleCancel(e) { |
|
|
|
console.log('Clicked cancel button'); |
|
|
|
|
|
|
|
this.visible = false; |
|
|
|
this.visible = false; |
|
|
|
|
|
|
|
this.$refs.ruleForm.resetFields(); |
|
|
|
|
|
|
|
this.form.name = '' |
|
|
|
|
|
|
|
this.form.sex = '' |
|
|
|
|
|
|
|
this.form.name = '' |
|
|
|
|
|
|
|
this.form.addr = '' |
|
|
|
|
|
|
|
this.form.phone = '' |
|
|
|
|
|
|
|
this.form.detailed = '' |
|
|
|
|
|
|
|
this.form.flag = false |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
toBuy(){ |
|
|
|
|
|
|
|
this.$refs.ruleForm1.validate(valid => { |
|
|
|
|
|
|
|
if (valid) { |
|
|
|
|
|
|
|
this.addrList.push(this.form1) |
|
|
|
|
|
|
|
console.log(this.addrList) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
<style lang="less" scoped> |
|
|
|
<style lang="less" scoped> |
|
|
|
|
|
|
|
.ant-form /deep/ .ant-form-item{ |
|
|
|
|
|
|
|
margin-bottom: 12px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.cardDiv .j-area-linkage /deep/ .area-select{ |
|
|
|
|
|
|
|
background-color: #fff; |
|
|
|
|
|
|
|
border: none; |
|
|
|
|
|
|
|
span{ |
|
|
|
|
|
|
|
padding-left: 0; |
|
|
|
|
|
|
|
font-size: 12px; |
|
|
|
|
|
|
|
color:#313131; |
|
|
|
|
|
|
|
cursor:auto; |
|
|
|
|
|
|
|
font-weight: 500; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
i{ |
|
|
|
|
|
|
|
display: none; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
.btnDiv{ |
|
|
|
.btnDiv{ |
|
|
|
border-bottom: 1px solid #E7E7E7; |
|
|
|
border-bottom: 1px solid #E7E7E7; |
|
|
|
padding-bottom: 30px; |
|
|
|
padding-bottom: 30px; |
|
|
@ -421,6 +605,9 @@ |
|
|
|
.f_12{ |
|
|
|
.f_12{ |
|
|
|
border: 1px solid #C8C6C5; |
|
|
|
border: 1px solid #C8C6C5; |
|
|
|
padding: 3px 8px; |
|
|
|
padding: 3px 8px; |
|
|
|
|
|
|
|
height: 26px; |
|
|
|
|
|
|
|
box-sizing: border-box; |
|
|
|
|
|
|
|
line-height: 18px; |
|
|
|
} |
|
|
|
} |
|
|
|
i{ |
|
|
|
i{ |
|
|
|
margin-right: 3px; |
|
|
|
margin-right: 3px; |
|
|
@ -430,7 +617,11 @@ |
|
|
|
.cardDiv{ |
|
|
|
.cardDiv{ |
|
|
|
justify-content: space-between; |
|
|
|
justify-content: space-between; |
|
|
|
flex-wrap: wrap; |
|
|
|
flex-wrap: wrap; |
|
|
|
|
|
|
|
.f_12{ |
|
|
|
|
|
|
|
height: 26px; |
|
|
|
|
|
|
|
box-sizing: border-box; |
|
|
|
|
|
|
|
line-height: 18px; |
|
|
|
|
|
|
|
} |
|
|
|
.cardItem{ |
|
|
|
.cardItem{ |
|
|
|
padding: 15px 16px; |
|
|
|
padding: 15px 16px; |
|
|
|
margin-bottom: 20px; |
|
|
|
margin-bottom: 20px; |
|
|
|