feat(decorate): 首页金刚区替换为各级运营与合伙中心并支持待开发内容展示

这个提交包含在:
chen
2026-09-19 16:05:08 +08:00
父节点 506d931abb
当前提交 34981d90c0
共有 15 个文件被更改,包括 254 次插入 和 9 次删除

查看文件

@@ -289,6 +289,51 @@ def build_menu_icons():
build_menu_icons()
def build_partner_centers_menu_icons():
import os
font_menu = ImageFont.truetype(font_title, 42)
font_sub = ImageFont.truetype(font_text, 22)
font_sub_3 = ImageFont.truetype(font_text, 19)
menus = [
("menu_city_center.png", "市级", "运营", (25, 45, 80), (230, 200, 130), False),
("menu_city_partner.png", "市级", "合伙", (85, 25, 30), (225, 185, 120), False),
("menu_province_center.png", "省级", "服务", (20, 55, 45), (145, 215, 180), False),
("menu_province_partner.png", "省级", "合伙", (65, 28, 68), (240, 195, 150), False),
("menu_region_branch.png", "大区", "分公司", (32, 30, 26), (245, 210, 135), True),
]
out_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '../public/uploads/decorate'))
os.makedirs(out_dir, exist_ok=True)
for filename, t1, t2, bg_c, fg_c, is_3 in menus:
size = (160, 160)
img = Image.new('RGBA', size, (0, 0, 0, 0))
d = ImageDraw.Draw(img)
# Soft background circle with border
d.ellipse([6, 6, 154, 154], fill=(*bg_c, 245), outline=(*fg_c, 210), width=3)
d.ellipse([14, 14, 146, 146], outline=(*fg_c, 85), width=1)
# Text 1
bbox1 = d.textbbox((0, 0), t1, font=font_menu)
w1 = bbox1[2] - bbox1[0]
x1 = (160 - w1) / 2
d.text((x1, 40), t1, font=font_menu, fill=(*fg_c, 255))
# Text 2
cur_sub_font = font_sub_3 if is_3 else font_sub
bbox2 = d.textbbox((0, 0), t2, font=cur_sub_font)
w2 = bbox2[2] - bbox2[0]
x2 = (160 - w2) / 2
y2 = 98 if is_3 else 96
d.text((x2, y2), t2, font=cur_sub_font, fill=(245, 245, 245, 230))
img.save(os.path.join(out_dir, filename))
print(filename, "generated at", out_dir)
build_partner_centers_menu_icons()
def build_trust_bar():
size = (1420, 110)
img = Image.new('RGBA', size, (0, 0, 0, 0))