Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
campSite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨梦雪
campSite
Commits
b4cc10cd
Commit
b4cc10cd
authored
Oct 15, 2021
by
杨梦雪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2021/10/15-18-24
parent
ca4e3559
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
522 additions
and
166 deletions
+522
-166
src/common/utils.js
src/common/utils.js
+2
-0
src/common/validator.js
src/common/validator.js
+98
-0
src/components/breadcrumb.vue
src/components/breadcrumb.vue
+68
-13
src/components/index/SignUp/confirm.vue
src/components/index/SignUp/confirm.vue
+16
-12
src/components/index/SignUp/invitation.vue
src/components/index/SignUp/invitation.vue
+7
-12
src/components/index/SignUp/referInfo.vue
src/components/index/SignUp/referInfo.vue
+277
-115
src/request/index/network.js
src/request/index/network.js
+2
-2
src/router/index.js
src/router/index.js
+10
-3
src/views/index/camp/SignUp.vue
src/views/index/camp/SignUp.vue
+22
-6
src/views/index/login/Login.vue
src/views/index/login/Login.vue
+20
-3
No files found.
src/common/utils.js
View file @
b4cc10cd
/* eslint-disable */
// 验证用户名
// 验证用户名
export
function
dottom
(
username
)
{
export
function
dottom
(
username
)
{
const
myReg
=
/^
([
1-9
]
+
[
0-9
]
*
)
|
((([
1-9
]
+
[
0-9
]
*
)
|
[
0
])
.
[
0-9
]{1,2})
|
[
0
]
$/
;
const
myReg
=
/^
([
1-9
]
+
[
0-9
]
*
)
|
((([
1-9
]
+
[
0-9
]
*
)
|
[
0
])
.
[
0-9
]{1,2})
|
[
0
]
$/
;
...
...
src/common/validator.js
0 → 100644
View file @
b4cc10cd
/* eslint-disable */
//用户名
const
name
=
/^
[
a-zA-Z_0-9
]
*
[
a-zA-Z
][
a-zA-Z_0-9
]
*$/
// 数字
const
numberReg
=
/^
\d
+$|^
\d
+
[
.
]?\d
+$/
// 中文
const
cnReg
=
/^
[\u
4e00-
\u
9fa5
]
+$/
// 邮箱
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
()
}
},
}
src/components/breadcrumb.vue
View file @
b4cc10cd
...
@@ -2,57 +2,111 @@
...
@@ -2,57 +2,111 @@
<div
class=
"steps flex"
>
<div
class=
"steps flex"
>
<!-- 1 -->
<!-- 1 -->
<div
class=
"step flex"
>
<div
class=
"step flex"
>
<div
class=
"cricle
"
>
<div
:class=
"'cricle' + ' ' + (status >= 0 ? 'speed-bg-color' : '')
"
>
<span
class=
"num"
>
1
</span>
<span
class=
"num"
>
1
</span>
</div>
</div>
<div
class=
"step_title"
>
确认报名须知
</div>
<div
:class=
"'step_title' + ' ' + (status >= 0 ? 'speed-text-color' : '')"
>
确认报名须知
</div>
<div>
<div>
<img
src=
"../assets/img/signUp/left.png"
alt=
""
/>
<img
src=
"../assets/img/signUp/left.png"
alt=
""
/>
</div>
</div>
</div>
</div>
<!-- 2 -->
<!-- 2 -->
<div
class=
"step flex"
>
<div
class=
"step flex"
>
<div
class=
"cricle cc"
>
<div
class=
"cricle cc"
:class=
"'cricle' + ' ' + (status >= 1 ? 'speed-bg-color' : '')"
>
<span
class=
"num"
>
2
</span>
<span
class=
"num"
>
2
</span>
</div>
</div>
<div
class=
"step_title"
>
填写邀请码
</div>
<div
:class=
"'step_title' + ' ' + (status >= 1 ? 'speed-text-color' : '')"
>
填写邀请码
</div>
<img
src=
"../assets/img/signUp/left.png"
alt=
""
/>
<img
src=
"../assets/img/signUp/left.png"
alt=
""
/>
</div>
</div>
<!-- 3 -->
<!-- 3 -->
<div
class=
"step flex"
>
<div
class=
"step flex"
>
<div
class=
"cricle cc"
>
<div
class=
"cricle cc"
:class=
"'cricle' + ' ' + (status >= 2 ? 'speed-bg-color' : '')"
>
<span
class=
"num"
>
3
</span>
<span
class=
"num"
>
3
</span>
</div>
</div>
<div
class=
"step_title"
>
填写报名资料
</div>
<div
:class=
"'step_title' + ' ' + (status >= 2 ? 'speed-text-color' : '')"
>
填写报名资料
</div>
<img
src=
"../assets/img/signUp/left.png"
alt=
""
/>
<img
src=
"../assets/img/signUp/left.png"
alt=
""
/>
</div>
</div>
<!-- 4 -->
<!-- 4 -->
<div
class=
"step flex"
>
<div
class=
"step flex"
>
<div
class=
"cricle cc"
>
<div
class=
"cricle cc"
:class=
"'cricle' + ' ' + (status >= 3 ? 'speed-bg-color' : '')"
>
<span
class=
"num"
>
4
</span>
<span
class=
"num"
>
4
</span>
</div>
</div>
<div
class=
"step_title"
>
报名资料审核
</div>
<div
:class=
"'step_title' + ' ' + (status >= 3 ? 'speed-text-color' : '')"
>
报名资料审核
</div>
<img
src=
"../assets/img/signUp/left.png"
alt=
""
/>
<img
src=
"../assets/img/signUp/left.png"
alt=
""
/>
</div>
</div>
<!-- 5 -->
<!-- 5 -->
<div
class=
"step flex"
>
<div
class=
"step flex"
>
<div
class=
"cricle cc"
>
<div
class=
"cricle cc"
:class=
"'cricle' + ' ' + (status >= 4 ? 'speed-bg-color' : '')"
>
<span
class=
"num"
>
5
</span>
<span
class=
"num"
>
5
</span>
</div>
</div>
<div
class=
"step_title"
>
缴费
</div>
<div
:class=
"'step_title' + ' ' + (status >= 4 ? 'speed-text-color' : '')"
>
缴费
</div>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
/* eslint-disable */
/* 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
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
.flex
{
.flex
{
display
:
flex
;
display
:
flex
;
}
}
.speed-bg-color
{
background-color
:
#60194a
!
important
;
}
.speed-text-color
{
color
:
#60194a
!
important
;
}
.steps
{
.steps
{
.step
{
.step
{
}
}
...
@@ -67,7 +121,8 @@ export default {};
...
@@ -67,7 +121,8 @@ export default {};
position
:
relative
;
position
:
relative
;
width
:
57px
;
width
:
57px
;
height
:
29px
;
height
:
29px
;
background
:
#60194a
;
background
:
#d0ced0
;
border-radius
:
41px
;
border-radius
:
41px
;
margin-right
:
10px
;
margin-right
:
10px
;
}
}
...
@@ -79,7 +134,7 @@ export default {};
...
@@ -79,7 +134,7 @@ export default {};
width
:
100%
;
width
:
100%
;
height
:
20px
;
height
:
20px
;
font-weight
:
600
;
font-weight
:
600
;
color
:
#
60194a
;
color
:
#
d0ced0
;
line-height
:
34px
;
line-height
:
34px
;
}
}
}
}
...
...
src/components/index/SignUp/confirm.vue
View file @
b4cc10cd
...
@@ -21,30 +21,34 @@
...
@@ -21,30 +21,34 @@
>
>
</div>
</div>
<div
class=
"btn"
>
<div
class=
"btn"
>
<el-button
:disabled=
'!checked'
@
click=
"next()"
>
下一步
</el-button>
<el-button
:disabled=
"!checked"
@
click=
"next()"
>
下一步
</el-button>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
/* eslint-disable */
/* eslint-disable */
import
{
setSignShould
}
from
"
r/index/signUp
"
;
export
default
{
export
default
{
name
:
"
Confirm
"
,
name
:
"
Confirm
"
,
// props: { statusNum: [String, Number] }, //进度参数
data
()
{
data
()
{
return
{
return
{
checked
:
false
checked
:
false
,
};
};
},
},
methods
:{
created
()
{},
next
(){
methods
:
{
// if(!this.checked){
next
()
{
// return this.$message.console.error('请');
// console.log(this.checked);
// }
setSignShould
({}).
then
((
res
)
=>
{
console
.
log
(
this
.
checked
)
console
.
log
(
res
,
"
setSignShould
"
);
this
.
$router
.
push
(
"
/signUp/invitation
"
);
if
(
res
.
data
.
code
!==
200
)
return
this
.
$message
.
error
(
res
.
data
.
message
);
}
this
.
$message
.
success
(
res
.
data
.
message
);
}
this
.
$router
.
push
(
"
/signUp/referInfo
"
);
});
},
},
};
};
</
script
>
</
script
>
...
...
src/components/index/SignUp/invitation.vue
View file @
b4cc10cd
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
@
input=
"changeValue1"
@
input=
"changeValue1"
@
focus=
"getFocus(0, $event)"
@
focus=
"getFocus(0, $event)"
v-model=
"invatation1"
v-model=
"invatation1"
maxlength=
"
4
"
maxlength=
"
19
"
>
>
</el-input>
</el-input>
<el-input
<el-input
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
maxlength=
"4"
maxlength=
"4"
></el-input>
></el-input>
</div>
</div>
<
div
class=
"errorCode"
>
该邀请码无效,请输入正确的邀请码。
</div
>
<
!--
<div
class=
"errorCode"
>
该邀请码无效,请输入正确的邀请码。
</div>
--
>
</div>
</div>
</div>
</div>
...
@@ -203,17 +203,12 @@ export default {
...
@@ -203,17 +203,12 @@ export default {
"
-
"
+
"
-
"
+
this
.
invatation4
;
this
.
invatation4
;
}
}
// const { data: res } = await setInviteCode({
// code: code,
// });
setInviteCode
({
code
:
code
}).
then
((
res
)
=>
{
setInviteCode
({
code
:
code
}).
then
((
res
)
=>
{
console
.
log
(
222
);
console
.
log
(
res
,
"
code
"
);
if
(
res
.
data
.
code
!==
200
)
return
this
.
$message
.
error
(
res
.
data
.
message
);
if
(
res
.
code
!==
200
)
return
this
.
$message
.
error
(
res
.
message
);
this
.
$message
.
success
(
res
.
data
.
message
);
this
.
$message
.
success
(
res
.
message
);
this
.
$router
.
replace
(
"
/signUp/invitation
"
);
this
.
$router
.
replace
({
name
:
"
SignUpLists
"
});
});
});
},
},
},
},
...
...
src/components/index/SignUp/referInfo.vue
View file @
b4cc10cd
This diff is collapsed.
Click to expand it.
src/request/index/network.js
View file @
b4cc10cd
...
@@ -64,7 +64,7 @@ export function request(config) {
...
@@ -64,7 +64,7 @@ export function request(config) {
const
registerCode
=
'
/web/code/registerCode
'
;
const
registerCode
=
'
/web/code/registerCode
'
;
const
passwordCode
=
'
/web/code/passwordCode
'
;
const
passwordCode
=
'
/web/code/passwordCode
'
;
const
loginOut
=
'
/web/auth/loginOut
'
;
const
loginOut
=
'
/web/auth/loginOut
'
;
console
.
log
(
config
)
//
console.log(config)
if
(
if
(
config
.
url
.
indexOf
(
loginUrl
)
!=
-
1
||
config
.
url
.
indexOf
(
loginUrl
)
!=
-
1
||
config
.
url
.
indexOf
(
setAccountInfo
)
!=
-
1
||
config
.
url
.
indexOf
(
setAccountInfo
)
!=
-
1
||
...
@@ -77,7 +77,7 @@ export function request(config) {
...
@@ -77,7 +77,7 @@ export function request(config) {
}
}
const
token
=
localStorage
.
getItem
(
'
index-token
'
)
const
token
=
localStorage
.
getItem
(
'
index-token
'
)
if
(
token
)
{
if
(
token
)
{
console
.
log
(
token
)
//
console.log(token)
config
.
headers
.
token
=
token
config
.
headers
.
token
=
token
}
else
{
}
else
{
...
...
src/router/index.js
View file @
b4cc10cd
...
@@ -7,8 +7,7 @@ import indexCamp from './index/camp'
...
@@ -7,8 +7,7 @@ import indexCamp from './index/camp'
Vue
.
use
(
VueRouter
)
Vue
.
use
(
VueRouter
)
const
routes
=
[
const
routes
=
[{
{
path
:
'
/
'
,
path
:
'
/
'
,
meta
:
{
meta
:
{
title
:
'
招生简章
'
title
:
'
招生简章
'
...
@@ -49,7 +48,15 @@ const router = new VueRouter({
...
@@ -49,7 +48,15 @@ const router = new VueRouter({
// base: process.env.BASE_URL,
// base: process.env.BASE_URL,
routes
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) => {
// router.beforeEach((to, from, next) => {
// // 记录上一页
// // 记录上一页
// if (from) {
// if (from) {
...
...
src/views/index/camp/SignUp.vue
View file @
b4cc10cd
...
@@ -3,10 +3,10 @@
...
@@ -3,10 +3,10 @@
<div
class=
"content"
>
<div
class=
"content"
>
<div
class=
"signUp_titile"
>
营地报名
</div>
<div
class=
"signUp_titile"
>
营地报名
</div>
<div>
<div>
<Breadcrumb>
</Breadcrumb>
<Breadcrumb
:statusNum=
"status"
>
</Breadcrumb>
</div>
</div>
</div>
</div>
<Confirm
v-if=
"type == 'examInfo'"
>
</Confirm>
<Confirm
v-if=
"type == 'examInfo'"
:statusNum=
"status"
>
</Confirm>
<Invitation
v-else-if=
"type == 'invitation'"
>
</Invitation>
<Invitation
v-else-if=
"type == 'invitation'"
>
</Invitation>
<ReferInfo
v-else-if=
"type == 'referInfo'"
>
</ReferInfo>
<ReferInfo
v-else-if=
"type == 'referInfo'"
>
</ReferInfo>
<Pass
v-else-if=
"type == 'check'"
>
</Pass>
<Pass
v-else-if=
"type == 'check'"
>
</Pass>
...
@@ -41,8 +41,10 @@ export default {
...
@@ -41,8 +41,10 @@ export default {
},
},
created
()
{
created
()
{
this
.
type
=
this
.
$route
.
params
.
type
;
this
.
type
=
this
.
$route
.
params
.
type
;
console
.
log
(
this
.
$route
);
//
console.log(this.$route);
this
.
signUpInit
();
this
.
signUpInit
();
},
},
watch
:
{
watch
:
{
$route
:
{
$route
:
{
...
@@ -57,10 +59,24 @@ export default {
...
@@ -57,10 +59,24 @@ export default {
},
},
methods
:
{
methods
:
{
signUpInit
()
{
signUpInit
()
{
console
.
log
(
111
);
//
console.log(111);
signUpInit
({}).
then
((
res
)
=>
{
signUpInit
({}).
then
((
res
)
=>
{
console
.
log
(
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
"
;
}
});
});
},
},
},
},
...
...
src/views/index/login/Login.vue
View file @
b4cc10cd
...
@@ -127,7 +127,7 @@ export default {
...
@@ -127,7 +127,7 @@ 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
,
'
login
'
);
// console.log(res, "login"
);
if
(
res
.
data
.
code
!=
200
)
{
if
(
res
.
data
.
code
!=
200
)
{
return
this
.
$message
.
error
(
res
.
data
.
message
);
return
this
.
$message
.
error
(
res
.
data
.
message
);
}
}
...
@@ -135,7 +135,24 @@ export default {
...
@@ -135,7 +135,24 @@ export default {
// token存储
// token存储
window
.
localStorage
.
setItem
(
"
index-token
"
,
res
.
data
.
token
);
window
.
localStorage
.
setItem
(
"
index-token
"
,
res
.
data
.
token
);
window
.
localStorage
.
setItem
(
"
phone
"
,
res
.
data
.
phone
);
window
.
localStorage
.
setItem
(
"
phone
"
,
res
.
data
.
phone
);
this
.
$router
.
replace
({
path
:
"
/signUp/examInfo
"
});
// 判断营地报名进度
// //是否填写个人资料
// 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
"
});
});
});
});
});
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment