Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
a8290443
Commit
a8290443
authored
May 23, 2022
by
李嘉林
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
暂时隐藏定位api
parent
b1bd0a1d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
260 deletions
+22
-260
src/pages/changeAdr/index.vue
+4
-118
src/pages/index/index.vue
+0
-15
src/utils/wxIndex.js
+4
-5
static/nativeComponents/AreaNavigation/index.js
+14
-122
No files found.
src/pages/changeAdr/index.vue
View file @
a8290443
...
@@ -155,126 +155,12 @@
...
@@ -155,126 +155,12 @@
this
.
locationStatus
=
true
;
this
.
locationStatus
=
true
;
return
return
}
}
wx
.
getLocation
({
_this
.
reLocationStatus
=
false
;
type
:
'wgs84'
,
_this
.
locationStatus
=
false
;
success
:
function
(
res
){
const
latitude
=
res
.
latitude
const
longitude
=
res
.
longitude
console
.
log
(
'定位成功'
,
res
)
changeAdr
.
query_Location_operating_area_area_list
({
location
:
longitude
+
','
+
latitude
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
'200'
){
let
city
=
''
;
res
.
data
.
data
.
forEach
(
item
=>
{
if
(
item
.
operatingAreaAreaId
){
city
=
item
}
})
if
(
city
==
''
){
_this
.
positionCity
=
res
.
data
.
data
[
0
];
}
else
{
_this
.
positionCity
=
city
;
}
_this
.
reLocationStatus
=
false
;
_this
.
locationStatus
=
true
;
}
else
{
wx
.
showModal
({
title
:
'提示'
,
content
:
'定位失败,请检查是否开启了定位服务'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
console
.
log
(
'用户点击确定'
)
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
)
}
}
})
_this
.
reLocationStatus
=
false
;
_this
.
locationStatus
=
false
;
}
})
},
fail
:
function
(
err
){
console
.
log
(
'定位失败'
,
err
)
wx
.
showModal
({
title
:
'提示'
,
content
:
'定位失败,请检查是否开启了定位服务'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
console
.
log
(
'用户点击确定'
)
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
)
}
}
})
_this
.
reLocationStatus
=
false
;
_this
.
locationStatus
=
false
;
}
})
}
else
{
}
else
{
wx
.
getLocation
({
_this
.
reLocationStatus
=
false
;
type
:
'wgs84'
,
_this
.
locationStatus
=
false
;
success
:
function
(
res
){
const
latitude
=
res
.
latitude
const
longitude
=
res
.
longitude
console
.
log
(
'定位成功'
,
res
)
changeAdr
.
query_Location_operating_area_area_list
({
location
:
longitude
+
','
+
latitude
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
'200'
){
let
city
=
''
;
res
.
data
.
data
.
forEach
(
item
=>
{
if
(
item
.
operatingAreaAreaId
){
city
=
item
}
})
if
(
city
==
''
){
_this
.
positionCity
=
res
.
data
.
data
[
0
];
}
else
{
_this
.
positionCity
=
city
;
}
_this
.
reLocationStatus
=
false
;
_this
.
locationStatus
=
true
;
}
else
{
wx
.
showModal
({
title
:
'提示'
,
content
:
'定位失败,请检查是否开启了定位服务'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
console
.
log
(
'用户点击确定'
)
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
)
}
}
})
_this
.
reLocationStatus
=
false
;
_this
.
locationStatus
=
false
;
}
})
},
fail
:
function
(
err
){
console
.
log
(
'定位失败'
,
err
)
wx
.
showModal
({
title
:
'提示'
,
content
:
'定位失败,请检查是否开启了定位服务'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
console
.
log
(
'用户点击确定'
)
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
)
}
}
})
_this
.
reLocationStatus
=
false
;
_this
.
locationStatus
=
false
;
}
})
}
}
},
},
resetPosition
(){
resetPosition
(){
...
...
src/pages/index/index.vue
View file @
a8290443
...
@@ -441,21 +441,6 @@ export default {
...
@@ -441,21 +441,6 @@ export default {
// this.params += "&logOut=true";
// this.params += "&logOut=true";
}
}
},
},
getLocationHandle
()
{
wx
.
getLocation
({
type
:
"wgs84"
,
success
:
res
=>
{
var
latitude
=
res
.
latitude
;
var
longitude
=
res
.
longitude
;
var
speed
=
res
.
speed
;
var
accuracy
=
res
.
accuracy
;
log
.
info
(
"~~~~~~~~~1~~~~~~~"
,
res
);
},
fail
:
res
=>
{
log
.
info
(
"++++++++++2++++++"
,
res
);
}
});
},
async
getSpokesman
()
{
async
getSpokesman
()
{
await
spokesman
.
getSpokesmanidByShare
().
then
(
res
=>
{
await
spokesman
.
getSpokesmanidByShare
().
then
(
res
=>
{
log
.
info
(
'onShareAppMessage-getSpokesmanidByShare'
,
res
)
log
.
info
(
'onShareAppMessage-getSpokesmanidByShare'
,
res
)
...
...
src/utils/wxIndex.js
View file @
a8290443
...
@@ -9,11 +9,9 @@ export function wx_decode(appId, sessionKey, encryptedData, iv) {
...
@@ -9,11 +9,9 @@ export function wx_decode(appId, sessionKey, encryptedData, iv) {
// 定位方法
// 定位方法
export
function
getUserLocation
()
{
export
function
getUserLocation
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
wx
.
getLocation
({
resolve
({
type
:
'gcj02'
,
// type有两中类型,gcj02 是腾讯地图所能解析的
longitude
:
null
,
success
:
res
=>
{
latitude
:
null
,
resolve
(
res
)
}
})
})
})
})
}
}
\ No newline at end of file
static/nativeComponents/AreaNavigation/index.js
View file @
a8290443
...
@@ -81,130 +81,22 @@ Component({
...
@@ -81,130 +81,22 @@ Component({
if
(
this
.
data
.
changeLocation
==
1
){
if
(
this
.
data
.
changeLocation
==
1
){
return
return
}
}
wx
.
getLocation
({
if
(
!
wx
.
getStorageSync
(
'location'
)){
type
:
'wgs84'
,
if
(
_this
.
data
.
designateAreaObj
.
id
){
success
(
res
)
{
wx
.
setStorageSync
(
'location'
,
JSON
.
stringify
({
console
.
log
(
'组件1111'
,
_this
.
data
.
designateAreaObj
)
id
:
_this
.
data
.
designateAreaObj
.
id
,
console
.
log
(
res
,
'++++++++++获取地区'
)
regionName
:
_this
.
data
.
designateAreaObj
.
regionName
,
const
latitude
=
res
.
latitude
regionType
:
_this
.
data
.
designateAreaObj
.
regionType
,
const
longitude
=
res
.
longitude
systemRegionId
:
_this
.
data
.
designateAreaObj
.
systemRegionId
,
console
.
log
(
'组件2'
,
_this
.
data
.
designateAreaObj
)
areaGroupId
:
_this
.
data
.
designateAreaObj
.
areaGroupId
,
indexApi
.
queryLocation
(
longitude
,
latitude
).
then
(
data
=>
{
outId
:
_this
.
data
.
designateAreaObj
.
outId
if
(
data
.
data
.
code
==
'200'
)
{
}))
let
city
=
''
data
.
data
.
data
.
forEach
(
item
=>
{
_this
.
setData
({
if
(
item
.
operatingAreaAreaId
)
{
positionName
:
_this
.
data
.
designateAreaObj
.
regionName
city
=
item
;
}
})
if
(
city
==
''
)
{
_this
.
setData
({
positionCity
:
data
.
data
.
data
[
0
]
})
}
else
{
_this
.
setData
({
positionCity
:
city
})
}
if
(
!
wx
.
getStorageSync
(
'location'
)){
_this
.
setData
({
'designateAreaObj.id'
:
_this
.
data
.
positionCity
.
operatingAreaAreaId
,
'designateAreaObj.regionName'
:
_this
.
data
.
positionCity
.
regionName
,
'designateAreaObj.regionType'
:
_this
.
data
.
positionCity
.
regionType
,
'designateAreaObj.systemRegionId'
:
_this
.
data
.
positionCity
.
systemRegionId
,
'designateAreaObj.outId'
:
_this
.
data
.
positionCity
.
outId
,
})
}
console
.
log
(
_this
.
data
.
positionCity
,
'定位城市信息'
)
console
.
log
(
_this
.
data
.
designateAreaObj
,
'组件信息'
)
let
str
=
JSON
.
stringify
({
id
:
_this
.
data
.
positionCity
.
operatingAreaAreaId
,
regionName
:
_this
.
data
.
positionCity
.
regionName
,
regionType
:
_this
.
data
.
positionCity
.
regionType
,
systemRegionId
:
_this
.
data
.
positionCity
.
systemRegionId
,
outId
:
_this
.
data
.
positionCity
.
outId
,
areaGroupId
:
_this
.
data
.
designateAreaObj
.
areaGroupId
,
})
console
.
log
(
str
,
'str.......'
)
wx
.
setStorageSync
(
'location'
,
str
)
if
(
_this
.
data
.
positionCity
.
operatingAreaAreaId
==
_this
.
data
.
designateAreaObj
.
id
)
{
_this
.
setData
({
positionName
:
_this
.
data
.
positionCity
.
regionName
})
}
else
{
_this
.
setData
({
changeShow
:
true
})
}
}
else
{
if
(
!
wx
.
getStorageSync
(
'location'
))
{
if
(
_this
.
data
.
designateAreaObj
.
id
)
{
wx
.
setStorageSync
(
'location'
,
JSON
.
stringify
({
id
:
_this
.
data
.
designateAreaObj
.
id
,
regionName
:
_this
.
data
.
designateAreaObj
.
regionName
,
regionType
:
_this
.
data
.
designateAreaObj
.
regionType
,
systemRegionId
:
_this
.
data
.
designateAreaObj
.
systemRegionId
,
areaGroupId
:
_this
.
data
.
designateAreaObj
.
areaGroupId
,
outId
:
_this
.
data
.
designateAreaObj
.
outId
}))
_this
.
setData
({
positionName
:
_this
.
data
.
designateAreaObj
.
regionName
})
}
}
}
}).
catch
(
err
=>
{
console
.
log
(
'定位'
)
if
(
!
wx
.
getStorageSync
(
'location'
))
{
if
(
_this
.
data
.
designateAreaObj
.
id
)
{
wx
.
setStorageSync
(
'location'
,
JSON
.
stringify
({
id
:
_this
.
data
.
designateAreaObj
.
id
,
regionName
:
_this
.
data
.
designateAreaObj
.
regionName
,
regionType
:
_this
.
data
.
designateAreaObj
.
regionType
,
systemRegionId
:
_this
.
data
.
designateAreaObj
.
systemRegionId
,
areaGroupId
:
_this
.
data
.
designateAreaObj
.
areaGroupId
,
outId
:
_this
.
data
.
designateAreaObj
.
outId
}))
_this
.
setData
({
positionName
:
_this
.
data
.
designateAreaObj
.
regionName
})
}
}
})
})
},
fail
(
error
)
{
console
.
log
(
'定位失败'
)
if
(
!
wx
.
getStorageSync
(
'location'
)){
if
(
_this
.
data
.
designateAreaObj
.
id
){
wx
.
setStorageSync
(
'location'
,
JSON
.
stringify
({
id
:
_this
.
data
.
designateAreaObj
.
id
,
regionName
:
_this
.
data
.
designateAreaObj
.
regionName
,
regionType
:
_this
.
data
.
designateAreaObj
.
regionType
,
systemRegionId
:
_this
.
data
.
designateAreaObj
.
systemRegionId
,
areaGroupId
:
_this
.
data
.
designateAreaObj
.
areaGroupId
,
outId
:
_this
.
data
.
designateAreaObj
.
outId
}))
_this
.
setData
({
positionName
:
_this
.
data
.
designateAreaObj
.
regionName
})
}
}
}
}
}
)
}
}
}
...
...
李嘉林
@lijialin
mentioned in commit
6641f197
Feb 25, 2023
mentioned in commit
6641f197
mentioned in commit 6641f19715531992e9d9723d8bbf8fc18c0c21cd
Toggle commit list
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