From 46bacd1e38ee2971cc3199f6a28dd1907992324b Mon Sep 17 00:00:00 2001 From: Putoo <290555932@qq.com> Date: Tue, 9 Jun 2026 17:51:12 +0800 Subject: [PATCH] 121212 --- .../Services/Service/Equ/GameEquService.cs | 12 ++- .../Controllers/Pub/EquController.cs | 71 +++++++++++++++- .../Controllers/Pub/TeamController.cs | 8 +- .../Controllers/User/UserController.cs | 7 +- Web/src/pages/map/index.vue | 2 +- Web/src/pages/prop/equ.vue | 26 +++++- Web/src/pages/prop/suit.vue | 57 +++++++++++++ Web/src/pages/user/team/info.vue | 81 ++++++++++++++++++- Web/src/pages/user/user.vue | 15 +++- Web/src/services/Index/EquService.ts | 24 ++++++ 10 files changed, 279 insertions(+), 24 deletions(-) create mode 100644 Web/src/pages/prop/suit.vue diff --git a/Service/Application.Domain/Services/Service/Equ/GameEquService.cs b/Service/Application.Domain/Services/Service/Equ/GameEquService.cs index 5ed7550..0efffce 100644 --- a/Service/Application.Domain/Services/Service/Equ/GameEquService.cs +++ b/Service/Application.Domain/Services/Service/Equ/GameEquService.cs @@ -17,6 +17,7 @@ public class GameEquService(ISqlSugarClient DbClient, IRedisCache redis) : IGame return data; } + public async Task GetEuqSuitInfo(string suitCode) { string key = string.Format(BaseCache.BaseCacheKeys, "EquData", "SuitInfo"); @@ -27,6 +28,7 @@ public class GameEquService(ISqlSugarClient DbClient, IRedisCache redis) : IGame data = await db.Queryable().Where(it => it.suitCode == suitCode).SingleAsync(); await redis.AddHashAsync(key, suitCode, data); } + return data; } @@ -238,7 +240,7 @@ public class GameEquService(ISqlSugarClient DbClient, IRedisCache redis) : IGame return false; } - userEqu = userEqu.FindAll(it => it.isLock == 0); + userEqu = userEqu.FindAll(it => it.isLock == 0 && it.isOn == 0); if (userEqu.Count < count) { return false; @@ -304,16 +306,22 @@ public class GameEquService(ISqlSugarClient DbClient, IRedisCache redis) : IGame await db.Insertable(logs).SplitTable().ExecuteCommandAsync(); } + + + + + + #endregion #region 辅助方法 + public async Task GetUserEquWeightSum(string userId) { var db = DbClient.AsTenant().GetConnectionWithAttr(); var data = await db.Queryable().Where(it => it.userId == userId).ToListAsync(); return data.Sum(it => (int)it.weight); } - #endregion } \ No newline at end of file diff --git a/Service/Application.Web/Controllers/Pub/EquController.cs b/Service/Application.Web/Controllers/Pub/EquController.cs index b9ef3fd..58ce304 100644 --- a/Service/Application.Web/Controllers/Pub/EquController.cs +++ b/Service/Application.Web/Controllers/Pub/EquController.cs @@ -57,9 +57,9 @@ public class EquController : ControllerBase return PoAction.Message("装备不存在!"); } - if (equInfo.suitCode != "0" && !string.IsNullOrEmpty(equInfo.suitCode)) + if (ueInfo.suitCode != "0" && !string.IsNullOrEmpty(ueInfo.suitCode)) { - suit = await _equService.GetEuqSuitInfo(equInfo.suitCode); + suit = await _equService.GetEuqSuitInfo(ueInfo.suitCode); } user = await UserModelTool.GetUserView(ueInfo.owerId); @@ -67,5 +67,70 @@ public class EquController : ControllerBase return PoAction.Ok(new { equ = equInfo, suit, equData = ueInfo,user }); } - + + /// + /// 获取套装详情 + /// + /// + /// + [HttpGet] + public async Task GetEquSuitInfo(string suitCode) + { + var data = await _equService.GetEuqSuitInfo(suitCode); + if (data == null) + { + return PoAction.Message("套装不存在!"); + } + + return PoAction.Ok(data); + } + + /// + /// 绑定操作 + /// + /// + /// + [HttpGet] + public async Task EquLock(string ueId) + { + var userId = StateHelper.userId; + var equInfo = await _equService.GetUserEquInfo(ueId); + if (equInfo == null) + { + return PoAction.Message("装备不存在!"); + } + if (equInfo.userId != userId) + { + return PoAction.Message("装备不存在!"); + } + if (equInfo.isAppr == 0) + { + return PoAction.Message("装备未鉴定!"); + } + + + equInfo.isLock = equInfo.isLock == 0 ? 1 : 0; + + bool result = await _equService.UpdateUserEquInfo(equInfo); + if (result) + { + string msg = equInfo.isLock == 1 ? "成功绑定装备!" : "成功解除装备绑定!"; + return PoAction.Ok(true, msg); + } + else + { + return PoAction.Message("操作失败,请稍后尝试!"); + } + } + + /// + /// 穿/卸装备 + /// + /// + /// + [HttpGet] + public async Task DownOrUpEqu(string ueId) + { + return PoAction.Ok(true); + } } \ No newline at end of file diff --git a/Service/Application.Web/Controllers/Pub/TeamController.cs b/Service/Application.Web/Controllers/Pub/TeamController.cs index ac66b0c..08afcb9 100644 --- a/Service/Application.Web/Controllers/Pub/TeamController.cs +++ b/Service/Application.Web/Controllers/Pub/TeamController.cs @@ -115,13 +115,7 @@ public class TeamController : ControllerBase { string userId = StateHelper.userId; var teamInfo = await _teamService.GetTeamDataByTeamId(teamId); - int isMyTeam = teamInfo.user.Any(it => it.user.userId == userId) ? 1 : 0; - int manger = teamInfo.team.masterId == userId ? 1 : 0; - return PoAction.Ok(new - { - data = teamInfo, - isMyTeam = isMyTeam - }); + return PoAction.Ok(teamInfo); } /// diff --git a/Service/Application.Web/Controllers/User/UserController.cs b/Service/Application.Web/Controllers/User/UserController.cs index b4ff278..c9d4ed1 100644 --- a/Service/Application.Web/Controllers/User/UserController.cs +++ b/Service/Application.Web/Controllers/User/UserController.cs @@ -16,9 +16,10 @@ public class UserController : ControllerBase private readonly IGameGoodsService _goodsService; private readonly IGameChatService _chatService; private readonly IGameSkillService _skillService; + private readonly IGameTeamService _teamService; public UserController(IUnitUserService userService, IUnitUserAttrService attrService, IUnitUserAccService accService, IGameMapService mapService, IUnitUserRelationService relationService, - IGameGoodsService goodsService, IGameChatService chatService,IGameSkillService skillService) + IGameGoodsService goodsService, IGameChatService chatService,IGameSkillService skillService,IGameTeamService teamService) { _userService = userService; _attrService = attrService; @@ -28,6 +29,7 @@ public class UserController : ControllerBase _goodsService = goodsService; _chatService = chatService; _skillService = skillService; + _teamService = teamService; } @@ -160,7 +162,8 @@ public class UserController : ControllerBase string onMapName = $"{onCity.cityName}-{onMapInfo.mapName}"; bool isFriend = await _relationService.CheckIsFriend(userId, userInfo.userId); bool isEnemy = await _relationService.CheckUserEnemy(userId, userInfo.userId); - object result = new { user, attr = new { attrInfo.lev }, acc, isOnline, onMapName, isFriend, isEnemy }; + var team = await _teamService.GetUserTeamInfo(userInfo.userId); + object result = new { user, attr = new { attrInfo.lev }, acc, isOnline, onMapName, isFriend, isEnemy ,team}; return PoAction.Ok(result); } diff --git a/Web/src/pages/map/index.vue b/Web/src/pages/map/index.vue index aee64ce..aa44778 100644 --- a/Web/src/pages/map/index.vue +++ b/Web/src/pages/map/index.vue @@ -62,7 +62,7 @@ -
+
{{ item.mapName }}
diff --git a/Web/src/pages/prop/equ.vue b/Web/src/pages/prop/equ.vue index 2e6d49d..ace73b8 100644 --- a/Web/src/pages/prop/equ.vue +++ b/Web/src/pages/prop/equ.vue @@ -35,7 +35,7 @@
耐久:{{ equInfo.durability }}
- 套装:{{ suitInfo.suitName }}
+ 套装:{{ suitInfo.suitName }}
特性:{{ EquTool.GetEquAttrName(equInfo.equAttr, 0) }}
@@ -96,7 +96,7 @@
耐久:{{ equData.maxdurability }}/{{ equData.durability }}
- 套装:{{ suitInfo.suitName }}
+ 套装:{{ suitInfo.suitName }}
特性:{{ EquTool.GetEquAttrName(equData.equAttr, 0) }}
@@ -117,7 +117,7 @@
- ◈穿戴装备
+ ◈穿戴装备
洗练
@@ -129,7 +129,7 @@ ◈升星
- ◈绑定
+ ◈{{ equData.isLock == 0 ? "绑定" : "解绑" }}
寄售
@@ -186,4 +186,22 @@ const BindData = async (): Promise => { } }; +/**穿/卸装备 */ +const UpOrDownEqu = async () => { + alert(ueId); +} + +/**绑定装备 */ +const LockEqu = async () => { + MessageExtend.LoadingToast("操作中..."); + let result = await EquService.EquLock(ueId); + MessageExtend.LoadingClose(); + if (result.code == 0) { + await BindData(); + MessageExtend.Notify(result.msg, "success"); + } + else { + MessageExtend.ShowDialog("绑定装备", result.msg); + } +} \ No newline at end of file diff --git a/Web/src/pages/prop/suit.vue b/Web/src/pages/prop/suit.vue new file mode 100644 index 0000000..df231b7 --- /dev/null +++ b/Web/src/pages/prop/suit.vue @@ -0,0 +1,57 @@ + + \ No newline at end of file diff --git a/Web/src/pages/user/team/info.vue b/Web/src/pages/user/team/info.vue index 41a40c8..93c6c35 100644 --- a/Web/src/pages/user/team/info.vue +++ b/Web/src/pages/user/team/info.vue @@ -1 +1,80 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/Web/src/pages/user/user.vue b/Web/src/pages/user/user.vue index 0386b00..000cdcf 100644 --- a/Web/src/pages/user/user.vue +++ b/Web/src/pages/user/user.vue @@ -1,7 +1,9 @@