Commit a90c6063 by 林家欣

Merge branch 'master' of https://gitee.com/gs1-office-web-sit/gs1

parents 0131f489 67a7d6bb
...@@ -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>
......
...@@ -22,30 +22,30 @@ ...@@ -22,30 +22,30 @@
<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>
...@@ -55,17 +55,17 @@ ...@@ -55,17 +55,17 @@
<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,16 +123,28 @@ export default { ...@@ -107,16 +123,28 @@ 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>
...@@ -246,7 +274,5 @@ export default { ...@@ -246,7 +274,5 @@ export default {
padding:0 10px; padding:0 10px;
} }
} }
</style> </style>
...@@ -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