Files
2026-09-08 19:49:21 +08:00

105 lines
3.5 KiB
HTML

<!--#
layout("/mobile/platform.html"){
#-->
<div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading>
<van-nav-bar
title="活动列表"
left-arrow
placeholder
fixed
@click-left="history.go(-1)"
></van-nav-bar>
<div class="search-fixed">
<van-dropdown-menu active-color="#1989fa">
<van-dropdown-item v-model="pageForm.year" :options="yearOption" @change="yearChange"></van-dropdown-item>
</van-dropdown-menu>
</div>
<div style="margin: 60px auto 0 auto">
<van-list
v-model="mLoading"
:finished="finished"
:finished-text="tableData.length>0?'没有更多了':''"
@load="onLoad">
<div v-for="o in tableData" class="list-card" @click="openView(o)">
<van-cell-group inset>
<van-cell title="主题" :border="false">{{o.hdname}}</van-cell>
<van-cell :border="false" title="创建人">{{o.username}}</van-cell>
<van-cell :border="false" title="创建时间">{{o.hdcjsj}}</van-cell>
<van-cell :border="false" title="开始时间">{{o.hdkssj}}</van-cell>
<van-cell :border="false" title="结束时间">{{o.hdjssj}}</van-cell>
</van-cell-group>
</div>
</van-list>
<van-empty
v-if="mLoading==false&&tableData.length==0"
class="custom-image"
image="/none.svg"
description="暂无数据"
></van-empty>
</div>
</div>
<script>
let vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
yearOption: [],
pageForm: {
year: '',
hdtype: 2,
}
}
},
methods: {
yearChange() {
this.pageForm.pageNumber = 1
this.tableData = []
this.onLoad()
},
async onLoad() {
this.mLoading = true
$.post('/mobile/cahd/apply/pageData', this.pageForm).then(res => {
if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length === res.data.totalCount) {
this.finished = true
} else {
this.pageForm.pageNumber++
}
}
this.mLoading = false
})
},
openView(o) {
const {hdid, hdjssj, hdkssj} = o
if (moment().format("YYYY-MM-DD HH:mm:ss") < hdkssj) {
vant.Toast('报名暂未开始!')
return
} else if (moment().format("YYYY-MM-DD HH:mm:ss") > hdjssj) {
vant.Toast('报名已结束!')
return
}
window.location.href = '/childrenActivities?client=mobile&id=' + hdid
}
},
async created() {
for (let i = new Date().getFullYear() - 10; i <= new Date().getFullYear(); i++) {
this.yearOption.unshift({value: i, text: i + '年'},)
}
this.$set(this.pageForm, "year", this.yearOption[0].value)
}
})
</script>
<!--#
}
#-->