|
@@ -212,13 +212,14 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import { mapGetters, mapState } from 'vuex';
|
|
import PreviewProgressPie from "../EventView/PreviewProgressPie";
|
|
import PreviewProgressPie from "../EventView/PreviewProgressPie";
|
|
export default {
|
|
export default {
|
|
name: "EventList",
|
|
name: "EventList",
|
|
mounted() {
|
|
mounted() {
|
|
this.getActivityInfo()
|
|
this.getActivityInfo()
|
|
- this.selectedCondition(this.$store.getters.getItemTitle);
|
|
|
|
- if (this.$store.getters.getIsSelectedNow == false) {
|
|
|
|
|
|
+ this.selectedCondition(this.getItemTitle);
|
|
|
|
+ if (this.getIsSelectedNow == false) {
|
|
this.predealMockdatafirstItem();
|
|
this.predealMockdatafirstItem();
|
|
}
|
|
}
|
|
this.scrollList();
|
|
this.scrollList();
|
|
@@ -299,22 +300,37 @@
|
|
} else this.isListNoItem = false;
|
|
} else this.isListNoItem = false;
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapState({
|
|
|
|
+ studentProfile: state => state.user.studentProfile,
|
|
|
|
+ schoolCode: state => state.user.schoolCode,
|
|
|
|
+ userInfo: state => state.userInfo,
|
|
|
|
+ }),
|
|
|
|
+ ...mapGetters([
|
|
|
|
+ "getItemTitle",
|
|
|
|
+ "getIsSelectedNow",
|
|
|
|
+ "getisFromInfoPoptoScroll",
|
|
|
|
+ "getFilterType",
|
|
|
|
+ "getFinishedItem",
|
|
|
|
+ "getFinishedItemTime"
|
|
|
|
+ ])
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
//获取活动信息数据
|
|
//获取活动信息数据
|
|
getActivityInfo() {
|
|
getActivityInfo() {
|
|
this.eventList.length = 0
|
|
this.eventList.length = 0
|
|
this.isListNoItem = true;
|
|
this.isListNoItem = true;
|
|
- if (this.$store.state.user.studentProfile.classinfo.id !== "") {
|
|
|
|
- let classInfo = [this.$store.state.user.studentProfile.classinfo.id]
|
|
|
|
- if (this.$store.state.user.studentProfile.courses.length) {
|
|
|
|
- for (let item of this.$store.state.user.studentProfile.courses) {
|
|
|
|
|
|
+ if (this.studentProfile.classinfo.id !== "") {
|
|
|
|
+ let classInfo = [this.studentProfile.classinfo.id]
|
|
|
|
+ if (this.studentProfile.courses.length) {
|
|
|
|
+ for (let item of this.studentProfile.courses) {
|
|
classInfo.push(item.id)
|
|
classInfo.push(item.id)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
let params = {
|
|
let params = {
|
|
- userid: this.$store.state.userInfo.sub,
|
|
|
|
|
|
+ userid: this.userInfo.sub,
|
|
userType: "schoolid",
|
|
userType: "schoolid",
|
|
- school: this.$store.state.user.schoolCode
|
|
|
|
|
|
+ school: this.schoolCode
|
|
}
|
|
}
|
|
this.$api.studentWeb.getActivityInfo(params).then(res => {
|
|
this.$api.studentWeb.getActivityInfo(params).then(res => {
|
|
if (res) {
|
|
if (res) {
|
|
@@ -441,7 +457,7 @@
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- //选择所有
|
|
|
|
|
|
+ // 选择所有
|
|
selectAllType() {
|
|
selectAllType() {
|
|
this.eventTypeCheckers = '';
|
|
this.eventTypeCheckers = '';
|
|
this.predealMockdatafirstItem();
|
|
this.predealMockdatafirstItem();
|
|
@@ -474,12 +490,12 @@
|
|
this.$store.commit("SetTrytestCount", [0, 0, 0]);
|
|
this.$store.commit("SetTrytestCount", [0, 0, 0]);
|
|
},
|
|
},
|
|
scrollListfromInfoPop() {
|
|
scrollListfromInfoPop() {
|
|
- if (this.$store.getters.getisFromInfoPoptoScroll == true) {
|
|
|
|
|
|
+ if (this.getisFromInfoPoptoScroll == true) {
|
|
//當從通知操作進行捲動時,將篩選條件清空
|
|
//當從通知操作進行捲動時,將篩選條件清空
|
|
this.selectedEventStatusNow = this.$t('studentWeb.event.allStatus');
|
|
this.selectedEventStatusNow = this.$t('studentWeb.event.allStatus');
|
|
this.eventTypeCheckers = "";
|
|
this.eventTypeCheckers = "";
|
|
let targetItem = document.getElementById(
|
|
let targetItem = document.getElementById(
|
|
- `event${this.$store.getters.getItemTitle.eventID}`
|
|
|
|
|
|
+ `event${this.getItemTitle.eventID}`
|
|
);
|
|
);
|
|
let scrollList = document.querySelectorAll(
|
|
let scrollList = document.querySelectorAll(
|
|
".event-list .list-block"
|
|
".event-list .list-block"
|
|
@@ -502,8 +518,8 @@
|
|
},
|
|
},
|
|
selectedCondition(item) {
|
|
selectedCondition(item) {
|
|
if (
|
|
if (
|
|
- this.$store.getters.getIsSelectedNow == true &&
|
|
|
|
- this.$store.getters.getItemTitle.id == item.id
|
|
|
|
|
|
+ this.getIsSelectedNow == true &&
|
|
|
|
+ this.getItemTitle.id == item.id
|
|
) {
|
|
) {
|
|
return true;
|
|
return true;
|
|
} else return false;
|
|
} else return false;
|
|
@@ -550,7 +566,7 @@
|
|
},
|
|
},
|
|
sentEvenType(eventype) {
|
|
sentEvenType(eventype) {
|
|
this.$store.commit("ChangeFilterType", eventype);
|
|
this.$store.commit("ChangeFilterType", eventype);
|
|
- if (this.$store.getters.getFilterType == "all") {
|
|
|
|
|
|
+ if (this.getFilterType == "all") {
|
|
let filterListFinished = [],
|
|
let filterListFinished = [],
|
|
filterListUnFinished = [];
|
|
filterListUnFinished = [];
|
|
for (let i = 0; i < this.mockdata.length; i++) {
|
|
for (let i = 0; i < this.mockdata.length; i++) {
|
|
@@ -571,7 +587,7 @@
|
|
}
|
|
}
|
|
this.defaultFirstItem = filterListUnFinished[0];
|
|
this.defaultFirstItem = filterListUnFinished[0];
|
|
if (
|
|
if (
|
|
- this.$store.getters.getIsSelectedNow == false &&
|
|
|
|
|
|
+ this.getIsSelectedNow == false &&
|
|
this.defaultFirstItem != ""
|
|
this.defaultFirstItem != ""
|
|
) {
|
|
) {
|
|
this.sentSelectedEventTitle(this.defaultFirstItem);
|
|
this.sentSelectedEventTitle(this.defaultFirstItem);
|
|
@@ -581,34 +597,31 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
eventypeSelected: function (type) {
|
|
eventypeSelected: function (type) {
|
|
- if (this.$store.getters.getFilterType == type) return true;
|
|
|
|
|
|
+ if (this.getFilterType == type) return true;
|
|
else return false;
|
|
else return false;
|
|
},
|
|
},
|
|
scrollList() {
|
|
scrollList() {
|
|
},
|
|
},
|
|
showTheCurrentTab() {
|
|
showTheCurrentTab() {
|
|
if (
|
|
if (
|
|
- (this.finishedListNoItem == false &&
|
|
|
|
- this.$store.getters.getItemTitle.isDone == true) ||
|
|
|
|
- this.$store.getters.getFinishedItem.includes(
|
|
|
|
- this.$store.getters.getItemTitle.eventID
|
|
|
|
- )
|
|
|
|
|
|
+ (this.finishedListNoItem == false && this.getItemTitle.isDone == true)
|
|
|
|
+ || this.getFinishedItem.includes(this.getItemTitle.eventID)
|
|
)
|
|
)
|
|
return "tab2";
|
|
return "tab2";
|
|
else return "tab1";
|
|
else return "tab1";
|
|
},
|
|
},
|
|
finishedcondition(item) {
|
|
finishedcondition(item) {
|
|
- if (this.$store.getters.getFinishedItem.includes(item.eventID) == true) {
|
|
|
|
|
|
+ if (this.getFinishedItem.includes(item.eventID) == true) {
|
|
this.havejustfinishedItem = true;
|
|
this.havejustfinishedItem = true;
|
|
return true;
|
|
return true;
|
|
} else return false;
|
|
} else return false;
|
|
},
|
|
},
|
|
finishedItemtime(item) {
|
|
finishedItemtime(item) {
|
|
- if (this.$store.getters.getFinishedItem.includes(item.eventID) == true) {
|
|
|
|
- let timeIndex = this.$store.getters.getFinishedItem.indexOf(
|
|
|
|
|
|
+ if (this.getFinishedItem.includes(item.eventID) == true) {
|
|
|
|
+ let timeIndex = this.getFinishedItem.indexOf(
|
|
item.eventID
|
|
item.eventID
|
|
);
|
|
);
|
|
- return this.$store.getters.getFinishedItemTime[timeIndex];
|
|
|
|
|
|
+ return this.getFinishedItemTime[timeIndex];
|
|
}
|
|
}
|
|
},
|
|
},
|
|
},
|
|
},
|