21
This commit is contained in:
parent
2550f6d4c2
commit
1f6d996d85
|
|
@ -11,9 +11,9 @@
|
||||||
|
|
||||||
// 测试环境配置 - .NET 10 后端
|
// 测试环境配置 - .NET 10 后端
|
||||||
const testing = {
|
const testing = {
|
||||||
baseUrl: 'https://app.zpc-xy.com/honey/api',
|
// baseUrl: 'https://app.zpc-xy.com/honey/api',
|
||||||
// baseUrl: 'http://192.168.1.24:5238',
|
// baseUrl: 'http://192.168.1.24:5238',
|
||||||
// baseUrl: 'http://192.168.195.15:2822',
|
baseUrl: 'http://192.168.195.15:2822',
|
||||||
imageUrl: 'https://youdas-1308826010.cos.ap-shanghai.myqcloud.com',
|
imageUrl: 'https://youdas-1308826010.cos.ap-shanghai.myqcloud.com',
|
||||||
loginPage: '',
|
loginPage: '',
|
||||||
wxAppId: ''
|
wxAppId: ''
|
||||||
|
|
|
||||||
|
|
@ -300,9 +300,17 @@
|
||||||
async getData() {
|
async getData() {
|
||||||
try {
|
try {
|
||||||
const res = await getEquity();
|
const res = await getEquity();
|
||||||
|
console.log('[equity] API响应:', JSON.stringify(res.data?.quan_yi_level));
|
||||||
if (res.status == 1) {
|
if (res.status == 1) {
|
||||||
this.curLvId = `prize-item${res.data.quan_yi_level.level}`
|
const qyLevel = res.data.quan_yi_level;
|
||||||
|
console.log('[equity] 等级信息:', {
|
||||||
|
level: qyLevel.level,
|
||||||
|
ou_qi: qyLevel.ou_qi,
|
||||||
|
next_ou_qi: qyLevel.next_ou_qi,
|
||||||
|
cha: qyLevel.cha,
|
||||||
|
jindu: qyLevel.jindu
|
||||||
|
});
|
||||||
|
this.curLvId = `prize-item${qyLevel.level}`
|
||||||
this.pageData = res.data
|
this.pageData = res.data
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
|
|
@ -382,6 +382,9 @@ public class QuanYiService : IQuanYiService
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private QuanYiLevelInfo GetQuanYiLevelInfo(int ouQiLevel, int ouQi, List<EquityLevel> equityLevelConfigs)
|
private QuanYiLevelInfo GetQuanYiLevelInfo(int ouQiLevel, int ouQi, List<EquityLevel> equityLevelConfigs)
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("GetQuanYiLevelInfo called: ouQiLevel={OuQiLevel}, ouQi={OuQi}, configCount={ConfigCount}",
|
||||||
|
ouQiLevel, ouQi, equityLevelConfigs.Count);
|
||||||
|
|
||||||
// 从数据库配置构建等级阈值
|
// 从数据库配置构建等级阈值
|
||||||
var levelThresholds = equityLevelConfigs
|
var levelThresholds = equityLevelConfigs
|
||||||
.ToDictionary(v => v.Level, v => v.Number);
|
.ToDictionary(v => v.Level, v => v.Number);
|
||||||
|
|
@ -390,9 +393,13 @@ public class QuanYiService : IQuanYiService
|
||||||
var levelTitles = equityLevelConfigs
|
var levelTitles = equityLevelConfigs
|
||||||
.ToDictionary(v => v.Level, v => v.Title ?? $"等级{v.Level}");
|
.ToDictionary(v => v.Level, v => v.Title ?? $"等级{v.Level}");
|
||||||
|
|
||||||
|
_logger.LogInformation("Level thresholds from DB: {Thresholds}",
|
||||||
|
string.Join(", ", levelThresholds.Take(10).Select(kv => $"L{kv.Key}={kv.Value}")));
|
||||||
|
|
||||||
// 如果没有配置,使用默认值
|
// 如果没有配置,使用默认值
|
||||||
if (!levelThresholds.Any())
|
if (!levelThresholds.Any())
|
||||||
{
|
{
|
||||||
|
_logger.LogWarning("No equity level configs found in database, using defaults");
|
||||||
levelThresholds = new Dictionary<int, int>
|
levelThresholds = new Dictionary<int, int>
|
||||||
{
|
{
|
||||||
{ 0, 0 },
|
{ 0, 0 },
|
||||||
|
|
@ -423,6 +430,9 @@ public class QuanYiService : IQuanYiService
|
||||||
var currentLevelOuQi = levelThresholds.GetValueOrDefault(ouQiLevel, 0);
|
var currentLevelOuQi = levelThresholds.GetValueOrDefault(ouQiLevel, 0);
|
||||||
var maxLevel = levelThresholds.Keys.DefaultIfEmpty(0).Max();
|
var maxLevel = levelThresholds.Keys.DefaultIfEmpty(0).Max();
|
||||||
|
|
||||||
|
_logger.LogInformation("Level calculation: currentLevel={CurrentLevel}, nextLevel={NextLevel}, currentLevelOuQi={CurrentLevelOuQi}, nextOuQi={NextOuQi}, maxLevel={MaxLevel}",
|
||||||
|
ouQiLevel, nextLevel, currentLevelOuQi, nextOuQi, maxLevel);
|
||||||
|
|
||||||
// 计算差值和进度
|
// 计算差值和进度
|
||||||
int cha;
|
int cha;
|
||||||
int jindu;
|
int jindu;
|
||||||
|
|
@ -431,6 +441,7 @@ public class QuanYiService : IQuanYiService
|
||||||
// 已满级
|
// 已满级
|
||||||
cha = -1;
|
cha = -1;
|
||||||
jindu = 100;
|
jindu = 100;
|
||||||
|
_logger.LogInformation("User is at max level");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -439,9 +450,11 @@ public class QuanYiService : IQuanYiService
|
||||||
var levelRange = nextOuQi - currentLevelOuQi;
|
var levelRange = nextOuQi - currentLevelOuQi;
|
||||||
var progress = ouQi - currentLevelOuQi;
|
var progress = ouQi - currentLevelOuQi;
|
||||||
jindu = levelRange > 0 ? Math.Min(100, Math.Max(0, progress * 100 / levelRange)) : 0;
|
jindu = levelRange > 0 ? Math.Min(100, Math.Max(0, progress * 100 / levelRange)) : 0;
|
||||||
|
_logger.LogInformation("Progress calculation: levelRange={LevelRange}, progress={Progress}, cha={Cha}, jindu={Jindu}",
|
||||||
|
levelRange, progress, cha, jindu);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new QuanYiLevelInfo
|
var result = new QuanYiLevelInfo
|
||||||
{
|
{
|
||||||
Level = ouQiLevel,
|
Level = ouQiLevel,
|
||||||
Title = title,
|
Title = title,
|
||||||
|
|
@ -450,6 +463,11 @@ public class QuanYiService : IQuanYiService
|
||||||
Cha = cha,
|
Cha = cha,
|
||||||
Jindu = jindu
|
Jindu = jindu
|
||||||
};
|
};
|
||||||
|
|
||||||
|
_logger.LogInformation("GetQuanYiLevelInfo result: Level={Level}, Title={Title}, OuQi={OuQi}, NextOuQi={NextOuQi}, Cha={Cha}, Jindu={Jindu}",
|
||||||
|
result.Level, result.Title, result.OuQi, result.NextOuQi, result.Cha, result.Jindu);
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user