Commit 67a7d6bb by Jianli Ou

个人资料接口对接

parent 5e74f315
...@@ -22,6 +22,7 @@ import search from "./module/search.js" ...@@ -22,6 +22,7 @@ import search from "./module/search.js"
import service from "./module/service.js" import service from "./module/service.js"
import knowledge from "./module/knowledge.js" import knowledge from "./module/knowledge.js"
import news from "./module/news.js" import news from "./module/news.js"
import myManage from "./module/myManage";
const api = { const api = {
home, home,
...@@ -31,6 +32,7 @@ const api = { ...@@ -31,6 +32,7 @@ const api = {
service, service,
knowledge, knowledge,
news, news,
myManage,
getCaptcha, getCaptcha,
} }
......
import {
POST, POSTFORM, UPLOAD
} from "../fetch.js"
const Prefix = process.env.NODE_ENV === 'development' ? '/gs1' : '';
// 个人资料
const memberInfo = (params = {}) => {
return POST(`${Prefix}/office/member/api/info` + `/${params.id}`, params)
}
// 保存个人资料
const saveMemberInfo = (params = {}) => {
return POST(`${Prefix}/office/member/api/update`, params)
}
export default {
memberInfo,
saveMemberInfo
}
...@@ -69,7 +69,7 @@ export function handleResponseSuccess(res = {}) { ...@@ -69,7 +69,7 @@ export function handleResponseSuccess(res = {}) {
success: true, success: true,
returnCode: res.code || ResponseCode.success, returnCode: res.code || ResponseCode.success,
returnMsg: res.msg, returnMsg: res.msg,
data: res.data || res.page || null data: res.data || res.page || res.member || null
} }
} }
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<p>请直接登录<a href="#">网上业务大厅</a>办理商品条码在</p> <p>请直接登录<a href="#">网上业务大厅</a>办理商品条码在</p>
</li> </li>
<!-- 厂商实名认证已认证 --> <!-- 厂商实名认证已认证 -->
<li> <li v-if="loginInfo.isQY === 1">
<p class="content-title"> <p class="content-title">
厂商实名认证(办理“进口商品信息通报、GLN”等业务需先完成此认证) 厂商实名认证(办理“进口商品信息通报、GLN”等业务需先完成此认证)
</p> </p>
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</p> </p>
</li> </li>
<!-- 厂商实名认证未认证 --> <!-- 厂商实名认证未认证 -->
<li> <li v-if="loginInfo.isQY === 2">
<p class="content-title"> <p class="content-title">
厂商实名认证(办理“进口商品信息通报、GLN”等业务需先完成此认证) 厂商实名认证(办理“进口商品信息通报、GLN”等业务需先完成此认证)
</p> </p>
...@@ -142,7 +142,21 @@ ...@@ -142,7 +142,21 @@
<script> <script>
export default { export default {
name: "index" name: "index",
data () {
return {
loginInfo: {
id: 16, // 用户ID
isQY: 2, // 是否开通企业认证 1.是 2.否
isXT: 2, // 是否是业务大厅系统成员 1.是 2.否
userType: 3, // 用户类型 1、业务大厅(手机号用户);2、业务大厅(条码成员);3、官网用户
levels: 0 // 用户权限 空.普通用户 0.中心管理员 1.校验管理员 其他4位.分中心管理员
}
}
},
mounted() {
this.loginInfo = JSON.parse(localStorage.getItem('loginInfo'))
}
} }
</script> </script>
......
<template> <template>
<div class="container2"> <div class="container2">
<div class="content"> <div class="content">
<div class="title">个人资料</div> <div class="title">个人资料</div>
<div class="content-from"> <div class="content-from">
<el-form ref='ruleForm' <el-form ref='ruleForm'
label-position='right' label-position='right'
...@@ -22,50 +22,50 @@ ...@@ -22,50 +22,50 @@
<el-input v-model='form.email' autocomplete='off' placeholder="请输入E-mail"></el-input> <el-input v-model='form.email' autocomplete='off' placeholder="请输入E-mail"></el-input>
</el-form-item> </el-form-item>
<el-form-item label='手机:' <el-form-item label='手机:'
prop='mobile' prop='phone'
:rules="[{ :rules="[{
required: true, required: true,
message: '不能为空', message: '不能为空',
}, },
{ validator:checkMobileReg }, { validator:checkMobileReg },
{ validator:checkMobile, trigger:'blur' },]"> { validator:checkMobile, trigger:'blur' },]">
<el-input v-model='form.mobile' autocomplete='off' placeholder="请输入手机"></el-input> <el-input v-model='form.phone' autocomplete='off' placeholder="请输入手机"></el-input>
<p>请在[用户信息管理]-[修改手机号码]中修改正确的手机号码,便于找回密码</p> <p>请在[用户信息管理]-[修改手机号码]中修改正确的手机号码,便于找回密码</p>
</el-form-item> </el-form-item>
<el-form-item label='真实姓名:' <el-form-item label='真实姓名:'
prop='name' prop='realname'
> >
<el-input v-model='form.name' autocomplete='off' placeholder="请输入真实姓名:"></el-input> <el-input v-model='form.realname' autocomplete='off' placeholder="请输入真实姓名:"></el-input>
</el-form-item> </el-form-item>
<el-form-item label='证件号码:' <el-form-item label='证件号码:'
prop='IDNumber' prop='idcard'
:rules="[{ :rules="[{
required: true, required: true,
message: '不能为空', message: '不能为空',
}]" }]"
> >
<el-input placeholder="请输入证件号码" v-model="form.IDNumber" class="input-with-select"> <el-input placeholder="请输入证件号码" v-model="form.idcard" class="input-with-select">
<el-select v-model="form.IDType" slot="prepend" placeholder="请选择" class="smallselect"> <el-select v-model="form.IDType" slot="prepend" placeholder="请选择" class="smallselect">
<el-option label="身份证" value="1" ></el-option> <el-option label="身份证" value="1" ></el-option>
</el-select> </el-select>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label='联系地址:' <el-form-item label='联系地址:'
prop='address' prop='address'
> >
<el-input v-model='form.email' autocomplete='off' placeholder="请输入联系地址"></el-input> <el-input v-model='form.address' autocomplete='off' placeholder="请输入联系地址"></el-input>
</el-form-item> </el-form-item>
<el-form-item label='工作单位:' <el-form-item label='工作单位:'
prop='oficeAddr' prop='oficeAddr'
> >
<el-input v-model='form.oficeAddr' autocomplete='off' placeholder="请输入工作单位"></el-input> <el-input v-model='form.sign' autocomplete='off' placeholder="请输入工作单位"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div class="btn-div"> <div class="btn-div">
<el-button type="primary" style="width: 110px">保 存</el-button> <el-button type="primary" @click="save" style="width: 110px">保 存</el-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -81,23 +81,39 @@ export default { ...@@ -81,23 +81,39 @@ export default {
timer: null, timer: null,
time: 60, time: 60,
form: { form: {
id: '',
email:'', email:'',
mobile:'', phone:'',
IDType:'1', IDType:'1',
IDNumber:'', idcard: '',
name:'', realname:'',
address:'', address:'',
officeAddr:'' sign:''
}, },
mobilePattern: /^((13[0-9])|(15[^4])|(18[0-9])|(17[0-8])|(147))\d{8}$/, mobilePattern: /^((13[0-9])|(15[^4])|(18[0-9])|(17[0-8])|(147))\d{8}$/,
memberInfo: {},
loginInfo: {
id: 16, // 用户ID
isQY: 2, // 是否开通企业认证 1.是 2.否
isXT: 2, // 是否是业务大厅系统成员 1.是 2.否
userType: 3, // 用户类型 1、业务大厅(手机号用户);2、业务大厅(条码成员);3、官网用户
levels: 0 // 用户权限 空.普通用户 0.中心管理员 1.校验管理员 其他4位.分中心管理员
}
} }
}, },
methods: { methods: {
save() {
this.$refs['ruleForm'].validate((valid) => {
if (valid) {
this.saveMemberInfo()
} else {
return false;
}
});
},
register() { register() {
}, },
checkMobileReg(rule, value, callback) { checkMobileReg(rule, value, callback) {
if (value !== '') { if (value !== '') {
if (this.mobilePattern.test(value)) { if (this.mobilePattern.test(value)) {
...@@ -107,23 +123,35 @@ export default { ...@@ -107,23 +123,35 @@ export default {
} }
} }
}, },
checkMobile() { checkMobile() {
console.log('checkMobile'); console.log('checkMobile');
return new Promise((resolve) => { return new Promise((resolve) => {
resolve(true); resolve(true);
}); });
}, },
async getMemberInfo() {
this.memberInfo = (await this.$api.myManage.memberInfo({id: this.loginInfo.id})).data
Object.keys(this.form).forEach(key => {
this.form[key] = this.memberInfo[key] || ''
})
},
async saveMemberInfo() {
if ((await this.$api.myManage.saveMemberInfo(this.form)).success) {
this.$message.success('个人资料保存成功')
}
}
}, },
mounted() {
this.loginInfo = JSON.parse(localStorage.getItem('loginInfo'))
this.getMemberInfo()
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container2{ .container2{
.content{ .content{
@include module-box; @include module-box;
margin-top: 14px; margin-top: 14px;
...@@ -140,7 +168,7 @@ export default { ...@@ -140,7 +168,7 @@ export default {
color: #F26335; color: #F26335;
} }
} }
.content-from{ .content-from{
padding:0 40px; padding:0 40px;
width: 70%; width: 70%;
...@@ -152,10 +180,10 @@ export default { ...@@ -152,10 +180,10 @@ export default {
margin: 40px 0; margin: 40px 0;
} }
.content-from-title::before{ .content-from-title::before{
content: "◆"; content: "◆";
color: #F26335; color: #F26335;
margin-right: 5px; margin-right: 5px;
} }
.el-form { .el-form {
...@@ -166,7 +194,7 @@ export default { ...@@ -166,7 +194,7 @@ export default {
/deep/.el-input{ /deep/.el-input{
font-size: 13px; font-size: 13px;
} }
.smallselect{ .smallselect{
width: 100px!important; width: 100px!important;
...@@ -182,7 +210,7 @@ export default { ...@@ -182,7 +210,7 @@ export default {
padding: 0; padding: 0;
border-radius: 4px; border-radius: 4px;
} }
.el-select{ .el-select{
width: 100%; width: 100%;
} }
...@@ -194,7 +222,7 @@ export default { ...@@ -194,7 +222,7 @@ export default {
.el-input-group__append { .el-input-group__append {
border-color: transparent; border-color: transparent;
border: none; border: none;
button.el-button--primary { button.el-button--primary {
background-color: $theme-color1; background-color: $theme-color1;
border-color: $theme-color1; border-color: $theme-color1;
...@@ -220,7 +248,7 @@ export default { ...@@ -220,7 +248,7 @@ export default {
font-size: 13px; font-size: 13px;
} }
} }
} }
} }
.btn-div{ .btn-div{
...@@ -243,10 +271,8 @@ export default { ...@@ -243,10 +271,8 @@ export default {
.container2 .content .content-from { .container2 .content .content-from {
width: 100%; width: 100%;
margin: 0; margin: 0;
padding:0 10px; padding:0 10px;
} }
} }
</style>
</style>
\ No newline at end of file
...@@ -110,6 +110,14 @@ export default { ...@@ -110,6 +110,14 @@ export default {
}, },
methods: { methods: {
loginByUser() { loginByUser() {
const loginInfo = {
id: 16,
isQY: 2,
isXT: 2,
userType: 3,
levels: 0
}
localStorage.setItem('loginInfo', JSON.stringify(loginInfo))
this.$refs['userLoginFormRef'].validate((valid) => { this.$refs['userLoginFormRef'].validate((valid) => {
if (valid) { if (valid) {
if (this.userForm.validateCode.toLowerCase() === 'kjjj') { if (this.userForm.validateCode.toLowerCase() === 'kjjj') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment