Commit b614583b authored by wuwangwolihui's avatar wuwangwolihui

营地2.0-整合修改

parent ff01a6e9
<template> <template>
<div> <div>
<template v-if="activeList.length>0"> <template v-if="activeList.length>0">
<div :key="index" class="campList" v-for="(item,index) in activeList"> <div class="campList" v-for="(item,index) in activeList" :key="index">
<el-card class="box-card"> <div @click="toSignUp(item.identity)">
<div class="flex list_item" @click="toSignUp(item.identity)"> <el-card>
<div class="flex list_item">
<div class="item_img"> <div class="item_img">
<img :src="item.activityCover"/> <el-image :src="item.activityCover" fit="cover"/>
</div> </div>
<div class="right"> <div class="right">
<div> <div>
<div class="item_title">{{item.schoolName}}</div> <div class="item_title">{{item.schoolName}}</div>
<div class="item_tag">{{item.activityLabel}}</div> <div class="item_tag">{{item.activityLabel}}</div>
<div class="item_time">活动时间:{{formatYMD(item.activityStartTime)}}{{formatYMD(item.activityEndTime)}} <div class="item_time">活动时间:{{formatYMD(item.activityStartTime)}}
{{formatYMD(item.activityEndTime)}}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</el-card> </el-card>
</div> </div>
</div>
</template> </template>
<div class="noCamp" v-else> 暂无营地</div> <div class="noCamp" v-else>暂无营地</div>
</div> </div>
</template> </template>
...@@ -74,19 +78,48 @@ ...@@ -74,19 +78,48 @@
} }
.campList { .campList {
margin: 10px 0; margin: 20px 0;
::v-deep .el-card {
cursor: pointer;
.el-image {
width: 100%;
height: 100%;
border-radius: 4px;
transition: all .5s;
-webkit-transition: all .5s;
.el-image__error {
background-color: #D8D8D8;
}
}
&:hover {
box-shadow: 6px 6px 15px rgba(0, 0, 0, 0.1);
.el-image {
transform: scale(1.1);
-ms-transform: scale(1.1); /* IE 9 */
-moz-transform: scale(1.1); /* Firefox */
-webkit-transform: scale(1.1); /* Safari 和 Chrome */
-o-transform: scale(1.1);
}
}
}
.list_item { .list_item {
display: flex;
flex-flow: row;
.item_img { .item_img {
width: 30%; width: 30%;
margin-right: 10%; margin-right: 10%;
overflow: hidden;
img {
width: 100%;
}
} }
.right { .right {
flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -60,6 +60,7 @@ const reqList = [] ...@@ -60,6 +60,7 @@ const reqList = []
* @param {string} errorMessage - 请求中断时需要显示的错误信息 * @param {string} errorMessage - 请求中断时需要显示的错误信息
*/ */
const stopRepeatRequest = function (reqList, url, cancel, errorMessage) { const stopRepeatRequest = function (reqList, url, cancel, errorMessage) {
console.log(reqList)
const errorMsg = errorMessage || '' const errorMsg = errorMessage || ''
for (let i = 0; i < reqList.length; i++) { for (let i = 0; i < reqList.length; i++) {
if (reqList[i] === url) { if (reqList[i] === url) {
...@@ -67,7 +68,7 @@ const stopRepeatRequest = function (reqList, url, cancel, errorMessage) { ...@@ -67,7 +68,7 @@ const stopRepeatRequest = function (reqList, url, cancel, errorMessage) {
return return
} }
} }
reqList.push(url) reqList.push(url);
} }
/** /**
* 允许某个请求可以继续进行 * 允许某个请求可以继续进行
...@@ -139,13 +140,11 @@ export function request(config) { ...@@ -139,13 +140,11 @@ export function request(config) {
let cancel let cancel
// 设置cancelToken对象 // 设置cancelToken对象
config.cancelToken = new axios.CancelToken(function (c) { config.cancelToken = new axios.CancelToken((c) => {
cancel = c cancel = c
}) })
if ( if (config.url.indexOf('/web/config/getUniversity') == -1 &&
config.url.indexOf('/web/config/getUniversity') == -1 && config.url.indexOf('/web/config/getProfession') == -1) {
config.url.indexOf('/web/config/getProfession') == -1
) {
// 阻止重复请求。当上个请求未完成时,相同的请求不会进行 // 阻止重复请求。当上个请求未完成时,相同的请求不会进行
stopRepeatRequest( stopRepeatRequest(
reqList, reqList,
......
...@@ -196,7 +196,6 @@ function checkCam(code, cb) { ...@@ -196,7 +196,6 @@ function checkCam(code, cb) {
} }
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
console.log(to)
if (from.fullPath != '/') { if (from.fullPath != '/') {
store.commit('setFullPath', from.fullPath); store.commit('setFullPath', from.fullPath);
} }
......
...@@ -27,7 +27,6 @@ export default { ...@@ -27,7 +27,6 @@ export default {
window.localStorage.setItem('index-active-path', key); window.localStorage.setItem('index-active-path', key);
}, },
setFullPath(state, path){ setFullPath(state, path){
console.log(state, path)
state.fullPath = path; state.fullPath = path;
window.localStorage.setItem('index-fullPath', path); window.localStorage.setItem('index-fullPath', path);
}, },
......
...@@ -45,11 +45,12 @@ export function formatYMD(data) { ...@@ -45,11 +45,12 @@ export function formatYMD(data) {
return (y + "-" + add0(m) + "-" + add0(d)); return (y + "-" + add0(m) + "-" + add0(d));
} }
// 2023年1月1日 // 2023年1月1日1点
export function formatYMDChina(data) { export function formatYMDChina(data) {
let time = new Date(data); let time = new Date(data);
let y = time.getFullYear(); let y = time.getFullYear();
let m = time.getMonth() + 1; let m = time.getMonth() + 1;
let d = time.getDate(); let d = time.getDate();
return (y + "" + m + "" + d + ""); let h = time.getHours();
return (y + "" + m + "" + d + "" + h + "");
} }
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
}, },
methods: { methods: {
handleClick(tab, event) { handleClick(tab, event) {
this.campStatus=tab.name; this.campStatus = tab.name;
}, },
} }
...@@ -63,8 +63,26 @@ ...@@ -63,8 +63,26 @@
} }
.signUp { .signUp {
margin: 10px 80px 10px 31px; margin: 20px 30px;
::v-deep .el-tabs {
.el-tabs__active-bar {
background-color: var(--color);
} }
.el-tabs__item {
font-size: 18px;
&:hover,
&.is-active {
color: var(--color);
}
}
.el-tabs__content {
padding: 20px;
}
}
}
</style> </style>
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