1233
This commit is contained in:
@@ -41,5 +41,10 @@ namespace Application.Domain.Entity
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = true)]
|
||||
public int? giveRole { get; set; }
|
||||
/// <summary>
|
||||
/// 消息权限:0封禁 1正常
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = true)]
|
||||
public int? msgRole { get; set; }
|
||||
}
|
||||
}
|
||||
33
Service/Application.Domain.Entity/model/EquSuitAttr.cs
Normal file
33
Service/Application.Domain.Entity/model/EquSuitAttr.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
namespace Application.Domain.Entity;
|
||||
|
||||
public class EquSuitAttr
|
||||
{
|
||||
private System.String _NeedType;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.String NeedType
|
||||
{ get { return this._NeedType; } set { this._NeedType = value; } }
|
||||
|
||||
public String[] _NeedData;
|
||||
|
||||
public System.String[] NeedData
|
||||
{ get { return this._NeedData; } set { this._NeedData = value; } }
|
||||
|
||||
private System.Int32 _Type;
|
||||
|
||||
/// <summary>
|
||||
/// 0特殊属性 1隐藏属性
|
||||
/// </summary>
|
||||
public System.Int32 Type
|
||||
{ get { return this._Type; } set { this._Type = value; } }
|
||||
|
||||
private List<AttrItem> _AttrItem;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<AttrItem> AttrItem
|
||||
{ get { return this._AttrItem; } set { this._AttrItem = value; } }
|
||||
}
|
||||
20
Service/Application.Domain.Entity/model/EquSuitList.cs
Normal file
20
Service/Application.Domain.Entity/model/EquSuitList.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace Application.Domain.Entity;
|
||||
|
||||
public class EquSuitList
|
||||
{
|
||||
private System.Int32 _equId;
|
||||
|
||||
/// <summary>
|
||||
/// 装备表Id--goods表
|
||||
/// </summary>
|
||||
public System.Int32 equId
|
||||
{ get { return this._equId; } set { this._equId = value; } }
|
||||
|
||||
private System.String _equName;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public System.String equName
|
||||
{ get { return this._equName; } set { this._equName = value; } }
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
public class NpcBus
|
||||
{
|
||||
public string code { get; set; }
|
||||
public string name { get; set; }
|
||||
public string url { get; set; }
|
||||
}
|
||||
@@ -14,14 +14,14 @@
|
||||
public string remark { get; set; }
|
||||
public string TmImg { get; set; }
|
||||
public int lev { get; set; }//等级
|
||||
public decimal minAtk { get; set; }//最小攻击
|
||||
public decimal maxAtk { get; set; }//最大攻击
|
||||
public decimal defense { get; set; }//防御
|
||||
public decimal agility { get; set; }//敏捷
|
||||
public decimal blood { get; set; }//血量
|
||||
public decimal upBlood { get; set; }//最大血量
|
||||
public decimal morale { get; set; }//士气
|
||||
public decimal upMorale { get; set; }//最大士气
|
||||
public int minAtk { get; set; }//最小攻击
|
||||
public int maxAtk { get; set; }//最大攻击
|
||||
public int defense { get; set; }//防御
|
||||
public int agility { get; set; }//敏捷
|
||||
public int blood { get; set; }//血量
|
||||
public int upBlood { get; set; }//最大血量
|
||||
public int morale { get; set; }//士气
|
||||
public int upMorale { get; set; }//最大士气
|
||||
public decimal score { get; set; }//评分
|
||||
public decimal InBlood { get; set; }//吸血
|
||||
public decimal Crit { get; set; }//暴击
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
|
||||
namespace Application.Domain.Entity
|
||||
{
|
||||
[Tenant("Kg.SeaTime.Resource")]
|
||||
public class game_equ_suit
|
||||
{
|
||||
/// <summary>
|
||||
/// 套装编码
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, Length = 50)]
|
||||
public string suitCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 套装名称
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50, IsNullable = true)]
|
||||
public string? suitName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 套装介绍
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 500, IsNullable = true)]
|
||||
public string? sign { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 属性
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = true,IsJson = true)]
|
||||
public List<EquSuitAttr>? attr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 套装组成装备
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = true,IsJson = true)]
|
||||
public List<EquSuitList> onEqu { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 套装特权
|
||||
/// </summary>
|
||||
[SugarColumn(IsNullable = true)]
|
||||
public string? role { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -44,4 +44,11 @@ public static class GameEnum
|
||||
减少,
|
||||
增加
|
||||
}
|
||||
|
||||
public enum NpcBusCode
|
||||
{
|
||||
RetBlood,
|
||||
RetMorale,
|
||||
RetVigour,
|
||||
}
|
||||
}
|
||||
@@ -14,5 +14,6 @@ public static class UserEnum
|
||||
AutoBag,
|
||||
AutoDrug,
|
||||
GiveRole,
|
||||
MsgRole,
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ public interface IGameEquService
|
||||
#region 装备资源
|
||||
|
||||
Task<game_equ> GetEquInfo(int equId);
|
||||
|
||||
Task<game_equ_suit> GetEuqSuitInfo(string suitCode);
|
||||
#endregion
|
||||
#region 用户装备
|
||||
|
||||
@@ -29,4 +29,10 @@ public interface IGameEquService
|
||||
|
||||
#endregion
|
||||
|
||||
#region 辅助
|
||||
|
||||
Task<int> GetUserEquWeightSum(string userId);
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -20,5 +20,12 @@ public interface IGameGoodsService
|
||||
|
||||
Task<bool> UpdateUserGoods(string userId, int op, int goodsId, int count, string remark = "");
|
||||
|
||||
#endregion
|
||||
|
||||
#region 辅助
|
||||
|
||||
Task<int> GetUserGoodWeightSum(string userId, int type);
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -27,13 +27,14 @@ public interface IUnitUserAttrService
|
||||
|
||||
Task<unit_user_morale> GetUserMorale(string userId);
|
||||
Task<bool> UpdateUserMorale(string userId, int op, int count);
|
||||
|
||||
Task<bool> CheackRecoverMorale(string userId);
|
||||
Task LockRecoverMorale(string userId);
|
||||
#endregion
|
||||
|
||||
#region 活力
|
||||
|
||||
Task<unit_user_vigour> GetUserVigourInfo(string userId);
|
||||
Task<bool> UpdateUserVigour(string userId, int op, decimal count, string UpTime = "");
|
||||
Task<bool> UpdateUserVigour(string userId, int op, long count, string UpTime = "");
|
||||
Task<bool> UpdateUserUpVigour(string userId, decimal count);
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -3,10 +3,14 @@
|
||||
public interface IUnitUserWeight
|
||||
{
|
||||
Task<unit_user_weight> GetUserWeightInfo(string userId);
|
||||
Task<bool> UpdateUserWeight(unit_user_weight data);
|
||||
Task<bool> UpdateUserWeight(string userId, int op, int weight);
|
||||
Task<bool> UpdateUserMaxWeight(string userId, int op, int weight);
|
||||
Task<bool> AddUserWeightLog(string userId, int goodsId, string goodsName, int weight, int count);
|
||||
Task<bool> CheakUserWeight(string userId, int useWeight);
|
||||
|
||||
Task<bool> UpdateUserMaxWeight(string userId, int op, int weight, int count = 1, int goodsId = 0,
|
||||
string goodsName = "");
|
||||
|
||||
Task<List<unit_user_weight_log>> GetUserWeightLog(string userId);
|
||||
Task<bool> CheckUserWeight(string userId, int useWeight);
|
||||
|
||||
#region 船只相关
|
||||
|
||||
|
||||
@@ -17,6 +17,18 @@ public class GameEquService(ISqlSugarClient DbClient, IRedisCache redis) : IGame
|
||||
|
||||
return data;
|
||||
}
|
||||
public async Task<game_equ_suit> GetEuqSuitInfo(string suitCode)
|
||||
{
|
||||
string key = string.Format(BaseCache.BaseCacheKeys, "EquData", "SuitInfo");
|
||||
var data = await redis.GetHashAsync<game_equ_suit>(key, suitCode);
|
||||
if (data == null)
|
||||
{
|
||||
var db = DbClient.AsTenant().GetConnectionWithAttr<game_equ_suit>();
|
||||
data = await db.Queryable<game_equ_suit>().Where(it => it.suitCode == suitCode).SingleAsync();
|
||||
await redis.AddHashAsync(key, suitCode, data);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -292,5 +304,16 @@ public class GameEquService(ISqlSugarClient DbClient, IRedisCache redis) : IGame
|
||||
await db.Insertable(logs).SplitTable().ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 辅助方法
|
||||
public async Task<int> GetUserEquWeightSum(string userId)
|
||||
{
|
||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_equ>();
|
||||
var data = await db.Queryable<unit_user_equ>().Where(it => it.userId == userId).ToListAsync();
|
||||
return data.Sum(it => (int)it.weight);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -55,7 +55,8 @@ public class GameGoodsService(ISqlSugarClient DbClient, IRedisCache redis) : IGa
|
||||
return info == null ? 0 : (int)info.count;
|
||||
}
|
||||
|
||||
public async Task<List<unit_user_goods>> GetUserGoodsData(string userId, List<string> code, List<string> noCode, string search, int page,
|
||||
public async Task<List<unit_user_goods>> GetUserGoodsData(string userId, List<string> code, List<string> noCode,
|
||||
string search, int page,
|
||||
int limit, RefAsync<int> total)
|
||||
{
|
||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_goods>();
|
||||
@@ -125,13 +126,13 @@ public class GameGoodsService(ISqlSugarClient DbClient, IRedisCache redis) : IGa
|
||||
if (weightCount > 0)
|
||||
{
|
||||
var weightService = App.GetService<IUnitUserWeight>();
|
||||
if (UserGoods.code == nameof(GoodsEnum.Code.Cargo))//跑商物品处理
|
||||
if (UserGoods.code == nameof(GoodsEnum.Code.Cargo)) //跑商物品处理
|
||||
{
|
||||
await weightService.UpdateUserShipOnWeight(userId, op, weightCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
await weightService.UpdateUserWeight(userId, op, weightCount);
|
||||
await weightService.UpdateUserWeight(userId, op, weightCount);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,5 +165,16 @@ public class GameGoodsService(ISqlSugarClient DbClient, IRedisCache redis) : IGa
|
||||
return $"{userId}_{goodsId}";
|
||||
}
|
||||
|
||||
public async Task<int> GetUserGoodWeightSum(string userId, int type)
|
||||
{
|
||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_goods>();
|
||||
string code = nameof(GoodsEnum.Code.Cargo);
|
||||
var data = await db.Queryable<unit_user_goods>().Where(it => it.userId == userId)
|
||||
.WhereIF(type == 0, it => it.code != code)
|
||||
.WhereIF(type == 1, it => it.code == code)
|
||||
.ToListAsync();
|
||||
return data.Sum(it => (int)it.count * (int)it.weight);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -18,14 +18,16 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) :
|
||||
result.code = nameof(UserEnum.AttrCode.Person);
|
||||
var unitAttr = await GetUserAttr(userId);
|
||||
result.lev = (int)unitAttr.lev;
|
||||
result.minAtk = (decimal)unitAttr.minAtk;
|
||||
result.maxAtk = (decimal)unitAttr.maxAtk;
|
||||
result.defense = (decimal)unitAttr.defense;
|
||||
result.agility = (decimal)unitAttr.agility;
|
||||
result.upBlood = (decimal)unitAttr.upBlood;
|
||||
result.upMorale = (decimal)unitAttr.upMorale;
|
||||
result.blood = 1;
|
||||
result.morale = 1;
|
||||
result.minAtk = (int)unitAttr.minAtk;
|
||||
result.maxAtk = (int)unitAttr.maxAtk;
|
||||
result.defense = (int)unitAttr.defense;
|
||||
result.agility = (int)unitAttr.agility;
|
||||
result.upBlood = (int)unitAttr.upBlood;
|
||||
result.upMorale = (int)unitAttr.upMorale;
|
||||
var bloodInfo = await GetUserBlood(userId);
|
||||
result.blood = (int)bloodInfo.blood;
|
||||
var moraleInfo = await GetUserMorale(userId);
|
||||
result.morale = (int)moraleInfo.morale;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -172,6 +174,7 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) :
|
||||
.ExecuteCommandAsync() > 0;
|
||||
int upVigour = GameConfig.GameBaseVigour + (OnLev * 10);
|
||||
await UpdateUserUpVigour(userId, upVigour);
|
||||
|
||||
IsUpUserAttr = result;
|
||||
}
|
||||
}
|
||||
@@ -199,7 +202,7 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) :
|
||||
{
|
||||
//增加负重
|
||||
var wightService = App.GetService<IUnitUserWeight>();
|
||||
await wightService.UpdateUserMaxWeight(userId, 1, GameConfig.UpLevAddWeight);
|
||||
await wightService.UpdateUserMaxWeight(userId, 1, GameConfig.UpLevAddWeight, 1, 0, "升级增加负重");
|
||||
await ClearUserAttrCache(userId);
|
||||
}
|
||||
|
||||
@@ -252,6 +255,17 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) :
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<bool> CheackRecoverMorale(string userId)
|
||||
{
|
||||
string key = string.Format(UserCache.BaseCacheKeys, "Recover:Morale", userId);
|
||||
return await redis.ExistsAsync(key);
|
||||
}
|
||||
public async Task LockRecoverMorale(string userId)
|
||||
{
|
||||
string key = string.Format(UserCache.BaseCacheKeys, "Recover:Morale", userId);
|
||||
await redis.SetAsync(key, DateTime.Now,TimeAssist.GetDateTimeYMD(1));
|
||||
}
|
||||
|
||||
#endregion 士气
|
||||
|
||||
#region 活力
|
||||
@@ -279,7 +293,7 @@ public class UnitUserAttrService(ISqlSugarClient DbClient, IRedisCache redis) :
|
||||
await redis.DelHashAsync(key, userId);
|
||||
}
|
||||
|
||||
public async Task<bool> UpdateUserVigour(string userId, int op, decimal count, string UpTime = "")
|
||||
public async Task<bool> UpdateUserVigour(string userId, int op, long count, string UpTime = "")
|
||||
{
|
||||
bool result = false;
|
||||
try
|
||||
|
||||
@@ -207,6 +207,7 @@ public class UnitUserService(ISqlSugarClient DbClient, IRedisCache redis) : IUni
|
||||
config.autoBag = -1;
|
||||
config.autoDrug = -1;
|
||||
config.giveRole = 0;
|
||||
config.msgRole = 1;
|
||||
db.Insertable(config).AddQueue();
|
||||
|
||||
//注册个人血量
|
||||
@@ -231,14 +232,14 @@ public class UnitUserService(ISqlSugarClient DbClient, IRedisCache redis) : IUni
|
||||
unit_user_weight weight = new unit_user_weight();
|
||||
weight.userId = userId;
|
||||
weight.onWeight = 0;
|
||||
weight.maxWeight = 100;
|
||||
weight.maxWeight = 0;
|
||||
db.Insertable(weight).AddQueue();
|
||||
//注册活力
|
||||
unit_user_vigour vitality = new unit_user_vigour();
|
||||
vitality.userId = userId;
|
||||
vitality.vitality = GameConfig.GameBaseVigour;
|
||||
vitality.upVitality = GameConfig.GameBaseVigour;
|
||||
vitality.upTime = TimeAssist.GetDateTimeYMDString(0);
|
||||
vitality.upTime = TimeAssist.GetDateTimeYMDString(-1);
|
||||
db.Insertable(vitality).AddQueue();
|
||||
|
||||
//注册在线
|
||||
@@ -252,6 +253,13 @@ public class UnitUserService(ISqlSugarClient DbClient, IRedisCache redis) : IUni
|
||||
await db.SaveQueuesAsync(false);
|
||||
}
|
||||
|
||||
if (result)//注册各项后处理
|
||||
{
|
||||
//赠送初始负重
|
||||
var weightService = App.GetService<IUnitUserWeight>();
|
||||
await weightService.UpdateUserMaxWeight(userId, 1, 100, 1, 0, "初始负重");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -337,6 +345,9 @@ public class UnitUserService(ISqlSugarClient DbClient, IRedisCache redis) : IUni
|
||||
case "AutoDrug":
|
||||
result = (int)config.autoDrug;
|
||||
break;
|
||||
case "MsgRole":
|
||||
result = (int)config.msgRole;
|
||||
break;
|
||||
|
||||
}
|
||||
return result;
|
||||
@@ -357,6 +368,7 @@ public class UnitUserService(ISqlSugarClient DbClient, IRedisCache redis) : IUni
|
||||
.SetColumnsIF(code == "AutoBag", it => it.autoBag == state)
|
||||
.SetColumnsIF(code == "AutoDrug", it => it.autoDrug == state)
|
||||
.SetColumnsIF(code == "GiveRole", it => it.giveRole == state)
|
||||
.SetColumnsIF(code == "MsgRole", it => it.msgRole == state)
|
||||
.Where(it => it.userId == userId).ExecuteCommandAsync() > 0;
|
||||
if (result)
|
||||
{
|
||||
|
||||
@@ -30,6 +30,18 @@ public class UnitUserWeight(ISqlSugarClient DbClient, IRedisCache redis) : IUnit
|
||||
await redis.DelHashAsync(key, userId);
|
||||
}
|
||||
|
||||
public async Task<bool> UpdateUserWeight(unit_user_weight data)
|
||||
{
|
||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_weight>();
|
||||
bool result = await db.Updateable(data).ExecuteCommandAsync() > 0;
|
||||
if (result)
|
||||
{
|
||||
await ClearUserWeightInfo(data.userId);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<bool> UpdateUserWeight(string userId, int op, int weight)
|
||||
{
|
||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_weight>();
|
||||
@@ -46,22 +58,33 @@ public class UnitUserWeight(ISqlSugarClient DbClient, IRedisCache redis) : IUnit
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<bool> UpdateUserMaxWeight(string userId, int op, int weight)
|
||||
public async Task<bool> UpdateUserMaxWeight(string userId, int op, int weight, int count = 1, int goodsId = 0,
|
||||
string goodsName = "")
|
||||
{
|
||||
int sumWeight = weight * count;
|
||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_weight>();
|
||||
bool result = await db.Updateable<unit_user_weight>()
|
||||
.SetColumnsIF(op == 0, it => it.maxWeight == it.maxWeight - weight)
|
||||
.SetColumnsIF(op == 1, it => it.maxWeight == it.maxWeight + weight)
|
||||
.SetColumnsIF(op == 0, it => it.maxWeight == it.maxWeight - sumWeight)
|
||||
.SetColumnsIF(op == 1, it => it.maxWeight == it.maxWeight + sumWeight)
|
||||
.Where(it => it.userId == userId).ExecuteCommandAsync() > 0;
|
||||
if (result)
|
||||
{
|
||||
if (op == 1)
|
||||
{
|
||||
await AddUserWeightLog(userId, goodsId, goodsName, weight, count);
|
||||
}
|
||||
else
|
||||
{
|
||||
await AddUserWeightLog(userId, goodsId, goodsName, (0 - weight), count);
|
||||
}
|
||||
|
||||
await ClearUserWeightInfo(userId);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<bool> AddUserWeightLog(string userId, int goodsId, string goodsName, int weight, int count)
|
||||
private async Task<bool> AddUserWeightLog(string userId, int goodsId, string goodsName, int weight, int count)
|
||||
{
|
||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_weight_log>();
|
||||
unit_user_weight_log log = new unit_user_weight_log();
|
||||
@@ -76,7 +99,14 @@ public class UnitUserWeight(ISqlSugarClient DbClient, IRedisCache redis) : IUnit
|
||||
return await db.Insertable(log).ExecuteCommandAsync() > 0;
|
||||
}
|
||||
|
||||
public async Task<bool> CheakUserWeight(string userId, int useWeight)
|
||||
public async Task<List<unit_user_weight_log>> GetUserWeightLog(string userId)
|
||||
{
|
||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_weight_log>();
|
||||
return await db.Queryable<unit_user_weight_log>().Where(it => it.userId == userId)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<bool> CheckUserWeight(string userId, int useWeight)
|
||||
{
|
||||
bool result = false;
|
||||
var weightInfo = await GetUserWeightInfo(userId);
|
||||
@@ -103,11 +133,13 @@ public class UnitUserWeight(ISqlSugarClient DbClient, IRedisCache redis) : IUnit
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
public async Task<int> GetUserShipMaxWeight(string userId)
|
||||
{
|
||||
var data = await GetUserShip(userId);
|
||||
return data.Sum(it => (int)it.weight);
|
||||
}
|
||||
|
||||
private async Task ClearUserShipData(string userId)
|
||||
{
|
||||
string key = string.Format(UserCache.BaseCacheKeys, "WeightData", "Ship");
|
||||
@@ -142,7 +174,7 @@ public class UnitUserWeight(ISqlSugarClient DbClient, IRedisCache redis) : IUnit
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<bool> DeleteUserShip(string usId,string userId)
|
||||
public async Task<bool> DeleteUserShip(string usId, string userId)
|
||||
{
|
||||
var db = DbClient.AsTenant().GetConnectionWithAttr<unit_user_ship>();
|
||||
bool result = await db.Deleteable<unit_user_ship>().Where(it => it.usId == usId).ExecuteCommandAsync() > 0;
|
||||
@@ -154,7 +186,7 @@ public class UnitUserWeight(ISqlSugarClient DbClient, IRedisCache redis) : IUnit
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<bool> AddUserShip(string userId,string name,int goodsId,int speed,int weight)
|
||||
public async Task<bool> AddUserShip(string userId, string name, int goodsId, int speed, int weight)
|
||||
{
|
||||
unit_user_ship ship = new unit_user_ship();
|
||||
ship.usId = StringAssist.NewGuid;
|
||||
|
||||
@@ -214,4 +214,72 @@ public class ChatController : ControllerBase
|
||||
return PoAction.Message("操作失败,请稍后尝试!");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 封禁ID
|
||||
/// </summary>
|
||||
/// <param name="chatId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<IPoAction> BlackUser(string chatId)
|
||||
{
|
||||
var chatInfo = await _chatService.GetChatInfo(chatId);
|
||||
if (chatInfo == null)
|
||||
{
|
||||
return PoAction.Message("发言不存在!");
|
||||
}
|
||||
|
||||
if (chatInfo.state != 1)
|
||||
{
|
||||
return PoAction.Message("发言不存在!");
|
||||
}
|
||||
|
||||
if (chatInfo.areaId != StateHelper.areaId)
|
||||
{
|
||||
return PoAction.Message("发言不存在!");
|
||||
}
|
||||
|
||||
if (chatInfo.userId == StateHelper.userId)
|
||||
{
|
||||
return PoAction.Message("不能封禁自己!");
|
||||
}
|
||||
|
||||
bool IsOp = false;
|
||||
string userId = StateHelper.userId;
|
||||
int chatRole = await _userService.GetUserConfigInfo(userId, nameof(UserEnum.ConfigCode.ChatRole));
|
||||
if ((chatInfo.code == nameof(GameChatEnum.Code.Public) || chatInfo.code == nameof(GameChatEnum.Code.Region)) &&
|
||||
chatRole > 0)
|
||||
{
|
||||
IsOp = true;
|
||||
}
|
||||
else if (chatRole > 1 && chatInfo.code == nameof(GameChatEnum.Code.Dress))
|
||||
{
|
||||
IsOp = true;
|
||||
}
|
||||
|
||||
if (IsOp == false)
|
||||
{
|
||||
return PoAction.Message("无权限!");
|
||||
}
|
||||
|
||||
var otConfig = await _userService.GetUserConfigInfo(chatInfo.userId);
|
||||
if (otConfig.chatRole < 0)
|
||||
{
|
||||
return PoAction.Message("Ta已被禁言,无需封禁!");
|
||||
}
|
||||
|
||||
if (otConfig.chatRole != 0)
|
||||
{
|
||||
return PoAction.Message("您无权封禁!");
|
||||
}
|
||||
|
||||
if (await _userService.UpdateUserConfigInfo(chatInfo.userId, nameof(UserEnum.ConfigCode.ChatRole), -1))
|
||||
{
|
||||
return PoAction.Ok(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return PoAction.Message("操作失败,请稍后尝试!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,7 @@ public class StoreController : ControllerBase
|
||||
//此处需要计算负重
|
||||
var needWeight = await GameTool.GetPropWeight(storeInfo.type, storeInfo.parameter);
|
||||
needWeight = needWeight * parms.count;
|
||||
if (await _weightService.CheakUserWeight(userId, needWeight) == false)
|
||||
if (await _weightService.CheckUserWeight(userId, needWeight) == false)
|
||||
{
|
||||
return PoAction.Message("负重不足!");
|
||||
}
|
||||
|
||||
71
Service/Application.Web/Controllers/Pub/EquController.cs
Normal file
71
Service/Application.Web/Controllers/Pub/EquController.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Application.Web.Controllers.Pub;
|
||||
|
||||
/// <summary>
|
||||
/// 装备接口
|
||||
/// </summary>
|
||||
[Route("[controller]/[action]")]
|
||||
[ApiController]
|
||||
[Authorize]
|
||||
public class EquController : ControllerBase
|
||||
{
|
||||
private readonly IGameEquService _equService;
|
||||
|
||||
public EquController(IGameEquService equService)
|
||||
{
|
||||
_equService = equService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取装备信息
|
||||
/// </summary>
|
||||
/// <param name="equId"></param>
|
||||
/// <param name="ueId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<IPoAction> GetEquInfo(int? equId, string? ueId)
|
||||
{
|
||||
game_equ equInfo = new game_equ();
|
||||
game_equ_suit suit = new game_equ_suit();
|
||||
unit_user_equ ueInfo = new unit_user_equ();
|
||||
UserModel user = new UserModel();
|
||||
if (equId != 0)
|
||||
{
|
||||
equInfo = await _equService.GetEquInfo((int)equId);
|
||||
if (equInfo == null)
|
||||
{
|
||||
return PoAction.Message("装备不存在!");
|
||||
}
|
||||
|
||||
if (equInfo.suitCode != "0" && !string.IsNullOrEmpty(equInfo.suitCode))
|
||||
{
|
||||
suit = await _equService.GetEuqSuitInfo(equInfo.suitCode);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ueInfo = await _equService.GetUserEquInfo(ueId);
|
||||
if (ueInfo == null)
|
||||
{
|
||||
return PoAction.Message("装备不存在!");
|
||||
}
|
||||
|
||||
equInfo = await _equService.GetEquInfo((int)ueInfo.equId);
|
||||
if (equInfo == null)
|
||||
{
|
||||
return PoAction.Message("装备不存在!");
|
||||
}
|
||||
|
||||
if (equInfo.suitCode != "0" && !string.IsNullOrEmpty(equInfo.suitCode))
|
||||
{
|
||||
suit = await _equService.GetEuqSuitInfo(equInfo.suitCode);
|
||||
}
|
||||
|
||||
user = await UserModelTool.GetUserView(ueInfo.owerId);
|
||||
}
|
||||
|
||||
return PoAction.Ok(new { equ = equInfo, suit, equData = ueInfo,user });
|
||||
}
|
||||
|
||||
}
|
||||
39
Service/Application.Web/Controllers/Pub/GoodsController.cs
Normal file
39
Service/Application.Web/Controllers/Pub/GoodsController.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Application.Web.Controllers.Pub;
|
||||
|
||||
/// <summary>
|
||||
/// 物品接口
|
||||
/// </summary>
|
||||
[Route("[controller]/[action]")]
|
||||
[ApiController]
|
||||
[Authorize]
|
||||
public class GoodsController : ControllerBase
|
||||
{
|
||||
private readonly IGameGoodsService _goodsService;
|
||||
|
||||
public GoodsController(IGameGoodsService goodsService)
|
||||
{
|
||||
_goodsService = goodsService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取物品信息
|
||||
/// </summary>
|
||||
/// <param name="goodsId">物品ID</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<IPoAction> GetGoodsInfo(int goodsId)
|
||||
{
|
||||
var goodsInfo = await _goodsService.GetGoodsInfo(goodsId);
|
||||
if (goodsInfo == null)
|
||||
{
|
||||
return PoAction.Message("物品不存在!");
|
||||
}
|
||||
|
||||
string userId = StateHelper.userId;
|
||||
int count = await _goodsService.GetUserGoodsCount(userId, goodsId);
|
||||
|
||||
return PoAction.Ok(new { goods = goodsInfo, count });
|
||||
}
|
||||
}
|
||||
@@ -115,6 +115,12 @@ public class MessageController : ControllerBase
|
||||
string userId = StateHelper.userId;
|
||||
int areaId = StateHelper.areaId;
|
||||
|
||||
var msgRole = await _userService.GetUserConfigInfo(userId, nameof(UserEnum.ConfigCode.MsgRole));
|
||||
if (msgRole != 1)
|
||||
{
|
||||
return PoAction.Message("消息权限已被封禁!");
|
||||
}
|
||||
|
||||
var toUser = await _userService.GetUserInfoByUserNo(parms.no.ToString());
|
||||
if (toUser == null)
|
||||
{
|
||||
|
||||
203
Service/Application.Web/Controllers/Pub/RecoverController.cs
Normal file
203
Service/Application.Web/Controllers/Pub/RecoverController.cs
Normal file
@@ -0,0 +1,203 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Application.Web.Controllers.Pub;
|
||||
|
||||
/// <summary>
|
||||
/// 恢复接口
|
||||
/// </summary>
|
||||
[Route("[controller]/[action]")]
|
||||
[ApiController]
|
||||
[Authorize]
|
||||
public class RecoverController : ControllerBase
|
||||
{
|
||||
private readonly IUnitUserAttrService _attrService;
|
||||
private readonly IGameMapService _mapService;
|
||||
|
||||
public RecoverController(IUnitUserAttrService attrService, IGameMapService mapService)
|
||||
{
|
||||
_attrService = attrService;
|
||||
_mapService = mapService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 恢复体力
|
||||
/// </summary>
|
||||
/// <param name="npcId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<IPoAction> RecoverBlood(int npcId)
|
||||
{
|
||||
string userId = StateHelper.userId;
|
||||
|
||||
#region NPC验证
|
||||
|
||||
var npcInfo = await _mapService.GetNpcInfo(npcId);
|
||||
if (npcInfo == null)
|
||||
{
|
||||
return PoAction.Message("Npc不存在!");
|
||||
}
|
||||
|
||||
if (npcInfo.status != 1)
|
||||
{
|
||||
return PoAction.Message("Npc不存在!");
|
||||
}
|
||||
|
||||
if (!npcInfo.bus.Any(it => it.code == nameof(GameEnum.NpcBusCode.RetBlood)))
|
||||
{
|
||||
return PoAction.Message("业务不可用!");
|
||||
}
|
||||
|
||||
var onMap = await _mapService.GetUserOnMapId(userId);
|
||||
if (npcInfo.mapId != onMap)
|
||||
{
|
||||
return PoAction.Message("Npc不存在!");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
var userAttr = await _attrService.GetUserAttrModel(userId);
|
||||
if (userAttr.blood >= userAttr.upBlood)
|
||||
{
|
||||
return PoAction.Message("体力满满,无需恢复!");
|
||||
}
|
||||
|
||||
bool result = await _attrService.UpdateUserBlood(userId, 2, userAttr.upBlood, true);
|
||||
if (result)
|
||||
{
|
||||
return PoAction.Ok(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return PoAction.Message("恢复失败,请稍后尝试!");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 恢复士气
|
||||
/// </summary>
|
||||
/// <param name="npcId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<IPoAction> RecoverMorale(int npcId)
|
||||
{
|
||||
string userId = StateHelper.userId;
|
||||
|
||||
#region NPC验证
|
||||
|
||||
var npcInfo = await _mapService.GetNpcInfo(npcId);
|
||||
if (npcInfo == null)
|
||||
{
|
||||
return PoAction.Message("Npc不存在!");
|
||||
}
|
||||
|
||||
if (npcInfo.status != 1)
|
||||
{
|
||||
return PoAction.Message("Npc不存在!");
|
||||
}
|
||||
|
||||
if (!npcInfo.bus.Any(it => it.code == nameof(GameEnum.NpcBusCode.RetMorale)))
|
||||
{
|
||||
return PoAction.Message("业务不可用!");
|
||||
}
|
||||
|
||||
var onMap = await _mapService.GetUserOnMapId(userId);
|
||||
if (npcInfo.mapId != onMap)
|
||||
{
|
||||
return PoAction.Message("Npc不存在!");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
if (await _attrService.CheackRecoverMorale(userId))
|
||||
{
|
||||
return PoAction.Message("今天已恢复过士气啦!");
|
||||
}
|
||||
|
||||
var userAttr = await _attrService.GetUserAttrModel(userId);
|
||||
if (userAttr.morale >= userAttr.upMorale)
|
||||
{
|
||||
return PoAction.Message("士气满满,无需恢复!");
|
||||
}
|
||||
|
||||
bool result = await _attrService.UpdateUserMorale(userId, 2, userAttr.upMorale);
|
||||
if (result)
|
||||
{
|
||||
await _attrService.LockRecoverMorale(userId);
|
||||
return PoAction.Ok(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return PoAction.Message("恢复失败,请稍后尝试!");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取个人活力
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<IPoAction> GetUserVigour()
|
||||
{
|
||||
string userId = StateHelper.userId;
|
||||
var data = await _attrService.GetUserVigourInfo(userId);
|
||||
return PoAction.Ok(data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 恢复活力
|
||||
/// </summary>
|
||||
/// <param name="npcId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<IPoAction> RecoverVigour(int npcId)
|
||||
{
|
||||
string userId = StateHelper.userId;
|
||||
|
||||
#region NPC验证
|
||||
|
||||
var npcInfo = await _mapService.GetNpcInfo(npcId);
|
||||
if (npcInfo == null)
|
||||
{
|
||||
return PoAction.Message("Npc不存在!");
|
||||
}
|
||||
|
||||
if (npcInfo.status != 1)
|
||||
{
|
||||
return PoAction.Message("Npc不存在!");
|
||||
}
|
||||
|
||||
if (!npcInfo.bus.Any(it => it.code == nameof(GameEnum.NpcBusCode.RetVigour)))
|
||||
{
|
||||
return PoAction.Message("业务不可用!");
|
||||
}
|
||||
|
||||
var onMap = await _mapService.GetUserOnMapId(userId);
|
||||
if (npcInfo.mapId != onMap)
|
||||
{
|
||||
return PoAction.Message("Npc不存在!");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
var data = await _attrService.GetUserVigourInfo(userId);
|
||||
string time = TimeAssist.GetDateTimeYMDString(0);
|
||||
if (data.upTime == time)
|
||||
{
|
||||
return PoAction.Message("今天已恢复过活力啦!");
|
||||
}
|
||||
if (data.vitality >= data.upVitality)
|
||||
{
|
||||
return PoAction.Message("活力满满,无需恢复!");
|
||||
}
|
||||
|
||||
bool result = await _attrService.UpdateUserVigour(userId, 2, (long)data.upVitality,time);
|
||||
if (result)
|
||||
{
|
||||
return PoAction.Ok(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return PoAction.Message("恢复失败,请稍后尝试!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,11 +13,15 @@ public class SettingController : ControllerBase
|
||||
{
|
||||
private readonly IUnitUserService _userService;
|
||||
private readonly IGameGoodsService _goodsService;
|
||||
private readonly IGameEquService _equService;
|
||||
private readonly IUnitUserWeight _weightService;
|
||||
|
||||
public SettingController(IUnitUserService userService,IGameGoodsService goodsService)
|
||||
public SettingController(IUnitUserService userService,IGameGoodsService goodsService,IGameEquService equService,IUnitUserWeight weightService)
|
||||
{
|
||||
_userService = userService;
|
||||
_goodsService = goodsService;
|
||||
_equService = equService;
|
||||
_weightService = weightService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -190,4 +194,45 @@ public class SettingController : ControllerBase
|
||||
return PoAction.Message("暂无法设置!");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 刷新/重置设置
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<IPoAction> RefreshSetting(int type)
|
||||
{
|
||||
string userId = StateHelper.userId;
|
||||
if (type == 0)//刷新负重
|
||||
{
|
||||
var equWeight = await _equService.GetUserEquWeightSum(userId);
|
||||
var goodsWeight = await _goodsService.GetUserGoodWeightSum(userId,0);
|
||||
int onWeight = equWeight + goodsWeight;//当前总占用负重
|
||||
var weightLog = await _weightService.GetUserWeightLog(userId);
|
||||
int maxWeight = weightLog.Sum(it => (int)it.sum);
|
||||
var weightInfo = await _weightService.GetUserWeightInfo(userId);
|
||||
weightInfo.onWeight = onWeight;
|
||||
weightInfo.maxWeight = maxWeight;
|
||||
|
||||
var shipWeight = await _goodsService.GetUserGoodWeightSum(userId,1);
|
||||
weightInfo.shipOnWeight = shipWeight;
|
||||
if (await _weightService.UpdateUserWeight(weightInfo))
|
||||
{
|
||||
return PoAction.Ok(true,"负重数据已刷新成功!");
|
||||
}
|
||||
else
|
||||
{
|
||||
return PoAction.Message("负重刷新失败,请稍后尝试!");
|
||||
}
|
||||
}
|
||||
else if (type == 1)//刷新图标
|
||||
{
|
||||
return PoAction.Ok(true, "图标刷新成功!");
|
||||
}
|
||||
else
|
||||
{
|
||||
return PoAction.Message("无效的操作!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,6 +84,40 @@ public class UserController : ControllerBase
|
||||
var model = await UserModelTool.GetUserView(userId);
|
||||
return PoAction.Ok(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取基础属性信息
|
||||
/// </summary>
|
||||
/// <param name="no"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<IPoAction> GetUserBaseAttrInfo(string? no)
|
||||
{
|
||||
string userId = StateHelper.userId;
|
||||
if (!string.IsNullOrEmpty(no))
|
||||
{
|
||||
var userInfo = await _userService.GetUserInfoByUserNo(no); //基础资料
|
||||
if (userInfo == null)
|
||||
{
|
||||
return PoAction.Message("玩家不存在!", 102);
|
||||
}
|
||||
|
||||
if (userInfo.userId == userId)
|
||||
{
|
||||
return PoAction.Message("用户本身!", 101);
|
||||
}
|
||||
|
||||
if (userInfo.areaId != StateHelper.areaId)
|
||||
{
|
||||
return PoAction.Message("玩家不存在!", 102);
|
||||
}
|
||||
|
||||
userId = userInfo.userId;
|
||||
}
|
||||
|
||||
var model = await _attrService.GetUserAttrModel(userId);
|
||||
return PoAction.Ok(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户资料
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</span>
|
||||
</span>
|
||||
<span v-if="CheckRole(item.chat.code)">
|
||||
[<Abutton @click="DelChat(item.chat.chatId)">删除</Abutton>]
|
||||
[<Abutton @click="DelChat(item.chat.chatId)">删除</Abutton>.<Abutton @click="BlackChat(item.chat.chatId)">封禁</Abutton>]
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -68,10 +68,13 @@ const CheckRole = (type: string): boolean => {
|
||||
}
|
||||
|
||||
// 1. 声明要触发的事件
|
||||
const emit = defineEmits(['delChat'])
|
||||
const emit = defineEmits(['delChat','blackChat'])
|
||||
|
||||
const DelChat = async (chatId: string) => {
|
||||
emit('delChat', { chatId: chatId });
|
||||
}
|
||||
const BlackChat = async (chatId: string) => {
|
||||
emit('blackChat', { chatId: chatId });
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="common">
|
||||
<Abar href="/user">状态</Abar>.
|
||||
<Abar href="/bag">物品</Abar>.
|
||||
<Abar href="/user/bag">物品</Abar>.
|
||||
<Abar href="/chat">聊天</Abar>
|
||||
</div>
|
||||
<div class="common">
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<template></template>
|
||||
58
Web/src/pages/business/retBlood.vue
Normal file
58
Web/src/pages/business/retBlood.vue
Normal file
@@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<div class="content">
|
||||
【恢复体力】
|
||||
</div>
|
||||
<div class="content">
|
||||
当前体力:{{ data.blood }}/{{ data.upBlood }}
|
||||
</div>
|
||||
<div class="content" v-if="data.blood < data.upBlood">
|
||||
[<Abutton @click="Recover">立即恢复</Abutton>]
|
||||
</div>
|
||||
<div class="content" v-else>
|
||||
体力满满,无需恢复!
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
definePageMeta({
|
||||
layout: layout.default,
|
||||
middleware: 'page-loading'
|
||||
})
|
||||
const data = ref<any>({});
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await BindData();
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
const BindData = async (): Promise<void> => {
|
||||
let result = await UserService.GetUserBaseAttrInfo("")
|
||||
if (result.code == 0) {
|
||||
data.value = result.data;
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
};
|
||||
|
||||
const Recover = async (): Promise<void> => {
|
||||
let npcId = LocalStorageHelper.GetOnNpc();
|
||||
MessageExtend.LoadingToast("恢复中...");
|
||||
let result = await RecoverService.RecoverBlood(Number(npcId));
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
MessageExtend.Notify("恢复成功!", "success");
|
||||
await BindData();
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
@@ -1 +1,58 @@
|
||||
<template></template>
|
||||
<template>
|
||||
<div class="content">
|
||||
【恢复士气】
|
||||
</div>
|
||||
<div class="content">
|
||||
当前士气:{{ data.morale }}/{{ data.upMorale }}
|
||||
</div>
|
||||
<div class="content" v-if="data.morale < data.upMorale">
|
||||
[<Abutton @click="Recover">立即恢复</Abutton>]
|
||||
</div>
|
||||
<div class="content" v-else>
|
||||
士气满满,无需恢复!
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
definePageMeta({
|
||||
layout: layout.default,
|
||||
middleware: 'page-loading'
|
||||
})
|
||||
const data = ref<any>({});
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await BindData();
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
const BindData = async (): Promise<void> => {
|
||||
let result = await UserService.GetUserBaseAttrInfo("")
|
||||
if (result.code == 0) {
|
||||
data.value = result.data;
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
};
|
||||
|
||||
const Recover = async (): Promise<void> => {
|
||||
let npcId = LocalStorageHelper.GetOnNpc();
|
||||
MessageExtend.LoadingToast("恢复中...");
|
||||
let result = await RecoverService.RecoverMorale(Number(npcId));
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
MessageExtend.Notify("恢复成功!", "success");
|
||||
await BindData();
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
58
Web/src/pages/business/retVigour.vue
Normal file
58
Web/src/pages/business/retVigour.vue
Normal file
@@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<div class="content">
|
||||
【恢复活力】
|
||||
</div>
|
||||
<div class="content">
|
||||
当前活力:{{ data.vitality }}/{{ data.upVitality }}
|
||||
</div>
|
||||
<div class="content" v-if="data.vitality < data.upVitality">
|
||||
[<Abutton @click="Recover">立即恢复</Abutton>]
|
||||
</div>
|
||||
<div class="content" v-else>
|
||||
活力满满,无需恢复!
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
definePageMeta({
|
||||
layout: layout.default,
|
||||
middleware: 'page-loading'
|
||||
})
|
||||
const data = ref<any>({});
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await BindData();
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
const BindData = async (): Promise<void> => {
|
||||
let result = await RecoverService.GetUserVigour()
|
||||
if (result.code == 0) {
|
||||
data.value = result.data;
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
};
|
||||
|
||||
const Recover = async (): Promise<void> => {
|
||||
let npcId = LocalStorageHelper.GetOnNpc();
|
||||
MessageExtend.LoadingToast("恢复中...");
|
||||
let result = await RecoverService.RecoverVigour(Number(npcId));
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
MessageExtend.Notify("恢复成功!", "success");
|
||||
await BindData();
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
@@ -12,7 +12,7 @@
|
||||
<Acheak @click="ChangeChat('5')" :on-value="type" on-cheak="5">系统</Acheak>
|
||||
</div>
|
||||
<div class="content">
|
||||
<GameChat :data="data" :show-time="1" :role="chatRole" @delChat="DelChat"></GameChat>
|
||||
<GameChat :data="data" :show-time="1" :role="chatRole" @delChat="DelChat" @blackChat="BlackChat"></GameChat>
|
||||
<span v-if="data.length == 0">暂无发言.</span>
|
||||
</div>
|
||||
<div class="content">
|
||||
@@ -131,14 +131,29 @@ const ChangeChat = async (typeid: string): Promise<void> => {
|
||||
|
||||
//删除记录
|
||||
const DelChat = async (data: any) => {
|
||||
MessageExtend.ShowConfirmDialogAsyc("频道管理", `您确定要删除该发言吗?`, async () => {
|
||||
let result = await ChatService.DeleteChat(data.chatId);
|
||||
MessageExtend.ShowConfirmDialogAsyc("频道管理", `您确定要删除该发言吗?`, async () => {
|
||||
let result = await ChatService.DeleteChat(data.chatId);
|
||||
if (result.code == 0) {
|
||||
await BindData();
|
||||
MessageExtend.Notify("删除成功!", "success");
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("删除操作", result.msg);
|
||||
MessageExtend.Notify(result.msg, "danger");
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
/**封禁 */
|
||||
const BlackChat = async (data: any) => {
|
||||
MessageExtend.ShowConfirmDialogAsyc("频道管理", `您确定要封禁Ta吗?`, async () => {
|
||||
let result = await ChatService.BlackUser(data.chatId);
|
||||
if (result.code == 0) {
|
||||
await BindData();
|
||||
MessageExtend.Notify("封禁成功!", "success");
|
||||
}
|
||||
else {
|
||||
MessageExtend.Notify(result.msg, "danger");
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -1 +1,189 @@
|
||||
<template></template>
|
||||
<template>
|
||||
<div class="content">
|
||||
<div class="common" v-if="equInfo.img != ''">
|
||||
<Aimage :url="equInfo.img" _alt="."></Aimage>
|
||||
</div>
|
||||
<div class="common" v-if="ueId == ''">
|
||||
名称:{{ equInfo.equName }}<br>
|
||||
部位:{{ EquTool.GetEquPlaceName(equInfo.code) }}<br>
|
||||
等级:{{ equInfo.lev }}<br>
|
||||
交易:{{ equInfo.isDeal == 1 ? "可交易" : "不可交易" }}<br>
|
||||
赠送:{{ equInfo.isGive == 1 ? "可赠送" : "不可赠送" }}<br>
|
||||
获取途径:{{ equInfo.source }}<br>
|
||||
说明:{{ equInfo.remark }}<br>
|
||||
<span v-if="equInfo.sex != 'Default'">
|
||||
性别:{{ equInfo.sex == 'Boy' ? "男" : "女" }}<br>
|
||||
</span>
|
||||
强化:{{ equInfo.isIntensify == 1 ? "可强化" : "不可强化" }}<br>
|
||||
负重:{{ equInfo.weight }}<br>
|
||||
<div v-if="equInfo.isAppr == 0" style="margin:0px;">
|
||||
<span v-if="Number(equInfo.blood) > 0">
|
||||
体力:{{ equInfo.blood }}<br>
|
||||
</span>
|
||||
<span v-if="Number(equInfo.minAtk) > 0">
|
||||
攻击:{{ equInfo.minAtk }}-{{ equInfo.maxAtk }}<br>
|
||||
</span>
|
||||
<span v-if="Number(equInfo.defense) > 0">
|
||||
防御:{{ equInfo.defense }}<br>
|
||||
</span>
|
||||
<span v-if="Number(equInfo.agility) > 0">
|
||||
敏捷:{{ equInfo.agility }}<br>
|
||||
</span>
|
||||
<span v-if="Number(equInfo.morale) > 0">
|
||||
士气:{{ equInfo.morale }}<br>
|
||||
</span>
|
||||
</div>
|
||||
耐久:{{ equInfo.durability }}<br>
|
||||
<span v-if="equInfo.suitCode != '0' && equInfo.suitCode != ''">
|
||||
套装:<Abar href="/">{{ suitInfo.suitName }}</Abar><br>
|
||||
</span>
|
||||
特性:{{ EquTool.GetEquAttrName(equInfo.equAttr, 0) }}<br>
|
||||
<span v-if="equInfo.holeCount > 0">
|
||||
镶嵌:{{ equInfo.holeCount }}<br>
|
||||
</span>
|
||||
<span v-if="equInfo.useTime > 0">
|
||||
有效期:{{ equInfo.useTime }}天
|
||||
</span>
|
||||
<div v-if="equInfo.isAppr == 1">
|
||||
(*该装备需要鉴定)
|
||||
</div>
|
||||
</div>
|
||||
<div class="common" v-if="ueId != ''">
|
||||
名称:{{ equData.equName }}<br>
|
||||
<span v-if="equData.equName != equData.unitEquName">
|
||||
装备名称:{{ equData.unitEquName }}<br>
|
||||
</span>
|
||||
部位:{{ EquTool.GetEquPlaceName(equData.code) }}<br>
|
||||
等级:{{ equData.lev }}<br>
|
||||
品阶:{{ EquTool.EquStartTips(equData.start) }}<br>
|
||||
<span v-if="equData.quality > 0">
|
||||
品质:<Abar href="">equData.qualityName</Abar><br>
|
||||
</span>
|
||||
交易:{{ equData.isDeal == 1 ? "可交易" : "不可交易" }}<br>
|
||||
赠送:{{ equData.isGive == 1 ? "可赠送" : "不可赠送" }}<br>
|
||||
获取途径:{{ equInfo.source }}<br>
|
||||
说明:{{ equInfo.remark }}<br>
|
||||
签名:{{ equData.sign }}<br>
|
||||
获得人:<GameUser :data="owUser" :show-icon="0" :show-area="0"></GameUser><br>
|
||||
<span v-if="equData.sex != 'Default'">
|
||||
性别:{{ equData.sex == 'Boy' ? "男" : "女" }}<br>
|
||||
</span>
|
||||
强化:{{ equData.isIntensify == 1 ? "可强化" : "不可强化" }}<br>
|
||||
<span v-if="equData.intensifyLev > 0">
|
||||
强化等级:{{ equData.intensifyLev }}<br>
|
||||
</span>
|
||||
<span v-if="equAwaken.length > 0">
|
||||
<Abar href="">装备特性:{{ equAwaken[0].name }}({{ equAwaken[0].lev }}级)</Abar><br>
|
||||
</span>
|
||||
附魔:{{ equMent.name }}<br>
|
||||
负重:{{ equData.weight }}<br>
|
||||
<div v-if="equData.isAppr == 1" style="margin:0px;">
|
||||
<span v-if="Number(equData.blood) > 0">
|
||||
体力:{{ equData.blood }}<br>
|
||||
</span>
|
||||
<span v-if="Number(equData.minAtk) > 0">
|
||||
攻击:{{ equData.minAtk }}-{{ equData.maxAtk }}<br>
|
||||
</span>
|
||||
<span v-if="Number(equData.defense) > 0">
|
||||
防御:{{ equData.defense }}<br>
|
||||
</span>
|
||||
<span v-if="Number(equData.agility) > 0">
|
||||
敏捷:{{ equData.agility }}<br>
|
||||
</span>
|
||||
<span v-if="Number(equData.morale) > 0">
|
||||
士气:{{ equData.morale }}<br>
|
||||
</span>
|
||||
</div>
|
||||
耐久:{{ equData.maxdurability }}/{{ equData.durability }}<br>
|
||||
<span v-if="equData.suitCode != '0' && equData.suitCode != ''">
|
||||
套装:<Abar href="/">{{ suitInfo.suitName }}</Abar><br>
|
||||
</span>
|
||||
特性:{{ EquTool.GetEquAttrName(equData.equAttr, 0) }}<br>
|
||||
<span v-if="equData.holeCount > 0">
|
||||
镶嵌:({{ gemMent.length }}/{{ equData.holeCount }})<br>
|
||||
</span>
|
||||
<span v-if="equData.opTime == 0">
|
||||
<span v-if="equInfo.useTime > 0">
|
||||
有效期:{{ equInfo.useTime }}天
|
||||
</span>
|
||||
</span>
|
||||
<span v-else>
|
||||
<span v-if="equInfo.useTime > 0">
|
||||
到期时间:{{ TimeExtend.Format(equData.useEndTime, "yyyy-MM-dd") }}
|
||||
</span>
|
||||
</span>
|
||||
<div v-if="equData.isAppr == 0">
|
||||
(*该装备需要鉴定)
|
||||
</div>
|
||||
<div class="common" v-if="myUserId == equData.userId && equData.isAppr == 1">
|
||||
<span>
|
||||
◈<Abutton>穿戴装备</Abutton><br>
|
||||
</span>
|
||||
<span>
|
||||
◈<Abutton>洗练</Abutton><br>
|
||||
</span>
|
||||
<span>
|
||||
◈<Abutton>觉醒</Abutton><br>
|
||||
</span>
|
||||
<span>
|
||||
◈<Abutton>升星</Abutton><br>
|
||||
</span>
|
||||
<span>
|
||||
◈<Abutton>绑定</Abutton><br>
|
||||
</span>
|
||||
<span>
|
||||
◈<Abar href="">寄售</Abar><br>
|
||||
</span>
|
||||
<span>
|
||||
◈<Abutton>个性化</Abutton><br>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
definePageMeta({
|
||||
layout: layout.default,
|
||||
middleware: 'page-loading'
|
||||
})
|
||||
const equData = ref<any>({});
|
||||
const equInfo = ref<any>({});
|
||||
const suitInfo = ref<any>({});
|
||||
const owUser = ref<any>({});
|
||||
const equAwaken = ref<Array<any>>([]);
|
||||
const equMent = ref<any>({});
|
||||
const gemMent = ref<Array<any>>([]);
|
||||
const myUserId = StateHelper.userId;
|
||||
let ueId = PageExtend.QueryString("ue");
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await BindData();
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
const BindData = async (): Promise<void> => {
|
||||
let equId = PageExtend.QueryString("id");
|
||||
|
||||
let result = await EquService.GetEquInfo(Number(equId), ueId);
|
||||
if (result.code == 0) {
|
||||
equData.value = result.data.equData;
|
||||
equInfo.value = result.data.equ;
|
||||
suitInfo.value = result.data.suit;
|
||||
owUser.value = result.data.user;
|
||||
equAwaken.value = result.data.equData.equAwaken;
|
||||
equMent.value = result.data.equData.equMent;
|
||||
gemMent.value = result.data.equData.gemMent;
|
||||
console.log(result);
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
@@ -1 +1,56 @@
|
||||
<template></template>
|
||||
<template>
|
||||
<div class="content">
|
||||
<div class="common" v-if="data.img != ''">
|
||||
<Aimage :url="data.img" _alt="."></Aimage>
|
||||
</div>
|
||||
名称:{{ data.goodsName }} <Abar href="" v-if="count > 0">寄售</Abar><br>
|
||||
<div class="common" v-if="data.code == 'Card'">
|
||||
等级:{{ data.lev }}星
|
||||
</div>
|
||||
获取途径:{{ data.source }}<br>
|
||||
说明:{{ data.tips }}<br>
|
||||
交易:{{ data.isDeal == 1 ? "可交易" : "不可交易" }}<br>
|
||||
赠送:{{ data.isGive == 1 ? "可赠送" : "不可赠送" }}<br>
|
||||
负重:{{ data.weight }}<br>
|
||||
</div>
|
||||
<div class="content" v-if="count > 0">
|
||||
<div class="common">
|
||||
数量:{{ count }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
definePageMeta({
|
||||
layout: layout.default,
|
||||
middleware: 'page-loading'
|
||||
})
|
||||
const data = ref<any>({});
|
||||
const count = ref(0);
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await BindData();
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
const BindData = async (): Promise<void> => {
|
||||
let goodsId = PageExtend.QueryString("id");
|
||||
let result = await GoodsService.GetGoodsInfo(Number(goodsId));
|
||||
if (result.code == 0) {
|
||||
data.value = result.data.goods;
|
||||
count.value = result.data.count;
|
||||
console.log(result);
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("提示", result.msg);
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
@@ -49,7 +49,7 @@
|
||||
<div class="common" v-if="type == '0'">
|
||||
<div class="item" v-for="(item, index) in data" :key="index">
|
||||
{{ PageExtend.GetPageIndex(currentPage, 10, index + 1) }}.
|
||||
<Abar :href='"/prop/goods?ue=" + item.ueId'>{{ item.equName }}({{ item.lev }}级)</Abar>
|
||||
<Abar :href='"/prop/equ?ue=" + item.ueId'>{{ item.equName }}({{ item.lev }}级)</Abar>
|
||||
<span v-if="item.isOn == 1">(穿)</span>
|
||||
<span v-if="item.isAppr == 0">(未鉴定)</span>
|
||||
<span v-if="item.useEndTime < onTime" style="color: red;">(过期)</span>
|
||||
@@ -14,16 +14,40 @@
|
||||
</div>
|
||||
<div class="item border-btm ">
|
||||
➣<Abar href="/user/setting/drug">急救箱设置</Abar>
|
||||
</div>
|
||||
<div class="item border-btm ">
|
||||
➣<Abutton>重置负重</Abutton><span style="font-size: 14px;;">(*重置负重数据)</span>
|
||||
</div>
|
||||
<div class="item border-btm ">
|
||||
➣<Abutton>刷新图标</Abutton><span style="font-size: 14px;;">(*更新图标数据)</span>
|
||||
➣<Abutton @click="RefreshSetting(0)">重置负重</Abutton><span style="font-size: 14px;;">(*重置负重数据)</span>
|
||||
</div>
|
||||
<div class="item border-btm ">
|
||||
➣<Abutton @click="RefreshSetting(1)">刷新图标</Abutton><span style="font-size: 14px;;">(*更新图标数据)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
definePageMeta({
|
||||
layout: layout.default,
|
||||
middleware: 'page-loading'
|
||||
})
|
||||
const role = ref(0);
|
||||
onMounted(async () => {
|
||||
try {
|
||||
|
||||
}
|
||||
finally {
|
||||
PageLoading.Close();
|
||||
}
|
||||
})
|
||||
|
||||
const RefreshSetting = async (_type: number) => {
|
||||
MessageExtend.LoadingToast("操作中...");
|
||||
let result = await SettingService.RefreshSetting(_type);
|
||||
MessageExtend.LoadingClose();
|
||||
if (result.code == 0) {
|
||||
MessageExtend.Notify(result.msg, "success");
|
||||
}
|
||||
else {
|
||||
MessageExtend.ShowDialog("操作提示", result.msg);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="content">
|
||||
<Abar :href='"/message/read?id=" + userData.userNo'>私聊</Abar>. <Abar :href='"/user/gift/give?no="+userData.userNo'>送礼物</Abar>. <Abar href="/user/interact/dou">逗一下</Abar><br />
|
||||
<Abar :href='"/user/message/read?id=" + userData.userNo'>私聊</Abar>. <Abar :href='"/user/gift/give?no="+userData.userNo'>送礼物</Abar>. <Abar href="/user/interact/dou">逗一下</Abar><br />
|
||||
<Abar href="/user/master/add">拜师</Abar>. <Abar :href='"/trade/user?no="+userData.userNo'>交易</Abar>. <Abar href="/bag/give">送道具</Abar><br>
|
||||
<Abutton @click="FriendHandle">{{ isFriend ? "删除好友" : "加好友" }}</Abutton>
|
||||
<span v-if="isEnemy == false">
|
||||
|
||||
@@ -16,6 +16,7 @@ export class ChatService {
|
||||
static async SendChat(type: number, sign: string) {
|
||||
return await ApiService.Request("post", "/Chat/Chat/SendChat", { type, sign });
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除聊天记录
|
||||
* GET /Chat/Chat/DeleteChat
|
||||
@@ -23,4 +24,12 @@ export class ChatService {
|
||||
static async DeleteChat(chatId: string) {
|
||||
return await ApiService.Request("get", "/Chat/Chat/DeleteChat", { chatId });
|
||||
}
|
||||
|
||||
/**
|
||||
* 封禁ID
|
||||
* GET /Chat/Chat/BlackUser
|
||||
*/
|
||||
static async BlackUser(chatId: string) {
|
||||
return await ApiService.Request("get", "/Chat/Chat/BlackUser", { chatId });
|
||||
}
|
||||
}
|
||||
9
Web/src/services/Index/EquService.ts
Normal file
9
Web/src/services/Index/EquService.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export class EquService {
|
||||
/**
|
||||
* 获取装备信息
|
||||
* GET /Equ/GetEquInfo
|
||||
*/
|
||||
static async GetEquInfo(equId: number, ueId: string) {
|
||||
return await ApiService.Request("get", "/Equ/GetEquInfo", { equId, ueId });
|
||||
}
|
||||
}
|
||||
10
Web/src/services/Index/GoodsService.ts
Normal file
10
Web/src/services/Index/GoodsService.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export class GoodsService {
|
||||
/**
|
||||
* 获取物品信息
|
||||
* GET /Goods/GetGoodsInfo
|
||||
* @param goodsId 物品ID
|
||||
*/
|
||||
static async GetGoodsInfo(goodsId: number) {
|
||||
return await ApiService.Request("get", "/Goods/GetGoodsInfo", { goodsId });
|
||||
}
|
||||
}
|
||||
33
Web/src/services/Index/RecoverService.ts
Normal file
33
Web/src/services/Index/RecoverService.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
export class RecoverService {
|
||||
/**
|
||||
* 恢复体力
|
||||
* GET /Recover/RecoverBlood
|
||||
*/
|
||||
static async RecoverBlood(npcId: number) {
|
||||
return await ApiService.Request("get", "/Recover/RecoverBlood", { npcId });
|
||||
}
|
||||
|
||||
/**
|
||||
* 恢复士气
|
||||
* GET /Recover/RecoverMorale
|
||||
*/
|
||||
static async RecoverMorale(npcId: number) {
|
||||
return await ApiService.Request("get", "/Recover/RecoverMorale", { npcId });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取个人活力
|
||||
* GET /Recover/GetUserVigour
|
||||
*/
|
||||
static async GetUserVigour() {
|
||||
return await ApiService.Request("get", "/Recover/GetUserVigour");
|
||||
}
|
||||
|
||||
/**
|
||||
* 恢复活力
|
||||
* GET /Recover/RecoverVigour
|
||||
*/
|
||||
static async RecoverVigour(npcId: number) {
|
||||
return await ApiService.Request("get", "/Recover/RecoverVigour", { npcId });
|
||||
}
|
||||
}
|
||||
@@ -14,4 +14,12 @@ export class SettingService {
|
||||
static async UpdateUserConfig(type: number, state: number) {
|
||||
return await ApiService.Request("get", "/User/Setting/UpdateUserConfig", { type, state });
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新/重置设置
|
||||
* GET /User/Setting/RefreshSetting
|
||||
*/
|
||||
static async RefreshSetting(type: number) {
|
||||
return await ApiService.Request("get", "/User/Setting/RefreshSetting", { type });
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,14 @@ export class UserService {
|
||||
return await ApiService.Request("get", "/User/User/GetUserBaseInfo", { no });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取基础属性信息
|
||||
* GET /User/User/GetUserBaseAttrInfo
|
||||
*/
|
||||
static async GetUserBaseAttrInfo(no: string) {
|
||||
return await ApiService.Request("get", "/User/User/GetUserBaseAttrInfo", { no });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户资料
|
||||
* GET /User/User/GetHomeInfo
|
||||
@@ -33,10 +41,10 @@ export class UserService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 变更性别
|
||||
* POST /User/User/UpdateUserSex
|
||||
* @param sex body
|
||||
*/
|
||||
* 变更性别
|
||||
* POST /User/User/UpdateUserSex
|
||||
* @param sex body
|
||||
*/
|
||||
static async UpdateUserSex(sex: string) {
|
||||
return await ApiService.Request("post", "/User/User/UpdateUserSex", { sex });
|
||||
}
|
||||
|
||||
85
Web/src/utility/EquTool.ts
Normal file
85
Web/src/utility/EquTool.ts
Normal file
@@ -0,0 +1,85 @@
|
||||
export class EquTool {
|
||||
public static GetEquPlaceName(code: string): string {
|
||||
let result = "";
|
||||
switch (code) {
|
||||
case "Mouth":
|
||||
result = "嘴饰";
|
||||
break;
|
||||
|
||||
case "Hold":
|
||||
result = "手持";
|
||||
break;
|
||||
|
||||
case "Vice":
|
||||
result = "副手";
|
||||
break;
|
||||
|
||||
case "Head":
|
||||
result = "头戴";
|
||||
break;
|
||||
|
||||
case "Wear":
|
||||
result = "身穿";
|
||||
break;
|
||||
|
||||
case "Waist":
|
||||
result = "腰戴";
|
||||
break;
|
||||
|
||||
case "Foot":
|
||||
result = "脚穿";
|
||||
break;
|
||||
|
||||
case "Ornaments":
|
||||
result = "佩戴";
|
||||
break;
|
||||
|
||||
case "Fashion":
|
||||
result = "时装";
|
||||
break;
|
||||
|
||||
case "Wing":
|
||||
result = "羽翼";
|
||||
break;
|
||||
|
||||
case "Decorate":
|
||||
result = "装饰";
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static GetEquAttrName(equAttr: Array<any>, type: number): string {
|
||||
if (!equAttr) {
|
||||
equAttr = [];
|
||||
}
|
||||
let result = "";
|
||||
equAttr.forEach(item => {
|
||||
result += `${item.tip}${type == 1 ? "<br />" : ","}`;
|
||||
});
|
||||
|
||||
result = StringExtend.trimEnd(result, ',');
|
||||
return result;
|
||||
}
|
||||
public static EquStartTips(start: number): string {
|
||||
if (!start) {
|
||||
start = 0;
|
||||
}
|
||||
let result = "";
|
||||
if (start == 0) {
|
||||
result = "✩(0星)";
|
||||
}
|
||||
else {
|
||||
let s = start / 2;
|
||||
for (let i = 0; i < s; i++) {
|
||||
result += "★";
|
||||
}
|
||||
if (start % 2 != 0) {
|
||||
result += "✩";
|
||||
}
|
||||
result += `(${start}星)`;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user