commit
This commit is contained in:
+9
@@ -71,6 +71,7 @@ public class ClientGroupController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询自己在那个团队
|
* 查询自己在那个团队
|
||||||
|
*
|
||||||
* @param activityId
|
* @param activityId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -139,4 +140,12 @@ public class ClientGroupController {
|
|||||||
List<NutMap> list = clientActivityService.listMap(sql);
|
List<NutMap> list = clientActivityService.listMap(sql);
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@At("/list-group-rank/?")
|
||||||
|
@SaCheckLogin(type = StpClientUtil.TYPE)
|
||||||
|
public Result listGroupRank(Long activityId) {
|
||||||
|
List<ActGroup> groupList = dao.query(ActGroup.class, Cnd.where(ActGroup::getActivityId, "=", activityId).desc(ActGroup::getTotalScore));
|
||||||
|
return Result.success(groupList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+145
@@ -0,0 +1,145 @@
|
|||||||
|
package com.budwk.app.module.activity.controller;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.budwk.app.base.page.Pagination;
|
||||||
|
import com.budwk.app.base.result.Result;
|
||||||
|
import com.budwk.app.module.activity.models.Activity;
|
||||||
|
import com.budwk.app.module.activity.models.ActivityItem;
|
||||||
|
import com.budwk.app.module.activity.service.ActivitySignInQueryService;
|
||||||
|
import com.budwk.app.module.activity.vo.page.ActSignInUserPageForm;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
|
import org.nutz.dao.Cnd;
|
||||||
|
import org.nutz.dao.Sqls;
|
||||||
|
import org.nutz.dao.sql.Sql;
|
||||||
|
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||||
|
import org.nutz.ioc.loader.annotation.Inject;
|
||||||
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
|
import org.nutz.lang.util.NutMap;
|
||||||
|
import org.nutz.mvc.annotation.At;
|
||||||
|
import org.nutz.mvc.annotation.Ok;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhf
|
||||||
|
* @date 2025/4/30 15:29
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
@IocBean
|
||||||
|
@At("/platform/activity/itemApplyQuery")
|
||||||
|
@Slf4j
|
||||||
|
@Ok("json:full")
|
||||||
|
public class ActivityItemApplyQueryController {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private ActivitySignInQueryService activitySignInQueryService;
|
||||||
|
|
||||||
|
@At("")
|
||||||
|
@SaCheckPermission("activity.itemApplyQuery")
|
||||||
|
@Ok("beetl:/platform/activity/itemApplyQuery/index.html")
|
||||||
|
public void index() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@At()
|
||||||
|
@SaCheckPermission("activity.signInUserQuery")
|
||||||
|
public Result getActivityOptions(Integer year) {
|
||||||
|
return Result.success(activitySignInQueryService.dao().query(Activity.class, Cnd.NEW().andEX("YEAR(startTime)", "=", year)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@At()
|
||||||
|
@SaCheckPermission("activity.signInUserQuery")
|
||||||
|
public Result getActivityItemOptions(Long activityId) {
|
||||||
|
return Result.success(activitySignInQueryService.dao().query(ActivityItem.class, Cnd.where(ActivityItem::getActivityId, "=", activityId)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@At()
|
||||||
|
@SaCheckPermission("activity.signInUserQuery")
|
||||||
|
public Result pageData(ActSignInUserPageForm pageForm) {
|
||||||
|
Cnd cnd = Cnd.NEW();
|
||||||
|
Sql sql = Sqls.create("""
|
||||||
|
SELECT
|
||||||
|
au.*,
|
||||||
|
ai.`name` itemName
|
||||||
|
FROM
|
||||||
|
act_item_user aiu
|
||||||
|
LEFT JOIN activity_item ai ON ai.id = aiu.itemId
|
||||||
|
LEFT JOIN `act_user` au ON aiu.userId = au.userId
|
||||||
|
$condition
|
||||||
|
""");
|
||||||
|
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||||
|
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||||
|
group.or("au.userName", "LIKE", "%" + pageForm.getSearchKeyword() + "%");
|
||||||
|
group.or("au.unitName", "LIKE", "%" + pageForm.getSearchKeyword() + "%");
|
||||||
|
cnd.and(group);
|
||||||
|
}
|
||||||
|
cnd.and("au.activityId", "=", pageForm.getActivityId());
|
||||||
|
cnd.andEX("aiu.itemId", "=", pageForm.getItemId());
|
||||||
|
cnd.asc("ai.`name`");
|
||||||
|
sql.setCondition(cnd);
|
||||||
|
Pagination pagination = activitySignInQueryService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||||
|
return Result.success(pagination);
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@Ok("void")
|
||||||
|
@SaCheckPermission("activity.signInUserQuery")
|
||||||
|
public void doExport(ActSignInUserPageForm pageForm, HttpServletResponse response) {
|
||||||
|
try {
|
||||||
|
Activity activity = activitySignInQueryService.dao().fetch(Activity.class, Cnd.NEW().and("id", "=", pageForm.getActivityId()));
|
||||||
|
Cnd cnd = Cnd.NEW();
|
||||||
|
Sql sql = Sqls.create("""
|
||||||
|
SELECT
|
||||||
|
au.*,
|
||||||
|
ai.`name` itemName
|
||||||
|
FROM
|
||||||
|
act_item_user aiu
|
||||||
|
LEFT JOIN activity_item ai ON ai.id = aiu.itemId
|
||||||
|
LEFT JOIN `act_user` au ON aiu.userId = au.userId
|
||||||
|
$condition
|
||||||
|
""");
|
||||||
|
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||||
|
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||||
|
group.or("au.userName", "LIKE", "%" + pageForm.getSearchKeyword() + "%");
|
||||||
|
group.or("au.unitName", "LIKE", "%" + pageForm.getSearchKeyword() + "%");
|
||||||
|
cnd.and(group);
|
||||||
|
}
|
||||||
|
cnd.and("au.activityId", "=", pageForm.getActivityId());
|
||||||
|
cnd.andEX("aiu.itemId", "=", pageForm.getItemId());
|
||||||
|
cnd.asc("ai.`name`");
|
||||||
|
sql.setCondition(cnd);
|
||||||
|
List<NutMap> nutMaps = activitySignInQueryService.listMap(sql);
|
||||||
|
List<ExcelExportEntity> entityList = new ArrayList<>() {{
|
||||||
|
add(new ExcelExportEntity("姓名", "userName", 20));
|
||||||
|
add(new ExcelExportEntity("性别", "sex", 20));
|
||||||
|
add(new ExcelExportEntity("职务", "position", 20));
|
||||||
|
add(new ExcelExportEntity("身份证号码", "idCard", 20));
|
||||||
|
add(new ExcelExportEntity("联系方式", "mobile", 20));
|
||||||
|
add(new ExcelExportEntity("参加单位名称", "unitName", 20));
|
||||||
|
add(new ExcelExportEntity("参加项目", "itemName", 20));
|
||||||
|
}};
|
||||||
|
|
||||||
|
response.setContentType("application/octet-stream");
|
||||||
|
response.setHeader("Content-Disposition", "attachment;filename=" + new String((activity.getTitle() + "签到数据表.xlsx").getBytes(StandardCharsets.UTF_8), "ISO8859-1"));
|
||||||
|
ExportParams exportParams = new ExportParams();
|
||||||
|
exportParams.setType(ExcelType.XSSF);
|
||||||
|
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, nutMaps);
|
||||||
|
workbook.write(response.getOutputStream());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+7
-1
@@ -10,6 +10,7 @@ import cn.hutool.core.util.StrUtil;
|
|||||||
import com.budwk.app.base.page.Pagination;
|
import com.budwk.app.base.page.Pagination;
|
||||||
import com.budwk.app.base.result.Result;
|
import com.budwk.app.base.result.Result;
|
||||||
import com.budwk.app.module.activity.models.Activity;
|
import com.budwk.app.module.activity.models.Activity;
|
||||||
|
import com.budwk.app.module.activity.models.ActivityItem;
|
||||||
import com.budwk.app.module.activity.service.ActivitySignInQueryService;
|
import com.budwk.app.module.activity.service.ActivitySignInQueryService;
|
||||||
import com.budwk.app.module.activity.vo.page.ActSignInUserPageForm;
|
import com.budwk.app.module.activity.vo.page.ActSignInUserPageForm;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -51,6 +52,12 @@ public class ActivitySignInQueryController {
|
|||||||
return Result.success(activitySignInQueryService.dao().query(Activity.class, Cnd.NEW().andEX("YEAR(startTime)", "=", year)));
|
return Result.success(activitySignInQueryService.dao().query(Activity.class, Cnd.NEW().andEX("YEAR(startTime)", "=", year)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@At()
|
||||||
|
@SaCheckPermission("activity.signInUserQuery")
|
||||||
|
public Result getActivityItemOptions(Long activityId) {
|
||||||
|
return Result.success(activitySignInQueryService.dao().query(ActivityItem.class, Cnd.where(ActivityItem::getActivityId, "=", activityId)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@At()
|
@At()
|
||||||
@SaCheckPermission("activity.signInUserQuery")
|
@SaCheckPermission("activity.signInUserQuery")
|
||||||
@@ -107,7 +114,6 @@ public class ActivitySignInQueryController {
|
|||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
List<NutMap> nutMaps = activitySignInQueryService.listMap(sql);
|
List<NutMap> nutMaps = activitySignInQueryService.listMap(sql);
|
||||||
List<ExcelExportEntity> entityList = new ArrayList<>() {{
|
List<ExcelExportEntity> entityList = new ArrayList<>() {{
|
||||||
add(new ExcelExportEntity("报名号", "actUserNo", 20));
|
|
||||||
add(new ExcelExportEntity("姓名", "userName", 20));
|
add(new ExcelExportEntity("姓名", "userName", 20));
|
||||||
add(new ExcelExportEntity("性别", "sex", 20));
|
add(new ExcelExportEntity("性别", "sex", 20));
|
||||||
add(new ExcelExportEntity("职务", "position", 20));
|
add(new ExcelExportEntity("职务", "position", 20));
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ public class ActSignInUserPageForm extends PageForm {
|
|||||||
|
|
||||||
// 活动ID
|
// 活动ID
|
||||||
private Long activityId;
|
private Long activityId;
|
||||||
|
// 项目ID
|
||||||
|
private Long itemId;
|
||||||
|
|
||||||
// 联系方式
|
// 联系方式
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|||||||
@@ -0,0 +1,139 @@
|
|||||||
|
<!--#
|
||||||
|
layout("/layouts/platform_1.html"){
|
||||||
|
#-->
|
||||||
|
|
||||||
|
<div id="app">
|
||||||
|
<el-card shadow="never">
|
||||||
|
<div class="search">
|
||||||
|
<div class="search-item">
|
||||||
|
<div class="search-item-label">年度</div>
|
||||||
|
<div class="search-item-option">
|
||||||
|
<el-date-picker
|
||||||
|
:clearable="false"
|
||||||
|
placeholder="选择年"
|
||||||
|
style="width: 100%"
|
||||||
|
@change="getActivityOptions"
|
||||||
|
type="year"
|
||||||
|
v-model="pageForm.year"
|
||||||
|
value-format="yyyy"
|
||||||
|
></el-date-picker>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="search-item">
|
||||||
|
<div class="search-item-label">所属活动</div>
|
||||||
|
<div class="search-item-option">
|
||||||
|
<el-select v-model="pageForm.activityId" placeholder="请选择活动" @change="getActivityItemOptions">
|
||||||
|
<el-option
|
||||||
|
v-for="item in activityOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.title"
|
||||||
|
:value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="search-item">
|
||||||
|
<div class="search-item-label">所属项目</div>
|
||||||
|
<div class="search-item-option">
|
||||||
|
<el-select v-model="pageForm.itemId" placeholder="请选择所属项目" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="item in activityItemOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="search-item">
|
||||||
|
<div class="search-item-label">姓名/单位</div>
|
||||||
|
<div class="search-item-option">
|
||||||
|
<el-input v-model="pageForm.searchKeyword" clearable placeholder="请输入姓名/单位"></el-input>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="search-query">
|
||||||
|
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card shadow="never" class="mt-3">
|
||||||
|
<el-row type="flex" class="mb-3" style="justify-content: flex-end">
|
||||||
|
<el-button icon="el-icon-plus" type="primary" size="small" @click="doExport">导出</el-button>
|
||||||
|
</el-row>
|
||||||
|
<el-table v-loading="tableLoading" show-overflow-tooltip :data="tableData">
|
||||||
|
<el-table-column label="序号" prop="index" header-align="center" align="center" width="50">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="姓名" prop="userName"width="150"></el-table-column>
|
||||||
|
<el-table-column label="性别" prop="sex"width="150"></el-table-column>
|
||||||
|
<el-table-column label="职务" prop="position"></el-table-column>
|
||||||
|
<el-table-column label="身份证号码" prop="idCard"></el-table-column>
|
||||||
|
<el-table-column label="联系方式" prop="mobile"></el-table-column>
|
||||||
|
<el-table-column label="参加单位名称" prop="unitName"></el-table-column>
|
||||||
|
<el-table-column label="参加项目" prop="itemName"></el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--#include("/layouts/pagination.html"){}#-->
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
new Vue({
|
||||||
|
el: "#app",
|
||||||
|
mixins: [initTableMixins],
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
pageForm: {
|
||||||
|
year: new Date().getFullYear() + ""
|
||||||
|
},
|
||||||
|
activityOptions: [],
|
||||||
|
activityItemOptions: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
doExport() {
|
||||||
|
window.open("/platform/activity/itemApplyQuery/doExport?activityId=" + this.pageForm.activityId + "&searchKeyword=" + this.pageForm.searchKeyword)
|
||||||
|
},
|
||||||
|
getActivityOptions() {
|
||||||
|
$.post("/platform/activity/itemApplyQuery/getActivityOptions", {year: this.pageForm.year}).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
if (res.data && res.data.length > 0) {
|
||||||
|
this.$set(this.pageForm, "activityId", res.data[0].id)
|
||||||
|
} else {
|
||||||
|
this.$set(this.pageForm, "activityId", "")
|
||||||
|
}
|
||||||
|
this.activityOptions = res.data;
|
||||||
|
this.getActivityItemOptions()
|
||||||
|
this.doSearch()
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
getActivityItemOptions() {
|
||||||
|
$.post("/platform/activity/itemApplyQuery/getActivityItemOptions", {activityId: this.pageForm.activityId}).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.activityItemOptions = res.data;
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getActivityOptions()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<!--#
|
||||||
|
}
|
||||||
|
#-->
|
||||||
@@ -55,7 +55,6 @@ layout("/layouts/platform_1.html"){
|
|||||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="报名号" prop="actUserNo"></el-table-column>
|
|
||||||
<el-table-column label="姓名" prop="userName"></el-table-column>
|
<el-table-column label="姓名" prop="userName"></el-table-column>
|
||||||
<el-table-column label="性别" prop="sex"></el-table-column>
|
<el-table-column label="性别" prop="sex"></el-table-column>
|
||||||
<el-table-column label="职务" prop="position"></el-table-column>
|
<el-table-column label="职务" prop="position"></el-table-column>
|
||||||
|
|||||||
@@ -36,17 +36,17 @@
|
|||||||
<!-- 队伍信息 -->
|
<!-- 队伍信息 -->
|
||||||
<view class="rank-team">
|
<view class="rank-team">
|
||||||
<view class="team-info">
|
<view class="team-info">
|
||||||
<image class="team-avatar" :src="team.avatar || '/static/team-avatar.png'" mode="aspectFill"></image>
|
<!-- <image class="team-avatar" :src="team.avatar || '/static/team-avatar.png'" mode="aspectFill"></image>-->
|
||||||
<view class="team-detail">
|
<view class="team-detail">
|
||||||
<view class="team-name-row">
|
<view class="team-name-row">
|
||||||
<text class="team-name">{{ team.teamName }}</text>
|
<text class="team-name">{{ team.groupName }}</text>
|
||||||
<t-tag v-if="team.isMyTeam" theme="primary" variant="light" size="small" class="my-team-tag">我的队伍</t-tag>
|
<t-tag v-if="team.isMyTeam" theme="primary" variant="light" size="small" class="my-team-tag">我的队伍</t-tag>
|
||||||
</view>
|
</view>
|
||||||
<view class="progress-bar">
|
<view class="progress-bar">
|
||||||
<view class="progress-bar-bg"></view>
|
<view class="progress-bar-bg"></view>
|
||||||
<view
|
<view
|
||||||
class="progress-bar-fill"
|
class="progress-bar-fill"
|
||||||
:style="{width: `${(team.score / 100) * 100}%`}"
|
:style="{width: `${(team.totalScore / 100) * 100}%`}"
|
||||||
></view>
|
></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
<!-- 得分 -->
|
<!-- 得分 -->
|
||||||
<view class="rank-score">
|
<view class="rank-score">
|
||||||
<view class="score-value">{{ team.score }}</view>
|
<view class="score-value">{{ team.totalScore }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="empty-container" v-if="!loading && rankList.length === 0">
|
<view class="empty-container" v-if="!loading && rankList.length === 0">
|
||||||
@@ -78,98 +78,25 @@
|
|||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
import { Toast } from 'tdesign-mobile-vue';
|
import { Toast } from 'tdesign-mobile-vue';
|
||||||
import { useRequest } from "@/utils/request";
|
import { useRequest } from "@/utils/request";
|
||||||
|
import {onLoad} from "@dcloudio/uni-app";
|
||||||
|
|
||||||
// 排行榜数据
|
// 排行榜数据
|
||||||
const rankList = ref([]);
|
const rankList = ref([]);
|
||||||
|
const activityId = ref([]);
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const refresherTriggered = ref(false);
|
const refresherTriggered = ref(false);
|
||||||
|
|
||||||
const generateMockData = () => {
|
|
||||||
const teams = [
|
|
||||||
{
|
|
||||||
id: '1',
|
|
||||||
teamName: '闪电队',
|
|
||||||
score: 98,
|
|
||||||
avatar: 'https://tdesign.gtimg.com/mobile/demos/avatar_1.png',
|
|
||||||
isMyTeam: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '2',
|
|
||||||
teamName: '飞鹰战队',
|
|
||||||
score: 96,
|
|
||||||
avatar: 'https://tdesign.gtimg.com/mobile/demos/avatar_2.png',
|
|
||||||
isMyTeam: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '3',
|
|
||||||
teamName: '猎豹小组',
|
|
||||||
score: 90,
|
|
||||||
avatar: 'https://tdesign.gtimg.com/mobile/demos/avatar_3.png',
|
|
||||||
isMyTeam: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '4',
|
|
||||||
teamName: '雄狮战队',
|
|
||||||
score: 85,
|
|
||||||
avatar: 'https://tdesign.gtimg.com/mobile/demos/avatar_4.png',
|
|
||||||
isMyTeam: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '5',
|
|
||||||
teamName: '飓风俱乐部',
|
|
||||||
score: 80,
|
|
||||||
avatar: 'https://tdesign.gtimg.com/mobile/demos/avatar_5.png',
|
|
||||||
isMyTeam: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '6',
|
|
||||||
teamName: '钢铁战士',
|
|
||||||
score: 78,
|
|
||||||
avatar: 'https://tdesign.gtimg.com/mobile/demos/avatar_1.png',
|
|
||||||
isMyTeam: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '7',
|
|
||||||
teamName: '赤焰战队',
|
|
||||||
score: 75,
|
|
||||||
avatar: 'https://tdesign.gtimg.com/mobile/demos/avatar_2.png',
|
|
||||||
isMyTeam: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '8',
|
|
||||||
teamName: '金龙小组',
|
|
||||||
score: 68,
|
|
||||||
avatar: 'https://tdesign.gtimg.com/mobile/demos/avatar_3.png',
|
|
||||||
isMyTeam: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '9',
|
|
||||||
teamName: '星辰队',
|
|
||||||
score: 65,
|
|
||||||
avatar: 'https://tdesign.gtimg.com/mobile/demos/avatar_4.png',
|
|
||||||
isMyTeam: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '10',
|
|
||||||
teamName: '黑豹战队',
|
|
||||||
score: 62,
|
|
||||||
avatar: 'https://tdesign.gtimg.com/mobile/demos/avatar_5.png',
|
|
||||||
isMyTeam: false
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
// 按分数排序
|
|
||||||
return teams.sort((a, b) => b.score - a.score);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取排行榜数据
|
// 获取排行榜数据
|
||||||
const getRankData = async () => {
|
const getRankData = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
|
||||||
// 模拟API请求延迟
|
|
||||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
||||||
try {
|
try {
|
||||||
rankList.value = generateMockData();
|
const {code,data, msg} = await useRequest().post('/client/group/list-group-rank/' + activityId.value);
|
||||||
|
if (code === 0) {
|
||||||
|
rankList.value = data;
|
||||||
|
} else {
|
||||||
|
Toast({message: msg, theme: 'error'});
|
||||||
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取排行榜数据失败', error);
|
console.error('获取排行榜数据失败', error);
|
||||||
Toast({ message: '获取排行榜数据失败', theme: 'error' });
|
Toast({ message: '获取排行榜数据失败', theme: 'error' });
|
||||||
@@ -193,7 +120,11 @@ const handleRefresh = () => {
|
|||||||
refresherTriggered.value = true;
|
refresherTriggered.value = true;
|
||||||
getRankData();
|
getRankData();
|
||||||
};
|
};
|
||||||
|
onLoad((option) => {
|
||||||
|
if (option.id) {
|
||||||
|
activityId.value=option.id
|
||||||
|
}
|
||||||
|
});
|
||||||
// 页面加载时获取数据
|
// 页面加载时获取数据
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getRankData();
|
getRankData();
|
||||||
|
|||||||
@@ -25,16 +25,16 @@
|
|||||||
<div class="stat-item">
|
<div class="stat-item">
|
||||||
<div class="stat-icon"><i class="bi bi-people"></i></div>
|
<div class="stat-icon"><i class="bi bi-people"></i></div>
|
||||||
<div class="stat-content">
|
<div class="stat-content">
|
||||||
<div class="stat-value">{{ team.groupUsers?.length }}</div>
|
<div class="stat-value">成员:{{ team.groupUsers?.length }}</div>
|
||||||
<div class="stat-label">成员</div>
|
<!-- <div class="stat-label">成员</div>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-divider"></div>
|
<div class="stat-divider"></div>
|
||||||
<div class="stat-item">
|
<div class="stat-item" @click="queryRank">
|
||||||
<div class="stat-icon"><i class="bi bi-trophy"></i></div>
|
<div class="stat-icon"><i class="bi bi-trophy"></i></div>
|
||||||
<div class="stat-content">
|
<div class="stat-content">
|
||||||
<div class="stat-value">{{ team.totalRank ? team.totalRank : '--' }}</div>
|
<div class="stat-value">排名:{{ team.totalRank ? team.totalRank : '--' }}</div>
|
||||||
<div class="stat-label">排名</div>
|
<div class="stat-label">点击查看排行榜</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -240,6 +240,11 @@ const getListAct = async () => {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 点击查看成绩排名
|
||||||
|
const queryRank=()=>{
|
||||||
|
uni.navigateTo({url: '/pages/activity/rank/index?id=' + pageForm.actId})
|
||||||
|
}
|
||||||
|
|
||||||
// 初始化
|
// 初始化
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
getListAct();
|
getListAct();
|
||||||
|
|||||||
Reference in New Issue
Block a user