diff --git a/honey_box/pages/infinite/bonus_house_details.vue b/honey_box/pages/infinite/bonus_house_details.vue
index dc223cd1..8d7a98ba 100644
--- a/honey_box/pages/infinite/bonus_house_details.vue
+++ b/honey_box/pages/infinite/bonus_house_details.vue
@@ -535,13 +535,13 @@ export default {
}
},
- handleTabChange(index) {
+ async handleTabChange(index) {
this.currentTab = index;
- // 添加延迟加载动画
- if (index === 1 && this.participantList.length > 0) {
- this.animateListItems('participant-row');
- } else if (index === 2 && this.awardRecordList.length > 0) {
- this.animateListItems('award-row');
+ // 切换到参与人数或赏品记录时,重新加载数据
+ if (index === 1) {
+ await this.loadParticipants(this.goods_id);
+ } else if (index === 2) {
+ await this.loadAwardRecords(this.goods_id);
}
},
diff --git a/server/HoneyBox/src/HoneyBox.Api/Controllers/WelfareController.cs b/server/HoneyBox/src/HoneyBox.Api/Controllers/WelfareController.cs
index b9395e1a..ee768c9d 100644
--- a/server/HoneyBox/src/HoneyBox.Api/Controllers/WelfareController.cs
+++ b/server/HoneyBox/src/HoneyBox.Api/Controllers/WelfareController.cs
@@ -238,61 +238,69 @@ public class WelfareController : ControllerBase
///
/// 获取福利屋参与者列表
- /// POST /api/fuliwu_participants
- /// Requirements: 14.1
+ /// GET /api/fuliwu_participants
///
- [HttpPost("fuliwu_participants")]
+ [HttpGet("fuliwu_participants")]
[Authorize]
- public async Task>> GetParticipants([FromForm] ParticipantsRequest request)
+ public async Task> GetParticipants(
+ [FromQuery(Name = "goods_id")] int goodsId,
+ [FromQuery] int page = 1,
+ [FromQuery] int limit = 15)
{
var userId = GetCurrentUserId();
if (userId == null)
{
- return ApiResponse>.Unauthorized();
+ return ApiResponse.Unauthorized();
+ }
+
+ if (goodsId <= 0)
+ {
+ return ApiResponse.Fail("商品ID不能为空");
}
try
{
- var result = await _welfareService.GetParticipantsAsync(
- request.GoodsId,
- request.Page,
- request.Limit);
- return ApiResponse>.Success(result);
+ var result = await _welfareService.GetParticipantsAsync(goodsId, page, limit);
+ return ApiResponse.Success(new WelfareParticipantsResponse { List = result });
}
catch (Exception ex)
{
- _logger.LogError(ex, "Failed to get participants: GoodsId={GoodsId}", request.GoodsId);
- return ApiResponse>.Fail("获取参与者列表失败");
+ _logger.LogError(ex, "Failed to get participants: GoodsId={GoodsId}", goodsId);
+ return ApiResponse.Fail("获取参与者列表失败");
}
}
///
/// 获取福利屋开奖记录
- /// POST /api/fuliwu_records
- /// Requirements: 14.2
+ /// GET /api/fuliwu_records
///
- [HttpPost("fuliwu_records")]
+ [HttpGet("fuliwu_records")]
[Authorize]
- public async Task>> GetWinningRecords([FromForm] WinningRecordsRequest request)
+ public async Task> GetWinningRecords(
+ [FromQuery(Name = "goods_id")] int goodsId,
+ [FromQuery] int page = 1,
+ [FromQuery] int limit = 15)
{
var userId = GetCurrentUserId();
if (userId == null)
{
- return ApiResponse>.Unauthorized();
+ return ApiResponse.Unauthorized();
+ }
+
+ if (goodsId <= 0)
+ {
+ return ApiResponse.Fail("商品ID不能为空");
}
try
{
- var result = await _welfareService.GetWinningRecordsAsync(
- request.GoodsId,
- request.Page,
- request.Limit);
- return ApiResponse>.Success(result);
+ var result = await _welfareService.GetWinningRecordsAsync(goodsId, page, limit);
+ return ApiResponse.Success(new WelfareRecordsResponse { List = result });
}
catch (Exception ex)
{
- _logger.LogError(ex, "Failed to get winning records: GoodsId={GoodsId}", request.GoodsId);
- return ApiResponse>.Fail("获取开奖记录失败");
+ _logger.LogError(ex, "Failed to get winning records: GoodsId={GoodsId}", goodsId);
+ return ApiResponse.Fail("获取开奖记录失败");
}
}
diff --git a/server/HoneyBox/src/HoneyBox.Model/Models/Welfare/WelfareModels.cs b/server/HoneyBox/src/HoneyBox.Model/Models/Welfare/WelfareModels.cs
index a7105c6a..73fe673c 100644
--- a/server/HoneyBox/src/HoneyBox.Model/Models/Welfare/WelfareModels.cs
+++ b/server/HoneyBox/src/HoneyBox.Model/Models/Welfare/WelfareModels.cs
@@ -629,3 +629,26 @@ public class FuliwuListResponse
///
public int LastPage { get; set; }
}
+
+
+///
+/// 福利屋参与者列表响应
+///
+public class WelfareParticipantsResponse
+{
+ ///
+ /// 参与者列表
+ ///
+ public List List { get; set; } = new();
+}
+
+///
+/// 福利屋开奖记录响应
+///
+public class WelfareRecordsResponse
+{
+ ///
+ /// 开奖记录列表
+ ///
+ public List List { get; set; } = new();
+}