first commit

This commit is contained in:
2026-09-09 09:14:28 +08:00
commit 5343198112
5199 changed files with 1052895 additions and 0 deletions
@@ -0,0 +1,396 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.search-fixed {
z-index: 2;
}
.register-icon {
position: absolute;
bottom: 8px;
right: 16px;
z-index: 1;
}
.list-card > .van-cell-group {
position: relative;
}
.list-card .van-cell {
padding: 3px 16px;
}
.list-card .van-cell__value {
flex: 2;
}
</style>
<div id="app" v-cloak>
<van-nav-bar :title="title" @click-left="history.back()" fixed left-arrow
placeholder></van-nav-bar>
<div class="search-fixed">
<van-dropdown-menu active-color="#1989fa">
<!-- <van-dropdown-item v-model="pageForm.isMenWomen" @change="yearChange"
:options="sexList"></van-dropdown-item>-->
<van-dropdown-item v-model="pageForm.groupName" @change="yearChange"
:options="groupList"></van-dropdown-item>
<van-dropdown-item :options="eventList" @change="yearChange"
v-model="pageForm.eventId"></van-dropdown-item>
<van-dropdown-item :options="auditList" @change="yearChange"
v-model="pageForm.isAudit"></van-dropdown-item>
</van-dropdown-menu>
</div>
<div style="margin: 60px auto 0 auto">
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''"
v-model="loading"
@load="pageData">
<div v-for="o in tableData" class="list-card">
<van-cell-group inset>
<image class="register-icon" src="/assets/mobile/svg/activity/wbm.svg"
@click="openActivity(o)"
v-if="o.userApply==0&&o.applyWay.includes(1)"></image>
<image class="register-icon" src="/assets/mobile/svg/activity/qxbm.svg"
@click="openActivity(o)"
v-if="o.userApply>0&&o.applyWay.includes(1)"></image>
<van-cell :border="false" title="项目名称" @click="openActivity(o)">
<span :style="{color:themeColor}" class="van-ellipsis"
style="font-size: 16px;">
{{o.allName}}
</span>
</van-cell>
<van-cell :border="false" title="项目类型">{{o.projectType==1?'单项':'团体'}}</van-cell>
<van-cell :border="false" title="您报队伍">
{{o.activityTeamName?o.activityTeamName:'暂无'}}
</van-cell>
<van-cell :border="false" title="年龄限制" v-if="o.projectType==1">
<span v-if="o.startAgeDate!=null">{{o.startAgeDate}}至{{o.endAgeDate}}</span>
<span v-else>暂无</span>
</van-cell>
<van-cell :border="false" title="可报队数" v-if="o.projectType==2">
{{o.restrictTotalTeam}}队
</van-cell>
<van-cell :border="false" title="每队可报人数" v-if="o.applyUserModel===1">
<span v-if="o.athletesMaxNum">{{o.athletesMaxNum}}人</span>
<span v-else-if="o.applyType==1">{{o.athletesMaxNum*o.restrictTotalTeam}}人</span>
<span v-else-if="o.applyType==2&&o.projectType==1">{{o.athletesMaxNum}}人</span>
<span v-else-if="o.applyType==2&&o.projectType==2">{{o.restrictGirlNum+o.restrictBoyNum}}人</span>
<span v-else>暂无</span>
</van-cell>
<van-cell :border="false" title="成功报名人数">
<span v-if="o.applyNum>0&&o.applyType!=3">{{o.applyNum}}人</span>
<span v-else-if="o.totalApplyNum>0&&o.applyType==3">{{o.totalApplyNum}}人</span>
<span v-else>0人</span>
</van-cell>
</van-cell-group>
</div>
</van-list>
</div>
<van-dialog @confirm="doActivityConfirm" show-cancel-button title="您确定要报名此活动吗?"
v-model="activityDialog"
@cancel="activityDialog = false" :before-close="onBeforeClose">
<van-radio-group v-model="formData.teamId" v-if="projectType==2">
<van-cell-group>
<template v-for="i in teams">
<van-cell :title="i.name" clickable>
<template #right-icon>
<van-radio :name="i.id"></van-radio>
</template>
</van-cell>
</template>
</van-cell-group>
</van-radio-group>
</van-dialog>
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg"
description="暂无数据">
</van-empty>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
formData: {
teamId: null,
teamName: null,
activityId: "",
eventId: ""
},
title: "",
projectType: "",
applyType: "",
activityDialog: false,
restrictBoyNum: "",
restrictGirlNum: "",
athletesMaxNum: "",
events: [],
eventList: [],
groupList: [
{text: '按组别', value: null},
{text: '甲组', value: '甲组'},
{text: '乙组', value: '乙组'},
{text: '丙组', value: '丙组'},
{text: '丁组', value: '丁组'},
],
sexList: [
{text: '按性别', value: 1},
{text: '男子', value: 2},
{text: '女子', value: 3},
{text: '团体', value: 4},
],
auditList: [
{text: '全部', value: null},
{text: '已报名', value: "true"},
{text: '未报名', value: "false"},
],
teams: [],
yearOption: [],
pageForm: {
year: '',
isMenWomen: "1"
}
}
},
methods: {
onBeforeClose(action, done) {
return done(false)
},
async doActivityConfirm() {
if (this.formData.teamId == null && this.projectType == 2) {
this.$toast("请选择报名的小队")
return
} else {
const {data} = await $.post("/mobile/activity/Sports/list/getTeamUserData", {
teamId: this.formData.teamId,
activityId: this.formData.activityId,
eventId: this.formData.eventId,
applyType: this.applyType
})
const nv = data.filter(v => v.sex === '女')
const nan = data.filter(v => v.sex === '男')
let title = this.projectType === 1 ? "项目" : "小队"
/* if (this.applyType !== 3) {
if (this.isManGirlNum === false && "${@shiro.getPrincipalProperty('sex')}" == '男' && nan.length == (this.applyType === 1 ? (this.athletesMaxNum - this.restrictGirlNum) : this.restrictBoyNum)) {
this.$toast("该" + title + "男运动员已报满!")
return
}
if (this.isManGirlNum === false && "${@shiro.getPrincipalProperty('sex')}" == '女' && nv.length == (this.applyType === 1 ? (this.athletesMaxNum - this.restrictBoyNum) : this.restrictGirlNum)) {
this.$toast("该" + title + "女运动员已报满!")
return
}
}*/
if (this.athletesMaxNum && (data.length >= this.athletesMaxNum)) {
this.$toast("该" + title + "人员已报满!")
return
}
if (this.formData.teamId != null) this.$set(this.formData, "teamName", this.teams.find(v => v.id == this.formData.teamId).name)
await $.post("/mobile/activity/Sports/list/doActivity", this.formData)
await this.onRefresh()
this.activityDialog = false
}
},
async openActivity(o) {
let {
isManGirlNum,
applyType,
eventId,
activityId,
projectType,
userApply,
applyUserModel,
unionLimit,
activityGroupId,
restrictRegNumber
} = o
this.projectType = projectType
this.formData.activityId = activityId
this.formData.eventId = eventId
this.applyType = applyType
this.isManGirlNum = isManGirlNum
const res = await $.get("/mobile/activity/Sports/list/getScopeUser", {activityGroupId: activityGroupId})
if (res.data == 0) {
this.$toast("您不在报名人员内!")
return
}
if ("${@shiro.getPrincipalProperty('unit').getUnionid()}" == "") {
this.$toast("您的工会信息有误,无法报名,请联系工会管理员!")
return
}
/*if ((isInterest && "${@shiro.hasRole('H04')}" === 'false') || (isInterest && "${@shiro.hasRole('sysadmin')}" === 'false')) {
this.$toast("您所报的是趣味运动,请联系工会管理员报名!")
return
}*/
if (userApply == 1) {
const confirm = await vant.Dialog.confirm({
title: '提示',
message: '确定取消此次报名吗?',
})
if (confirm === 'confirm') {
await $.get("/platform/activity/apply/doDeleteApply", {
userId: "${@shiro.getPrincipalProperty('id')}",
activityId: activityId,
eventId: eventId
})
this.yearChange()
}
return
}
this.events = []
const data = await $.get("/platform/activity/apply/getEvents", {activityId: activityId})
this.events = data
const {
athletesMaxNum,
startAgeDate,
endAgeDate,
isMenWomen,
restrictBoyNum,
restrictGirlNum
} = this.events.find(v => v.id == eventId)
if (isMenWomen) {
this.restrictBoyNum = athletesMaxNum
this.restrictGirlNum = athletesMaxNum
} else {
this.restrictBoyNum = restrictBoyNum ? restrictBoyNum : 0
this.restrictGirlNum = restrictGirlNum ? restrictGirlNum : 0
}
this.athletesMaxNum = athletesMaxNum
if (projectType == 1) {
if (isMenWomen != null && isMenWomen === 1 && "${@shiro.getPrincipalProperty('sex')}" != '男') {
this.$toast("此项目只能男性老师才能报名!")
return
}
if (isMenWomen != null && isMenWomen === 2 && "${@shiro.getPrincipalProperty('sex')}" != '女') {
this.$toast("此项目只能女性老师才能报名!")
return
}
if (restrictRegNumber > 0) {
const {data} = await $.post("/platform/activity/apply/getActivityData", {activityId})
const userApplyNum = data.filter(v => v.userId == "${@shiro.getPrincipalProperty('id')}").length
if (userApplyNum >= restrictRegNumber) {
this.$toast('单项项目,每人限报' + restrictRegNumber + '个!团体项目除外')
return
}
}
const {data} = await $.post("/mobile/activity/Sports/list/getTeamUserData", {
activityId: this.formData.activityId,
applyType: applyType,
eventId: eventId
})
if (applyUserModel === 1) {
if (athletesMaxNum != null) {
if (data.length >= athletesMaxNum) {
this.$toast("此项目报名人数已满!此项目只需报" + athletesMaxNum + "人")
return
}
}
} else {
unionLimit = JSON.parse(unionLimit)
const limit = unionLimit.find(v => v.id === "${@shiro.getPrincipalProperty('unit').getUnionid()}")
this.athletesMaxNum = limit.limitCount
if (data.length >= limit.limitCount) {
this.$toast("此项目报名人数已满!此项目只需报" + limit.limitCount + "人")
return
}
}
if (startAgeDate != null) {
const birthday = moment("${@shiro.getPrincipalProperty('birthday')}").valueOf()
if (birthday < moment(startAgeDate).valueOf() || birthday > moment(endAgeDate).valueOf()) {
this.$toast("您的年龄不在限制范围內!")
return
}
}
} else {
if (isMenWomen != null && isMenWomen == 1 && "${@shiro.getPrincipalProperty('sex')}" != '男') {
this.$toast("此项目只能男性老师才能报名!")
return
}
if (isMenWomen != null && isMenWomen == 2 && "${@shiro.getPrincipalProperty('sex')}" != '女') {
this.$toast("此项目只能女性老师才能报名!")
return
}
}
if (projectType == 2) {
const {data} = await $.get("/platform/activity/apply/getActivityTeamId", {
activityId: activityId,
eventId: eventId
})
this.teams = data
if (data.length && data.length > 0) this.$set(this.formData, "teamId", data[0].id)
}
this.activityDialog = true
},
yearChange() {
this.pageForm.pageNumber = 1
this.tableData = []
this.finished = false
this.pageData()
},
async pageData() {
this.loading = true
const {data} = await $.get('/platform/activity/apply/pageData', this.pageForm)
setTimeout(() => {
this.tableData = this.tableData.concat(data.list)
if (this.tableData.length === data.totalCount) {
this.finished = true
} else {
this.pageForm.pageNumber++
}
this.loading = false
this.pageForm.totalCount = data.totalCount
}, 300)
}
,
},
async created() {
const id = GetQueryString('id')
const applyType = GetQueryString('applyType')
this.pageForm.activityId = id
this.pageForm.applyType = applyType
const data = await $.post("/platform/activity/apply/getEvents", {activityId: id})
data.forEach(v => {
this.eventList.push({value: v.eventId, text: v.allName})
})
this.eventList.unshift({value: null, text: "按项目"})
this.$set(this.pageForm, "eventId", this.eventList[0].value)
this.$set(this.pageForm, "isMenWomen", 1)
this.$set(this.pageForm, "groupName", null)
this.$set(this.pageForm, "isAudit", null)
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,108 @@
<!--#
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.back()"></van-nav-bar>
<div class="search-fixed">
<van-dropdown-menu active-color="#1989fa">
<van-dropdown-item v-model="pageForm.year" :options="yearList"
@change="getActivityData"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.isActivity" :options="activityList"
@change="getActivityData"></van-dropdown-item>
</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)">
<van-cell-group inset>
<van-cell :border="false" title="活动名称">
<span class="van-ellipsis" style="font-size: 16px;" :style="{color:themeColor}">
{{o.NAME}}
</span>
</van-cell>
<van-cell :border="false" title="活动地址">{{o.address}}</van-cell>
<van-cell :border="false" title="报名时间">
<span style="font-size: 12px">
{{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-cell>
</van-cell-group>
</div>
</van-list>
</div>
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg"
description="暂无数据">
</van-empty>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
activityList: [
{text: '全部', value: 1},
{text: '报名中', value: 2},
{text: '已结束', value: 3},
],
pageForm: {
year: '',
isActivity: "1"
}
}
},
methods: {
async getActivityData() {
const {data} = await $.post("/platform/activity/apply/activityData", {
year: this.pageForm.year,
isActivity: this.pageForm.isActivity
})
this.tableData = data
},
openInfo(id, applyEndTime, applyType) {
if (moment(applyEndTime).valueOf() < moment().valueOf()) {
this.$toast("活动已结束,暂不能报名")
return
}
window.location.href = '/mobile/activity/Sports/list/activityEventList?id=' + id + "&applyType=" + applyType
}
},
async created() {
this.mLoading = true
this.$set(this.pageForm, "year", this.yearList[0].value)
this.$set(this.pageForm, "isActivity", 2)
await this.getActivityData()
this.mLoading = false
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,150 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.register-icon {
position: absolute;
bottom: 8px;
right: 16px;
z-index: 1;
}
.list-card > .van-cell-group {
position: relative;
}
.list-card .van-cell {
padding: 3px 16px;
}
</style>
<div id="app" v-cloak>
<van-nav-bar title="报名详情" left-arrow placeholder fixed
@click-left="history.back()"></van-nav-bar>
<div style="margin: 20px auto 0 auto">
<div v-for="o in tableData" class="list-card">
<van-cell-group inset>
<image class="register-icon" src="/assets/mobile/svg/activity/ybm.svg"
@click="openActivity(o)"
v-if="o.userApply>0&&o.applyWay.includes(1)"></image>
<van-cell :border="false" title="项目名称">
<span class="van-ellipsis" style="font-size: 16px;"
:style="{color:themeColor}">
{{o.allName}}
</span>
</van-cell>
<van-cell :border="false" title="项目类型">{{o.projectType==1?'单项':'团体'}}</van-cell>
<van-cell :border="false" title="年龄限制" v-if="o.projectType==1">
<span v-if="o.startAgeDate!=null">{{o.startAgeDate}}至{{o.endAgeDate}}</span>
<span v-else>暂无</span>
</van-cell>
<van-cell :border="false" title="每队可报人数" v-if="o.applyUserModel===1">
<span v-if="o.athletesMaxNum">{{o.athletesMaxNum}}人</span>
<span v-else-if="o.applyType==1">{{o.athletesMaxNum*o.restrictTotalTeam}}人</span>
<span v-else-if="o.applyType==2&&o.projectType==1">{{o.athletesMaxNum}}人</span>
<span v-else-if="o.applyType==2&&o.projectType==2">{{o.restrictGirlNum+o.restrictBoyNum}}人</span>
<span v-else>暂无</span>
</van-cell>
<van-cell :border="false" title="已报名人数">
<span v-if="o.applyNum>0&&o.applyType!=3">{{o.applyNum}}人</span>
<span v-else-if="o.totalApplyNum>0&&o.applyType==3">{{o.totalApplyNum}}人</span>
<span v-else>0人</span>
</van-cell>
</van-cell-group>
</div>
</div>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
activityId: '',
o: {},
projectInfo: null
}
},
methods: {
async getActivityInfo() {
const resp = await $.get('/mobile/activity/unionActivity/findOne', {id: this.activityId})
if (resp.code === 0) {
this.o = resp.data
this.$nextTick(() => {
// document.getElementsByClassName('activity_img_back')[0].style.backgroundImage = "url(" + FILE_DOMAIN + this.o.cover + ")"
})
}
},
async getSchoolActivityProjectInfoByMine() {
const resp = await $.get('/mobile/activity/myActivity/getSchoolActivityProjectInfoByMine', {activityId: this.activityId})
if (resp.code === 0) {
this.projectInfo = resp.data
}
},
async getHasRegEventProject() {
const resp = await $.get('/platform/activity/apply/pageData', this.pageForm)
if (resp.code === 0) {
this.tableData = resp.data.list
}
},
async openActivity(o) {
const {
applyType,
eventId,
activityId,
projectType,
userApply,
applyNum,
name,
activityGroupId,
restrictRegNumber
} = o
const confirm = await vant.Dialog.confirm({
title: '提示',
message: '确定取消此次报名吗?',
})
if (confirm === 'confirm') {
const loading = this.$toast.loading({
message: '取消中...',
forbidClick: true,
overlay: true,
duration: 0
})
const resp = await $.get("/platform/activity/apply/doDeleteApply", {
userId: "${@shiro.getPrincipalProperty('id')}",
activityId: activityId,
eventId: eventId
})
loading.close()
if (resp.code === 0) {
this.$toast.success('取消成功')
this.getHasRegEventProject()
}
}
}
},
created() {
const id = GetQueryString("id")
if (id) {
this.$set(this.pageForm, 'isAudit', 'true')
this.$set(this.pageForm, 'activityId', id)
this.$set(this.pageForm, 'pageSize', 100)
this.activityId = id
this.getActivityInfo()
this.getHasRegEventProject()
}
}
})
</script>
<!--#
}
#-->