Commit b9489fef by zhuzhequan

添加重新绑定功能

parent 4adac5de
......@@ -6,7 +6,7 @@
<div class="container" v-else>
<div class="logo">
<span class="logo_text">
<img src="../assets/logo.png" height="40px" />
<img style="height: 40px" src="../assets/logo.png" />
</span>
</div>
<nav class="navbar">
......
......@@ -16,33 +16,36 @@
</div>
<div class="login_content">
<div class="no-authority">
<div
style="
<div style="display: flex;align-items: center">
<div
style="
text-align: center;
color: #fff;
font-size: 50px;
line-height: 100px;
font-family: '微软雅黑';
"
v-if="userInfo && userInfo.erpKey">
<a
:href="`https://${userInfo && userInfo.erpKey}.jomalls.com`"
target="_blank"
style="text-decoration: none">
{{ `https://${userInfo && userInfo.erpKey}.jomalls.com` }}
</a>
</div>
<h1
style="
v-if="userInfo && userInfo.erpKey">
<a
:href="`https://${userInfo && userInfo.erpKey}.jomalls.com`"
target="_blank"
style="text-decoration: none">
{{ `https://${userInfo && userInfo.erpKey}.jomalls.com` }}
</a>
</div>
<h1
style="
text-align: center;
color: #fff;
font-size: 50px;
line-height: 100px;
font-family: '微软雅黑';
"
v-else>
您尚未开通erp权限,请联系您的商务经理
</h1>
v-else>
您尚未开通erp权限,请联系您的商务经理
</h1>
<el-button @click="handleBind" style="margin-left: 8px;height: 41px" type="primary">重新绑定ERP</el-button>
</div>
<h2
style="
text-align: center;
......@@ -79,6 +82,22 @@
</el-button>
</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>
</template>
......@@ -92,6 +111,10 @@ export default {
components: {},
data() {
return {
bindVisible:false,
bindForm:{
erpKey:''
},
userInfo: JSON.parse(localStorage.getItem('userInfo')),
shopifyObj: JSON.parse(localStorage.getItem('shopifyObj'))
}
......@@ -107,6 +130,36 @@ export default {
},
methods: {
...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() {
this.$router.push('/')
},
......
......@@ -4,8 +4,8 @@
<div class="logo">
<a href="/">
<span class="logo_text">
<img src="../assets/logo1.png" height="40px" v-if="$isMobile" />
<img src="../assets/logo.png" height="40px" v-else />
<img src="../assets/logo1.png" style="height: 40px" v-if="$isMobile" />
<img src="../assets/logo.png" style="height: 40px" v-else />
</span>
</a>
</div>
......@@ -465,7 +465,7 @@ export default {
code: this.ruleForm.code
}
}
let url = `business/user/login`
post(url, parmes).then((res) => {
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