diff --git a/core/cless_wzry.py b/core/cless_wzry.py index aaab454..583ff22 100644 --- a/core/cless_wzry.py +++ b/core/cless_wzry.py @@ -95,7 +95,7 @@ class WZRYFunction: # 需要提取的字段 fields = ["gametime","killcnt","deadcnt","assistcnt","gameresult","mvpcnt","losemvp","mapName", "oldMasterMatchScore","newMasterMatchScore","usedTime","winNum","failNum","roleJobName","stars","desc", - "gradeGame","heroIcon"] + "gradeGame","heroIcon","godLikeCnt", "firstBlood","hero1TripleKillCnt","hero1UltraKillCnt","hero1RampageCnt"] # 处理返回数据 try: # 获取数据 @@ -110,24 +110,6 @@ class WZRYFunction: minutes = m["usedTime"] // 60 seconds = m["usedTime"] % 60 m["time_str"] = f"{minutes}:{seconds:02d}" - # 可选:提前转义 gameresult - if m["gameresult"] == 1: - m["gameresult_label"] = "胜利" - m["gameresult_bg"] = "#e6fbf1" - m["gameresult_color"] = "#056a3a" - elif m["gameresult"] == 2: - m["gameresult_label"] = "失败" - m["gameresult_bg"] = "#fff0f0" - m["gameresult_color"] = "#9c1f1f" - else: - m["gameresult_label"] = "平局" - m["gameresult_bg"] = "#eee" - m["gameresult_color"] = "#555" - m["MVP"] = "混子" - if m["mvpcnt"] ==1: - m["MVP"] = "胜方MVP" - if m["mvpcnt"] ==1: - m["MVP"] = "败方MVP" return_data["data"] = result @@ -136,7 +118,7 @@ class WZRYFunction: return_data["msg"] = "处理接口返回信息时出错" # 加载模板 try: - return_data["temp"] = load_template("wangzhezhanji.html") + return_data["temp"] = load_template("temp_test.html") except FileNotFoundError as e: logger.error(f"加载模板失败: {e}") return_data["msg"] = "系统错误:模板文件不存在" @@ -175,7 +157,7 @@ class WZRYFunction: return_data["msg"] = "处理接口返回信息时出错" # 加载模板 try: - return_data["temp"] = load_template("temp_test.html") + return_data["temp"] = load_template("wzry_zl.html") except FileNotFoundError as e: logger.error(f"加载模板失败: {e}") return_data["msg"] = "系统错误:模板文件不存在" diff --git a/templates/temp_test.html b/templates/temp_test.html index 0204c02..543f1bf 100644 --- a/templates/temp_test.html +++ b/templates/temp_test.html @@ -1,3 +1,253 @@ -
- -
\ No newline at end of file + + + + +王者荣耀 — 对局列表 + + + + + +
+

王者荣耀 — 对局列表

+ + {% for m in data %} + +
+ +
+ +
{{ m.desc }}
+
+ +
+ + +
+ {% if m.mvpcnt == 1 %} +
胜方 MVP
+ {% elif m.losemvp == 1 %} +
败方 MVP
+ {% endif %} + +
+ {% if m.gameresult == 1 %}胜利 + {% elif m.gameresult == 2 %}失败 + {% else %}平局 + {% endif %} +
+
+ + +
+ {{ m.gametime }} · {{ m.mapName }} +
+ + +
+ {{ m.roleJobName }} · ⭐{{ m.stars }} +
+ + +
+ 巅峰赛积分 {{ m.oldMasterMatchScore }} → {{ m.newMasterMatchScore }} +
+ + +
+ 击杀 {{ m.killcnt }} 死亡 {{ m.deadcnt }} 助攻 {{ m.assistcnt }} 时长 {{ m.time_str }} +
+ + +
+ {% if m.godLikeCnt > 0 %}超神 × {{ m.godLikeCnt }}{% endif %} + {% if m.firstBlood > 0 %}一血{% endif %} + {% if m.hero1TripleKillCnt > 0 %}三杀 × {{ m.hero1TripleKillCnt }}{% endif %} + {% if m.hero1UltraKillCnt > 0 %}四杀 × {{ m.hero1UltraKillCnt }}{% endif %} + {% if m.hero1RampageCnt > 0 %}五杀 × {{ m.hero1RampageCnt }}{% endif %} +
+ + +
+ 评分 {{ m.gradeGame }} +
+ +
+ +
+ + {% endfor %} +
+ + + diff --git a/templates/wangzhezhanji.html b/templates/wangzhezhanji.html index b048538..40d8ffa 100644 --- a/templates/wangzhezhanji.html +++ b/templates/wangzhezhanji.html @@ -1,57 +1,228 @@ -
-

王者荣耀 — 对局列表

+ + + + +王者荣耀 — 对局列表 - - - {% for m in data %} - - -
- - -
- {{ m.desc }} -
-
- -
- -
- {{ m.MVP }} -
- -
- {{ m.gameresult_label }} -
-
+ + + + +
+

王者荣耀 — 对局列表

+ + {% for m in data %} + +
+ +
+ +
{{ m.desc }}
+
+ +
+ + +
+ {% if m.mvpcnt == 1 %} +
胜方 MVP
+ {% elif m.losemvp == 1 %} +
败方 MVP
+ {% endif %} + +
+ {% if m.gameresult == 1 %}胜利 + {% elif m.gameresult == 2 %}失败 + {% else %}平局 + {% endif %} +
+
+ +
+ {{ m.gametime }} · {{ m.mapName }}
+ {{ m.roleJobName }} · ⭐{{ m.stars }} +
+ +
+ 击杀 {{ m.killcnt }} 死亡 {{ m.deadcnt }} 助攻 {{ m.assistcnt }} 时长 {{ m.time_str }} +
+ + +
+ 巅峰赛积分 {{ m.oldMasterMatchScore }} → {{ m.newMasterMatchScore }} +
+ + +
+ {% if m.godLikeCnt > 0 %}超神 × {{ m.godLikeCnt }}{% endif %} + {% if m.firstBlood > 0 %}一血{% endif %} + {% if m.hero1TripleKillCnt > 0 %}三杀 × {{ m.hero1TripleKillCnt }}{% endif %} + {% if m.hero1UltraKillCnt > 0 %}四杀 × {{ m.hero1UltraKillCnt }}{% endif %} + {% if m.hero1RampageCnt > 0 %}五杀 × {{ m.hero1RampageCnt }}{% endif %} +
+ + +
+ 评分 {{ m.gradeGame }} +
+ +
+ +
+ + {% endfor %}
+ + + diff --git a/templates/wzry_zl.html b/templates/wzry_zl.html new file mode 100644 index 0000000..0204c02 --- /dev/null +++ b/templates/wzry_zl.html @@ -0,0 +1,3 @@ +
+ +
\ No newline at end of file