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
3524bea4
Commit
3524bea4
authored
Mar 08, 2023
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
a7538e4b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
11 deletions
+17
-11
src/components/common/StoreAddr.vue
+12
-9
src/components/common/pageLoading.vue
+3
-2
src/pages/home/index.vue
+2
-0
No files found.
src/components/common/StoreAddr.vue
View file @
3524bea4
...
@@ -35,33 +35,36 @@ export default {
...
@@ -35,33 +35,36 @@ export default {
};
};
},
},
onLoad
()
{
onLoad
()
{
if
(
this
.
openThousandsStoresFlag
)
{
this
.
getLocationHandle
(()
=>
{
this
.
getLocationHandle
(()
=>
{
this
.
getShopList
();
this
.
getShopList
();
});
});
}
},
},
computed
:
{
computed
:
{
shopName
()
{
shopName
()
{
return
app
.
globalData
.
shopInfo
.
shopName
;
return
app
.
globalData
&&
app
.
globalData
.
shopInfo
&&
app
.
globalData
.
shopInfo
.
shopName
;
},
},
shopLogo
()
{
shopLogo
()
{
return
DFSImg
(
app
.
globalData
.
shopInfo
.
logoUrl
,
400
,
400
);
return
app
.
globalData
&&
app
.
globalData
.
shopInfo
&&
DFSImg
(
app
.
globalData
.
shopInfo
.
logoUrl
,
400
,
400
);
},
},
// 开启连锁商城(千店千面)
// 开启连锁商城(千店千面)
openThousandsStoresFlag
()
{
openThousandsStoresFlag
()
{
return
app
.
globalData
.
shopInfo
.
openThousandsStoresFlag
==
1
return
app
.
globalData
&&
app
.
globalData
.
shopInfo
&&
app
.
globalData
.
shopInfo
.
openThousandsStoresFlag
==
1
}
}
},
},
methods
:
{
methods
:
{
getLocationHandle
(
callback
)
{
getLocationHandle
(
callback
)
{
let
_this
=
this
;
let
_this
=
this
;
wx
.
getLocation
({
wx
.
getLocation
({
type
:
"wgs84"
,
type
:
"gcj02"
,
// gcj02 wgs84
isHighAccuracy
:
true
,
success
:
res
=>
{
success
:
res
=>
{
// latitude longitude speed accuracy
// latitude longitude speed accuracy
log
.
info
(
"~~~~~~~~~1~~~~~~~"
,
res
);
log
.
info
(
"~~~~~~~~~1~~~~~~~"
,
res
);
console
.
log
(
"~~~~~~~~~1~~~~~~~"
,
res
);
console
.
log
(
"~~~~~~~~~1~~~~~~~"
,
res
);
this
.
offlineStoreReq
.
latitude
=
res
.
latitude
;
_
this
.
offlineStoreReq
.
latitude
=
res
.
latitude
;
this
.
offlineStoreReq
.
longitude
=
res
.
longitude
;
_
this
.
offlineStoreReq
.
longitude
=
res
.
longitude
;
// 存缓存
// 存缓存
wx
.
setStorageSync
(
"locationObj"
,
JSON
.
stringify
(
res
));
wx
.
setStorageSync
(
"locationObj"
,
JSON
.
stringify
(
res
));
callback
(
res
);
callback
(
res
);
...
@@ -86,8 +89,8 @@ export default {
...
@@ -86,8 +89,8 @@ export default {
// 进店规则获取门店id
// 进店规则获取门店id
let
query
=
{
let
query
=
{
channelType
:
2
,
//设备类型(0:pc,1:app,2:小程序)
channelType
:
2
,
//设备类型(0:pc,1:app,2:小程序)
consumerLongitude
:
this
.
$store
.
state
.
wxLocation
.
longitude
,
//经度,小程序和app可以获取到就要传,没有不传
consumerLongitude
:
this
.
offlineStoreReq
.
longitude
,
//经度,小程序和app可以获取到就要传,没有不传
consumerLatitude
:
this
.
$store
.
state
.
wxLocation
.
latitude
,
//纬度,小程序和app可以获取到就要传,没有不传
consumerLatitude
:
this
.
offlineStoreReq
.
latitude
,
//纬度,小程序和app可以获取到就要传,没有不传
distributionOfficerShopId
:
""
//分销员门店id,没有不传
distributionOfficerShopId
:
""
//分销员门店id,没有不传
}
}
let
enterShopRes
=
await
shop
.
getEnterShopId
(
query
);
let
enterShopRes
=
await
shop
.
getEnterShopId
(
query
);
...
@@ -112,9 +115,9 @@ export default {
...
@@ -112,9 +115,9 @@ export default {
this
.
$store
.
dispatch
(
"setShopName"
,
{
this
.
$store
.
dispatch
(
"setShopName"
,
{
shopName
:
ruleShop
[
0
].
shopName
,
shopName
:
ruleShop
[
0
].
shopName
,
});
});
}
return
;
return
;
}
}
}
this
.
storeList
.
forEach
((
item
,
index
)
=>
{
this
.
storeList
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
shopName
==
offlineShopName
)
{
if
(
item
.
shopName
==
offlineShopName
)
{
isStore
=
true
;
isStore
=
true
;
...
...
src/components/common/pageLoading.vue
View file @
3524bea4
<
template
>
<
template
>
<div
class=
"loadings"
>
<div
class=
"loadings"
v-if=
"shopLogo"
>
<div
class=
"img flex"
>
<div
class=
"img flex"
>
<image
:src=
"shopLogo"
alt=
""
mode=
"aspectFill"
></image>
<image
:src=
"shopLogo"
alt=
""
mode=
"aspectFill"
></image>
<van-loading
color=
"black"
size=
"60px"
/>
<van-loading
color=
"black"
size=
"60px"
/>
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
<
script
>
<
script
>
import
{
DFSImg
}
from
"@/utils/index"
;
import
{
DFSImg
}
from
"@/utils/index"
;
const
app
=
getApp
();
export
default
{
export
default
{
props
:
{
props
:
{
toHide
:
{
toHide
:
{
...
@@ -21,7 +22,7 @@ export default {
...
@@ -21,7 +22,7 @@ export default {
},
},
computed
:
{
computed
:
{
shopLogo
()
{
shopLogo
()
{
let
logoUrl
=
this
.
mpA
pp
.
globalData
.
shopInfo
.
logoUrl
;
let
logoUrl
=
app
.
globalData
&&
app
.
globalData
.
shopInfo
&&
a
pp
.
globalData
.
shopInfo
.
logoUrl
;
return
logoUrl
?
DFSImg
(
logoUrl
):
""
;
return
logoUrl
?
DFSImg
(
logoUrl
):
""
;
},
},
},
},
...
...
src/pages/home/index.vue
View file @
3524bea4
...
@@ -387,7 +387,9 @@ export default {
...
@@ -387,7 +387,9 @@ export default {
})
})
});
});
}
}
if
(
this
.
$options
)
{
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
}
if
(
options
.
from
&&
options
.
from
==
"logout"
)
{
if
(
options
.
from
&&
options
.
from
==
"logout"
)
{
//来自用户登出
//来自用户登出
wx
.
removeStorage
({
wx
.
removeStorage
({
...
...
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