修改登录页样式、车牌号输入问题、定位加载问题、联系物业权限问题
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<!-- 表单区域 -->
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
<view v-if="dataList.length === 0" class="empty-state">
|
||||
<uni-icons type="info" size="60" color="#ccc"></uni-icons>
|
||||
<uni-icons type="info" size="30" color="#ccc"></uni-icons>
|
||||
<text class="empty-text">
|
||||
{{ '暂无数据'}}
|
||||
</text>
|
||||
@@ -28,10 +28,9 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 值班电话 -->
|
||||
<view class="phone-item" v-for="phoneItems,phoneIndex in item.phoneList" :key="phoneIndex" @click="callPhone(phoneItems.phoneNum)">
|
||||
<view class="phone-item" v-for="phoneItems,phoneIndex in item.phoneList" :key="phoneIndex" @click="callPhone(phoneItems.phoneNum)" @longpress="copyPhone(phoneItems.phoneNum)">
|
||||
<text class="phone-label">值班电话:</text>
|
||||
<text class="phone-num">{{phoneItems.phoneNum}}</text>
|
||||
<!-- <text class="phone-icon"></text> -->
|
||||
<uni-icons type="phone" size="16" color="#2F77FD"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
@@ -52,13 +51,39 @@ import { getManagePhoneData } from '../api/apiSub.js'
|
||||
|
||||
// ====方法=====
|
||||
function callPhone(phone) {
|
||||
if (!phone || !phone.trim()) {
|
||||
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)) {
|
||||
uni.showToast({ title: '电话号码格式有误', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: phone.replace(/-/g, ""),
|
||||
phoneNumber: cleanPhone,
|
||||
fail: (err) => {
|
||||
console.log('用户取消拨号', err)
|
||||
console.log('拨号失败或用户取消', err);
|
||||
uni.showToast({ title: '拨号失败,请长按复制号码', icon: 'none' });
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function copyPhone(phone) {
|
||||
if (!phone || !phone.trim()) {
|
||||
uni.showToast({ title: '电话号码为空', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
uni.setClipboardData({
|
||||
data: phone.replace(/-/g, '').trim(),
|
||||
success: () => {
|
||||
uni.showToast({ title: '号码已复制', icon: 'none' });
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({ title: '复制失败', icon: 'none' });
|
||||
}
|
||||
});
|
||||
}
|
||||
function goBack() {
|
||||
uni.switchTab({
|
||||
url: '/pages/serviceIndex/serviceIndex',
|
||||
@@ -117,7 +142,7 @@ import { getManagePhoneData } from '../api/apiSub.js'
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 32rpx;
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 10rpx;
|
||||
|
||||
Reference in New Issue
Block a user