Commit 67a7d6bb by Jianli Ou

个人资料接口对接

parent 5e74f315
......@@ -22,6 +22,7 @@ import search from "./module/search.js"
import service from "./module/service.js"
import knowledge from "./module/knowledge.js"
import news from "./module/news.js"
import myManage from "./module/myManage";
const api = {
home,
......@@ -31,6 +32,7 @@ const api = {
service,
knowledge,
news,
myManage,
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 = {}) {
success: true,
returnCode: res.code || ResponseCode.success,
returnMsg: res.msg,
data: res.data || res.page || null
data: res.data || res.page || res.member || null
}
}
......
......@@ -17,7 +17,7 @@
<p>请直接登录<a href="#">网上业务大厅</a>办理商品条码在</p>
</li>
<!-- 厂商实名认证已认证 -->
<li>
<li v-if="loginInfo.isQY === 1">
<p class="content-title">
厂商实名认证(办理“进口商品信息通报、GLN”等业务需先完成此认证)
</p>
......@@ -40,7 +40,7 @@
</p>
</li>
<!-- 厂商实名认证未认证 -->
<li>
<li v-if="loginInfo.isQY === 2">
<p class="content-title">
厂商实名认证(办理“进口商品信息通报、GLN”等业务需先完成此认证)
</p>
......@@ -142,7 +142,21 @@
<script>
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>
......
<template>
<div class="container2">
<div class="content">
<div class="title">个人资料</div>
<div class="content-from">
<el-form ref='ruleForm'
label-position='right'
......@@ -22,50 +22,50 @@
<el-input v-model='form.email' autocomplete='off' placeholder="请输入E-mail"></el-input>
</el-form-item>
<el-form-item label='手机:'
prop='mobile'
prop='phone'
:rules="[{
required: true,
message: '不能为空',
},
{ validator:checkMobileReg },
{ 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>
</el-form-item>
<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 label='证件号码:'
prop='IDNumber'
prop='idcard'
:rules="[{
required: true,
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-option label="身份证" value="1" ></el-option>
</el-select>
</el-input>
</el-form-item>
<el-form-item label='联系地址:'
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 label='工作单位:'
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>
</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>
......@@ -81,23 +81,39 @@ export default {
timer: null,
time: 60,
form: {
id: '',
email:'',
mobile:'',
phone:'',
IDType:'1',
IDNumber:'',
name:'',
idcard: '',
realname:'',
address:'',
officeAddr:''
sign:''
},
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: {
save() {
this.$refs['ruleForm'].validate((valid) => {
if (valid) {
this.saveMemberInfo()
} else {
return false;
}
});
},
register() {
},
checkMobileReg(rule, value, callback) {
if (value !== '') {
if (this.mobilePattern.test(value)) {
......@@ -107,23 +123,35 @@ export default {
}
}
},
checkMobile() {
console.log('checkMobile');
return new Promise((resolve) => {
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>
<style lang="scss" scoped>
.container2{
.content{
@include module-box;
margin-top: 14px;
......@@ -140,7 +168,7 @@ export default {
color: #F26335;
}
}
.content-from{
padding:0 40px;
width: 70%;
......@@ -152,10 +180,10 @@ export default {
margin: 40px 0;
}
.content-from-title::before{
content: "◆";
content: "◆";
color: #F26335;
margin-right: 5px;
}
.el-form {
......@@ -166,7 +194,7 @@ export default {
/deep/.el-input{
font-size: 13px;
}
.smallselect{
width: 100px!important;
......@@ -182,7 +210,7 @@ export default {
padding: 0;
border-radius: 4px;
}
.el-select{
width: 100%;
}
......@@ -194,7 +222,7 @@ export default {
.el-input-group__append {
border-color: transparent;
border: none;
button.el-button--primary {
background-color: $theme-color1;
border-color: $theme-color1;
......@@ -220,7 +248,7 @@ export default {
font-size: 13px;
}
}
}
}
.btn-div{
......@@ -243,10 +271,8 @@ export default {
.container2 .content .content-from {
width: 100%;
margin: 0;
padding:0 10px;
}
}
</style>
\ No newline at end of file
</style>
......@@ -110,6 +110,14 @@ export default {
},
methods: {
loginByUser() {
const loginInfo = {
id: 16,
isQY: 2,
isXT: 2,
userType: 3,
levels: 0
}
localStorage.setItem('loginInfo', JSON.stringify(loginInfo))
this.$refs['userLoginFormRef'].validate((valid) => {
if (valid) {
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