Commit a4c6cecf authored by tyn's avatar tyn

前台end

parent eeafcbfb
import network from "@/utils/network";
export const getAuthenticationDetailApi = () => network({
url: "/attestation/information",
method: "post"
});
// 获取供应商类型
export const getSupplierTypeApi = () => network({
url : "/category/list/tree",
method : "post"
})
\ No newline at end of file
...@@ -42,7 +42,7 @@ export const checkUser = (data) => network({ ...@@ -42,7 +42,7 @@ export const checkUser = (data) => network({
}); });
export const loginApi = (data) => network({ export const loginApi = (data) => network({
url: "", url: "/login",
method: "post", method: "post",
data data
}); });
...@@ -54,5 +54,5 @@ export const loginOutApi = () => network({ ...@@ -54,5 +54,5 @@ export const loginOutApi = () => network({
export const getUserInfoApi = () => network({ export const getUserInfoApi = () => network({
url: "/getInfo", url: "/getInfo",
method: "post" method: "get"
}); });
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br>
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router" target="_blank" rel="noopener">router</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex" target="_blank" rel="noopener">vuex</a></li>
</ul>
<h3>Essential Links</h3>
<ul>
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
<template>
<div class="side-bar">
<!-- 顶部系统名 -->
<div class="top-title">
<img src="@/assets/images/logo.png" alt="">
</div>
<!-- 菜单 -->
<div class="menu">
<el-menu mode="vertical" default-active="/home/index" :collapse="collapseStatus" :unique-opened="true" @select="selectMenu">
<template v-for="(item, subIndex) of menus">
<el-menu-item v-if="item.show" :index="item.path" :key="item.path">
{{item.title}}
</el-menu-item>
</template>
<el-submenu v-for="(subItem, index) of subMenu" :index="subItem.path" :key="subItem.path">
<template slot="title">{{subItem.meta.title}}</template>
<template v-if="subItem.children">
<el-menu-item v-for="(item, subIndex) of subItem.children" :index="item.path" :key="item.path">
{{item.meta.title}}
</el-menu-item>
</template>
</el-submenu>
</el-menu>
</div>
</div>
</template>
<script>
import { routes } from "@/router/";
export default {
name: "sideBar",
data() {
return {
menus: [],
subMenu: [],
collapseStatus: false
};
},
//可访问data属性
created() {
this.createMenu();
},
//计算集
computed: {
},
//方法集
methods: {
createMenu() {
routes.forEach(item => {
if (item.path === "/home") {
if (item.children && item.children.length > 0) {
let temp = item.children;
temp.forEach(child => {
if (child.children && child.children.length > 0) {
this.subMenu.push(child);
} else {
this.menus.push({
path: child.path,
name: child.name,
title: child.meta?.title,
show: child.meta?.show
});
}
});
}
}
});
},
selectMenu(path, pathName) {
if (this.$route.path === path) return;
this.$router.push({ path });
}
},
}
</script>
<style lang="scss" scoped>
.side-bar {
width: 100%;
height: 100%;
border-right: 1px solid #eeeeee;
// 顶部系统名
.top-title {
width: 100%;
height: 70px;
display: flex;
justify-content: center;
align-items: center;
background: #fff;
border-bottom: 1px solid #eeeeee;
}
// 菜单
.menu {
width: 100%;
height: calc(100% - 60px);
}
}
</style>
<template>
<div class="home-container">
<!-- 左侧菜单 -->
<div class="side-bar">
<side-bar></side-bar>
</div>
<!-- 主体 -->
<div class="main-container">
<div class="nav-bar">
</div>
<div class="content-container">
<router-view></router-view>
</div>
</div>
</div>
</template>
<script>
import SideBar from "@/components/SideBar";
export default {
name: "home",
components: {
SideBar
},
data() {
return {
};
},
//可访问data属性
created() {
},
//计算集
computed: {
},
//方法集
methods: {
},
}
</script>
<style lang="scss" scoped>
.home-container {
position: relative;
width: 100%;
height: 100%;
display: flex;
overflow: hidden;
.side-bar {
width: 260px;
height: 100%;
}
.main-container {
position: relative;
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
.nav-bar {
width: 100%;
height: 70px;
border-bottom: 1px solid #EEEEEE;
box-sizing: border-box;
}
.content-container {
width: 100%;
height: calc(100% - 70px);
padding: 16px;
box-sizing: border-box;
overflow-y: auto;
overflow-x: hidden;
}
}
}
</style>
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
<el-input placeholder="请输入登录密码" show-password v-model="mimaparam.password"></el-input> <el-input placeholder="请输入登录密码" show-password v-model="mimaparam.password"></el-input>
</div> </div>
<div class="inputs"> <div class="inputs">
<el-input width="191px" class="small" placeholder="请输入验证码" v-model="mimaparam.code" ></el-input> <el-input width="191px" class="small" placeholder="请输入验证码" v-model="mimaparam.code"></el-input>
<div class="login-code"> <div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img"/> <img :src="codeUrl" @click="getCode" class="login-code-img" />
</div> </div>
</div> </div>
<div class="loginin" @click="login">登录</div> <div class="loginin" @click="login">登录</div>
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
<div class="inputs"> <div class="inputs">
<el-input class="small" v-model="resetparam.code" placeholder="请输入验证码"></el-input> <el-input class="small" v-model="resetparam.code" placeholder="请输入验证码"></el-input>
<div class="login-code"> <div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img"/> <img :src="codeUrl" @click="getCode" class="login-code-img" />
</div> </div>
</div> </div>
<div class="loginin" @click="yzSmscode">下一步</div> <div class="loginin" @click="yzSmscode">下一步</div>
...@@ -76,10 +76,10 @@ ...@@ -76,10 +76,10 @@
<!-- 提交重置的密码--> <!-- 提交重置的密码-->
<div class="logoncont" v-if="type=='tjmm'"> <div class="logoncont" v-if="type=='tjmm'">
<div class="inputs"> <div class="inputs">
<el-input v-model="resetparam.passWord" placeholder="请输入密码" show-password ></el-input> <el-input v-model="resetparam.passWord" placeholder="请输入密码" show-password></el-input>
</div> </div>
<div class="inputs"> <div class="inputs">
<el-input v-model="resetparam.passWord1" placeholder="请再次输入密码" show-password ></el-input> <el-input v-model="resetparam.passWord1" placeholder="请再次输入密码" show-password></el-input>
</div> </div>
<div class="loginin" @click="resetpwd">提交</div> <div class="loginin" @click="resetpwd">提交</div>
<div class="loginzc" style="justify-content: center"> <div class="loginzc" style="justify-content: center">
...@@ -152,7 +152,8 @@ ...@@ -152,7 +152,8 @@
<br> <br>
<br>2、用户应对其在交易平台及产品上发布的任何信息承担全部责任。 <br>2、用户应对其在交易平台及产品上发布的任何信息承担全部责任。
<br> <br>
<br>3、用户应遵守国家相关法律和规定,不得利用交易平台、产品从事任何有违法律和社会公德的活动;不得传输任何非法的、骚扰性的、中伤他人的、辱骂性的、恐吓性的、伤害性的、庸俗的,淫秽的等信息;不得传输助长国内不利条件和涉及国家安全的资料;不得干扰交易平台的服务秩序;否则,交易平台有权取消其账号,相关的系统记 录有可能作为证据提交司法机关。 <br>3、用户应遵守国家相关法律和规定,不得利用交易平台、产品从事任何有违法律和社会公德的活动;不得传输任何非法的、骚扰性的、中伤他人的、辱骂性的、恐吓性的、伤害性的、庸俗的,淫秽的等信息;不得传输助长国内不利条件和涉及国家安全的资料;不得干扰交易平台的服务秩序;否则,交易平台有权取消其账号,相关的系统记
录有可能作为证据提交司法机关。
<br> <br>
<br>4、用户不得将帐号、密码及相关服务销售、转让、或赠与任何第三方,由此造成的一切后果和责任均由用户承担。如遇以上情形,交易平台有权通过电话、邮件或传真方式 告知,经警告无效后交易平台有权停止服务,并有权单方终止对用户提供的服务。 <br>4、用户不得将帐号、密码及相关服务销售、转让、或赠与任何第三方,由此造成的一切后果和责任均由用户承担。如遇以上情形,交易平台有权通过电话、邮件或传真方式 告知,经警告无效后交易平台有权停止服务,并有权单方终止对用户提供的服务。
<br> <br>
...@@ -237,9 +238,7 @@ ...@@ -237,9 +238,7 @@
<el-input v-model="ruleForm.amount" placeholder="请输入注册资本"></el-input> <el-input v-model="ruleForm.amount" placeholder="请输入注册资本"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="成立日期" prop="date" class="left-title"> <el-form-item label="成立日期" prop="date" class="left-title">
<el-date-picker v-model="ruleForm.date" <el-date-picker v-model="ruleForm.date" type="date" placeholder="请输入成立日期">
type="date"
placeholder="请输入成立日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="企业注册地" prop="region"> <el-form-item label="企业注册地" prop="region">
...@@ -249,21 +248,16 @@ ...@@ -249,21 +248,16 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="办公地址" prop="address" class="left-title"> <el-form-item label="办公地址" prop="address" class="left-title">
<el-input type="textarea" :autosize="{ minRows: 2, maxRows: 2}" placeholder="请输入办公地址" v-model="ruleForm.address" style="width: 670px;"></el-input> <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 2}" placeholder="请输入办公地址" v-model="ruleForm.address"
style="width: 670px;"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="企业简介" prop="detail" class="left-title"> <el-form-item label="企业简介" prop="detail" class="left-title">
<el-input type="textarea" :autosize="{ minRows: 3, maxRows: 3}" placeholder="请输入企业简介" v-model="ruleForm.detail" style="width: 670px;"></el-input> <el-input type="textarea" :autosize="{ minRows: 3, maxRows: 3}" placeholder="请输入企业简介" v-model="ruleForm.detail" style="width: 670px;">
</el-input>
</el-form-item> </el-form-item>
<el-form-item label="营业执照扫描件" prop="detail" class="upload-image" style="margin-bottom: 34px;"> <el-form-item label="营业执照扫描件" prop="detail" class="upload-image" style="margin-bottom: 34px;">
<el-upload ref="upload" <el-upload ref="upload" :auto-upload="false" :data="ruleForm" class="avatar-uploader" action="#" :show-file-list="false"
:auto-upload="false" :on-success="handleAvatarSuccess" :on-change='changeUpload' :before-upload='beforeAvatarUpload'>
:data="ruleForm"
class="avatar-uploader"
action="#"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:on-change='changeUpload'
:before-upload='beforeAvatarUpload'>
<img v-if="ruleForm.imageUrl" :src="ruleForm.imageUrl" class="avatar" style=" height: 100%;"> <img v-if="ruleForm.imageUrl" :src="ruleForm.imageUrl" class="avatar" style=" height: 100%;">
<div v-else> <div v-else>
...@@ -274,15 +268,8 @@ ...@@ -274,15 +268,8 @@
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="法人代表身份证扫描件" prop="detail" class="upload-image" style="width: 375px; margin-bottom: 34px;"> <el-form-item label="法人代表身份证扫描件" prop="detail" class="upload-image" style="width: 375px; margin-bottom: 34px;">
<el-upload ref="upload" <el-upload ref="upload" :auto-upload="false" :data="ruleForm" class="avatar-uploader" action="#" :show-file-list="false"
:auto-upload="false" :on-success="handleAvatarSuccess" :on-change='changeUpload' :before-upload='beforeAvatarUpload'>
:data="ruleForm"
class="avatar-uploader"
action="#"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:on-change='changeUpload'
:before-upload='beforeAvatarUpload'>
<img v-if="ruleForm.imageUrl" :src="ruleForm.imageUrl" class="avatar" style=" height: 100%;"> <img v-if="ruleForm.imageUrl" :src="ruleForm.imageUrl" class="avatar" style=" height: 100%;">
<div v-else> <div v-else>
...@@ -311,13 +298,14 @@ ...@@ -311,13 +298,14 @@
</el-form> </el-form>
<div class="line-box"></div> <div class="line-box"></div>
<el-button type="primary" class="checkBtn" @click="registerType = 3">提交审核</el-button> <el-button type="primary" class="checkBtn" @click="registerType = 3">提交审核</el-button>
<div class="agreement">提交即表示已阅读并同意 <el-button type="text" style=" padding: 0;">《服务协议》</el-button><el-button type="text" style="margin-left: 0; padding: 0;">《隐私协议》</el-button></div> <div class="agreement">提交即表示已阅读并同意 <el-button type="text" style=" padding: 0;">《服务协议》</el-button><el-button type="text"
style="margin-left: 0; padding: 0;">《隐私协议》</el-button>
</div>
</template> </template>
<template v-if="registerType == 3"> <template v-if="registerType == 3">
<div class="register-results"> <div class="register-results">
<img src="@/assets/images/successbg.png"/> <img src="@/assets/images/successbg.png" />
<p>供应商入驻提交成功</p> <p>供应商入驻提交成功</p>
<span>您的认证申请已成功提交,审核结果将会在24小时内短信通知,请耐心等待。</span> <span>您的认证申请已成功提交,审核结果将会在24小时内短信通知,请耐心等待。</span>
</div> </div>
...@@ -330,19 +318,19 @@ ...@@ -330,19 +318,19 @@
</template> </template>
<script> <script>
import footers from '@/components/foots' import footers from '@/components/foots';
import {login,smsLogin,validateSmsCode,validateCaptcha,forgotPassword,captchaImage,checkUser} from "./api/login" import { login, smsLogin, validateSmsCode, validateCaptcha, forgotPassword, captchaImage, checkUser } from "./api/login";
export default { export default {
components: {footers}, components: { footers },
data() { data() {
return { return {
codeUrl:'',//图形验证码 codeUrl: '',//图形验证码
uuid:'',//图形验证码唯一凭证 uuid: '',//图形验证码唯一凭证
dialogVisible: false, dialogVisible: false,
agreeRegister: false, agreeRegister: false,
registerType: 2, registerType: 2,
form: { form: {
phone:"", phone: "",
code: "", code: "",
sex: 0, sex: 0,
name: "", name: "",
...@@ -350,7 +338,7 @@ export default { ...@@ -350,7 +338,7 @@ export default {
passwordCheck: "", passwordCheck: "",
email: "", email: "",
}, },
ruleForm:{ ruleForm: {
companyName: "", companyName: "",
code: "", code: "",
name: "", name: "",
...@@ -387,151 +375,145 @@ export default { ...@@ -387,151 +375,145 @@ export default {
{ required: true, message: '请输入企业简介', trigger: 'change' } { required: true, message: '请输入企业简介', trigger: 'change' }
], ],
}, },
type:"mima",//登录方式 密码:mima 验证码:yzm 忘记密码:wjmm 提交密码:tjmm type: "mima",//登录方式 密码:mima 验证码:yzm 忘记密码:wjmm 提交密码:tjmm
yzmparam:{ yzmparam: {
phone:'', phone: '',
smsCode:'' smsCode: ''
} ,
mimaparam:{
userName:'',
password:'',
code:'',
uuid:''
}, },
resetparam:{ mimaparam: {
phone:'', userName: '',
passWord:'', password: '',
passWord1:'', code: '',
code:'', uuid: ''
smsCode:''
}, },
timer:'获取验证码',//倒计时 resetparam: {
phone: '',
passWord: '',
passWord1: '',
code: '',
smsCode: ''
},
timer: '获取验证码',//倒计时
}; };
}, },
computed: { computed: {
}, },
mounted() { mounted() {
this.getCode() this.getCode();
}, },
watch:{ watch: {
type(val){ type(val) {
this.cleardata() this.cleardata();
} }
}, },
methods: { methods: {
//清空填写的登录数据 //清空填写的登录数据
cleardata(){ cleardata() {
}, },
//登录 //登录
login(){ login() {
this.mimaparam.uuid = this.uuid this.mimaparam.uuid = this.uuid;
if(!(this.mimaparam.username || this.mimaparam.code || this.mimaparam.code)){ if (!(this.mimaparam.username || this.mimaparam.code || this.mimaparam.code)) {
this.$message.error('账号、密码、验证码不能为空!'); this.$message.error('账号、密码、验证码不能为空!');
return false; return false;
} }
// this.$store.dispatch("/login",this.mimaparam).then((res) => {
// // }) this.$store.dispatch("user/userLogin", this.mimaparam).then((res) => {
login(this.mimaparam).then(res=>{ this.toList();
if(res.code == 200){ });
let token = res.token
this.$store.commit("user/SET_TOKEN",token)
this.toList()
}else{
this.$message.error(res.msg);
}
})
}, },
//验证码登录 //验证码登录
yzmlogin(){ yzmlogin() {
if(!(this.yzmparam.phone || this.yzmparam.smsCode)){ if (!(this.yzmparam.phone || this.yzmparam.smsCode)) {
this.$message.error('账号、验证码不能为空!'); this.$message.error('账号、验证码不能为空!');
return false; return false;
} }
smsLogin(this.yzmparam).then(res=>{ smsLogin(this.yzmparam).then(res => {
if(res.code == 200){ if (res.code == 200) {
let token = res.token let token = res.token;
this.$store.commit("user/SET_TOKEN",token) this.$store.commit("user/SET_TOKEN", token);
this.toList() this.toList();
}else{ } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) });
}, },
//验证短信验证码、图形验证码 //验证短信验证码、图形验证码
yzSmscode(){ yzSmscode() {
if(!(this.resetparam.phone || this.resetparam.smsCode || this.resetparam.code)){ if (!(this.resetparam.phone || this.resetparam.smsCode || this.resetparam.code)) {
this.$message.error('账号、验证码不能为空!'); this.$message.error('账号、验证码不能为空!');
return false; return false;
} }
let param = { let param = {
phone:this.resetparam.phone, phone: this.resetparam.phone,
code:this.resetparam.smsCode code: this.resetparam.smsCode
} };
//校验短信验证码 //校验短信验证码
validateSmsCode(param).then(res=>{ validateSmsCode(param).then(res => {
if (res.code == 200){ if (res.code == 200) {
let params = { let params = {
uuid:this.uuid, uuid: this.uuid,
code:this.resetparam.code code: this.resetparam.code
} };
校验图形验证码 校验图形验证码;
validateCaptcha(params).then(res=>{ validateCaptcha(params).then(res => {
if(res.code == 200){ if (res.code == 200) {
this.type='tjmm' this.type = 'tjmm';
}else{ } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) });
}else{ } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) });
}, },
//重置密码 //重置密码
resetpwd(){ resetpwd() {
let pwd = this.resetparam.passWord let pwd = this.resetparam.passWord;
let pwd1 = this.resetparam.passWord1 let pwd1 = this.resetparam.passWord1;
if(pwd!=pwd1){ if (pwd != pwd1) {
this.$message.error('两次输入密码不一致'); this.$message.error('两次输入密码不一致');
}else{ } else {
//重置 //重置
let param = {phone:this.resetparam.phone,passWord:this.resetparam.passWord} let param = { phone: this.resetparam.phone, passWord: this.resetparam.passWord };
forgotPassword(param).then(res=>{ forgotPassword(param).then(res => {
if(res.code == 200){ if (res.code == 200) {
this.type = 'mima' this.type = 'mima';
this.getCode() this.getCode();
this.$message({ this.$message({
message: res.msg, message: res.msg,
type: 'success' type: 'success'
}); });
}else{ } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) });
} }
}, },
//获取验图形证码 //获取验图形证码
getCode(){ getCode() {
captchaImage().then(res=>{ captchaImage().then(res => {
this.codeUrl = 'data:image/gif;base64,'+res.img this.codeUrl = 'data:image/gif;base64,' + res.img;
this.uuid = res.uuid this.uuid = res.uuid;
}) });
}, },
//获取手机验证码 //获取手机验证码
getSmsCode(type){ getSmsCode(type) {
if(type == 1){//短信登录 if (type == 1) {//短信登录
if(this.yzmparam.phone) if (this.yzmparam.phone)
this.yzPohne(this.yzmparam.phone) this.yzPohne(this.yzmparam.phone);
else else
this.$message({ this.$message({
message: '请输入手机号!', message: '请输入手机号!',
type: 'warning' type: 'warning'
}); });
} }
if(type == 2){//忘记密码 if (type == 2) {//忘记密码
if(this.resetparam.phone) if (this.resetparam.phone)
this.yzPohne(this.resetparam.phone) this.yzPohne(this.resetparam.phone);
else else
this.$message({ this.$message({
message: '请输入手机号!', message: '请输入手机号!',
...@@ -540,59 +522,59 @@ export default { ...@@ -540,59 +522,59 @@ export default {
} }
}, },
// 验证手机号发送验证码 // 验证手机号发送验证码
yzPohne(phone){ yzPohne(phone) {
var param = { var param = {
phone:phone, phone: phone,
type:1 //0:注册,1:短信登录/忘记密码 type: 1 //0:注册,1:短信登录/忘记密码
} };
//验证账户发送短信 //验证账户发送短信
checkUser(param).then(res=>{ checkUser(param).then(res => {
if(res.code == 200){ if (res.code == 200) {
this.getTimer() this.getTimer();
}else{ } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) });
}, },
getTimer(){//倒计时 getTimer() {//倒计时
let num = 60 let num = 60;
var timers = setInterval(()=>{ var timers = setInterval(() => {
if(num>0){ if (num > 0) {
num--; num--;
this.timer = num+'s重新发送' this.timer = num + 's重新发送';
}else{ } else {
clearInterval(timers) clearInterval(timers);
this.timer = '发送验证码' this.timer = '发送验证码';
timers = null timers = null;
} }
},1000) }, 1000);
}, },
wjmm(){ wjmm() {
this.type='wjmm' this.type = 'wjmm';
this.getCode() this.getCode();
}, },
//登录成功跳转 //登录成功跳转
toList(){ toList() {
this.$router.push("/home");
}, },
handleAvatarSuccess(res, file) { handleAvatarSuccess(res, file) {
console.log("上传成功") console.log("上传成功");
this.ruleForm.imageUrl = URL.createObjectURL(file.raw) this.ruleForm.imageUrl = URL.createObjectURL(file.raw);
}, },
changeUpload: function (file) { changeUpload: function (file) {
let fileName = file.name; let fileName = file.name;
console.log(fileName) console.log(fileName);
let regex = /(.jpg|.jpeg)$/ let regex = /(.jpg|.jpeg)$/;
if (regex.test(fileName.toLowerCase())) { if (regex.test(fileName.toLowerCase())) {
this.ruleForm.imageUrl = URL.createObjectURL(file.raw) this.ruleForm.imageUrl = URL.createObjectURL(file.raw);
} }
}, },
beforeAvatarUpload(file) { beforeAvatarUpload(file) {
const isJPG = file.type === 'image/jpeg'; const isJPG = file.type === 'image/jpeg';
const isLt2M = file.size / 1024 / 1024 < 2; const isLt2M = file.size / 1024 / 1024 < 2;
console.log(isJPG) console.log(isJPG);
if (!isJPG) { if (!isJPG) {
this.$message.error('上传头像图片只能是 JPG 格式!'); this.$message.error('上传头像图片只能是 JPG 格式!');
} }
...@@ -610,10 +592,10 @@ export default { ...@@ -610,10 +592,10 @@ export default {
position: relative; position: relative;
height: 100%; height: 100%;
width: 100%; width: 100%;
.loginbox{ .loginbox {
margin-bottom: 24px; margin-bottom: 24px;
.logionhead { .logionhead {
border-bottom: 1px solid #F0F0F0; border-bottom: 1px solid #f0f0f0;
text-align: center; text-align: center;
margin-bottom: 32px; margin-bottom: 32px;
.title { .title {
...@@ -625,14 +607,14 @@ export default { ...@@ -625,14 +607,14 @@ export default {
cursor: pointer; cursor: pointer;
} }
.title.on { .title.on {
color: #0081FF; color: #0081ff;
position: relative; position: relative;
} }
.title.on::after { .title.on::after {
content: ' '; content: " ";
width: 42px; width: 42px;
height: 3px; height: 3px;
background: #0081FF; background: #0081ff;
border-radius: 1px 1px 1px 1px; border-radius: 1px 1px 1px 1px;
position: absolute; position: absolute;
bottom: 0; bottom: 0;
...@@ -641,17 +623,17 @@ export default { ...@@ -641,17 +623,17 @@ export default {
} }
} }
} }
.loginzc{ .loginzc {
font-size: 12px; font-size: 12px;
margin-top: 24px; margin-top: 24px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 0 52px 32px; padding: 0 52px 32px;
>p{ > p {
line-height: 20px; line-height: 20px;
color: #999999; color: #999999;
cursor: pointer; cursor: pointer;
>span{ > span {
cursor: pointer; cursor: pointer;
color: #0081ff; color: #0081ff;
} }
...@@ -661,7 +643,7 @@ export default { ...@@ -661,7 +643,7 @@ export default {
position: absolute; position: absolute;
width: 100vw; width: 100vw;
height: 75px; height: 75px;
background: #FFFFFF; background: #ffffff;
} }
.login-video { .login-video {
...@@ -700,12 +682,12 @@ export default { ...@@ -700,12 +682,12 @@ export default {
.login { .login {
width: 426px; width: 426px;
/*height: 451px;*/ /*height: 451px;*/
background: #FFFFFF; background: #ffffff;
border-radius: 8px; border-radius: 8px;
opacity: 1; opacity: 1;
position: absolute; position: absolute;
top: 50%; top: 50%;
transform: translate(0,-50%); transform: translate(0, -50%);
right: 61px; right: 61px;
.logintop { .logintop {
position: absolute; position: absolute;
...@@ -716,7 +698,7 @@ export default { ...@@ -716,7 +698,7 @@ export default {
> h3 { > h3 {
font-size: 24px; font-size: 24px;
font-weight: bold; font-weight: bold;
color: #0081FF; color: #0081ff;
text-align: center; text-align: center;
margin-top: 60px; margin-top: 60px;
margin-bottom: 40px; margin-bottom: 40px;
...@@ -731,7 +713,7 @@ export default { ...@@ -731,7 +713,7 @@ export default {
width: 100%; width: 100%;
height: 48px; height: 48px;
border-radius: 8px; border-radius: 8px;
border: 1px solid #E3E3E3; border: 1px solid #e3e3e3;
text-indent: 16px; text-indent: 16px;
outline: none; outline: none;
font-size: 14px; font-size: 14px;
...@@ -754,12 +736,12 @@ export default { ...@@ -754,12 +736,12 @@ export default {
text-align: center; text-align: center;
color: #0081ff; color: #0081ff;
font-size: 14px; font-size: 14px;
border-left: 1px solid #D8D8D8; border-left: 1px solid #d8d8d8;
} }
} }
input::-webkit-input-placeholder, input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder { textarea::-webkit-input-placeholder {
color: #9E9E9E; color: #9e9e9e;
} }
.small { .small {
...@@ -770,10 +752,10 @@ export default { ...@@ -770,10 +752,10 @@ export default {
float: right; float: right;
width: 131px; width: 131px;
height: 46px; height: 46px;
background: #FFFFFF; background: #ffffff;
border-radius: 8px; border-radius: 8px;
border: 1px solid #F1F1F1; border: 1px solid #f1f1f1;
>img{ > img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
...@@ -783,14 +765,14 @@ export default { ...@@ -783,14 +765,14 @@ export default {
.loginin { .loginin {
width: 340px; width: 340px;
height: 48px; height: 48px;
background: #0081FF; background: #0081ff;
border-radius: 4px; border-radius: 4px;
margin: 0 auto; margin: 0 auto;
line-height: 48px; line-height: 48px;
font-size: 16px; font-size: 16px;
font-family: Microsoft YaHei-Bold, Microsoft YaHei; font-family: Microsoft YaHei-Bold, Microsoft YaHei;
font-weight: bold; font-weight: bold;
color: #FFFFFF; color: #ffffff;
text-align: center; text-align: center;
} }
...@@ -820,14 +802,14 @@ export default { ...@@ -820,14 +802,14 @@ export default {
.el-steps { .el-steps {
padding: 0; padding: 0;
background: #FFFFFF; background: #ffffff;
margin-left: -8px; margin-left: -8px;
.el-step__title { .el-step__title {
width: 226px; width: 226px;
max-width: 226px; max-width: 226px;
padding: 8px 0 8px 16px; padding: 8px 0 8px 16px;
background: #F2F2F2; background: #f2f2f2;
height: 18px; height: 18px;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
...@@ -837,12 +819,13 @@ export default { ...@@ -837,12 +819,13 @@ export default {
.el-step__title.is-finish { .el-step__title.is-finish {
font-weight: bold; font-weight: bold;
color: #FFFFFF; color: #ffffff;
background: #0081FF; background: #0081ff;
} }
.el-step__title::before, .el-step__title::after { .el-step__title::before,
content: ''; .el-step__title::after {
content: "";
display: block; display: block;
position: absolute; position: absolute;
top: 0; top: 0;
...@@ -853,27 +836,27 @@ export default { ...@@ -853,27 +836,27 @@ export default {
.el-step__title::before { .el-step__title::before {
left: 0; left: 0;
border-top: 17px solid transparent; border-top: 17px solid transparent;
border-left: 8px solid #FFFFFF; border-left: 8px solid #ffffff;
border-bottom: 17px solid transparent; border-bottom: 17px solid transparent;
z-index: 9; z-index: 9;
} }
.el-step__title::after { .el-step__title::after {
right: -8px; right: -8px;
border-top: 17px solid transparent; border-top: 17px solid transparent;
border-left: 8px solid #F2F2F2; border-left: 8px solid #f2f2f2;
border-bottom: 17px solid transparent; border-bottom: 17px solid transparent;
} }
.el-step__title.is-finish::after { .el-step__title.is-finish::after {
right: -8px; right: -8px;
border-top: 17px solid transparent; border-top: 17px solid transparent;
border-left: 8px solid #0081FF; border-left: 8px solid #0081ff;
border-bottom: 17px solid transparent; border-bottom: 17px solid transparent;
} }
.el-step:first-child .el-step__title::before, .el-step:last-child .el-step__title::after { .el-step:first-child .el-step__title::before,
.el-step:last-child .el-step__title::after {
display: none; display: none;
} }
...@@ -905,7 +888,7 @@ export default { ...@@ -905,7 +888,7 @@ export default {
right: 16px; right: 16px;
padding: 0; padding: 0;
padding-left: 16px; padding-left: 16px;
border-left: 1px solid #D8D8D8; border-left: 1px solid #d8d8d8;
margin: 12px 0; margin: 12px 0;
} }
} }
...@@ -937,7 +920,7 @@ export default { ...@@ -937,7 +920,7 @@ export default {
position: relative; position: relative;
width: 100vw; width: 100vw;
height: 1px; height: 1px;
background: #EEEEEE; background: #eeeeee;
} }
.checkBtn { .checkBtn {
...@@ -951,13 +934,12 @@ export default { ...@@ -951,13 +934,12 @@ export default {
width: 345px; width: 345px;
height: 18px; height: 18px;
font-size: 14px; font-size: 14px;
color: #9E9E9E; color: #9e9e9e;
line-height: 18px; line-height: 18px;
margin: auto; margin: auto;
} }
.company-detail { .company-detail {
.el-input { .el-input {
width: 240px; width: 240px;
} }
...@@ -974,10 +956,10 @@ export default { ...@@ -974,10 +956,10 @@ export default {
.el-form-item__content { .el-form-item__content {
width: 287px; width: 287px;
height: 176px; height: 176px;
background: #F4F4F4; background: #f4f4f4;
border-radius: 8px 8px 8px 8px; border-radius: 8px 8px 8px 8px;
opacity: 1; opacity: 1;
border: 1px solid #DCDCDC; border: 1px solid #dcdcdc;
margin-left: 0 !important; margin-left: 0 !important;
.avatar-uploader { .avatar-uploader {
...@@ -1011,7 +993,7 @@ export default { ...@@ -1011,7 +993,7 @@ export default {
.el-upload__tip { .el-upload__tip {
height: 18px; height: 18px;
font-size: 14px; font-size: 14px;
color: #9E9E9E; color: #9e9e9e;
line-height: 18px; line-height: 18px;
margin-left: 7px; margin-left: 7px;
margin-top: 16px; margin-top: 16px;
...@@ -1078,7 +1060,7 @@ export default { ...@@ -1078,7 +1060,7 @@ export default {
overflow-y: auto; overflow-y: auto;
padding: 16px 16px 3px; padding: 16px 16px 3px;
margin: 10px 16px 0; margin: 10px 16px 0;
background: #F9F9F9; background: #f9f9f9;
} }
.el-dialog__footer { .el-dialog__footer {
......
import Vue from 'vue' import Vue from 'vue';
import App from './App.vue' import App from './App.vue';
import router from './router' import router from './router';
import store from './store' import store from './store';
import ElementUI from 'element-ui' import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css' import 'element-ui/lib/theme-chalk/index.css';
import "@/router/permission";
Vue.use(ElementUI); Vue.use(ElementUI);
Vue.config.productionTip = false Vue.config.productionTip = false;
new Vue({ new Vue({
router, router,
store, store,
render: h => h(App) render: h => h(App)
}).$mount('#app') }).$mount('#app');
...@@ -3,29 +3,61 @@ import VueRouter from 'vue-router'; ...@@ -3,29 +3,61 @@ import VueRouter from 'vue-router';
Vue.use(VueRouter); Vue.use(VueRouter);
const routes = [ //replace报错
const originalReplace = VueRouter.prototype.replace;
VueRouter.prototype.replace = function replace(location) {
return originalReplace.call(this, location).catch(err => err);
};
//push报错
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err);
};
const routes = [
{
path: '/',
redirect: '/login',
},
{
path: '/login',
name: 'login',
component: () => import('@/login'),
meta: {
title: "登录页",
needToken: false
}
},
{
path: '/home',
redirect : "/home/index",
name: 'Home',
component: () => import(/* webpackChunkName: "Home" */"@/home"),
meta: {
title: "首页",
needToken: true
},
children: [
{
path: '/home/index',
name: 'HomeIndex',
component: () => import(/* webpackChunkName: "Home" */"@/views/certificationManagement"),
meta: {
title: "认证管理",
needToken: true,
show: true
},
}
]
},
]; ];
const router = new VueRouter({ const router = new VueRouter({
mode: 'history', mode: 'history',
base: process.env.BASE_URL, base: process.env.BASE_URL,
routes: [ routes
{
path: '/',
redirect: '/login',
},
{
path: '/login',
// redirect: '/login',
name: 'login',
component: () => import('@/login'),
meta: {
title: "登录页",
needToken: false
}
},
]
}); });
export default router; export default router;
export { routes };
...@@ -20,7 +20,7 @@ router.beforeEach((to, from, next) => { ...@@ -20,7 +20,7 @@ router.beforeEach((to, from, next) => {
// 跳转拉取用户基本信息 // 跳转拉取用户基本信息
if (!store.state.user.userInfo?.userId) { if (!store.state.user.userInfo?.userId) {
store.dispatch("user/getUserInfo").then(() => { store.dispatch("user/getUserInfo").then(() => {
next(); next({path : "/home"});
}) })
.catch(err => { .catch(err => {
Message.error(err.msg || "获取用户信息失败!"); Message.error(err.msg || "获取用户信息失败!");
......
...@@ -21,7 +21,7 @@ const actions = { ...@@ -21,7 +21,7 @@ const actions = {
* @param {Object} payload 参数 * @param {Object} payload 参数
* @param {Function} commit 提交同步处理数据 * @param {Function} commit 提交同步处理数据
*/ */
userLogin(payload, { commit }) { userLogin({ commit },payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// 登录api调用 // 登录api调用
...@@ -43,7 +43,7 @@ const actions = { ...@@ -43,7 +43,7 @@ const actions = {
* @param {Object} payload 参数 * @param {Object} payload 参数
* @param {Function} commit 提交同步处理数据 * @param {Function} commit 提交同步处理数据
*/ */
getUserInfo(payload, { commit }) { getUserInfo({ commit },payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// 用户信息api调用 // 用户信息api调用
......
...@@ -9,7 +9,7 @@ const getToken = () => { ...@@ -9,7 +9,7 @@ const getToken = () => {
const setToken = (token) => { const setToken = (token) => {
try { try {
if (token) { if (token) {
localStorage.setItem("userToken", toekn); localStorage.setItem("userToken", token);
} }
} catch (error) { } catch (error) {
console.log(error); console.log(error);
......
<template>
<div class="about">
<h1>This is an about page</h1>
</div>
</template>
<template>
<div class="home">
<img alt="Vue logo" src="../assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/>
</div>
</template>
<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'
export default {
name: 'HomeView',
components: {
HelloWorld
}
}
</script>
<template>
<div class="certification-management">
<el-form :model="form" ref="form" :rules="rules" disabled class="certification-form" label-width="160px" :show-message="false">
<div class="registry-info">
<div class="title">
注册信息
</div>
<div class="content">
<div class="inner">
<el-form-item label="账号:" prop="phone">
<el-input v-model="form.phone"></el-input>
</el-form-item>
<el-form-item label="手机号码:" prop="phone">
<el-input v-model="form.phone"></el-input>
</el-form-item>
<el-form-item label="姓名:" prop="userName">
<el-input v-model="form.userName"></el-input>
</el-form-item>
<el-form-item label="性别:" prop="sex">
<el-radio v-model="form.sex" label="0"></el-radio>
<el-radio v-model="form.sex" label="1"></el-radio>
</el-form-item>
<el-form-item label="邮箱:" prop="email" style="margin:0px">
<el-input v-model="form.email"></el-input>
</el-form-item>
</div>
</div>
</div>
<div class="authentication-info">
<div class="title">
认证信息
</div>
<div class="content">
<div class="inner">
<el-form-item label="公司名称:" prop="companyName">
<el-input v-model="form.companyName"></el-input>
</el-form-item>
<el-form-item label="统一社会信用代码:" prop="creditCode">
<el-input v-model="form.creditCode"></el-input>
</el-form-item>
<el-form-item label="法定代表人:" prop="legalPerson">
<el-input v-model="form.legalPerson"></el-input>
</el-form-item>
<el-form-item label="注册资本:" prop="registeredCapital" class="registered-capital">
<el-input v-model="form.registeredCapital"></el-input>
<span>万元</span>
</el-form-item>
<el-form-item label="成立日期:" prop="registeredDate">
<el-input v-model="form.registeredDate"></el-input>
</el-form-item>
<el-form-item label="企业注册地:" prop="registeredAddress">
<el-input v-model="form.registeredAddress"></el-input>
</el-form-item>
<el-form-item label="企业注册地:" prop="addressDetail" style="width:100%">
<el-input v-model="form.addressDetail"></el-input>
</el-form-item>
<el-form-item label="营业执照扫描件:" prop="licenseUrl">
<img v-if="form.licenseUrl" :src="form.licenseUrl" alt="">
</el-form-item>
<el-form-item label="法人代表身份证扫描件:" prop="cardUrl">
<img v-if="form.licenseUrl" :src="form.cardUrl" alt="">
</el-form-item>
<el-form-item label="供应商类型选择:" prop="catId">
<el-cascader v-model="form.catId" :options="options" disabled placeholder=""></el-cascader>
</el-form-item>
</div>
</div>
</div>
</el-form>
</div>
</template>
<script>
import { getAuthenticationDetailApi, getSupplierTypeApi } from "@/api/authentication";
import { mapState } from "vuex";
export default {
name: "certificationManagement",
data() {
return {
form: {
account: "",
userName: "",
sex: "",
email: "",
companyName: "",
creditCode: "",
legalPerson: "",
registeredCapital: "",
registeredDate: "",
addressDetail: "",
registeredAddress: "",
licenseUrl: "",
cardUrl: "",
catId: "",
},
rules: {
"account": [{ required: true }],
"userName": [{ required: true }],
"sex": [{ required: true }],
"email": [{ required: true }],
"companyName": [{ required: true }],
"creditCode": [{ required: true }],
"legalPerson": [{ required: true }],
"registeredCapital": [{ required: true }],
"registeredDate": [{ required: true }],
"addressDetail": [{ required: true }],
"registeredAddress": [{ required: true }],
"licenseUrl": [{ required: true }],
"cardUrl": [{ required: true }],
"catId": [{ required: true }],
},
options: [],
props: {
emitPath: false,
value : "catId",
label : "name"
}
};
},
//可访问data属性
created() {
this.getDetail();
},
//计算集
computed: {
...mapState("user", {
userInfo: state => state.userInfo
})
},
//方法集
methods: {
async getDetail() {
try {
let type = await getSupplierTypeApi();
if (type) {
this.options = type?.data;
}
let res = await getAuthenticationDetailApi();
if (res) {
this.form = { ...this.form, ...this.userInfo, ...res.data };
}
} catch (error) {
console.log(error);
}
}
},
}
</script>
<style lang="scss" scoped>
.certification-management {
width: 100%;
height: 100%;
.certification-form {
// 注册信息
.authentication-info,
.registry-info {
.title {
color: #0081ff;
font-size: 14px;
font-weight: bold;
height: 40px;
line-height: 40px;
padding: 0px 16px;
box-sizing: border-box;
border: 1px solid #eeeeee;
}
.content {
border: 1px solid #eeeeee;
border-top: none;
display: flex;
justify-content: center;
padding: 16px;
box-sizing: border-box;
.inner {
width: 80%;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
::v-deep .el-form-item {
display: flex;
width: 45%;
.el-form-item__label {
white-space: nowrap;
min-width: 160px;
}
.el-form-item__content {
flex: 1;
margin: 0px !important;
img {
width: 100%;
max-height: 200px;
}
}
}
}
}
}
// 认证信息
.authentication-info {
.title {
border-top: none;
}
.registered-capital {
::v-deep .el-form-item__content {
& > span {
position: absolute;
right: 0;
height: 100%;
background: #aaaaaa;
width: 20%;
text-align: center;
}
.el-input__inner {
padding-right: 20%;
}
}
}
}
}
}
</style>
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