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