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

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

@@ -3,7 +3,7 @@
"appid" : "__UNI__29C3D60", "appid" : "__UNI__29C3D60",
"description" : "物业用户端app", "description" : "物业用户端app",
"versionName" : "1.0.1", "versionName" : "1.0.1",
"versionCode" : "101", "versionCode" : "102",
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {
@@ -19,7 +19,9 @@
/* */ /* */
"modules" : { "modules" : {
"Geolocation" : {}, "Geolocation" : {},
"Maps" : {} "Maps" : {},
"Camera" : {},
"Contacts" : {}
}, },
/* */ /* */
"distribute" : { "distribute" : {
@@ -63,6 +65,12 @@
"appkey_ios" : "39a4c28a01c3ec15684b21d4093aad3d", "appkey_ios" : "39a4c28a01c3ec15684b21d4093aad3d",
"appkey_android" : "044055aed47cb305e86419fd82e4c5f3" "appkey_android" : "044055aed47cb305e86419fd82e4c5f3"
} }
},
"push" : {
"unipush" : {
"version" : "2",
"offline" : false
}
} }
} }
} }

View File

@@ -89,7 +89,7 @@ const handleTextInput = (e) => {
const reverseGeocode = async (lng, lat) => { const reverseGeocode = async (lng, lat) => {
if (!AMAP_KEY) return null; if (!AMAP_KEY) return null;
try { try {
const [err, res] = await uni.request({ const res = await uni.request({
url: 'https://restapi.amap.com/v3/geocode/regeo', url: 'https://restapi.amap.com/v3/geocode/regeo',
data: { data: {
key: AMAP_KEY, key: AMAP_KEY,
@@ -97,7 +97,6 @@ const reverseGeocode = async (lng, lat) => {
extensions: 'base' extensions: 'base'
} }
}); });
if (err) throw err;
if (res.data?.status === '1' && res.data.regeocode?.formatted_address) { if (res.data?.status === '1' && res.data.regeocode?.formatted_address) {
return res.data.regeocode.formatted_address; return res.data.regeocode.formatted_address;
} }

View File

@@ -44,9 +44,10 @@
<!-- 加载中 / 无更多 / 空布局 --> <!-- 加载中 / 无更多 / 空布局 -->
<view class="load-more" v-if="loadingMore">加载中...</view> <view class="load-more" v-if="loadingMore">加载中...</view>
<view class="no-more" v-if="noMoreData && noticeList.length">没有更多通知了</view> <view class="no-more" v-if="noMoreData && noticeList.length">没有更多通知了</view>
<view class="empty" v-if="noticeList.length === 0 && !loading"> <view v-if="noticeList.length === 0 && !loading" class="empty-state">
暂无通知 <uni-icons type="info" size="30" color="#ccc"></uni-icons>
</view> <text class="empty-text">暂无通知</text>
</view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
@@ -208,10 +209,20 @@ page {
color: #999; color: #999;
font-size: 24rpx; font-size: 24rpx;
} }
.empty { .empty-state {
text-align: center; display: flex;
padding: 100rpx 0; flex-direction: column;
color: #999; align-items: center;
justify-content: center;
padding: 100rpx 0;
color: #ccc;
}
.empty-text {
font-size: 28rpx;
color: #999;
margin-top: 20rpx;
margin-bottom: 10rpx;
} }
.refresh-btn { .refresh-btn {
background: #007AFF; background: #007AFF;

View File

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