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

个人信息

parent 279944cb
<template>
<div>
<div :key="index" class="campList" v-for="(item,index) in List">
<template v-if="activeList.length>0">
<div :key="index" class="campList" v-for="(item,index) in activeList">
<el-card class="box-card">
<div class="flex list_item">
<div class="flex list_item" @click="toSignUp(item.identity)">
<div class="item_img">
<img :src="item.url"/>
<img :src="item.activityCover"/>
</div>
<div class="right">
<div>
<div class="item_title">{{item.name}}</div>
<div class="item_tag">{{item.tag}}</div>
<div class="item_time">活动时间:{{item.time}}</div>
<div class="item_title">{{item.schoolName}}</div>
<div class="item_tag">{{item.activityLabel}}</div>
<div class="item_time">活动时间:{{formatYMD(item.activityStartTime)}}{{formatYMD(item.activityEndTime)}}
</div>
</div>
</div>
</div>
</el-card>
</div>
</template>
<div class="noCamp" v-else> 暂无营地</div>
</div>
</template>
<script>
import img from "../../../assets/img/recruit.png";
import {activity} from "r/base/myInfo";
export default {
name: "campList",
props: {
typeFu: [String, Number]
},
data() {
return {
List: [{
url: img,
name: 'XX大学暑期营',
tag: '线下活动',
time: '2023-07-23至2023-07-27',
}, {
url: img,
name: 'XX大学暑期营',
tag: '线下活动',
time: '2023-07-23至2023-07-27',
}]
activeList: [],
type: this.typeFu,
}
},
created() {
this.getCampList();
},
methods: {
getCampList() {
activity({
phone: window.localStorage.getItem('index-phone-all'),
type: this.type
}).then((res) => {
if (res.data.code != 200) {
return this.$message.error(res.data.message);
}
this.activeList = res.data.data;
console.log(typeof (this.activeList))
})
},
toSignUp(code) {
console.log(code)
this.$store.commit('setIndexIdentity', code)
this.$router.push('/signUp/examInfo?code=' + code)
}
},
watch: {
typeFu() {
this.type = this.typeFu;
}
}
}
</script>
......@@ -85,4 +110,9 @@
}
}
}
.noCamp {
text-align: center;
margin-top: 100px;
}
</style>
import {request} from './network'
import {request} from '../network'
//我的营地列表
export function activity(data) {
......
......@@ -41,7 +41,6 @@
import Footer from "@/components/Footer.vue";
import svg1 from '@/assets/img/signUp/icon.svg';
import signUpList from '../myInfo/signUp.vue';
import {activity} from "r/base/myInfo";
export default {
name: "myInfoIndex",
......@@ -72,8 +71,6 @@
watch: {},
created() {
// this.ToSignUp(this.campindex_type)
this.getCampList();
},
mounted() {
window.addEventListener("scroll", this.handleScrollX, true);
......@@ -84,18 +81,7 @@
window.removeEventListener("resize", this.onResize, true);
},
methods: {
getCampList() {
activity({
phone:window.localStorage.getItem('index-phone-all'),
type:1
}).then((res) => {
if (res.data.code != 200) {
return this.$message.error(res.data.message);
}
this.$message.success(res.data.message);
this.activeList = res.data.data;
})
},
ToSignUp(index) {
console.log(index, 'index')
this.campindex_type = index;
......
......@@ -2,19 +2,30 @@
<div class="signUp">
<el-tabs @tab-click="handleClick" v-model="campStatus">
<el-tab-pane label="正在报名" name="1">
<campList></campList>
<template v-if="campStatus==1">
<campList :typeFu="campStatus"></campList>
</template>
</el-tab-pane>
<el-tab-pane label="即将开营" name="2">
<campList></campList>
<template v-if="campStatus==2">
<campList :typeFu="campStatus"></campList>
</template>
</el-tab-pane>
<el-tab-pane label="开营中" name="3">
<campList></campList>
<template v-if="campStatus==3">
<campList :typeFu="campStatus"></campList>
</template>
</el-tab-pane>
<el-tab-pane label="已结营" name="4">
<campList></campList>
<template v-if="campStatus==4">
<campList :typeFu="campStatus"></campList>
</template>
</el-tab-pane>
<el-tab-pane label="已退营" name="5">
<campList></campList>
<template v-if="campStatus==5">
<campList :typeFu="campStatus"></campList>
</template>
</el-tab-pane>
</el-tabs>
</div>
......@@ -22,6 +33,7 @@
<script>
import campList from "@/components/base/myInfo/campList.vue";
import {activity} from "r/base/myInfo";
export default {
name: "signUpList",
......@@ -30,15 +42,16 @@
},
data() {
return {
campStatus: '1'
campStatus: '1',
}
},
created() {
},
methods: {
handleClick(tab, event) {
console.log(tab, event);
console.log(tab.index);
console.log(tab.name);
}
this.campStatus=tab.name;
},
}
}
......
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