From 53d1ed2e79d47929d1a8f3bd8efac8e30eb58ed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=8A=E6=99=9A=E6=89=93=E8=80=81=E8=99=8E?= Date: Thu, 19 Mar 2026 14:20:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E6=8A=95=E7=A8=BF]=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=84=9A=E6=9C=AC:=20=E6=B1=87=E7=8E=87=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E5=99=A8=20=E2=80=94=20by=20=E4=BB=8A=E6=99=9A=E6=89=93?= =?UTF-8?q?=E8=80=81=E8=99=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scripts/widgets/script_mmx2zhqn.py | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 script_library/scripts/widgets/script_mmx2zhqn.py diff --git a/script_library/scripts/widgets/script_mmx2zhqn.py b/script_library/scripts/widgets/script_mmx2zhqn.py new file mode 100644 index 0000000..6f9a8e4 --- /dev/null +++ b/script_library/scripts/widgets/script_mmx2zhqn.py @@ -0,0 +1,96 @@ +# 欢迎使用 PythonIDE!如果觉得好用,请给个好评哦~ +# -*- coding: utf-8 -*- +"""汇率转换器 — major currencies with flags and trend arrows.""" + +from widget import Widget, family, SMALL, MEDIUM, LARGE +import time + +currencies = [ + ("🇺🇸", "USD", 1.0000, "up"), + ("🇪🇺", "EUR", 0.9182, "down"), + ("🇯🇵", "JPY", 149.85, "up"), + ("🇬🇧", "GBP", 0.7923, "down"), + ("🇨🇳", "CNY", 7.2450, "up"), +] + +now = time.strftime("%H:%M") + +bg = ("#F8FAFC", "#0F172A") +card_bg = ("#F1F5F9", "#1E293B") +txt_main = ("#0F172A", "#F8FAFC") +txt_sub = ("#64748B", "#94A3B8") +up_clr = ("#10B981", "#34D399") +down_clr = ("#EF4444", "#F87171") +accent = "#3B82F6" + +w = Widget(background=bg, padding=14) + +if family == SMALL: + with w.vstack(spacing=0, align="center"): + w.spacer() + w.icon("dollarsign.circle.fill", size=18, color=accent) + w.spacer(6) + w.text("1 USD", size=22, weight="bold", design="rounded", color=txt_main) + w.spacer(4) + with w.hstack(spacing=4): + w.text("🇺🇸", size=14) + w.text("USD", size=12, weight="semibold", color=txt_main) + w.spacer() + w.text("基准", size=10, color=txt_sub) + w.spacer() + with w.hstack(spacing=6): + clr = up_clr + arrow = "arrow.up.right" + w.icon(arrow, size=8, color=clr) + w.text("EUR 0.92", size=11, weight="medium", color=clr) + w.spacer() + clr = down_clr + arrow = "arrow.down.right" + w.icon(arrow, size=8, color=clr) + w.text("JPY 149.9", size=11, weight="medium", color=clr) + w.spacer() + +elif family == MEDIUM: + with w.vstack(spacing=0): + with w.hstack(spacing=6): + w.icon("dollarsign.circle.fill", size=14, color=accent) + w.text("汇率", size=14, weight="semibold", color=txt_main) + w.spacer() + w.text(f"更新 {now}", size=11, color=txt_sub) + w.spacer() + with w.hstack(spacing=0): + for flag, code, rate, trend in currencies[:4]: + with w.vstack(spacing=2, align="center"): + clr = up_clr if trend == "up" else down_clr + arrow = "arrow.up.right" if trend == "up" else "arrow.down.right" + w.text(flag, size=16) + w.text(code, size=11, weight="semibold", color=txt_main) + with w.hstack(spacing=2): + w.icon(arrow, size=8, color=clr) + w.text(f"{rate:.2f}" if rate < 10 else f"{rate:.1f}", size=12, weight="medium", color=clr) + w.spacer() + w.spacer() + +else: + with w.vstack(spacing=6): + with w.hstack(spacing=6, align="center"): + w.icon("dollarsign.circle.fill", size=18, color=accent) + w.text("汇率转换器", size=17, weight="bold", color=txt_main) + w.spacer() + w.icon("clock", size=12, color=txt_sub) + w.text(f"更新于 {now}", size=12, color=txt_sub) + w.divider(color=("#E2E8F0", "#334155")) + for flag, code, rate, trend in currencies: + with w.hstack(spacing=6, align="center"): + w.text(flag, size=16) + w.text(code, size=14, weight="bold", color=txt_main) + w.spacer() + clr = up_clr if trend == "up" else down_clr + arrow = "arrow.up.right" if trend == "up" else "arrow.down.right" + w.icon(arrow, size=11, color=clr) + w.text(f"{rate:.4f}" if rate < 10 else f"{rate:.2f}", + size=15, weight="semibold", color=clr) + if code != "CNY": + w.divider(color=("#F1F5F9", "#1E293B")) + +w.render() \ No newline at end of file From 0b66cefac9eb09914454ed57d0b074c52dda159f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=8A=E6=99=9A=E6=89=93=E8=80=81=E8=99=8E?= Date: Thu, 19 Mar 2026 14:20:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E6=8A=95=E7=A8=BF]=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=20index.json:=20=E6=B7=BB=E5=8A=A0=20=E6=B1=87=E7=8E=87?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script_library/index.json | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/script_library/index.json b/script_library/index.json index 7bf5d4c..ce844bd 100644 --- a/script_library/index.json +++ b/script_library/index.json @@ -1,7 +1,7 @@ { "format_version": 1, - "data_version": 8, - "updated": "2026-03-18T16:49:17.705Z", + "data_version": 9, + "updated": "2026-03-19T06:20:23.291Z", "announcement": null, "categories": [ { @@ -380,6 +380,29 @@ "updated": null, "status": "active", "lines": 95 + }, + { + "id": "script_mmx2zhqn", + "name": "汇率转换器", + "name_en": "汇率转换器", + "desc": "硬编码的,可以自己换api", + "desc_en": "硬编码的,可以自己换api", + "category": "widgets", + "file": "scripts/widgets/script_mmx2zhqn.py", + "thumbnail": null, + "version": 1, + "file_type": "py", + "author": "今晚打老虎", + "author_en": "今晚打老虎", + "tags": [ + "community" + ], + "requires": [], + "min_app_version": "1.5.0", + "added": "2026-03-19", + "updated": null, + "status": "active", + "lines": 96 } ] }