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
9eda2c8c
Commit
9eda2c8c
authored
Sep 08, 2023
by
wuwangwolihui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
营地2.0-活动中心-筛选
parent
0d002cae
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
179 additions
and
268 deletions
+179
-268
src/config/server.js
src/config/server.js
+1
-1
src/request/base/active.js
src/request/base/active.js
+11
-0
src/request/base/network.js
src/request/base/network.js
+26
-245
src/views/base/active/Active.vue
src/views/base/active/Active.vue
+141
-22
No files found.
src/config/server.js
View file @
9eda2c8c
...
...
@@ -13,7 +13,7 @@
// 正式
export
const
SERVER_URL
=
"
https://apiy.thuers.com/
"
;
// 正式环境
export
const
DEVELOPMENT_SERVER_URL
=
"
http://192.168.1.1
45:9212
/
"
;
//开发环境
export
const
DEVELOPMENT_SERVER_URL
=
"
http://192.168.1.1
93:8088
/
"
;
//开发环境
export
const
SERVER_WS_URL
=
"
wss://apiy.thuers.com
"
;
// websocket
// 测试
...
...
src/request/base/active.js
0 → 100644
View file @
9eda2c8c
/* eslint-disable */
import
{
request
}
from
'
./network
'
;
// 登录
export
function
HotList
(
data
)
{
return
request
({
method
:
'
post
'
,
url
:
'
/modules-campsite/activityCenter/hotList
'
,
data
:
data
})
}
src/request/base/network.js
View file @
9eda2c8c
/* eslint-disable */
import
axios
from
'
axios
'
import
store
from
'
@/store
'
import
{
SERVER_URL
,
DEVELOPMENT_SERVER_URL
}
from
'
@/config/server
'
import
{
Notification
,
Message
,
Loading
}
from
'
element-ui
'
import
router
from
'
@/router
'
const
instance
=
axios
.
create
({
baseURL
:
'
http://192.168.1.145:9212
'
,
timeout
:
60000
,
method
:
"
post
"
,
headers
:
{
"
Content-Type
"
:
"
application/x-www-form-urlencoded
"
,
},
withCredentials
:
false
,
});
instance
.
interceptors
.
request
.
use
(
(
config
)
=>
{
if
(
config
.
method
===
"
post
"
&&
!
config
.
notQs
)
{
config
.
data
=
qs
.
stringify
(
config
.
data
);
}
if
(
config
.
url
.
indexOf
(
SERVER_URL
)
===
-
1
)
{
// console.log("upload");
config
.
headers
[
"
Content-Type
"
]
=
"
multipart/form-data
"
;
}
else
{
config
.
headers
[
"
Content-Type
"
]
=
"
application/x-www-form-urlencoded
"
;
}
// 调用接口请求添加token认证信息
// let token = localStorage.getItem("index-token");
const
token
=
localStorage
.
getItem
(
'
index-token
'
+
store
.
state
.
indexIdentity
)
//
config
.
headers
.
token
=
token
if
(
token
)
config
.
headers
.
authorization
=
token
;
return
config
;
},
(
error
)
=>
{
return
Promise
.
reject
(
error
);
}
);
// instance.interceptors.response.use(
// (response) => {
// return response.data;
// },
// (error) => {
// return Promise.reject(error);
// }
// );
export
default
instance
;
import
{
SERVER_URL
,
DEVELOPMENT_SERVER_URL
}
from
'
@/config/server
'
import
{
Notification
,
Message
,
Loading
}
from
'
element-ui
'
import
router
from
'
@/router
'
;
// 正在进行中的请求列表
const
reqList
=
[]
const
reqList
=
[]
;
/**
* 阻止重复请求
...
...
@@ -75,7 +19,6 @@ const stopRepeatRequest = function (reqList, url, cancel, errorMessage) {
const
errorMsg
=
errorMessage
||
''
for
(
let
i
=
0
;
i
<
reqList
.
length
;
i
++
)
{
if
(
reqList
[
i
]
===
url
)
{
// cancel(errorMsg);
return
}
}
...
...
@@ -99,81 +42,36 @@ let loadingInstance = null
export
function
request
(
config
)
{
const
instance
=
axios
.
create
({
baseURL
:
process
.
env
.
NODE_ENV
===
'
development
'
?
'
http://192.168.1.145:9212
'
:
'
http://192.168.1.145:9212
'
,
DEVELOPMENT_SERVER_URL
:
SERVER_URL
,
timeout
:
60
*
1000
})
instance
.
interceptors
.
request
.
use
(
(
config
)
=>
{
const
loginUrl
=
'
/web/auth/login
'
;
const
setAccountInfo
=
'
/web/register/setAccountInfo
'
;
const
passMsgOld
=
'
/web/auth/changePassOld
'
;
const
getCam
=
'
/web/auth/getCam
'
;
const
registerCode
=
'
/web/code/registerCode
'
;
const
registerEmailCode
=
'
web/code/registerEmailCode
'
;
const
passwordEmailCode
=
'
web/code/passwordEmailCode
'
;
const
passwordCode
=
'
/web/code/passwordCode
'
;
const
changePassCode
=
'
/web/auth/changePassCode
'
;
const
loginOut
=
'
/web/auth/loginOut
'
;
// console.log(config)
if
(
config
.
url
.
indexOf
(
loginUrl
)
!=
-
1
||
config
.
url
.
indexOf
(
setAccountInfo
)
!=
-
1
||
config
.
url
.
indexOf
(
passMsgOld
)
!=
-
1
||
config
.
url
.
indexOf
(
getCam
)
!=
-
1
||
config
.
url
.
indexOf
(
registerCode
)
!=
-
1
||
config
.
url
.
indexOf
(
registerEmailCode
)
!=
-
1
||
config
.
url
.
indexOf
(
passwordEmailCode
)
!=
-
1
||
config
.
url
.
indexOf
(
changePassCode
)
!=
-
1
||
config
.
url
.
indexOf
(
passwordCode
)
!=
-
1
||
config
.
url
.
indexOf
(
loginOut
)
!=
-
1
)
{
return
config
}
const
token
=
localStorage
.
getItem
(
'
index-token
'
+
store
.
state
.
indexIdentity
)
if
(
token
)
{
// console.log(token,'11')
config
.
headers
.
token
=
token
}
else
{
window
.
localStorage
.
clear
()
router
.
push
({
path
:
'
/login
'
,
query
:
{
redirect
:
router
.
currentRoute
.
fullPath
}
// 从哪个页面跳转
})
const
error
=
new
Error
(
'
请登录!
'
)
return
Promise
.
reject
(
error
)
}
let
cancel
// 设置cancelToken对象
config
.
cancelToken
=
new
axios
.
CancelToken
(
function
(
c
)
{
cancel
=
c
})
if
(
config
.
url
.
indexOf
(
'
/web/config/getUniversity
'
)
==
-
1
&&
config
.
url
.
indexOf
(
'
/web/config/getProfession
'
)
==
-
1
)
{
// 阻止重复请求。当上个请求未完成时,相同的请求不会进行
stopRepeatRequest
(
reqList
,
config
.
url
,
cancel
,
`
${
config
.
url
}
请求被中断`
)
}
// const hotList = '/modules-campsite/activityCenter/hotList';
//
// if (config.url.indexOf(hotList) != -1) {
// return config
// }
// const token = localStorage.getItem('index-all-token')
// if (token) {
// config.headers.token = token
// } else {
// window.localStorage.clear()
// router.push({
// path: '/baseLogin',
// query: {
// redirect: router.currentRoute.fullPath
// } // 从哪个页面跳转
// })
// const error = new Error('请登录!')
// return Promise.reject(error)
// }
if
(
config
.
hasLoading
)
{
const
loadingText
=
config
.
loadingText
?
config
.
loadingText
:
'
请求中
'
loadingInstance
=
Loading
.
service
({
lock
:
true
,
fullscreen
:
true
,
text
:
loadingText
,
// spinner: 'el-icon-loading',
background
:
'
rgba(0, 0, 0, 0.25)
'
})
}
...
...
@@ -186,96 +84,15 @@ export function request(config) {
instance
.
interceptors
.
response
.
use
(
(
res
)
=>
{
// console.log(res, '11111')
// console.log(res.data.code, 'res.data.code')
if
(
res
.
data
.
code
==
400034
||
res
.
data
.
code
==
400035
||
// res.data.code == 400001 ||
res
.
data
.
code
==
400002
||
res
.
data
.
code
==
400003
)
{
router
.
push
({
path
:
'
/
'
+
store
.
state
.
indexIdentity
,
})
Notification
({
message
:
res
.
data
.
message
,
duration
:
1000
,
});
return
}
if
(
res
.
data
.
code
==
400023
)
{
console
.
log
(
res
)
// console.log(store.state.indexIdentity, 'store.state.indexIdentity')
let
code
=
store
.
state
.
indexIdentity
;
let
isLogout
=
res
.
config
.
url
==
'
/web/auth/loginOut
'
;
window
.
localStorage
.
removeItem
(
"
doubt_code
"
+
code
);
window
.
localStorage
.
removeItem
(
"
doubt_info
"
+
code
);
window
.
localStorage
.
removeItem
(
"
doubt_check
"
+
code
);
window
.
localStorage
.
removeItem
(
"
index-token
"
+
code
);
window
.
localStorage
.
removeItem
(
"
phone
"
+
code
);
window
.
localStorage
.
removeItem
(
"
camp_name
"
+
code
);
window
.
localStorage
.
removeItem
(
"
system_color
"
+
code
);
window
.
localStorage
.
removeItem
(
"
system_logo
"
+
code
);
window
.
localStorage
.
removeItem
(
"
has_amount
"
+
code
);
window
.
localStorage
.
removeItem
(
"
campsite_id
"
+
code
);
window
.
localStorage
.
removeItem
(
"
order_no
"
+
code
);
window
.
localStorage
.
removeItem
(
"
campindex_type
"
+
code
);
window
.
localStorage
.
removeItem
(
"
bk_pic
"
+
code
);
window
.
localStorage
.
removeItem
(
"
examine_status
"
+
code
);
window
.
localStorage
.
removeItem
(
"
examine_reason
"
+
code
);
window
.
localStorage
.
removeItem
(
"
sign_up_file_18355151517
"
+
code
);
window
.
localStorage
.
removeItem
(
"
schoolName
"
+
code
);
window
.
localStorage
.
removeItem
(
"
restet_code_time
"
+
code
);
window
.
localStorage
.
removeItem
(
"
camp_statement
"
+
code
)
router
.
push
({
path
:
'
/
'
+
store
.
state
.
indexIdentity
,
})
if
(
!
isLogout
){
Notification
({
message
:
res
.
data
.
message
,
duration
:
3000
,
});
}
return
}
if
(
res
.
data
.
code
==
400003
)
{
let
code
=
this
.
$store
.
state
.
indexIdentity
;
window
.
localStorage
.
removeItem
(
"
doubt_code
"
+
code
);
window
.
localStorage
.
removeItem
(
"
doubt_info
"
+
code
);
window
.
localStorage
.
removeItem
(
"
doubt_check
"
+
code
);
window
.
localStorage
.
removeItem
(
"
index-token
"
+
code
);
window
.
localStorage
.
removeItem
(
"
phone
"
+
code
);
window
.
localStorage
.
removeItem
(
"
camp_name
"
+
code
);
window
.
localStorage
.
removeItem
(
"
system_color
"
+
code
);
window
.
localStorage
.
removeItem
(
"
system_logo
"
+
code
);
window
.
localStorage
.
removeItem
(
"
has_amount
"
+
code
);
window
.
localStorage
.
removeItem
(
"
campsite_id
"
+
code
);
window
.
localStorage
.
removeItem
(
"
order_no
"
+
code
);
window
.
localStorage
.
removeItem
(
"
campindex_type
"
+
code
);
window
.
localStorage
.
removeItem
(
"
bk_pic
"
+
code
);
window
.
localStorage
.
removeItem
(
"
examine_status
"
+
code
);
window
.
localStorage
.
removeItem
(
"
examine_reason
"
+
code
);
window
.
localStorage
.
removeItem
(
"
sign_up_file_18355151517
"
+
code
);
window
.
localStorage
.
removeItem
(
"
schoolName
"
+
code
);
window
.
localStorage
.
clear
();
router
.
push
({
path
:
'
/
l
ogin
'
,
path
:
'
/
baseL
ogin
'
,
query
:
{
redirect
:
router
.
currentRoute
.
fullPath
}
// 从哪个页面跳转
})
}
// else if (
// res.data.code == 400801 ||
// res.data.code == 400910 ||
// res.data.code == 4002132 ||
// res.data.code == 40068
// ) {
// store.state.showDialog = true
// store.state.dialogType = 1
// }
loadingInstance
&&
loadingInstance
.
close
()
setTimeout
(()
=>
{
allowRequest
(
reqList
,
res
.
config
.
url
)
...
...
@@ -283,20 +100,8 @@ export function request(config) {
return
res
},
(
error
)
=>
{
// console.log(error, 'err')
// console.log(error.response.status, '5555')
Message
.
closeAll
()
if
(
error
.
response
.
status
===
404
)
{
// return this.$message.error("营地报名已结束")
// 未登录
Notification
({
message
:
"
营地报名已关闭
"
,
duration
:
3000
,
// onClose() {
// console.log('error');
// router.push("/admin/login");
// },
});
return
false
;
}
if
(
axios
.
isCancel
(
error
))
{
...
...
@@ -311,33 +116,9 @@ export function request(config) {
return
Promise
.
reject
(
error
)
}
)
return
instance
(
config
)
}
/**
* axios:upload 文件上传方法
* @param url
* @param data
* @returns {Promise}
*/
export
function
upload
(
url
,
data
=
{})
{
// console.log(11111)
return
new
Promise
((
resolve
,
reject
)
=>
{
axios
.
post
(
url
,
data
).
then
(
(
response
)
=>
{
console
.
log
(
url
)
// console.log(11111)
resolve
(
response
);
},
(
err
)
=>
{
console
.
log
(
11111
)
reject
(
err
);
}
);
});
}
// 合并多个请求
export
function
allRequest
(
arrRequest
)
{
return
axios
.
all
(
arrRequest
)
...
...
src/views/base/active/Active.vue
View file @
9eda2c8c
...
...
@@ -5,16 +5,23 @@
<div
class=
"active-search-content"
>
<div
class=
"content-item"
v-for=
"(item, index) in labelList"
:key=
"index"
>
<div
class=
"content-item-tit"
>
{{
item
.
categoryName
}}
</div>
<div
class=
"content-item-txt is-active"
>
全部
</div>
<div
class=
"content-item-txt"
v-for=
"(item2, index2) in item.labelLists"
:key=
"index2"
>
{{
item2
.
lableName
}}
</div>
<el-checkbox
v-model=
"checkAll[index]"
@
change=
"handleCheckAllChange($event,1, item.labelLists, index)"
>
全部
</el-checkbox>
<el-checkbox-group
v-model=
"selectIds[index]"
@
change=
"handleCheckedItemChange($event,1, item.labelLists, index)"
>
<el-checkbox
v-for=
"(item2, index2) in item.labelLists"
:key=
"index2"
:label=
"item2.lableId"
border
>
{{
item2
.
lableName
}}
</el-checkbox>
</el-checkbox-group>
</div>
<div
class=
"content-item"
>
<div
class=
"content-item-tit"
>
活动天数
</div>
<el-input
v-model=
"queryForm.
num1
"
<el-input
v-model=
"queryForm.
minDay
"
type=
"number"
:min=
"1"
placeholder=
"最小天数"
...
...
@@ -22,7 +29,7 @@
oninput=
"value=value.replace(/^0/g, '')"
></el-input>
<div
class=
"line"
>
——
</div>
<el-input
v-model=
"queryForm.
num2
"
<el-input
v-model=
"queryForm.
maxDay
"
type=
"number"
:min=
"1"
placeholder=
"最大天数"
...
...
@@ -33,9 +40,19 @@
</div>
<div
class=
"content-item"
>
<div
class=
"content-item-tit"
>
本站报名
</div>
<div
class=
"content-item-txt is-active"
>
全部
</div>
<div
class=
"content-item-txt"
>
支持
</div>
<div
class=
"content-item-txt"
>
不支持
</div>
<el-checkbox
v-model=
"checkAllSupp"
@
change=
"handleCheckAllChange($event,2, supportList)"
>
全部
</el-checkbox>
<el-checkbox-group
v-model=
"isSupport"
@
change=
"handleCheckedItemChange($event,2, supportList)"
>
<el-checkbox
v-for=
"(item, index) in supportList"
:key=
"index"
:label=
"item.lableId"
border
>
{{
item
.
lableName
}}
</el-checkbox>
</el-checkbox-group>
</div>
</div>
</div>
...
...
@@ -71,6 +88,7 @@
<
script
>
import
img
from
"
../../../assets/img/recruit.png
"
;
import
{
HotList
}
from
"
r/base/active
"
;
export
default
{
name
:
"
Active
"
,
...
...
@@ -78,8 +96,10 @@
return
{
loading
:
false
,
queryForm
:
{
num1
:
null
,
num2
:
null
,
ids
:
{},
isSupport
:
null
,
minDay
:
null
,
maxDay
:
null
,
},
labelList
:
[
{
...
...
@@ -203,10 +223,37 @@
days
:
'
3
'
,
bmEndTime
:
'
2023-08-31
'
,
}
]
],
supportList
:
[
{
lableId
:
2
,
lableName
:
'
支持
'
},
{
lableId
:
1
,
lableName
:
'
不支持
'
},
],
selectIds
:
{
0
:
[],
1
:
[],
2
:
[],
3
:
[],
4
:
[],
},
checkAll
:
{
0
:
false
,
1
:
false
,
2
:
false
,
3
:
false
,
4
:
false
,
},
isSupport
:
[],
checkAllSupp
:
false
,
}
},
created
()
{
this
.
getHotList
();
this
.
getList
();
},
methods
:
{
...
...
@@ -216,10 +263,55 @@
},
// 重置按钮
resetHandle
()
{
this
.
queryForm
.
num1
=
null
;
this
.
queryForm
.
num2
=
null
;
this
.
queryForm
=
{
ids
:
{},
isSupport
:
null
,
minDay
:
null
,
maxDay
:
null
,
};
for
(
let
key
in
this
.
selectIds
)
{
this
.
selectIds
[
key
]
=
[];
}
for
(
let
key
in
this
.
checkAll
)
{
this
.
checkAll
[
key
]
=
false
;
}
this
.
isSupport
=
[];
this
.
checkAllSupp
=
false
;
console
.
log
(
this
.
checkAll
)
this
.
getList
();
},
// 全部-标签操作
handleCheckAllChange
(
val
,
type
=
1
,
list
=
[],
idx
=
0
)
{
let
lableIdArr
=
list
.
map
(
item
=>
item
.
lableId
);
let
arr
=
val
?
lableIdArr
:
[];
if
(
type
==
1
)
{
this
.
selectIds
[
idx
]
=
arr
;
if
(
arr
.
length
>
0
)
{
this
.
queryForm
.
ids
[
idx
]
=
arr
;
}
else
{
delete
this
.
queryForm
.
ids
[
idx
]
}
}
else
{
this
.
isSupport
=
arr
;
this
.
queryForm
.
isSupport
=
arr
.
join
(
'
,
'
);
}
},
// 单个-标签操作
handleCheckedItemChange
(
val
,
type
=
1
,
list
=
[],
idx
=
0
)
{
let
lableIdArr
=
list
.
map
(
item
=>
item
.
lableId
);
let
checkedCount
=
val
.
length
;
if
(
type
==
1
)
{
this
.
checkAll
[
idx
]
=
checkedCount
===
lableIdArr
.
length
;
if
(
checkedCount
>
0
)
{
this
.
queryForm
.
ids
[
idx
]
=
val
;
}
else
{
delete
this
.
queryForm
.
ids
[
idx
]
}
}
else
{
this
.
checkAllSupp
=
checkedCount
===
lableIdArr
.
length
;
this
.
queryForm
.
isSupport
=
val
.
join
(
'
,
'
);
}
},
// 获取列表
getList
()
{
if
(
this
.
loading
)
{
...
...
@@ -231,6 +323,14 @@
this
.
loading
=
false
;
},
2000
)
},
// 获取筛选标签列表
getHotList
()
{
HotList
().
then
(
res
=>
{
console
.
log
(
res
)
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
}
}
}
</
script
>
...
...
@@ -292,18 +392,37 @@
.content-item-tit
{
width
:
140px
;
text-align
:
center
;
font-size
:
16px
;
background-color
:
#f5f5f5
;
margin-right
:
10px
;
}
.content-item-txt
{
::v-deep
.el-checkbox-group
{
height
:
36px
;
line-height
:
36px
;
}
::v-deep
.el-checkbox
{
border
:
0
;
padding
:
0
10px
;
margin-left
:
15px
;
cursor
:
pointer
;
margin
:
0
0
0
15px
;
height
:
36px
;
line-height
:
36px
;
&
:hover
,
&
.is-active
{
color
:
var
(
--
all_color
);
.el-checkbox__input
{
display
:
none
;
}
.el-checkbox__label
{
padding
:
0
;
font-size
:
16px
;
}
/*&:hover,*/
&
.is-checked
{
.el-checkbox__label
{
color
:
var
(
--
all_color
)
!
important
;
}
}
}
...
...
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