Commit b9489fef by zhuzhequan

添加重新绑定功能

parent 4adac5de
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<div class="container" v-else> <div class="container" v-else>
<div class="logo"> <div class="logo">
<span class="logo_text"> <span class="logo_text">
<img src="../assets/logo.png" height="40px" /> <img style="height: 40px" src="../assets/logo.png" />
</span> </span>
</div> </div>
<nav class="navbar"> <nav class="navbar">
......
...@@ -16,33 +16,36 @@ ...@@ -16,33 +16,36 @@
</div> </div>
<div class="login_content"> <div class="login_content">
<div class="no-authority"> <div class="no-authority">
<div <div style="display: flex;align-items: center">
style=" <div
style="
text-align: center; text-align: center;
color: #fff; color: #fff;
font-size: 50px; font-size: 50px;
line-height: 100px; line-height: 100px;
font-family: '微软雅黑'; font-family: '微软雅黑';
" "
v-if="userInfo && userInfo.erpKey"> v-if="userInfo && userInfo.erpKey">
<a <a
:href="`https://${userInfo && userInfo.erpKey}.jomalls.com`" :href="`https://${userInfo && userInfo.erpKey}.jomalls.com`"
target="_blank" target="_blank"
style="text-decoration: none"> style="text-decoration: none">
{{ `https://${userInfo && userInfo.erpKey}.jomalls.com` }} {{ `https://${userInfo && userInfo.erpKey}.jomalls.com` }}
</a> </a>
</div> </div>
<h1 <h1
style=" style="
text-align: center; text-align: center;
color: #fff; color: #fff;
font-size: 50px; font-size: 50px;
line-height: 100px; line-height: 100px;
font-family: '微软雅黑'; font-family: '微软雅黑';
" "
v-else> v-else>
您尚未开通erp权限,请联系您的商务经理 您尚未开通erp权限,请联系您的商务经理
</h1> </h1>
<el-button @click="handleBind" style="margin-left: 8px;height: 41px" type="primary">重新绑定ERP</el-button>
</div>
<h2 <h2
style=" style="
text-align: center; text-align: center;
...@@ -79,6 +82,22 @@ ...@@ -79,6 +82,22 @@
</el-button> </el-button>
</div> </div>
</div> </div>
<el-dialog :close-on-click-modal="false" :visible.sync="bindVisible" titlt="" width="500px">
<template slot="title">重新绑定ERP</template>
<el-form ref="formRef" :model="bindForm" inline label-width="80px">
<el-form-item label="域名" prop="erpKey" :rules="[{ required: true, message: '请输入erp域名',trigger:'blur' }]">
<el-input style="width: 100%;" v-model="bindForm.erpKey" clearable>
<template slot="append">
.jomalls.com
</template>
</el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="confirmBind" type="primary">确定</el-button>
<el-button @click="bindVisible = false">取消</el-button>
</template>
</el-dialog>
<!-- <div class="contain" v-else></div> --> <!-- <div class="contain" v-else></div> -->
</div> </div>
</template> </template>
...@@ -92,6 +111,10 @@ export default { ...@@ -92,6 +111,10 @@ export default {
components: {}, components: {},
data() { data() {
return { return {
bindVisible:false,
bindForm:{
erpKey:''
},
userInfo: JSON.parse(localStorage.getItem('userInfo')), userInfo: JSON.parse(localStorage.getItem('userInfo')),
shopifyObj: JSON.parse(localStorage.getItem('shopifyObj')) shopifyObj: JSON.parse(localStorage.getItem('shopifyObj'))
} }
...@@ -107,6 +130,36 @@ export default { ...@@ -107,6 +130,36 @@ export default {
}, },
methods: { methods: {
...mapMutations(['setUserInfo']), ...mapMutations(['setUserInfo']),
confirmBind(){
this.$refs.formRef.validate((v)=>{
if(v){
let u = localStorage.getItem('userInfo')
if(u) u = JSON.parse(u)
let obj = {
erpKey: this.bindForm.erpKey,
}
if(u.email) obj.email = u.email
if(u.phoneNumber) obj.phoneNumber = u.phoneNumber
post('business/user/bindErp',obj).then((res) => {
if(res.code === 200){
this.$message.success('操作成功')
u.erpKey = this.bindForm.erpKey
localStorage.setItem('userInfo',JSON.stringify(u))
location.reload()
}
})
}
})
},
handleBind(){
this.bindVisible = true
this.bindForm = {
erpKey: ''
}
this.$nextTick(function(){
this.$refs.formRef?.clearValidate()
})
},
goBack() { goBack() {
this.$router.push('/') this.$router.push('/')
}, },
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<div class="logo"> <div class="logo">
<a href="/"> <a href="/">
<span class="logo_text"> <span class="logo_text">
<img src="../assets/logo1.png" height="40px" v-if="$isMobile" /> <img src="../assets/logo1.png" style="height: 40px" v-if="$isMobile" />
<img src="../assets/logo.png" height="40px" v-else /> <img src="../assets/logo.png" style="height: 40px" v-else />
</span> </span>
</a> </a>
</div> </div>
...@@ -465,7 +465,7 @@ export default { ...@@ -465,7 +465,7 @@ export default {
code: this.ruleForm.code code: this.ruleForm.code
} }
} }
let url = `business/user/login` let url = `business/user/login`
post(url, parmes).then((res) => { post(url, parmes).then((res) => {
if (res.code === 200) { if (res.code === 200) {
......
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