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

2021/10/15-18-24

parent ca4e3559
/* eslint-disable */
// 验证用户名
export function dottom(username) {
const myReg = /^([1-9]+[0-9]*)|((([1-9]+[0-9]*)|[0]).[0-9]{1,2})|[0]$/;
......
/* eslint-disable */
//用户名
const name = /^[a-zA-Z_0-9]*[a-zA-Z][a-zA-Z_0-9]*$/
// 数字
const numberReg = /^\d+$|^\d+[.]?\d+$/
// 中文
const cnReg = /^[\u4e00-\u9fa5]+$/
// 邮箱
const emailReg = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/
// 手机号
const phoneReg = /^1(3|4|5|6|7|8|9)\d{9}$/
export default {
//手机号验证
validatePhone: function (rule, value, callback) {
if (!phoneReg.test(value) || value.length !== 11) {
callback(new Error('手机号格式错误!'))
} else {
callback()
}
},
validateid_card: function (rule, value, callback) {
if (!value) {
return callback(new Error("身份证号不能为空"));
}
if (!/(^\d{15}$)|(^\d{17}(\d|X|x)$)/.test(value)) {
callback(new Error("你输入的身份证长度或格式错误"));
}
//身份证城市
var aCity = {
11: "北京",
12: "天津",
13: "河北",
14: "山西",
15: "内蒙古",
21: "辽宁",
22: "吉林",
23: "黑龙江",
31: "上海",
32: "江苏",
33: "浙江",
34: "安徽",
35: "福建",
36: "江西",
37: "山东",
41: "河南",
42: "湖北",
43: "湖南",
44: "广东",
45: "广西",
46: "海南",
50: "重庆",
51: "四川",
52: "贵州",
53: "云南",
54: "西藏",
61: "陕西",
62: "甘肃",
63: "青海",
64: "宁夏",
65: "新疆",
71: "台湾",
81: "香港",
82: "澳门",
91: "国外"
};
if (!aCity[parseInt(value.substr(0, 2))]) {
callback(new Error("你的身份证地区非法"));
}
},
// 数字验证
validateNumber: function (rule, value, callback) {
if (!numberReg.test(value)) {
callback(new Error('请输入数字'))
} else {
callback()
}
},
// 中文验证
validateCn: function (rule, value, callback) {
if (!cnReg.test(value)) {
callback(new Error("请输入中文"));
} else {
callback()
}
},
// 邮箱验证
validateEmail: function (rule, value, callback) {
if (!emailReg.test(value)) {
callback(new Error('邮箱格式错误!'))
} else {
callback()
}
},
}
......@@ -2,57 +2,111 @@
<div class="steps flex">
<!-- 1 -->
<div class="step flex">
<div class="cricle">
<div :class="'cricle' + ' ' + (status >= 0 ? 'speed-bg-color' : '')">
<span class="num">1</span>
</div>
<div class="step_title">确认报名须知</div>
<div
:class="'step_title' + ' ' + (status >= 0 ? 'speed-text-color' : '')"
>
确认报名须知
</div>
<div>
<img src="../assets/img/signUp/left.png" alt="" />
</div>
</div>
<!-- 2 -->
<div class="step flex">
<div class="cricle cc">
<div
class="cricle cc"
:class="'cricle' + ' ' + (status >= 1 ? 'speed-bg-color' : '')"
>
<span class="num">2</span>
</div>
<div class="step_title">填写邀请码</div>
<div
:class="'step_title' + ' ' + (status >= 1 ? 'speed-text-color' : '')"
>
填写邀请码
</div>
<img src="../assets/img/signUp/left.png" alt="" />
</div>
<!-- 3 -->
<div class="step flex">
<div class="cricle cc">
<div
class="cricle cc"
:class="'cricle' + ' ' + (status >= 2 ? 'speed-bg-color' : '')"
>
<span class="num">3</span>
</div>
<div class="step_title">填写报名资料</div>
<div
:class="'step_title' + ' ' + (status >= 2 ? 'speed-text-color' : '')"
>
填写报名资料
</div>
<img src="../assets/img/signUp/left.png" alt="" />
</div>
<!-- 4 -->
<div class="step flex">
<div class="cricle cc">
<div
class="cricle cc"
:class="'cricle' + ' ' + (status >= 3 ? 'speed-bg-color' : '')"
>
<span class="num">4</span>
</div>
<div class="step_title">报名资料审核</div>
<div
:class="'step_title' + ' ' + (status >= 3 ? 'speed-text-color' : '')"
>
报名资料审核
</div>
<img src="../assets/img/signUp/left.png" alt="" />
</div>
<!-- 5 -->
<div class="step flex">
<div class="cricle cc">
<div
class="cricle cc"
:class="'cricle' + ' ' + (status >= 4 ? 'speed-bg-color' : '')"
>
<span class="num">5</span>
</div>
<div class="step_title">缴费</div>
<div
:class="'step_title' + ' ' + (status >= 4 ? 'speed-text-color' : '')"
>
缴费
</div>
</div>
</div>
</template>
<script>
/* eslint-disable */
export default {};
export default {
name: "breadcrumb",
props: { statusNum: [String,Number] }, //进度参数
data() {
return {
status: this.statusNum,
};
},
created() {},
watch: {
statusNum(val) {
// console.log(val)
this.status = val;
},
},
methods: {},
};
</script>
<style scoped lang="scss">
.flex {
display: flex;
}
.speed-bg-color {
background-color: #60194a !important;
}
.speed-text-color {
color: #60194a !important;
}
.steps {
.step {
}
......@@ -67,7 +121,8 @@ export default {};
position: relative;
width: 57px;
height: 29px;
background: #60194a;
background: #d0ced0;
border-radius: 41px;
margin-right: 10px;
}
......@@ -79,7 +134,7 @@ export default {};
width: 100%;
height: 20px;
font-weight: 600;
color: #60194a;
color: #d0ced0;
line-height: 34px;
}
}
......
......@@ -21,30 +21,34 @@
>
</div>
<div class="btn">
<el-button :disabled='!checked' @click="next()">下一步</el-button>
<el-button :disabled="!checked" @click="next()">下一步</el-button>
</div>
</div>
</template>
<script>
/* eslint-disable */
import { setSignShould } from "r/index/signUp";
export default {
name: "Confirm",
// props: { statusNum: [String, Number] }, //进度参数
data() {
return {
checked:false
checked: false,
};
},
methods:{
next(){
// if(!this.checked){
// return this.$message.console.error('请');
// }
console.log(this.checked)
this.$router.push( "/signUp/invitation");
}
}
created() {},
methods: {
next() {
// console.log(this.checked);
setSignShould({}).then((res) => {
console.log(res, "setSignShould");
if (res.data.code !== 200) return this.$message.error(res.data.message);
this.$message.success(res.data.message);
this.$router.push("/signUp/referInfo");
});
},
},
};
</script>
......
......@@ -14,7 +14,7 @@
@input="changeValue1"
@focus="getFocus(0, $event)"
v-model="invatation1"
maxlength="4"
maxlength="19"
>
</el-input>
<el-input
......@@ -47,7 +47,7 @@
maxlength="4"
></el-input>
</div>
<div class="errorCode">该邀请码无效,请输入正确的邀请码。</div>
<!-- <div class="errorCode">该邀请码无效,请输入正确的邀请码。</div> -->
</div>
</div>
......@@ -203,17 +203,12 @@ export default {
"-" +
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" });
console.log(res, "code");
if (res.data.code !== 200) return this.$message.error(res.data.message);
this.$message.success(res.data.message);
this.$router.replace("/signUp/invitation");
});
},
},
......
This diff is collapsed.
......@@ -64,7 +64,7 @@ export function request(config) {
const registerCode = '/web/code/registerCode';
const passwordCode = '/web/code/passwordCode';
const loginOut = '/web/auth/loginOut';
console.log(config)
// console.log(config)
if (
config.url.indexOf(loginUrl) != -1 ||
config.url.indexOf(setAccountInfo) != -1 ||
......@@ -77,7 +77,7 @@ export function request(config) {
}
const token = localStorage.getItem('index-token')
if (token) {
console.log(token)
// console.log(token)
config.headers.token = token
} else {
......
......@@ -7,8 +7,7 @@ import indexCamp from './index/camp'
Vue.use(VueRouter)
const routes = [
{
const routes = [{
path: '/',
meta: {
title: '招生简章'
......@@ -49,7 +48,15 @@ const router = new VueRouter({
// base: process.env.BASE_URL,
routes
})
// 运用vue-router的错误处理函数 onError 捕获错误
router.onError((error) => {
const pattern = /Loading chunk (\d)+ failed/g
const isChunkLoadFailed = error.message.match(pattern)
const targetPath = router.history.pending.fullPath
if (isChunkLoadFailed) {
router.replace(targetPath)
}
})
// router.beforeEach((to, from, next) => {
// // 记录上一页
// if (from) {
......
......@@ -3,10 +3,10 @@
<div class="content">
<div class="signUp_titile">营地报名</div>
<div>
<Breadcrumb> </Breadcrumb>
<Breadcrumb :statusNum="status"> </Breadcrumb>
</div>
</div>
<Confirm v-if="type == 'examInfo'"> </Confirm>
<Confirm v-if="type == 'examInfo'" :statusNum="status"> </Confirm>
<Invitation v-else-if="type == 'invitation'"> </Invitation>
<ReferInfo v-else-if="type == 'referInfo'"> </ReferInfo>
<Pass v-else-if="type == 'check'"> </Pass>
......@@ -40,9 +40,11 @@ export default {
};
},
created() {
this.type = this.$route.params.type;
console.log(this.$route);
this.type = this.$route.params.type;
// console.log(this.$route);
this.signUpInit();
},
watch: {
$route: {
......@@ -57,10 +59,24 @@ export default {
},
methods: {
signUpInit() {
console.log(111);
// console.log(111);
signUpInit({}).then((res) => {
console.log(res);
this.status = res.status;
if (res.data.code != 200) {
return this.$message.error(res.data.message);
}
this.status = res.data.status;
if (this.status == 0) {
this.type = "examInfo";
}else if (this.status == 1) {
this.type = "invitation";
}else if (this.status == 2) {
this.type = "referInfo";
}else if (this.status == 3) {
this.type = "check";
}else if (this.status == 4) {
this.type = "pay";
}
});
},
},
......
......@@ -127,15 +127,32 @@ export default {
phone: this.loginForm.phone,
password: this.loginForm.password,
}).then((res) => {
console.log(res,'login');
// console.log(res, "login");
if (res.data.code != 200) {
return this.$message.error(res.data.message);
}
this.$message.success("登录成功");
// token存储
window.localStorage.setItem("index-token", res.data.token);
window.localStorage.setItem("phone", res.data.phone);
this.$router.replace({ path: "/signUp/examInfo" });
window.localStorage.setItem("phone", res.data.phone);
// 判断营地报名进度
// //是否填写个人资料
// window.localStorage.setItem(
// "fill_individual_information",
// res.data.cam.fill_individual_information
// );
// //是否填写邀请码
// window.localStorage.setItem(
// "fill_individual_Invitationcode",
// res.data.cam.fill_individual_Invitationcode
// );
// //是否审核个人资料
// window.localStorage.setItem(
// "audit_individual_information",
// res.data.cam.audit_individual_information
// );
// 跳转到报名
this.$router.push({ 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