Commit ca4e3559 authored by 杨梦雪's avatar 杨梦雪

111

parent ddfd31db
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1685.7 1685.7"><defs><style>.cls-1{fill:none;}.cls-2{isolation:isolate;}.cls-3{clip-path:url(#clip-path);}.cls-4{fill:#fde7b8;}.cls-5{fill:#e8cd96;}.cls-6{fill:#f9e0aa;}.cls-7{fill:#ccbf9f;}.cls-8{fill:#2a2d36;}.cls-9{fill:#22242b;}.cls-10,.cls-14{fill:#404a54;}.cls-11,.cls-12{fill:#3b434d;}.cls-12,.cls-14{opacity:0.3;mix-blend-mode:overlay;}.cls-13{fill:#fafafc;}.cls-15{fill:#8d9cb3;}.cls-16{fill:#ced3db;}</style><clipPath id="clip-path"><rect class="cls-1" width="1685.7" height="1685.7" rx="187.3" ry="187.3"/></clipPath></defs><title>user</title><g class="cls-2"><g id="图层_1" data-name="图层 1"><g class="cls-3"><polygon class="cls-4" points="948.52 1241.53 819.44 1462.28 683.63 1241.53 683.63 991.35 948.52 991.35 948.52 1241.53"/><path class="cls-5" d="M816.07,1085.55c-48.3,0-92.83-18.44-132.44-50v42.85C720.17,1159.52,821.54,1218,941.16,1218c2.49,0,4.89-.23,7.36-.28V1035.5C908.91,1067.11,864.38,1085.55,816.07,1085.55Z"/><path class="cls-4" d="M1139.84,579.29c0,256-132.45,544.51-323.77,544.51S492.31,835.31,492.31,579.29s145-367.91,323.76-367.91S1139.84,323.27,1139.84,579.29Z"/><ellipse class="cls-4" cx="520.92" cy="718.39" rx="83.9" ry="114.4" transform="translate(-244.65 269.67) rotate(-23.68)"/><ellipse class="cls-6" cx="1109.17" cy="718.39" rx="114.4" ry="83.9" transform="translate(5.82 1445.69) rotate(-66.32)"/><path class="cls-6" d="M1139.84,579.29c0-256-145-367.91-323.77-367.91V1123.8C1007.39,1123.8,1139.84,835.31,1139.84,579.29Z"/><path class="cls-7" d="M1014.78,344.84S897.05,506.72,794,536.15s-235.46,14.72-235.46,14.72,11.48,29.43,0,58.86-36.82,58.87-36.82,58.87L507,742.18,477.6,609.73s-22.05,0-36.76-29.43S404,418.42,448.16,315.4C484.83,229.86,617.43,79.94,808.75,94.66s220.74,117.73,220.74,117.73,103-14.72,161.88,103S1175.74,550.87,1147.22,595s-57,44.15-57,44.15-31.27-73.59-46-147.17Z"/><path class="cls-8" d="M628.12,1226.81s-44.15,29.44-117.73,58.87-147.16,44.15-176.59,147.16-29.44,279.62-29.44,279.62v117.73H819.44V1609.44l-147.17-206Z"/><path class="cls-9" d="M1010.75,1226.81s44.15,29.44,117.73,58.87,147.17,44.15,176.6,147.16,29.43,279.62,29.43,279.62v117.73H819.44V1609.44l147.16-206Z"/><path class="cls-10" d="M819.44,1727.17V1491.71L657.56,1197.38l-58.87,44.15s14.72,117.73,88.3,279.61S819.44,1727.17,819.44,1727.17Z"/><path class="cls-11" d="M819.44,1727.17V1491.71l161.88-294.33,58.86,44.15s-14.71,117.73-88.29,279.61S819.44,1727.17,819.44,1727.17Z"/><polygon class="cls-12" points="1025.47 1241.53 1010.75 1359.26 966.6 1359.26 922.45 1403.41 819.44 1476.99 966.6 1182.66 1025.47 1241.53"/><path class="cls-13" d="M922.45,1271v103l-103,88.3s58.86-103,88.3-176.6,44.15-147.16,44.15-147.16L996,1226.81v117.74Z"/><polygon class="cls-14" points="716.42 1256.25 642.84 1256.25 642.84 1344.55 716.42 1315.11 716.42 1256.25"/><path class="cls-13" d="M716.42,1271v103l103,88.3s-58.87-103-88.3-176.6S687,1138.52,687,1138.52l-44.15,88.29v117.74Z"/><rect class="cls-15" x="1054.9" y="1568.64" width="117.73" height="14.72"/><polygon class="cls-16" points="1157.91 1598.07 1069.62 1598.07 1054.9 1583.35 1172.63 1583.35 1157.91 1598.07"/></g></g></g></svg>
\ No newline at end of file
<template>
<div class="Header">
<div class="H_content flex">
<div class="cc flex">
<div class="image">
<img src="@/assets/img/南开logo@2x.png" alt="" />
</div>
<div class="right">
<el-dropdown @command="handleCommand">
<span class="el-dropdown-link">
<img src="@/assets/img/default.svg" class="img_user" />
<span class="phone">{{ phone }}</span>
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="1">退出</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
</div>
</div>
</template>
<script>
/* eslint-disable */
import { logout } from "r/index/login";
export default {
name: "Header",
data() {
return {
phone: window.localStorage.getItem("phone"),
};
},
methods: {
handleCommand(command) {
if (command == 1) {
this.logout();
}
},
// 退出
async logout() {
const confirmResult = await this.$confirm(`确认退出登录?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
closeOnClickModal: false,
type: "warning",
}).catch((err) => err);
if (confirmResult !== "confirm")
return this.$message.info("您取消了退出");
await logout({});
// if (res.code !== 200) return this.$message.error(res.message);
// 清除本地的 token
window.localStorage.clear();
this.$store.state.token = "";
// 使用编程式导航跳转到登录页面
this.$router.replace({ name: "index-login" });
},
},
};
</script>
<style lang="scss" scoped>
.flex {
display: flex;
}
.Header {
font-family: PingFangSC-Medium, PingFang SC;
height: 80px;
box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.12);
.H_content {
justify-content: center;
.cc {
width: 100%;
justify-content: space-around;
align-items: center;
div {
flex-direction: column;
}
}
}
.image img {
width: 318px;
height: 62px;
}
.right {
.el-dropdown {
float: right;
&:hover {
cursor: pointer;
}
.img_user {
width: 34px;
height: 34px;
background-color: #d8d8d8;
border-radius: 50%;
float: left;
margin: 15px 0 0 0;
}
.phone {
margin: 0 10px 0 12px;
}
}
}
::v-deep .el-dropdown-menu__item {
min-width: 124px !important;
}
::v-deep .el-dropdown-item {
display: inline-block;
}
::v-deep .el-dropdown-menu__item:hover {
color: #ffffff;
background-color: #563279;
}
::v-deep .el-message-box {
width: 1000px !important;
.el-message-box__header {
.el-message-box__title {
color: red !important;
}
}
.el-button--primary {
color: #fff;
background-color: #563279;
border-color: #563279;
}
}
}
</style>
...@@ -7,10 +7,45 @@ ...@@ -7,10 +7,45 @@
</div> </div>
<div> <div>
<div class="code flex"> <div class="code flex">
<el-input v-model="input1"></el-input> <el-input
<el-input v-model="input2"></el-input> :disabled="!inputFlag"
<el-input v-model="input3"></el-input> :autofocus="true"
<el-input v-model="input4"></el-input> ref="input0"
@input="changeValue1"
@focus="getFocus(0, $event)"
v-model="invatation1"
maxlength="4"
>
</el-input>
<el-input
:disabled="!inputFlag"
:autofocus="true"
ref="input1"
@input="changeValue1"
@focus="getFocus(1, $event)"
v-model="invatation2"
maxlength="4"
>
</el-input>
<el-input
:disabled="!inputFlag"
:autofocus="true"
ref="input2"
@input="changeValue1"
@focus="getFocus(2, $event)"
v-model="invatation3"
maxlength="4"
>
</el-input>
<el-input
:disabled="!inputFlag"
:autofocus="true"
ref="input3"
@input="changeValue1"
@focus="getFocus(3, $event)"
v-model="invatation4"
maxlength="4"
></el-input>
</div> </div>
<div class="errorCode">该邀请码无效,请输入正确的邀请码。</div> <div class="errorCode">该邀请码无效,请输入正确的邀请码。</div>
</div> </div>
...@@ -28,16 +63,160 @@ ...@@ -28,16 +63,160 @@
<script> <script>
/* eslint-disable */ /* eslint-disable */
import { setInviteCode } from "r/index/signUp";
export default { export default {
name: "Invitation", name: "Invitation",
data(){ data() {
return{ return {
input1: null, invatation1: "",
input2: null, invatation2: "",
input3: null, invatation3: "",
input4: null, invatation4: "",
} inputFlag: true,
} };
},
watch: {
invatation1: function () {
this.invatation1 = this.invatation1
.replace(/[\W]/g, "")
.toUpperCase()
.substring(0, 4);
},
invatation2: function () {
this.invatation2 = this.invatation2
.replace(/[\W]/g, "")
.toUpperCase()
.substring(0, 4);
},
invatation3: function () {
this.invatation3 = this.invatation3
.replace(/[\W]/g, "")
.toUpperCase()
.substring(0, 4);
},
invatation4: function () {
this.invatation4 = this.invatation4
.replace(/[\W]/g, "")
.toUpperCase()
.substring(0, 4);
},
},
methods: {
next() {
this.$router.push("/signUp/referInfo");
},
//第一个输入框
changeValue1(e) {
// console.log(e, "输入");
if (e.length == 19 && e.indexOf("-") !== -1) {
//如果是复制过来的带'-'邀请码
let copyCode = e.split("-");
// console.log(copyCode, "输入");
this.invatation1 = copyCode[0];
this.invatation2 = copyCode[1];
this.invatation3 = copyCode[2];
this.invatation4 = copyCode[3];
this.$refs.input3.focus();
} else if (e.length > 4) {
this.changeValue(e.substring(0, 4));
} else {
this.changeValue(e);
}
},
// 输入框
changeValue(e) {
if (e.length >= 4) {
// console.log(e, "length");
// console.log(this.currentIndex, "this.currentIndex");
switch (this.currentIndex) {
case 0:
// console.log(this.text0.length);
if (this.invatation1.length >= 4) {
// this.$nextTick(() => {
this.$refs.input1.focus();
// })
}
break;
case 1:
if (this.invatation2.length >= 4) {
this.$refs.input2.focus();
}
break;
case 2:
if (this.invatation3.length >= 4) {
this.$refs.input3.focus();
}
break;
case 3:
if (this.invatation4.length >= 4) {
this.$refs.input3.focus();
}
break;
default:
break;
}
} else if (e.length === 0) {
switch (this.currentIndex) {
case 0:
this.$refs.input0.focus();
break;
case 1:
this.$refs.input0.focus();
break;
case 2:
this.$refs.input1.focus();
break;
case 3:
this.$refs.input2.focus();
break;
default:
break;
}
} else {
}
},
getFocus(index, e) {
this.currentIndex = index;
},
// 下一步
async next() {
console.log(111);
let code;
if (
this.invatation1 == "" &&
this.invatation2 == "" &&
this.invatation3 == "" &&
this.invatation4 == ""
) {
code =
this.invatation1 +
this.invatation2 +
this.invatation3 +
this.invatation4;
} else {
code =
this.invatation1 +
"-" +
this.invatation2 +
"-" +
this.invatation3 +
"-" +
this.invatation4;
}
// const { data: res } = await setInviteCode({
// code: code,
// });
setInviteCode({ code: code }).then((res) => {
console.log(222);
if (res.code !== 200) return this.$message.error(res.message);
this.$message.success(res.message);
this.$router.replace({ name: "SignUpLists" });
});
},
},
}; };
</script> </script>
......
...@@ -255,6 +255,9 @@ export default { ...@@ -255,6 +255,9 @@ export default {
}; };
}, },
methods: { methods: {
next() {
this.$router.push("/signUp/check");
},
open() { open() {
// 获取当前审核资料详情 // 获取当前审核资料详情
GetCheckInfo({ GetCheckInfo({
......
...@@ -77,14 +77,8 @@ export function request(config) { ...@@ -77,14 +77,8 @@ export function request(config) {
} }
const token = localStorage.getItem('index-token') const token = localStorage.getItem('index-token')
if (token) { if (token) {
const thatToken = store.state.token console.log(token)
if (thatToken != token && config.url != loginOut) {
// window.location.reload();
store.state.showDialog = true
store.state.dialogType = 0
const error = new Error('登录账号有问题!')
return Promise.reject(error)
}
config.headers.token = token config.headers.token = token
} else { } else {
window.localStorage.clear() window.localStorage.clear()
......
...@@ -24,6 +24,16 @@ export function setSignShould(data) { ...@@ -24,6 +24,16 @@ export function setSignShould(data) {
}) })
} }
// 绑定邀请码
export function setInviteCode(data) {
data['identity'] = identity;
return request({
method: 'post',
url: '/web/signUp/setInviteCode',
params: data
})
}
// 页面个人获取 // 页面个人获取
export function getAccount(data) { export function getAccount(data) {
data['identity'] = identity; data['identity'] = identity;
......
export default{
}
\ No newline at end of file
import Vue from 'vue'
import MyDialog from '../components/MyDialog.vue'
MyDialog.install = function(Vue) {
Vue.component(MyDialog.name, MyDialog);
};
export default MyDialog;
\ No newline at end of file
export default {
};
import Vue from 'vue' import Vue from 'vue'
import Vuex from 'vuex' import Vuex from 'vuex'
import actions from "./actions";
import mutations from "./mutations";
import getters from "./getters";
Vue.use(Vuex) Vue.use(Vuex)
let state = {
// 上一页地址
previousPage: "",
// 数据
data:[],
token: '',
showDialog: false,
dialogType: 0,
isLogin: localStorage.getItem("isLogin") || "0", // 只有1为已登录
};
export default new Vuex.Store({ export default new Vuex.Store({
state: { state,
}, mutations,
mutations: { actions,
}, getters,
actions: { });
},
modules: {
}
})
export default {
// 更新上一页信息
setPrePage(state, path) {
state.previousPage = path;
},
// 保存数据
setData(state, city) {
state.data = city;
},
login(state) {
state.isLogin = "1";
localStorage.setItem("isLogin", "1");
},
loginOut(state) {
state.isLogin = "0";
localStorage.removeItem("token");
localStorage.removeItem("isLogin");
},
};
// 补0
export function add0(m) {
return m < 10 ? "0" + m : m;
}
// 倒计时
export function djTime(data) {
return add0(parseInt(data/60))+':'+add0(data%60);
}
export function formatTime(data) {
var time = new Date(data);
var y = time.getFullYear();
var m = time.getMonth() + 1;
var d = time.getDate();
var h = time.getHours();
var mm = time.getMinutes();
var ss = time.getSeconds();
return (y + "-" + add0(m) + "-" + add0(d) + " " + add0(h) + ":" + add0(mm) + ":" + add0(ss));
}
//计算两个时间之间的时间差 多少天时分秒
export function intervalTime(startTime, endTime) {
var stime = new Date(startTime);
var etime = new Date(endTime);
if(stime > etime){
return add0(0)+':'+add0(0)
}
var y = etime.getFullYear() - stime.getFullYear();
var m = etime.getMonth() + 1 - (stime.getMonth() + 1);
var d = etime.getDate() - stime.getDate();
var h = etime.getHours() - stime.getHours();
var mm = etime.getMinutes() - stime.getMinutes();
var ss = etime.getSeconds() - stime.getSeconds();
var time = y*365*24*60*60 + m*30*24*60*60 + d*24*60*60 + h*60*60 + mm*60 + ss
time = add0(parseInt(time/60))+':'+add0(time%60)
return time;
}
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<script> <script>
/* eslint-disable */ /* eslint-disable */
import Header from "@/components/index/Header.vue"; import Header from "@/components/index/SignUp/Header.vue";
import Footer from "@/components/index/Footer.vue"; import Footer from "@/components/index/Footer.vue";
export default { export default {
name: "campIndex", name: "campIndex",
......
...@@ -22,6 +22,7 @@ import Invitation from "c/index/SignUp/invitation"; ...@@ -22,6 +22,7 @@ import Invitation from "c/index/SignUp/invitation";
import ReferInfo from "c/index/SignUp/referInfo"; import ReferInfo from "c/index/SignUp/referInfo";
import Pass from "c/index/SignUp/pass"; import Pass from "c/index/SignUp/pass";
import Paying from "c/index/SignUp/paying"; import Paying from "c/index/SignUp/paying";
import { signUpInit } from "r/index/signUp";
export default { export default {
name: "signUp", name: "signUp",
components: { components: {
...@@ -35,23 +36,34 @@ export default { ...@@ -35,23 +36,34 @@ export default {
data() { data() {
return { return {
type: "examInfo", type: "examInfo",
status: "", //进度
}; };
}, },
created() { created() {
this.type = this.$route.params.type; this.type = this.$route.params.type;
console.log(this.$route); console.log(this.$route);
this.signUpInit();
}, },
watch:{ watch: {
'$route': { $route: {
handler(val) { handler(val) {
const that = this; const that = this;
if(val.path.indexOf('signUp')!=-1){ if (val.path.indexOf("signUp") != -1) {
that.type = val.params.type; that.type = val.params.type;
} }
}, },
deep: true deep: true,
} },
} },
methods: {
signUpInit() {
console.log(111);
signUpInit({}).then((res) => {
console.log(res);
this.status = res.status;
});
},
},
}; };
</script> </script>
......
...@@ -127,13 +127,14 @@ export default { ...@@ -127,13 +127,14 @@ export default {
phone: this.loginForm.phone, phone: this.loginForm.phone,
password: this.loginForm.password, password: this.loginForm.password,
}).then((res) => { }).then((res) => {
console.log(res); console.log(res,'login');
if (res.status != 200) { if (res.data.code != 200) {
return this.$message.error(res.message); return this.$message.error(res.data.message);
} }
this.$message.success("登录成功"); this.$message.success("登录成功");
// token存储 // token存储
window.localStorage.setItem("index-token", res.token); window.localStorage.setItem("index-token", res.data.token);
window.localStorage.setItem("phone", res.data.phone);
this.$router.replace({ path: "/signUp/examInfo" }); this.$router.replace({ path: "/signUp/examInfo" });
}); });
}); });
......
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