"""customer-detail.html 改动:灰色字加深、商城订单加总金额、台桌详情改台桌名称""" filepath = "docs/h5_ui/pages/customer-detail.html" with open(filepath, "r", encoding="utf-8") as f: c = f.read() # 1. 灰色字颜色统一加深:text-gray-5 → text-gray-7, text-gray-6 → text-gray-8 # 只在 body 内容中替换(不动 CSS 定义) c = c.replace('text-gray-5 ', 'text-gray-7 ') c = c.replace('text-gray-5"', 'text-gray-7"') c = c.replace('text-gray-6 ', 'text-gray-8 ') c = c.replace('text-gray-6"', 'text-gray-8"') # 但保留 orig-price 的 color(在 style 中定义的) # text-gray-6 在 style 中是 #a6a6a6,不受影响 # 2. "台桌详情" → 台桌名称 c = c.replace( '台桌详情\n \n 2026-02-05', 'A12号台\n \n 2026-02-05' ) c = c.replace( '台桌详情\n \n 2026-02-01', '888号台\n \n 2026-02-01' ) # 3. 商城订单加总金额 old_mall = '''
🍷 食品酒水 ¥180
''' new_mall = '''
🍷 食品酒水 ¥180
总金额 ¥280
''' c = c.replace(old_mall, new_mall) with open(filepath, "w", encoding="utf-8") as f: f.write(c) print("✅ customer-detail.html 更新完成")