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

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

View File

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

View File

@@ -44,8 +44,9 @@
<!-- 加载中 / 无更多 / 空布局 -->
<view class="load-more" v-if="loadingMore">加载中...</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>
<text class="empty-text">暂无通知</text>
</view>
</view>
</scroll-view>
@@ -208,10 +209,20 @@ page {
color: #999;
font-size: 24rpx;
}
.empty {
text-align: center;
.empty-state {
display: flex;
flex-direction: column;
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 {
background: #007AFF;

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' });
},