Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
account-book
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘文虎
account-book
Commits
c5c5fa99
Commit
c5c5fa99
authored
Aug 31, 2022
by
刘文虎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复IOS获取定位权限错误
parent
171cbd32
Pipeline
#3372
canceled with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
10 deletions
+23
-10
manifest.json
manifest.json
+13
-5
index.vue
pages/index/index.vue
+8
-3
app-plus-auth.js
utils/app-plus-auth.js
+2
-2
No files found.
manifest.json
View file @
c5c5fa99
...
...
@@ -25,12 +25,12 @@
},
/*
模块配置
*/
"modules"
:
{
"Geolocation"
:
{},
"OAuth"
:
{},
"Payment"
:
{},
"Push"
:
{},
"Share"
:
{},
"Geolocation"
:
{},
"Maps"
:
{},
"Push"
:
{}
"Maps"
:
{}
},
"safearea"
:
{
"bottom"
:
{
...
...
@@ -45,6 +45,7 @@
"permissions"
:
[
"<uses-feature android:name=
\"
android.hardware.camera
\"
/>"
,
"<uses-feature android:name=
\"
android.hardware.camera.autofocus
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_COARSE_LOCATION
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_FINE_LOCATION
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_NETWORK_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_WIFI_STATE
\"
/>"
,
...
...
@@ -53,12 +54,14 @@
"<uses-permission android:name=
\"
android.permission.CHANGE_WIFI_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.FLASHLIGHT
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.GET_ACCOUNTS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.INTERNET
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.MODIFY_AUDIO_SETTINGS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.MOUNT_UNMOUNT_FILESYSTEMS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_LOGS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_PHONE_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.VIBRATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WAKE_LOCK
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WRITE_EXTERNAL_STORAGE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WRITE_SETTINGS
\"
/>"
],
"abiFilters"
:
[
"armeabi-v7a"
,
"arm64-v8a"
,
"x86"
],
...
...
@@ -93,7 +96,7 @@
},
"payment"
:
{
"weixin"
:
{
"__platform__"
:
[
"android"
],
"__platform__"
:
[
"
ios"
,
"
android"
],
"appid"
:
"wxf0a780908851623f"
,
"UniversalLinks"
:
"https://kaying.cc/uni-universallinks/__UNI__EDB8C7C/"
}
...
...
@@ -160,9 +163,14 @@
},
"splashscreen"
:
{
"androidStyle"
:
"default"
,
"iosStyle"
:
"
storyboard
"
,
"iosStyle"
:
"
common
"
,
"ios"
:
{
"storyboard"
:
"C:/启动页/扳手记账/CustomStoryboard.zip"
},
"android"
:
{
"hdpi"
:
"C:/启动页/扳手记账/__480762.9.png"
,
"xhdpi"
:
"C:/启动页/扳手记账/__7201242.9.png"
,
"xxhdpi"
:
"C:/启动页/扳手记账/__10801882.9.png"
}
}
}
...
...
pages/index/index.vue
View file @
c5c5fa99
...
...
@@ -156,7 +156,7 @@ export default {
};
},
computed
:
{
...
mapGetters
([
'userInfo'
,
'eyeClose'
,
'platform'
,
'canGetLocation'
]),
...
mapGetters
([
'userInfo'
,
'eyeClose'
,
'platform'
,
'canGetLocation'
,
'isIOS'
]),
baseUrl
()
{
return
process
.
uniEnv
.
qn_base_url
;
},
...
...
@@ -280,7 +280,11 @@ export default {
this
.
shareSuccessTip
();
},
onReady
()
{
if
(
this
.
platform
!==
'4'
)
{
if
(
this
.
platform
===
'4'
)
{
if
(
this
.
isIOS
){
this
.
getWeather
();
}
}
else
{
this
.
getWeather
();
}
},
...
...
@@ -326,12 +330,13 @@ export default {
await
checkOpenPermission
();
this
.
getLocation
();
}
catch
(
e
)
{
console
.
log
(
e
);
console
.
log
(
"getWeather:error"
,
e
);
//TODO handle the exception
}
}
},
getLocation
()
{
console
.
log
(
"===getLocation=="
);
uni
.
getLocation
({
type
:
'wgs84'
,
success
:
res
=>
{
...
...
utils/app-plus-auth.js
View file @
c5c5fa99
...
...
@@ -10,7 +10,7 @@ export function checkOpenPermission() {
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
let
result
if
(
isIOS
)
{
result
=
permision
.
judgeIosPermissionLocation
(
)
result
=
permision
.
judgeIosPermission
(
"location"
)
}
else
{
result
=
await
permision
.
requestAndroidPermission
(
'android.permission.ACCESS_FINE_LOCATION'
);
...
...
@@ -27,7 +27,7 @@ export function checkOpenPermission() {
resolve
()
}
else
{
console
.
log
(
"未获得权限"
);
if
(
result
===
-
1
)
{
if
(
result
===
-
1
||
(
isIOS
&&!
result
)
)
{
uni
.
showModal
({
title
:
'提示'
,
content
:
'请开启位置信息权限'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment