Commit 75abb357 by zhuzhequan

Merge branch 'dev' into 'master'

添加重新绑定功能

See merge request !16
parents 86f62861 b9489fef
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,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,6 +16,7 @@ ...@@ -16,6 +16,7 @@
</div> </div>
<div class="login_content"> <div class="login_content">
<div class="no-authority"> <div class="no-authority">
<div style="display: flex;align-items: center">
<div <div
style=" style="
text-align: center; text-align: center;
...@@ -43,6 +44,8 @@ ...@@ -43,6 +44,8 @@
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>
......
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