Add files via upload

This commit is contained in:
Cola-Echo
2025-12-23 01:19:53 +08:00
committed by GitHub
parent 1e1bf1bab2
commit 37e172bfa9
31 changed files with 10783 additions and 1041 deletions

View File

@@ -2,7 +2,17 @@
* Toast 提示(显示在手机面板内)
*/
export function showToast(message, icon = '✅', durationMs = 2000) {
import { ICON_SUCCESS, ICON_INFO, ICON_REFUND, ICON_RED_PACKET } from './icons.js';
// 图标类型映射
const TOAST_ICONS = {
'success': ICON_SUCCESS,
'info': ICON_INFO,
'refund': ICON_REFUND,
'red-packet': ICON_RED_PACKET
};
export function showToast(message, icon = 'success', durationMs = 2000) {
const phone = document.getElementById('wechat-phone');
if (!phone) return;
@@ -14,7 +24,13 @@ export function showToast(message, icon = '✅', durationMs = 2000) {
const iconEl = document.createElement('span');
iconEl.className = 'wechat-toast-icon';
iconEl.textContent = icon;
// 支持图标类型字符串或直接的 SVG/emoji
if (TOAST_ICONS[icon]) {
iconEl.innerHTML = TOAST_ICONS[icon];
} else {
iconEl.textContent = icon;
}
const textEl = document.createElement('span');
textEl.textContent = message;