Commit 1d640ded authored by wuwangwolihui's avatar wuwangwolihui

营地2.0-整合修改

parent fd369a29
......@@ -4,7 +4,8 @@
<div class="image">
<img v-if="type==1" :src="all_logo" alt=""/>
<img v-if="type==2" :src="system_logo" alt=""/>
<img v-if="type==3" :src="system_logo?system_logo:all_logo" alt="" @click="toRecruit"/>
<img v-if="type==3" :src="system_logo" alt="" @click="toRecruit"/>
<img v-if="type==4" :src="system_logo?system_logo:all_logo" alt="" @click="toRecruit"/>
</div>
<div class="right">
<el-menu :default-active="$store.state.activeIndex"
......@@ -53,7 +54,7 @@
},
data() {
return {
type: this.typeFu, // 1-baseHeader 2-indexHeader
type: this.typeFu, // 1-baseHeader 2-营地简章的header 3-登录报名流程里的header 4-报名中心的header
isHover: true,
isLogin: false,
phone: '',
......@@ -89,15 +90,6 @@
toCenter() {
this.$router.replace("/myInfo/signUpList");
},
// 去注册
toRegister() {
if (this.type == 1) {
this.$router.push("/baseRegister");
} else if (this.type == 2 || this.type == 3) {
let code = this.$store.state.indexIdentity;
this.$router.push("/register?code=" + code);
}
},
// 立即报名
toSignUp() {
let code = this.$store.state.indexIdentity;
......@@ -112,7 +104,7 @@
toLogin() {
if (this.type == 1) {
this.$router.push("/baseLogin");
} else if (this.type == 2 || this.type == 3) {
} else if (this.type == 2) {
let code = this.$store.state.indexIdentity;
this.$router.push("/login?code=" + code);
}
......@@ -128,9 +120,13 @@
if (confirmResult !== "confirm") {
return this.$message.info("您取消了退出");
}
await logout({});
let previousPath = localStorage.getItem('index-previousPath');
// 清除本地缓存 除了特殊缓存
this.$store.commit('removeLocalStorage');
if (this.type == 2 || this.type == 3) {
this.isLogin = false;
this.$message.success("退出成功");
if (this.type == 3) {
let code = this.$store.state.indexIdentity;
if (this.$store.state.human == 1) {
await this.$router.replace({
......@@ -143,9 +139,26 @@
await this.$router.replace("/" + code);
}
}
this.isLogin = false;
this.$message.success("退出成功");
// await logout({});
if (this.type == 4) {
if (previousPath &&
(previousPath == '/home' ||
previousPath == '/active' ||
previousPath.indexOf('/active/') != -1)) {
await this.$router.replace(previousPath);
} else {
let code = this.$store.state.indexIdentity;
if (this.$store.state.human == 1) {
await this.$router.replace({
path: "/login",
query: {
code: code,
},
});
} else {
await this.$router.replace("/" + code);
}
}
}
},
// 鼠标移入事件
onMouserEnter(val) {
......
......@@ -15,6 +15,7 @@ export function getCam(code) {
params: data
})
}
export function getCamInfo(code) {
let data = {};
data['identity'] = code ? code : store.state.indexIdentity;
......@@ -27,6 +28,7 @@ export function getCamInfo(code) {
params: data
})
}
// 登录
export function login(data) {
data['identity'] = store.state.indexIdentity;
......@@ -37,6 +39,7 @@ export function login(data) {
})
}
// 获取登录验证码
export function loginCode(data) {
data['identity'] = store.state.indexIdentity;
......@@ -47,10 +50,15 @@ export function loginCode(data) {
})
}
// 退出
export function logout(data) {
const token = localStorage.getItem('index-token-all');
data['identity'] = store.state.indexIdentity;
return request({
headers: {
token: token
},
method: 'post',
url: '/web/auth/loginOut',
data
......
......@@ -108,6 +108,7 @@ export function request(config) {
const HotList = '/activityCenter/hotList';
const GetActiveInfo = '/activityCenter/detail/';
const HomeHot = '/activityCenter/hot';
const Logout = '/web/auth/loginOut';
if ((config.url.indexOf(loginUrl) != -1 && config.url.indexOf(loginOut) == -1) ||
config.url.indexOf(setAccountInfo) != -1 ||
config.url.indexOf(passMsgOld) != -1 ||
......@@ -122,7 +123,8 @@ export function request(config) {
config.url.indexOf(LabelType) != -1 ||
config.url.indexOf(HotList) != -1 ||
config.url.indexOf(GetActiveInfo) != -1 ||
config.url.indexOf(HomeHot) != -1) {
config.url.indexOf(HomeHot) != -1 ||
config.url.indexOf(Logout) != -1) {
return config
}
const token = localStorage.getItem('index-token-all');
......
......@@ -197,6 +197,7 @@ function checkCam(code, cb) {
}
router.beforeEach((to, from, next) => {
console.log(to, from)
if (from.fullPath != '/' && from.fullPath != '/baseLogin' && from.fullPath != '/baseRegister') {
store.commit('setPreviousPath', from.fullPath);
}
......
......@@ -3,6 +3,23 @@
<div class="active-search">
<div class="active-search-title">活动筛选</div>
<div class="active-search-content">
<div class="content-item">
<div class="content-item-tit">活动状态</div>
<el-checkbox
class="is-check-all"
v-model="checkAllStatus"
@change="handleCheckAllChange($event,3, statusList)"
>全部
</el-checkbox>
<el-checkbox-group v-model="isStatus"
@change="handleCheckedItemChange($event,3, statusList)">
<el-checkbox v-for="(item, index) in statusList"
:key="index"
:label="item.lableId"
border>{{item.lableName}}
</el-checkbox>
</el-checkbox-group>
</div>
<div class="content-item" v-for="(item, index) in labelList" :key="index">
<div class="content-item-tit">{{item.categoryName}}</div>
<el-checkbox
......@@ -118,17 +135,36 @@
loading: false,
queryForm: {
ids: {},
activityStatus: null,
isSupport: null,
minDay: null,
maxDay: null,
},
labelList: [],
activeList: [],// 通过后台数据得到的所有数据
showActiveList: [],// 前端页面需要渲染的数据
pageSize: 6, //渲染数据的多少根据实际情况设置
baseSize: 6,// 渲染基础页数
totall: 0, //总数据量
statusList: [
{
lableId: 1,
lableName: '报名未开放'
},
{
lableId: 2,
lableName: '报名中'
},
{
lableId: 3,
lableName: '开营中'
},
{
lableId: 4,
lableName: '已结营'
},
],
supportList: [
{
lableId: 2,
......@@ -141,6 +177,8 @@
],
selectIds: {},
checkAll: {},
isStatus: [],
checkAllStatus: false,
isSupport: [],
checkAllSupp: false,
}
......@@ -215,6 +253,7 @@
}
this.loading = true;
let queryForm = JSON.parse(JSON.stringify(this.queryForm));
// 全选项 置空传值
let flag = true;
for (let key in queryForm['ids']) {
if (!this.checkAll[key]) {
......@@ -224,6 +263,12 @@
if (flag) {
queryForm['ids'] = {};
}
if (this.checkAllStatus) {
queryForm['activityStatus'] = null;
}
if (this.checkAllSupp) {
queryForm['isSupport'] = null;
}
HotList(queryForm).then(res => {
console.log(res)
if (res.data.code != 200) {
......@@ -267,6 +312,7 @@
resetHandle() {
this.queryForm = {
ids: {},
activityStatus: null,
isSupport: null,
minDay: null,
maxDay: null,
......@@ -279,7 +325,8 @@
}
this.isSupport = [];
this.checkAllSupp = false;
console.log(this.checkAll)
this.isStatus = [];
this.checkAllStatus = false;
this.getList();
},
// 全部-标签操作
......@@ -293,9 +340,12 @@
} else {
delete this.queryForm.ids[idx]
}
} else {
} else if (type == 2) {
this.isSupport = arr;
this.queryForm.isSupport = arr.join(',');
} else if (type == 3) {
this.isStatus = arr;
this.queryForm.activityStatus = arr.join(',');
}
},
// 单个-标签操作
......@@ -309,9 +359,12 @@
} else {
delete this.queryForm.ids[idx]
}
} else {
} else if (type == 2) {
this.checkAllSupp = checkedCount === lableIdArr.length;
this.queryForm.isSupport = val.join(',');
} else if (type == 3) {
this.checkAllStatus = checkedCount === lableIdArr.length;
this.queryForm.activityStatus = val.join(',');
}
},
}
......
<template>
<el-container>
<el-header height="104px">
<Header :typeFu="3"></Header>
<Header :typeFu="4"></Header>
<div class="bg-top"></div>
</el-header>
<el-container>
......
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