This commit is contained in:
Paidax
2024-07-26 15:46:08 +08:00
parent eefb76c781
commit ddf52e5e86
109 changed files with 1384 additions and 1473 deletions
@@ -1,7 +1,21 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.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>
<m-page-loading v-if="mLoading"></m-page-loading>
<van-nav-bar title="活动列表" left-arrow placeholder fixed @click-left="history.back()"></van-nav-bar>
@@ -15,7 +29,6 @@ layout("/mobile/platform.html"){
</van-dropdown-menu>
</div>
<div style="margin: 60px auto 0 auto">
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''">
<div v-for="o in tableData" class="list-card" @click="openInfo(o.id,o.applyEndTime,o.applyType)">
@@ -31,20 +44,18 @@ layout("/mobile/platform.html"){
{{moment(o.applyStartTime).format('YYYY/MM/DD HH:mm')}} 至
{{moment(o.applyEndTime).format('YYYY/MM/DD HH:mm')}}
</span>
</van-cell>
<van-cell :border="false" title="活动时间">
<span style="font-size: 12px">
{{moment(o.startTime).format('YYYY/MM/DD HH:mm')}} 至
{{moment(o.endTime).format('YYYY/MM/DD HH:mm')}}
</span>
</van-cell>
<van-cell :border="false" title="活动状态">
<van-tag type="danger" v-if="moment(o.applyEndTime).valueOf() <moment().valueOf()">报名结束
</van-tag>
<van-tag type="success" v-else-if="moment(o.applyEndTime).valueOf() >moment().valueOf()">报名中
</van-tag>
<van-tag type="warning" v-if="moment(o.applyStartTime).valueOf() > moment().valueOf()">未开始</van-tag>
<van-tag type="primary" v-else-if="moment(o.applyEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.applyStartTime).valueOf()">报名中</van-tag>
<van-tag type="success" v-else-if="moment(o.startTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.endTime).valueOf()">进行中</van-tag>
<van-tag type="danger" v-else-if="moment().valueOf() > moment(o.endTime).valueOf()">活动结束</van-tag>
</van-cell>
</van-cell-group>
</div>
@@ -55,7 +66,6 @@ layout("/mobile/platform.html"){
description="暂无数据">
</van-empty>
</div>
<script>
@@ -66,7 +76,9 @@ layout("/mobile/platform.html"){
return {
activityList: [
{text: '全部', value: 1},
{text: '未开始', value: 5},
{text: '报名中', value: 2},
{text: '进行中', value: 4},
{text: '已结束', value: 3},
],
pageForm: {
@@ -76,6 +88,11 @@ layout("/mobile/platform.html"){
}
},
methods: {
formChange() {
this.pageForm.pageNumber = 1
this.tableData = []
this.pageData()
},
async getActivityData() {
const {data} = await $.post("/platform/activity/apply/activityData", {
year: this.pageForm.year,
@@ -94,7 +111,7 @@ layout("/mobile/platform.html"){
async created() {
this.mLoading = true
this.$set(this.pageForm, "year", this.yearList[0].value)
this.$set(this.pageForm, "isActivity", 2)
this.$set(this.pageForm, "isActivity", 1)
await this.getActivityData()
this.mLoading = false
@@ -105,4 +122,4 @@ layout("/mobile/platform.html"){
<!--#
}
#-->
#-->
@@ -62,7 +62,9 @@
<van-cell title="活动内容" v-if="o.projectTypeCode!=='50004'">
<template #label>
{{o.activityContent}}
<span style="white-space: pre-line">
{{o.activityContent}}
</span>
</template>
</van-cell>
<van-cell title="签到点位" v-if="o.needSign">
@@ -73,4 +75,4 @@
</div>
</template>
</van-cell>
</van-cell-group>
</van-cell-group>
@@ -83,27 +83,61 @@ layout("/mobile/platform.html"){
height="200"
:src="FILE_DOMAIN + '/fileStreamPreview?id=' + o.cover"
></van-image>
<!-- <van-image-->
<!-- fit="cover"-->
<!-- width="100%"-->
<!-- height="200"-->
<!-- :src="'https://zhghydd.cpu.edu.cn/file_server/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 style="margin-left: 10px;width: calc(100% - 26px);text-overflow: ellipsis;overflow: hidden;white-space: nowrap">
{{o.name}}
</div>
</div>
<div class="activity_bottom">
<div class="left" style="width: 100%">
<van-icon name="clock" size="1em"></van-icon>
<span style="margin-left: 10px;">
报名时间:{{o.applyStartTime}}至{{o.applyEndTime}}
<!-- {{moment(o.activityStartTime).format('YYYY/MM/DD HH:mm')}} 至-->
<!-- {{moment(o.activityEndTime).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 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>
活动时间:{{o.startTime}}
<!-- {{moment(o.activityStartTime).format('YYYY/MM/DD HH:mm')}} 至-->
<!-- {{moment(o.activityEndTime).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()"
<span v-if="moment(o.applyStartTime).valueOf() > moment().valueOf()"
style="color: forestgreen">
未开始报名
</span>
<span v-else-if="moment(o.applyEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.applyStartTime).valueOf()"
style="color: forestgreen">
报名中
</span>
@@ -121,6 +155,19 @@ layout("/mobile/platform.html"){
</span>
</div>
</div>
<!-- <div class="activity_content" style="font-size: 12px; color: #c4bebe;">-->
<!-- <div class="left">-->
<!-- <van-icon name="clock" size="1em"></van-icon>-->
<!-- <span style="margin-left: 5px;">-->
<!-- {{moment(o.startTime).format('YYYY/MM/DD HH:mm')}} 至-->
<!-- {{moment(o.endTime).format('YYYY/MM/DD HH:mm')}}-->
<!-- </span>-->
<!-- </div>-->
<!-- </div>-->
</div>
</div>
</div>
@@ -157,6 +204,7 @@ layout("/mobile/platform.html"){
activityLevelList: [],
activityStatusList: [
{text: '全部', value: 1},
{text: '未开始', value: 5},
{text: '报名中', value: 2},
{text: '进行中', value: 3},
{text: '已结束', value: 4}
@@ -196,6 +244,11 @@ layout("/mobile/platform.html"){
},
//跳转页面
openReg(o) {
console.log(o)
if (moment(o.applyStartTime).valueOf() > moment().valueOf()) {
this.$toast('活动未开始报名')
return;
}
if (o.projectTypeCode === '50004') {
window.location.href = '/mobile/activity/Sports/list/activityEventList?id=' + o.id
} else {
@@ -203,9 +256,10 @@ layout("/mobile/platform.html"){
}
},
async init() {
this.$set(this.pageForm, "activityStatus", 2)
this.$set(this.pageForm, "activityStatus", 1)
this.$set(this.pageForm, "year", new Date().getFullYear())
const {data} = await $.get("/platform/activity/basic/basic/settings/getActivityTwoLevelType", {code: 40000})
this.activityLevelList = []
this.activityLevelList.push({value: null, text: "全部类别"})
data.forEach(v => {
this.activityLevelList.push({value: v.code, text: v.name})
@@ -221,10 +275,9 @@ layout("/mobile/platform.html"){
window.addEventListener('pageshow', e => {
if (e.persisted || (window.performance && window.performance.navigation.type === 2)) {
vue.init()
vue.onRefresh()
}
})
</script>
<!--#
}
#-->
#-->
@@ -42,13 +42,13 @@ layout("/mobile/platform.html"){
</style>
<div id="app" v-cloak>
<van-nav-bar :title="title" left-arrow placeholder fixed
@click-left="history.back()"></van-nav-bar>
<van-nav-bar :title="title" @click-left="history.back()" fixed left-arrow
placeholder></van-nav-bar>
<!--#include("/mobile/activity/unionActivity/common/activityInfo.html"){}#-->
<van-cell-group inset class="mt5">
<van-cell title="报名人员" class="regCell">
<van-cell-group class="mt5" inset>
<van-cell class="regCell" title="报名人员">
<template #label>
<div>
<span v-if="o.userNumberLimit===1">
@@ -61,9 +61,10 @@ layout("/mobile/platform.html"){
<div class="mt5" v-loading="tagCloseable">
<div v-if="registerList && registerList.length>0">
<template v-for="item in registerList">
<van-tag type="primary" :closeable="tagCloseable" size="medium"
:color="themeColor"
@close="removeRegUser(item)">
<van-tag :closeable="tagCloseable" :color="themeColor"
@close="removeRegUser(item)"
size="medium"
type="primary">
{{item.userName}}
</van-tag>
</template>
@@ -76,17 +77,17 @@ layout("/mobile/platform.html"){
</div>
<div class="mt5" style="text-align: right"
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()">
<van-button v-if="tagCloseable" size="mini" type="info"
@click="openUserActionSheet" :color="themeColor">选择报名人员
<van-button :color="themeColor" @click="openUserActionSheet" size="mini"
type="info" v-if="tagCloseable">选择报名人员
</van-button>
</div>
</template>
</van-cell>
</van-cell-group>
<van-action-sheet v-model="userActionSheet" title="选择报名人员" class="userActionPopup">
<van-search v-model="searchKey" @search="onSearchUser" show-action
placeholder="请输入姓名搜索">
<van-action-sheet class="userActionPopup" title="选择报名人员" v-model="userActionSheet">
<van-search @search="onSearchUser" placeholder="请输入姓名搜索" show-action
v-model="searchKey">
<template #action>
<div @click="onSearchUser(searchKey)">搜索</div>
</template>
@@ -123,16 +124,25 @@ layout("/mobile/platform.html"){
<div style="margin: 20px 20px 10px 20px"
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()">
<van-button v-if="tagCloseable" @click="doSave()" style="border-radius: 10px" block
<van-button :color="themeColor" @click="doSave()" block style="border-radius: 10px"
type="info"
:color="themeColor">
v-if="tagCloseable">
提 交
</van-button>
<van-button v-else="!tagCloseable" @click="tagCloseable = true" style="border-radius: 10px"
block type="info"
:color="themeColor">
修 改
</van-button>
<template v-else="!tagCloseable">
<van-button :color="themeColor" @click="tagCloseable = true"
block style="border-radius: 10px"
type="info">
修 改
</van-button>
<van-button
@click="doCancel"
block color="red" style="border-radius: 10px;margin-top: 10px"
type="info">
取消报名
</van-button>
</template>
</div>
<!-- <div style="margin: 20px 20px 10px 20px" v-if="tagCloseable">-->
@@ -169,6 +179,32 @@ layout("/mobile/platform.html"){
}
},
methods: {
async doCancel() {
const confirm = await this.$dialog.confirm({
title: '提示',
message: '您确认要取消报名吗?',
})
const loading = this.$toast.loading({
message: '取消中...',
forbidClick: true,
overlay: true,
duration: 0
})
if (confirm === 'confirm') {
const resp = await $.post('/mobile/activity/unionActivity/doSingleCancelRegister', {activityId: this.activityId})
if (resp.code === 0) {
setTimeout(() => {
loading.close()
this.$toast.success(resp.msg)
setTimeout(() => {
window.history.back()
}, 400)
}, 1000)
} else {
this.$toast.fail(resp.msg)
}
}
},
async getRegisterUser() {
const resp = await $.get('/mobile/activity/myActivity/selectRegisterList', {activityId: this.activityId})
if (resp.code === 0) {
@@ -209,6 +245,7 @@ layout("/mobile/platform.html"){
searchUserAdd(item) {
const {id, userName} = item
this.registerList.push({id, userName})
this.$toast.success("添加成功")
},
async removeRegUser(item) {
if (this.userId === item.id) {
@@ -304,11 +341,14 @@ layout("/mobile/platform.html"){
personIds: JSON.stringify(this.registerList.map(v => v.id))
}
const resp = await $.post('/mobile/activity/unionActivity/doSaveUnionRegister', params)
loading.close()
if (resp.code === 0) {
await this.getRegisterUser()
await this.getHasRegUserNum()
this.$toast.success(resp.msg)
setTimeout(() => {
loading.close()
this.$toast.success(resp.msg)
}, 1000)
} else {
this.$toast.fail(resp.msg)
}
@@ -337,4 +377,4 @@ layout("/mobile/platform.html"){
<!--#
}
#-->
#-->