diff --git a/Service/Application.Domain.Entity/model/RandomModel.cs b/Service/Application.Domain.Entity/model/RandomModel.cs index 28f1277..8c3983f 100644 --- a/Service/Application.Domain.Entity/model/RandomModel.cs +++ b/Service/Application.Domain.Entity/model/RandomModel.cs @@ -22,6 +22,7 @@ public class RandomData public string code { get; set; } public string name { get; set; } public string par { get; set; } - public long count { get; set; } + public int minCount { get; set; } + public int maxCount { get; set; } public double chance { get; set; } } \ No newline at end of file diff --git a/Service/Application.Domain/Tool/Base/GameBus.cs b/Service/Application.Domain/Tool/Base/GameBus.cs index 64ead07..82647b6 100644 --- a/Service/Application.Domain/Tool/Base/GameBus.cs +++ b/Service/Application.Domain/Tool/Base/GameBus.cs @@ -364,6 +364,7 @@ public static class GameBus { return null; } + double totalWeight = data.Sum(it => it.random); int rnd = _randomInstance.Next(Convert.ToInt32(totalWeight) + 1); double current = 0; @@ -399,7 +400,7 @@ public static class GameBus var onAward = result.FindIndex(it => it.code == item.code && it.parameter == item.par); if (onAward > -1) { - result[onAward].count += item.count; + result[onAward].count += RandomAssist.GetFormatedNumeric(item.minCount, item.maxCount); } else { @@ -408,7 +409,7 @@ public static class GameBus code = item.code, name = item.name, parameter = item.par, - count = item.count + count = RandomAssist.GetFormatedNumeric(item.minCount, item.maxCount) }; result.Add(add); } diff --git a/Service/Application.Web/Controllers/Pub/GoodsController.cs b/Service/Application.Web/Controllers/Pub/GoodsController.cs index 5b0a2ab..d271bf6 100644 --- a/Service/Application.Web/Controllers/Pub/GoodsController.cs +++ b/Service/Application.Web/Controllers/Pub/GoodsController.cs @@ -33,7 +33,15 @@ public class GoodsController : ControllerBase string userId = StateHelper.userId; int count = await _goodsService.GetUserGoodsCount(userId, goodsId); + int UseState = 0; + switch (goodsInfo.code) + { + case "Pack": + UseState = 1; + break; + } + - return PoAction.Ok(new { goods = goodsInfo, count }); + return PoAction.Ok(new { goods = goodsInfo, count, use = UseState }); } } \ No newline at end of file diff --git a/Web/src/pages/prop/goods.vue b/Web/src/pages/prop/goods.vue index 3312244..9cf609c 100644 --- a/Web/src/pages/prop/goods.vue +++ b/Web/src/pages/prop/goods.vue @@ -3,7 +3,7 @@
- 名称:{{ data.goodsName }} 寄售
+ 名称:{{ data.goodsName }} 寄售
等级:{{ data.lev }}星
@@ -20,6 +20,9 @@
添加药品栏
+
+ 使用物品 +
@@ -45,6 +48,7 @@ definePageMeta({ }) const data = ref({}); const count = ref(0); +const useState = ref(0); let goodsId = PageExtend.QueryString("id"); onMounted(async () => { try { @@ -62,6 +66,7 @@ const BindData = async (): Promise => { if (result.code == 0) { data.value = result.data.goods; count.value = result.data.count; + useState.value = result.data.use; console.log(result); } else { diff --git a/Web/src/pages/user/bag/index.vue b/Web/src/pages/user/bag/index.vue index 4490c89..6cfa7d9 100644 --- a/Web/src/pages/user/bag/index.vue +++ b/Web/src/pages/user/bag/index.vue @@ -38,7 +38,7 @@ @click="ChangeChildBag('1')" :on-value="type_ch" on-cheak="1">宝石.九宫.圣痕.宝箱.礼包.材料.图纸.卡片.