first commit
This commit is contained in:
@@ -0,0 +1,177 @@
|
||||
<!--#
|
||||
layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.list-card {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.activity_card {
|
||||
padding: 15px;
|
||||
background: #fff;
|
||||
margin: 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.activity_card .van-image, .activity_card .van-image img {
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.activity_card .activity_content {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.activity_card .activity_content .activity_name {
|
||||
line-height: 25px;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.activity_card .activity_content .activity_bottom {
|
||||
line-height: 25px;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.activity_card .activity_content .activity_bottom .left {
|
||||
line-height: 25px;
|
||||
overflow: hidden;
|
||||
width: calc(100% - 80px);
|
||||
font-size: 12px;
|
||||
color: #c4bebe;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.activity_card .activity_content .activity_bottom .right {
|
||||
line-height: 25px;
|
||||
overflow: hidden;
|
||||
width: 80px;
|
||||
max-width: 80px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<van-nav-bar title="活动列表" left-arrow placeholder fixed
|
||||
@click-left="location.replace('/mobile/index')"></van-nav-bar>
|
||||
|
||||
<div style="margin: 10px auto 60px auto">
|
||||
<van-list v-model="loading" :finished="finished" :finished-text="tableData.length>0?'没有更多了':''"
|
||||
@load="pageData">
|
||||
<div v-for="o in tableData" class="list-card" @click="openReg(o)">
|
||||
|
||||
<div class="activity_card">
|
||||
<van-image
|
||||
fit="cover"
|
||||
width="100%"
|
||||
height="200"
|
||||
:src="FILE_DOMAIN + '/fileStreamPreview?id=' + o.cover"
|
||||
></van-image>
|
||||
<div class="activity_content">
|
||||
<div class="activity_name van-ellipsis">
|
||||
<van-icon name="fire" color="red"></van-icon>
|
||||
<span style="margin-left: 10px;">{{o.name}}</span>
|
||||
</div>
|
||||
<div class="activity_bottom">
|
||||
<div class="left">
|
||||
<van-icon name="clock" size="1em"></van-icon>
|
||||
<span style="margin-left: 10px;">
|
||||
{{moment(o.startTime).format('YYYY/MM/DD HH:mm')}} 至
|
||||
{{moment(o.endTime).format('YYYY/MM/DD HH:mm')}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<span v-if="moment(o.applyEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.applyStartTime).valueOf()"
|
||||
style="color: forestgreen">
|
||||
报名中
|
||||
</span>
|
||||
<span v-else-if="moment(o.applyEndTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.startTime).valueOf()"
|
||||
style="color: #ee1919">
|
||||
报名结束
|
||||
</span>
|
||||
<span v-else-if="moment(o.startTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.endTime).valueOf()"
|
||||
style="color: forestgreen">
|
||||
活动进行中
|
||||
</span>
|
||||
<span v-else-if="moment().valueOf() > moment(o.endTime).valueOf()"
|
||||
style="color: #ee1919">
|
||||
活动结束
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
</div>
|
||||
|
||||
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg"
|
||||
description="暂无数据">
|
||||
</van-empty>
|
||||
|
||||
<div>
|
||||
<van-tabbar v-model="tabBarIndex" :active-color="themeColor">
|
||||
<van-tabbar-item icon="home-o" url="/mobile/activity/unionActivity">全部活动</van-tabbar-item>
|
||||
<van-tabbar-item icon="friends-o" url="/mobile/activity/myActivity">我的活动</van-tabbar-item>
|
||||
</van-tabbar>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
pageDataUrl: '/mobile/activity/myActivity',
|
||||
pageForm: {
|
||||
year: ''
|
||||
},
|
||||
tabBarIndex: 1
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
yearChange() {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
},
|
||||
async pageData() {
|
||||
this.mLoading = true
|
||||
const resp = await $.post('/mobile/activity/myActivity/pageData', this.pageForm)
|
||||
if (resp.code === 0) {
|
||||
if (resp.data.list.length === 0) {
|
||||
this.tableData = []
|
||||
} else {
|
||||
this.tableData = this.tableData.concat(resp.data.list)
|
||||
}
|
||||
if (this.tableData.length === resp.data.totalCount) {
|
||||
this.finished = true
|
||||
} else {
|
||||
this.pageForm.pageNumber++
|
||||
}
|
||||
}
|
||||
this.loading = false;
|
||||
this.mLoading = false
|
||||
},
|
||||
openReg(o) {
|
||||
// window.location.href = '/mobile/activity/unionActivity/goReg?id=' + o.id + '&signUpMethod=1'
|
||||
if (o.projectTypeCode === '50004') {
|
||||
window.location.href = '/mobile/activity/myActivity/goMyProject?id=' + o.id
|
||||
} else {
|
||||
window.location.href = '/mobile/activity/myActivity/goSign?id=' + o.id
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageForm.year = new Date().getFullYear()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user