first commit
This commit is contained in:
@@ -0,0 +1,251 @@
|
||||
<!--#
|
||||
layout("/mobile/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.van-card {
|
||||
background: #ffffff;
|
||||
margin: 10px auto 0;
|
||||
width: 96%;
|
||||
border-radius: 10px;
|
||||
padding: 14px 12px;
|
||||
}
|
||||
|
||||
.van-card__thumb {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.van-card__content > div {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.train-title {
|
||||
flex: 0.6;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.van-doc-card {
|
||||
margin: 14px;
|
||||
padding: 12px;
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 8px 12px #ebedf0;
|
||||
line-height: 20px;
|
||||
font-size: 12px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.van-divider {
|
||||
margin: 6px 0 5px 0px;
|
||||
border-color: #1867b0;
|
||||
}
|
||||
|
||||
.van-image__img {
|
||||
max-height: 200px;
|
||||
}
|
||||
|
||||
.van-image__error, .van-image__loading {
|
||||
height: 200px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.tag {
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
background-color: #1867b0;
|
||||
color: #fff;
|
||||
font-size: 10px;
|
||||
top: 1px;
|
||||
border-radius: 6px;
|
||||
right: -8px;
|
||||
padding: 1px 7px;
|
||||
transform: rotate(17deg);
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<van-nav-bar title="活动列表" left-arrow placeholder fixed
|
||||
@click-left="location.replace('/mobile/index')"></van-nav-bar>
|
||||
|
||||
<div class="search-fixed">
|
||||
<van-dropdown-menu active-color="#1989fa">
|
||||
<van-dropdown-item v-model="pageForm.year" :options="yearList"
|
||||
@change="formChange"></van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.activityStatus" :options="activityStatusList"
|
||||
@change="formChange"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</div>
|
||||
|
||||
<!-- <van-sticky>-->
|
||||
<!-- <van-nav-bar title="活动列表" left-arrow-->
|
||||
<!-- @click-left="location.replace('/mobile/index')"></van-nav-bar>-->
|
||||
<!-- </van-sticky>-->
|
||||
|
||||
<!-- <van-sticky>-->
|
||||
<!-- <van-tabs v-model="pageForm.activityStatus" @change="tabChange">-->
|
||||
<!-- <van-tab title="全部" name="0"></van-tab>-->
|
||||
<!-- <van-tab v-if="type !== 'my'" title="进行中" name="1"></van-tab>-->
|
||||
<!-- <van-tab v-if="type === 'my'" title="进行中" name="3"></van-tab>-->
|
||||
<!-- <van-tab title="已结束" name="2"></van-tab>-->
|
||||
<!-- </van-tabs>-->
|
||||
<!-- </van-sticky>-->
|
||||
|
||||
<div style="margin: 60px auto 80px auto">
|
||||
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''"
|
||||
v-if="tableData && tableData.length>0"
|
||||
v-model="loading"
|
||||
@load="pageData">
|
||||
<div v-for="o in tableData" class="van-doc-card">
|
||||
<!-- <div class="tag" v-if="moment(o.activitySignUpStartTime).unix() > moment().unix()">即将开始</div>-->
|
||||
<div>
|
||||
<div class="tag" style="background-color: #bc62c5" v-if="o.isDisabled">活动未开启</div>
|
||||
<div class="tag" v-else-if="!o.isDisabled && moment(o.activitySignUpStartTime).valueOf() > moment().valueOf()">未开始报名</div>
|
||||
<div class="tag" v-else-if="!o.isDisabled &&moment(o.activitySignUpEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.activitySignUpStartTime).valueOf()">报名中</div>
|
||||
<div class="tag" style="background-color: #f14646" v-else-if="!o.isDisabled &&moment(o.activityEndTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.activityStartTime).valueOf()">报名结束</div>
|
||||
<div class="tag" v-else-if="!o.isDisabled &&moment(o.activityStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.activityEndTime).valueOf()">活动进行中</div>
|
||||
<div class="tag" style="background-color: #f14646" v-else-if="!o.isDisabled &&moment().valueOf() > moment(o.activityEndTime).valueOf()">活动结束</div>
|
||||
</div>
|
||||
<div @click="welfareClick(o)">
|
||||
<div>
|
||||
<van-image :src="CREATE_PREVIEW_URL(o.cover.id)"
|
||||
style="display: contents"
|
||||
v-if="o.cover && o.cover.filepath"></van-image>
|
||||
<van-image src=""
|
||||
style="display: contents"
|
||||
v-else></van-image>
|
||||
</div>
|
||||
<div>
|
||||
<div class="van-ellipsis" style="margin-top: 6px; font-size: 15px;font-weight: bold;flex: 1">
|
||||
{{o.activityName}}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="train-title">
|
||||
<span style="color: grey">年   度:</span>
|
||||
<span>{{o.year}}</span>
|
||||
</div>
|
||||
<div class="train-title">
|
||||
<span style="color: grey">活动对象:</span>
|
||||
<span>{{o.activityGroupName}}</span>
|
||||
</div>
|
||||
<van-divider></van-divider>
|
||||
</div>
|
||||
<div class="train-title">
|
||||
<span style="color: grey">报名时间:</span>
|
||||
<span>{{moment(o.activitySignUpStartTime).format('YYYY-MM-DD HH:mm') + ' ~ ' +
|
||||
moment(o.activitySignUpEndTime).format('YYYY-MM-DD HH:mm')}}</span>
|
||||
</div>
|
||||
<div style="margin-top: 6px">
|
||||
<span style="color: grey">活动时间:</span>
|
||||
<span>{{moment(o.activityStartTime).format('YYYY-MM-DD HH:mm') + ' ~ ' +
|
||||
moment(o.activityEndTime).format('YYYY-MM-DD HH:mm')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
<van-empty v-else description="暂无数据"></van-empty>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
tarBarActive: 0,
|
||||
type: '',
|
||||
|
||||
pageForm: {
|
||||
year: '',
|
||||
activityStatus: null
|
||||
},
|
||||
activityLevelList: [],
|
||||
activityStatusList: [
|
||||
{text: '全部', value: 1},
|
||||
{text: '未开启', value: 5},
|
||||
{text: '未开始', value: 6},
|
||||
{text: '报名中', value: 2},
|
||||
{text: '进行中', value: 3},
|
||||
{text: '已结束', value: 4}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
formChange() {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.tableData = []
|
||||
this.pageData()
|
||||
},
|
||||
|
||||
|
||||
async welfareClick(o) {
|
||||
console.log(o)
|
||||
if (o.isDisabled){
|
||||
this.$toast('活动未开启')
|
||||
return;
|
||||
}
|
||||
if (moment(o.applyStartTime).valueOf() > moment().valueOf()) {
|
||||
this.$toast('活动未开始报名')
|
||||
return;
|
||||
}
|
||||
if (this.type === 'my') {
|
||||
window.location.href = '/platform/mobile/trainSignUpActivity/trainInfo' +
|
||||
'?activityId=' + o.id + '&endTime=' + o.activitySignUpEndTime + '&type=my' + '&startTime=' + o.activitySignUpStartTime
|
||||
} else {
|
||||
window.location.href = '/platform/mobile/trainSignUpActivity/activityInfo?activityId=' + o.id + '&endTime=' + o.activitySignUpEndTime
|
||||
}
|
||||
},
|
||||
async pageData() {
|
||||
this.mLoading = true
|
||||
const resp = await $.post('/platform/mobile/trainSignUpActivity/pageData', this.pageForm)
|
||||
if (resp.code === 0) {
|
||||
if (resp.data.list.length === 0) {
|
||||
this.tableData = []
|
||||
this.loading = false
|
||||
this.finished = true
|
||||
} 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
|
||||
},
|
||||
tabChange(val) {
|
||||
this.tabName = val
|
||||
this.startLoading()
|
||||
this.tableData = []
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
this.closeLoading()
|
||||
},
|
||||
async init(){
|
||||
this.$set(this.pageForm, "activityStatus", 1)
|
||||
this.$set(this.pageForm, "year", new Date().getFullYear())
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.init()
|
||||
this.type = GetQueryString('type')
|
||||
this.pageForm.type = this.type
|
||||
this.startLoading()
|
||||
// this.pageForm.activityStatus = this.type === 'my' ? '3' : '1'
|
||||
this.pageData()
|
||||
this.closeLoading()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user