设置拨打电话权限、修改定位

This commit is contained in:
zhouyanli
2026-05-25 09:50:28 +08:00
parent c4d91787b5
commit 1b0e47e79e
4 changed files with 32 additions and 14 deletions

View File

@@ -55,8 +55,8 @@ import { getManagePhoneData } from '../api/apiSub.js'
uni.showToast({ title: '电话号码为空', icon: 'none' });
return;
}
const cleanPhone = phone.replace(/-/g, '').trim();
if (!/^1[3-9]\d{9}$/.test(cleanPhone) && !/^0\d{2,3}-?\d{7,8}$/.test(cleanPhone)) {
const cleanPhone = phone.replace(/\D/g, '');
if (!/^1[3-9]\d{9}$/.test(cleanPhone) && !/^0\d{2,3}\d{7,8}$/.test(cleanPhone)) {
uni.showToast({ title: '电话号码格式有误', icon: 'none' });
return;
}
@@ -75,7 +75,7 @@ import { getManagePhoneData } from '../api/apiSub.js'
return;
}
uni.setClipboardData({
data: phone.replace(/-/g, '').trim(),
data: phone.replace(/\D/g, ''),
success: () => {
uni.showToast({ title: '号码已复制', icon: 'none' });
},