[fix] 保全:联系方式变更, E-a-04联系方式变更 页逻辑完成, 正在进行mock开发

This commit is contained in:
tian.guangyuan
2020-04-08 18:07:18 +08:00
parent bdaa2e56e6
commit affcb65f36
4 changed files with 86 additions and 77 deletions

View File

@@ -0,0 +1,10 @@
import request from '@/assets/js/utils/request'
import getUrl from '@/assets/js/utils/get-url'
export function edorChange(data) {
return request({
url: getUrl('/edor/item/change', 0),
method: 'post',
data
})
}

4
src/config/preserve.js Normal file
View File

@@ -0,0 +1,4 @@
// 保全
export default {
'/edor/item/change': 'https://mockapi.eolinker.com/ScCp8u6b1d5781111d84f7b3fe45a0852e59758cd7a87e5/edor/item/change',
}

View File

@@ -11,6 +11,8 @@ import product from './product'
import serve from './serve' import serve from './serve'
import common from './common' import common from './common'
import survey from './survey' import survey from './survey'
import preserve from './preserve'
const mockBaseUrl = 'http://rap2api.taobao.org/app/mock' const mockBaseUrl = 'http://rap2api.taobao.org/app/mock'
let baseObj = { let baseObj = {
@@ -18,6 +20,6 @@ let baseObj = {
'/user/info': mockBaseUrl + '/223948/info', '/user/info': mockBaseUrl + '/223948/info',
'/user/logout': mockBaseUrl + '/223948/logout' '/user/logout': mockBaseUrl + '/223948/logout'
} }
Object.assign(baseObj, proposal, sale, customer, my, product, serve, common, survey) Object.assign(baseObj, proposal, sale, customer, my, product, serve, common, survey, preserve)
export default baseObj export default baseObj

View File

@@ -4,9 +4,9 @@
<!-- 基本信息 --> <!-- 基本信息 -->
<van-cell-group class="mt10"> <van-cell-group class="mt10">
<p style="border-bottom: 1px solid #ebedf0;" class="fs15 fwb pl10 pv12">基本信息</p> <p style="border-bottom: 1px solid #ebedf0;" class="fs15 fwb pl10 pv12">基本信息</p>
<van-field label="姓名" required :value="basicInfo.customerName" readonly /> <van-field label="姓名" required :value="customerInfo.customerName" readonly />
<van-field <van-field
v-model="basicInfo.customerMobile" v-model="customerInfo.customerMobile"
clearable clearable
required required
label="移动电话" label="移动电话"
@@ -26,16 +26,21 @@
v-validate="'required'" v-validate="'required'"
@click="homeShow = true" @click="homeShow = true"
/> />
<van-field v-model="basicInfo.homeAddress" label="" name="详细地址" placeholder="请输入详细地址" v-validate="'required'" clearable maxlength="30" /> <van-field v-model="customerInfo.address" label="" name="详细地址" placeholder="请输入详细地址" v-validate="'required'" clearable maxlength="30" />
<van-field v-model="basicInfo.homeZip" label="邮编" required name="邮编" placeholder="请输入" v-validate="'required|zipCode'" maxlength="6" clearable /> <van-field
v-model="customerInfo.homeZip"
<van-field v-model="basicInfo.customerEmail" label="电子邮箱" name="电子邮箱" placeholder="非必填" v-validate="'email'" clearable /> label="邮编"
required
<van-field v-model="basicInfo.homePhone" label="固定电话" name="固定电话" placeholder="非必填" maxlength="13" clearable /> name="邮编"
placeholder="请输入"
v-validate="'required|zipCode'"
maxlength="6"
clearable
/>
<van-field v-model="customerInfo.customerEmail" label="电子邮箱" name="电子邮箱" placeholder="非必填" v-validate="'email'" clearable />
<van-field v-model="customerInfo.homePhone" label="固定电话" name="固定电话" placeholder="非必填" maxlength="13" clearable />
</van-cell-group> </van-cell-group>
<div class="bottom-btn bg-white"><van-button type="danger" size="large" @click="nextStep" v-no-more-click="2000">下一步</van-button></div> <div class="bottom-btn bg-white"><van-button type="danger" size="large" @click="nextStep" v-no-more-click="2000">下一步</van-button></div>
<!-- 家庭地址选择 --> <!-- 家庭地址选择 -->
<van-popup v-model="homeShow" position="bottom"> <van-popup v-model="homeShow" position="bottom">
<van-area :area-list="areaList" value="110101" @confirm="sureArea($event)" @cancel="homeShow = false" /> <van-area :area-list="areaList" value="110101" @confirm="sureArea($event)" @cancel="homeShow = false" />
@@ -44,7 +49,8 @@
</template> </template>
<script> <script>
import { Field, CellGroup, Checkbox, Popup, Picker, Area, RadioGroup, Radio } from 'vant' import { Field, CellGroup, Popup, Picker, Area } from 'vant'
import { edorChange } from '@/api/ebiz/preserve/preserve'
import areaList from '@/assets/js/utils/area' import areaList from '@/assets/js/utils/area'
import getAreaName from '@/assets/js/utils/get-area-name' import getAreaName from '@/assets/js/utils/get-area-name'
export default { export default {
@@ -52,53 +58,45 @@ export default {
components: { components: {
[Field.name]: Field, [Field.name]: Field,
[CellGroup.name]: CellGroup, [CellGroup.name]: CellGroup,
[Checkbox.name]: Checkbox,
[Popup.name]: Popup, [Popup.name]: Popup,
[Picker.name]: Picker, [Picker.name]: Picker,
[Area.name]: Area, [Area.name]: Area
[RadioGroup.name]: RadioGroup,
[Radio.name]: Radio
}, },
data() { data() {
return { let feachData = {
areaList, surrenderDTOList: [
homeName: '', {
homeShow: false, surrenderId: '',
basicInfo: { edorapplyNo: '',
customerName: '', surrenderType: '1',
customerSex: '', customerInfoDTOList: []
customerBirthday: '', }
idType: '1', ]
idNo: '', },
isEndDate: '', // 证件截止日期 customerInfo = {
isLongId: '1', // 长期 surrenderId: '',
customerMobile: '', // 移动电话 customerNo: '客户号',
customerEmail: '', // 电子邮箱 customerType: '客户类型',
customerNo: '', customerName: '客户姓名',
companyAddress: '', // 单位详细地址 idType: '证件类型',
companyProvince: '', idNo: '证件号码',
companyCity: '', customerMobile: '客户手机号',
companyArea: '', customerEmail: '客户邮箱',
companyZip: '',
companyPhone: '',
homeAddress: '', // 家庭详细地址
homeProvince: '',
homeCity: '',
homeArea: '',
homeZip: '',
homePhone: '',
nationality: '', //国籍
jobname: '', //职业类别
jobcode: '', //职业编码
addressStatus: '0', // 设为联系地址
address: '', // 联系详细地址
province: '', province: '',
city: '', city: '',
area: '', area: '',
zipCode: '', address: '详细地址',
telephone: '' homeZip: '邮编',
}, homePhone: '固定电话',
customerInfo: {} isNewInfo: '是否变更后信息'
}
feachData.surrenderDTOList[0].customerInfoDTOList.push(customerInfo)
return {
homeName: '',
homeShow: false,
areaList,
feachData,
customerInfo
} }
}, },
created() { created() {
@@ -114,14 +112,9 @@ export default {
if (localStorage.customerInfo) { if (localStorage.customerInfo) {
this.customerInfo = JSON.parse(localStorage.customerInfo) this.customerInfo = JSON.parse(localStorage.customerInfo)
} }
for (var key in this.basicInfo) { //地址
if (this.customerInfo[key]) { if (this.customerInfo.province && this.customerInfo.city && this.customerInfo.area) {
this.basicInfo[key] = this.customerInfo[key] this.homeName = getAreaName([{ code: this.customerInfo.province }, { code: this.customerInfo.city }, { code: this.customerInfo.area }])
}
}
//家庭地址
if (this.basicInfo.homeProvince && this.basicInfo.homeCity && this.basicInfo.homeArea) {
this.homeName = getAreaName([{ code: this.basicInfo.homeProvince }, { code: this.basicInfo.homeCity }, { code: this.basicInfo.homeArea }])
} }
}) })
}, },
@@ -129,7 +122,7 @@ export default {
//区域选择 //区域选择
sureArea(area) { sureArea(area) {
this.homeName = getAreaName(area) this.homeName = getAreaName(area)
;[this.basicInfo.homeProvince, this.basicInfo.homeCity, this.basicInfo.homeArea] = [area[0].code, area[1].code, area[2].code] ;[this.customerInfo.province, this.customerInfo.city, this.customerInfo.area] = [area[0].code, area[1].code, area[2].code]
this.homeShow = false this.homeShow = false
}, },
// 下一步 // 下一步
@@ -137,17 +130,23 @@ export default {
//表单校验 //表单校验
this.$validator.validate().then(valid => { this.$validator.validate().then(valid => {
if (true == valid) { if (true == valid) {
// if (res.result == 0) { edorChange(this.feachData)
this.$jump({ .then( res => {
flag: 'h5', if (res.result == 0) {
extra: { this.$jump({
url: location.origin + '/#/preserve/HandleResult' flag: 'h5',
}, extra: {
routerInfo: '/preserve/HandleResult' url: location.origin + '/#/preserve/HandleResult'
},
routerInfo: '/preserve/HandleResult'
})
} else {
this.$toast(res.resultMessage)
}
})
.catch( err => {
console.log(err);
}) })
// } else {
// this.$toast(res.resultMessage)
// }
} else { } else {
this.$toast(this.$validator.errors.all()[0]) this.$toast(this.$validator.errors.all()[0])
return return
@@ -160,11 +159,5 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.basic-info-container { .basic-info-container {
/deep/.van-checkbox {
margin-left: auto;
}
/deep/.van-radio {
margin-left: auto;
}
} }
</style> </style>