/** 规范化号码:去首尾空白与常见空格 */ export function normalizeDialNumber(phone) { return String(phone ?? '') .trim() .replace(/\s/g, '') } /** 一键拨号;号码为空时提示 */ export function dialPhone(phone) { const raw = normalizeDialNumber(phone) if (!raw) { uni.showToast({ title: '暂无号码', icon: 'none' }) return } uni.makePhoneCall({ phoneNumber: raw }) }