Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-business
/
scrm-equity-new
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 26b624b5
authored
Nov 04, 2021
by
杨北旺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改小程序定位/体验卡/开通页面
1 parent
75ab3d9e
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
206 additions
and
34 deletions
src/main.js
src/router/index.js
src/views/cardRoll/opening.vue
src/views/commodity/business.vue
src/views/common/expcard.vue
src/views/equity/businessList.vue
src/views/equity/index.vue
src/main.js
View file @
26b624b
...
@@ -10,9 +10,9 @@ import store from "./store"
...
@@ -10,9 +10,9 @@ import store from "./store"
import
axios
from
'axios'
import
axios
from
'axios'
Vue
.
use
(
VueWechatTitle
)
Vue
.
use
(
VueWechatTitle
)
Vue
.
use
(
Vant
)
Vue
.
use
(
Vant
)
//
import VConsole from 'vconsole'
import
VConsole
from
'vconsole'
//
const vConsole = new VConsole()
const
vConsole
=
new
VConsole
()
//
Vue.use(vConsole)
Vue
.
use
(
vConsole
)
import
preview
from
'vue-photo-preview'
import
preview
from
'vue-photo-preview'
import
'vue-photo-preview/dist/skin.css'
import
'vue-photo-preview/dist/skin.css'
Vue
.
use
(
preview
)
Vue
.
use
(
preview
)
...
...
src/router/index.js
View file @
26b624b
...
@@ -125,6 +125,9 @@ const setUserInfo = params => {
...
@@ -125,6 +125,9 @@ const setUserInfo = params => {
localStorage
.
setItem
(
'APPID'
,
params
.
appId
)
localStorage
.
setItem
(
'APPID'
,
params
.
appId
)
}
}
sessionStorage
.
setItem
(
'URL_PARAM'
,
JSON
.
stringify
(
params
))
sessionStorage
.
setItem
(
'URL_PARAM'
,
JSON
.
stringify
(
params
))
if
(
user
.
freecard
)
{
localStorage
.
setItem
(
'bindinfo'
,
JSON
.
stringify
(
user
.
bingInfo
))
}
user
.
nickName
=
user
.
phone
user
.
nickName
=
user
.
phone
store
.
commit
(
'setUserInfo'
,
user
)
store
.
commit
(
'setUserInfo'
,
user
)
}
else
{
}
else
{
...
...
src/views/cardRoll/opening.vue
View file @
26b624b
...
@@ -5,6 +5,13 @@
...
@@ -5,6 +5,13 @@
<span
class=
"card_title"
>
{{
equityName
}}
</span>
<span
class=
"card_title"
>
{{
equityName
}}
</span>
<span
class=
"card_title_1"
>
尊享100+专属权益
</span>
<span
class=
"card_title_1"
>
尊享100+专属权益
</span>
</div>
</div>
<div
v-if=
"platform.platform!='app'"
class=
"activity_widget"
>
<img
class=
"img_bg"
:src=
"imgBase_url + 'open_activity.png'"
@
click=
"toArticle"
/>
</div>
<div
class=
"image_widget"
>
<div
class=
"image_widget"
>
<img
class=
"img_bg"
:src=
"imgBase_url + 'scrm_opening.png'"
/>
<img
class=
"img_bg"
:src=
"imgBase_url + 'scrm_opening.png'"
/>
</div>
</div>
...
@@ -15,7 +22,7 @@
...
@@ -15,7 +22,7 @@
@
click=
"jumpOpen"
@
click=
"jumpOpen"
/>
/>
</div>
</div>
<div
style=
"height:110px"
></div>
<div
style=
"height:
110px"
></div>
<div
class=
"fixed_wrapper"
>
<div
class=
"fixed_wrapper"
>
<div
class=
"btn_wrap"
>
<div
class=
"btn_wrap"
>
<div
<div
...
@@ -141,6 +148,7 @@ export default {
...
@@ -141,6 +148,7 @@ export default {
payStatus
:
0
,
payStatus
:
0
,
isOpen
:
0
,
isOpen
:
0
,
channelType
:
0
,
// 2是广汇
channelType
:
0
,
// 2是广汇
platform
:{}
};
};
},
},
created
()
{
created
()
{
...
@@ -356,6 +364,13 @@ export default {
...
@@ -356,6 +364,13 @@ export default {
let
url
=
`
${
href
}
/#/cardRoll/agreement?sessionId=
${
sessionId
}
`
;
let
url
=
`
${
href
}
/#/cardRoll/agreement?sessionId=
${
sessionId
}
`
;
this
.
openWindows
(
url
,
"cardRoll.agreement"
);
this
.
openWindows
(
url
,
"cardRoll.agreement"
);
},
},
toArticle
()
{
if
(
this
.
channelType
==
2
)
{
this
.
openWindows
(
"https://mp.weixin.qq.com/s/q-01zUdBjlOc4z_5HO-ruA"
);
}
else
{
this
.
openWindows
(
"https://mp.weixin.qq.com/s/Gj3PE3n31PHMOMc5S1CYkg"
);
}
},
},
},
beforeDestroy
()
{
beforeDestroy
()
{
clearInterval
(
this
.
timer
);
clearInterval
(
this
.
timer
);
...
@@ -401,6 +416,12 @@ export default {
...
@@ -401,6 +416,12 @@ export default {
text-shadow
:
0
2px
4px
rgba
(
255
,
123
,
43
,
0.24
);
text-shadow
:
0
2px
4px
rgba
(
255
,
123
,
43
,
0.24
);
}
}
}
}
.activity_widget
{
.img_bg
{
width
:
100%
;
height
:
100%
;
}
}
.image_widget
{
.image_widget
{
margin-top
:
16px
;
margin-top
:
16px
;
.img_bg
{
.img_bg
{
...
@@ -415,7 +436,7 @@ export default {
...
@@ -415,7 +436,7 @@ export default {
height
:
90px
;
height
:
90px
;
}
}
}
}
.fixed_wrapper
{
.fixed_wrapper
{
position
:
fixed
;
position
:
fixed
;
left
:
0
;
left
:
0
;
right
:
0
;
right
:
0
;
...
...
src/views/commodity/business.vue
View file @
26b624b
...
@@ -122,7 +122,13 @@
...
@@ -122,7 +122,13 @@
v-if=
"isHaveInventory"
v-if=
"isHaveInventory"
@
click=
"toBuyGoods"
@
click=
"toBuyGoods"
>
>
<span>
{{
isOpen
||
!
selectData
.
noMemberPrice
?
selectData
.
salesPrice
:
selectData
.
noMemberPrice
}}
元
</span>
立即购买
<span
>
{{
isOpen
||
!
selectData
.
noMemberPrice
?
selectData
.
salesPrice
:
selectData
.
noMemberPrice
}}
元
</span
>
立即购买
</div>
</div>
<div
class=
"recharge-operation disabled"
v-if=
"!isHaveInventory"
>
<div
class=
"recharge-operation disabled"
v-if=
"!isHaveInventory"
>
该商品已售罄
该商品已售罄
...
@@ -183,6 +189,7 @@
...
@@ -183,6 +189,7 @@
import
{
pay
}
from
"@/mixins"
;
import
{
pay
}
from
"@/mixins"
;
import
{
commodity
,
equity
}
from
"@r/api"
;
import
{
commodity
,
equity
}
from
"@r/api"
;
// import { Dialog } from 'vant'
// import { Dialog } from 'vant'
import
AMap
from
"AMap"
;
import
WxConfig
from
"@u/WxConfig"
;
import
WxConfig
from
"@u/WxConfig"
;
const
WX
=
new
WxConfig
([
"openLocation"
,
"getLocation"
]);
const
WX
=
new
WxConfig
([
"openLocation"
,
"getLocation"
]);
import
MyModal
from
"../../components/MyModal.vue"
;
import
MyModal
from
"../../components/MyModal.vue"
;
...
@@ -207,6 +214,7 @@ export default {
...
@@ -207,6 +214,7 @@ export default {
showModal
:
false
,
showModal
:
false
,
diffPrice
:
0
,
diffPrice
:
0
,
isLogin
:
true
,
isLogin
:
true
,
showAuthBtn
:
false
,
};
};
},
},
created
()
{
created
()
{
...
@@ -215,13 +223,35 @@ export default {
...
@@ -215,13 +223,35 @@ export default {
this
.
isLogin
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"LOGIN_TYPE"
));
this
.
isLogin
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"LOGIN_TYPE"
));
}
}
this
.
platform
=
sign
;
this
.
platform
=
sign
;
if
(
sign
.
platform
==
"mini"
)
{
let
address
=
this
.
getLocalStorage
(
"addressInfo"
);
let
showLocation
=
this
.
getLocalStorage
(
"isShowLoacationModal"
);
if
(
showLocation
)
{
this
.
showAuthBtn
=
true
;
this
.
getBusineInfo
()
return
;
}
else
{
//开启定位
if
(
address
){
console
.
log
(
1111110
);
this
.
getBusineInfo
()
}
else
{
this
.
initLocation
();
}
}
}
},
},
mounted
()
{
mounted
()
{
if
(
this
.
platform
.
platform
!=
'mini'
){
this
.
getBusineInfo
()
}
},
methods
:
{
// 获取商品详情
getBusineInfo
()
{
this
.
showLoading
();
this
.
showLoading
();
// const ua = navigator.userAgent.toLowerCase()
// let { latitude, longitude } = this.$store.state.address;
let
address
=
this
.
getLocalStorage
(
"addressInfo"
);
let
address
=
this
.
getLocalStorage
(
"addressInfo"
);
let
{
latitude
,
longitude
}
=
address
let
{
latitude
,
longitude
}
=
address
;
if
(
this
.
platform
.
platform
==
"H5"
)
{
if
(
this
.
platform
.
platform
==
"H5"
)
{
let
options
=
this
.
$route
.
query
;
let
options
=
this
.
$route
.
query
;
document
.
title
=
options
.
brandName
;
document
.
title
=
options
.
brandName
;
...
@@ -243,15 +273,13 @@ export default {
...
@@ -243,15 +273,13 @@ export default {
}
else
if
(
this
.
platform
.
platform
==
"mini"
)
{
}
else
if
(
this
.
platform
.
platform
==
"mini"
)
{
let
options
=
this
.
$route
.
query
;
let
options
=
this
.
$route
.
query
;
if
(
options
.
urlParam
)
{
if
(
options
.
urlParam
)
{
let
{
sessionId
,
brandName
,
supplier
,
selectedId
,
lat
,
lng
}
=
let
{
sessionId
,
brandName
,
supplier
,
selectedId
}
=
JSON
.
parse
(
options
.
urlParam
);
JSON
.
parse
(
options
.
urlParam
);
this
.
sessionId
=
sessionId
;
this
.
sessionId
=
sessionId
;
sessionStorage
.
setItem
(
"URL_PARAM"
,
options
.
urlParam
);
sessionStorage
.
setItem
(
"URL_PARAM"
,
options
.
urlParam
);
document
.
title
=
brandName
;
document
.
title
=
brandName
;
this
.
brandName
=
brandName
;
this
.
brandName
=
brandName
;
this
.
supplier
=
supplier
;
this
.
supplier
=
supplier
;
latitude
=
lat
;
longitude
=
lng
;
if
(
selectedId
)
{
if
(
selectedId
)
{
//首页选择的元素
//首页选择的元素
this
.
selectedId
=
selectedId
;
this
.
selectedId
=
selectedId
;
...
@@ -278,25 +306,13 @@ export default {
...
@@ -278,25 +306,13 @@ export default {
};
};
this
.
businessList
=
data
.
goodsDetailList
;
this
.
businessList
=
data
.
goodsDetailList
;
this
.
selectData
=
this
.
businessList
[
0
];
this
.
selectData
=
this
.
businessList
[
0
];
// if(this.selectedId){//存在则是从精选处跳转进来的
// this.businessList.forEach((el,index)=>{
// if(el.id==this.selectedId){
// this.selectData = this.businessList[index]
// this.bindex = index
// if(this.businessList.length>3) {
// document.querySelector('.business-select').scrollLeft = document.querySelector(`.select-${index}`).offsetLeft - 10;
// }
// }
// })
// }
this
.
checkInventory
(
this
.
selectData
.
id
);
this
.
checkInventory
(
this
.
selectData
.
id
);
this
.
autoSelect
()
this
.
autoSelect
();
}
else
{
}
else
{
this
.
showToast
(
message
);
this
.
showToast
(
message
);
}
}
});
});
},
},
methods
:
{
getCardInfo
()
{
getCardInfo
()
{
if
(
!
this
.
isLogin
)
{
if
(
!
this
.
isLogin
)
{
return
;
return
;
...
@@ -391,7 +407,7 @@ export default {
...
@@ -391,7 +407,7 @@ export default {
},
},
// 精选进来自动滚动
// 精选进来自动滚动
autoSelect
()
{
autoSelect
()
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
if
(
this
.
selectedId
)
{
if
(
this
.
selectedId
)
{
//存在则是从精选处跳转进来的
//存在则是从精选处跳转进来的
this
.
businessList
.
forEach
((
el
,
index
)
=>
{
this
.
businessList
.
forEach
((
el
,
index
)
=>
{
...
@@ -405,8 +421,45 @@ export default {
...
@@ -405,8 +421,45 @@ export default {
}
}
});
});
}
}
},
500
)
},
500
);
},
// 小程序端定位
initLocation
()
{
this
.
setLocalStorage
(
"isShowLoacationModal"
,
true
);
WX
.
getLocation
().
then
((
res
)
=>
{
this
.
mapChange
(
res
);
});
},
mapChange
(
e
)
{
AMap
.
plugin
(
"AMap.Geocoder"
,
()
=>
{
const
geocoder
=
new
AMap
.
Geocoder
();
let
{
longitude
,
latitude
}
=
e
;
let
lnglat
=
[
longitude
,
latitude
];
geocoder
.
getAddress
(
lnglat
,
(
status
,
result
)
=>
{
let
{
info
,
regeocode
:
{
formattedAddress
,
addressComponent
:
{
adcode
},
},
}
=
result
;
if
(
status
===
"complete"
&&
info
===
"OK"
)
{
// result为对应的地理位置详细信息
this
.
addressInfo
=
{
longitude
,
latitude
,
cityCode
:
adcode
,
address
:
formattedAddress
,
};
this
.
$store
.
commit
(
"setAddress"
,
this
.
addressInfo
);
this
.
setLocalStorage
(
"addressInfo"
,
this
.
addressInfo
);
this
.
setLocalStorage
(
"isShowLoacationModal"
,
false
);
this
.
getBusineInfo
()
}
else
{
console
.
log
(
"获取定位失败"
,
info
);
}
});
});
},
},
},
},
};
};
...
...
src/views/common/expcard.vue
View file @
26b624b
...
@@ -39,7 +39,11 @@ export default {
...
@@ -39,7 +39,11 @@ export default {
}
;
}
;
}
,
}
,
mounted
()
{
mounted
()
{
let
sign
=
this
.
getEnvironmentAndSource
();
this
.
platform
=
sign
if
(
sign
.
platform
==
'H5'
){
this
.
authcode
()
this
.
authcode
()
}
if
(
countDownTime
)
clearInterval
(
countDownTime
);
if
(
countDownTime
)
clearInterval
(
countDownTime
);
let
nowTime
=
Math
.
round
(
new
Date
()
/
1000
);
let
nowTime
=
Math
.
round
(
new
Date
()
/
1000
);
let
count
=
60
;
let
count
=
60
;
...
@@ -100,7 +104,9 @@ export default {
...
@@ -100,7 +104,9 @@ export default {
const
ua
=
navigator
.
userAgent
.
toLowerCase
()
const
ua
=
navigator
.
userAgent
.
toLowerCase
()
if
(
ua
.
match
(
/MicroMessenger/i
)
==
'micromessenger'
){
//微信环境
if
(
ua
.
match
(
/MicroMessenger/i
)
==
'micromessenger'
){
//微信环境
para
.
appId
=
appId
para
.
appId
=
appId
if
(
this
.
platform
.
platform
==
'H5'
){
para
.
code
=
params
.
code
para
.
code
=
params
.
code
}
this
.
removeLocalStorage
(
'bindinfo'
)
this
.
removeLocalStorage
(
'bindinfo'
)
this
.
removeLocalStorage
(
'showMydialog'
)
this
.
removeLocalStorage
(
'showMydialog'
)
this
.
removeLocalStorage
(
'showMydialog1'
)
this
.
removeLocalStorage
(
'showMydialog1'
)
...
@@ -113,7 +119,14 @@ export default {
...
@@ -113,7 +119,14 @@ export default {
return
return
}
}
sessionStorage
.
setItem
(
"LOGIN_TYPE"
,
true
);
sessionStorage
.
setItem
(
"LOGIN_TYPE"
,
true
);
if
(
this
.
platform
.
platform
==
'H5'
){
window
.
location
.
href
=
`${window.location.href.split('?')[0]
}
#/equity/index?pageFrom=expcard`
window
.
location
.
href
=
`${window.location.href.split('?')[0]
}
#/equity/index?pageFrom=expcard`
}
else
if
(
this
.
platform
.
platform
==
'mini'
){
let
temp
=
encodeURIComponent
(
JSON
.
stringify
(
res
))
wx
.
miniProgram
.
switchTab
({
url
:
`/pages/tab/equity/equity?freecard=${temp
}
`
}
)
}
}
)
}
)
}
else
{
//非微信环境
}
else
{
//非微信环境
equity
.
bindExpCard
(
para
).
then
(
res
=>
{
equity
.
bindExpCard
(
para
).
then
(
res
=>
{
...
...
src/views/equity/businessList.vue
View file @
26b624b
...
@@ -21,6 +21,9 @@
...
@@ -21,6 +21,9 @@
<
script
type=
'text/ecmascript-6'
>
<
script
type=
'text/ecmascript-6'
>
import
BusinessItem
from
"./businesstem.vue"
;
import
BusinessItem
from
"./businesstem.vue"
;
import
{
equity
}
from
"@r/api.js"
;
import
{
equity
}
from
"@r/api.js"
;
import
AMap
from
"AMap"
;
import
WxConfig
from
"@u/WxConfig"
;
const
WX
=
new
WxConfig
([
"openLocation"
,
"getLocation"
]);
export
default
{
export
default
{
name
:
""
,
name
:
""
,
components
:
{
BusinessItem
},
components
:
{
BusinessItem
},
...
@@ -35,6 +38,7 @@ export default {
...
@@ -35,6 +38,7 @@ export default {
bsloding
:
false
,
bsloding
:
false
,
bsfinshed
:
false
,
bsfinshed
:
false
,
homeBusinessList
:
[],
homeBusinessList
:
[],
showAuthBtn
:
false
,
};
};
},
},
mounted
()
{
mounted
()
{
...
@@ -47,14 +51,29 @@ export default {
...
@@ -47,14 +51,29 @@ export default {
sessionStorage
.
setItem
(
"URL_PARAM"
,
options
.
urlParam
);
sessionStorage
.
setItem
(
"URL_PARAM"
,
options
.
urlParam
);
this
.
addressInfo
=
addressInfo
;
this
.
addressInfo
=
addressInfo
;
}
}
let
showLocation
=
this
.
getLocalStorage
(
"isShowLoacationModal"
);
if
(
showLocation
)
{
this
.
showAuthBtn
=
true
;
return
;
}
else
{
//开启定位
let
address
=
this
.
getLocalStorage
(
"addressInfo"
);
if
(
address
)
{
// 如果首页已经定位过,则不需要重新定位
this
.
addressInfo
=
address
;
this
.
getBusinessList
();
}
else
{
this
.
initLocation
();
}
}
}
}
else
{
let
address
=
this
.
getLocalStorage
(
"addressInfo"
);
let
address
=
this
.
getLocalStorage
(
"addressInfo"
);
this
.
addressInfo
=
address
;
this
.
addressInfo
=
address
;
this
.
getBusinessList
();
this
.
getBusinessList
();
}
},
},
methods
:
{
methods
:
{
getBusinessList
()
{
getBusinessList
()
{
if
(
this
.
businessParam
.
pageSize
==
0
)
{
if
(
this
.
businessParam
.
pageSize
==
0
)
{
this
.
showLoading
();
this
.
showLoading
();
}
}
let
{
latitude
,
longitude
}
=
this
.
addressInfo
;
let
{
latitude
,
longitude
}
=
this
.
addressInfo
;
...
@@ -97,6 +116,44 @@ export default {
...
@@ -97,6 +116,44 @@ export default {
this
.
getBusinessList
();
this
.
getBusinessList
();
}
}
},
},
// 小程序端定位
initLocation
()
{
this
.
setLocalStorage
(
"isShowLoacationModal"
,
true
);
WX
.
getLocation
().
then
((
res
)
=>
{
this
.
mapChange
(
res
);
});
},
mapChange
(
e
)
{
AMap
.
plugin
(
"AMap.Geocoder"
,
()
=>
{
const
geocoder
=
new
AMap
.
Geocoder
();
let
{
longitude
,
latitude
}
=
e
;
let
lnglat
=
[
longitude
,
latitude
];
geocoder
.
getAddress
(
lnglat
,
(
status
,
result
)
=>
{
let
{
info
,
regeocode
:
{
formattedAddress
,
addressComponent
:
{
adcode
},
},
}
=
result
;
if
(
status
===
"complete"
&&
info
===
"OK"
)
{
// result为对应的地理位置详细信息
this
.
addressInfo
=
{
longitude
,
latitude
,
cityCode
:
adcode
,
address
:
formattedAddress
,
};
this
.
$store
.
commit
(
"setAddress"
,
this
.
addressInfo
);
this
.
setLocalStorage
(
"addressInfo"
,
this
.
addressInfo
);
this
.
setLocalStorage
(
"isShowLoacationModal"
,
false
);
this
.
getBusinessList
();
}
else
{
console
.
log
(
"获取定位失败"
,
info
);
}
});
});
},
},
},
};
};
</
script
>
</
script
>
...
...
src/views/equity/index.vue
View file @
26b624b
...
@@ -365,7 +365,7 @@ export default {
...
@@ -365,7 +365,7 @@ export default {
//微信环境
//微信环境
isWXH5Environment
:
true
,
isWXH5Environment
:
true
,
//定位信息
//定位信息
addressInfo
:
{}
,
addressInfo
:
null
,
//金刚区数据
//金刚区数据
menuList
:
[],
menuList
:
[],
menuH
:
true
,
menuH
:
true
,
...
@@ -409,6 +409,7 @@ export default {
...
@@ -409,6 +409,7 @@ export default {
bsloding
:
false
,
bsloding
:
false
,
bsfinshed
:
false
,
bsfinshed
:
false
,
homeBusinessList
:
[],
homeBusinessList
:
[],
showAuthBtn
:
false
,
};
};
},
},
mixins
:
[
indexMixin
],
mixins
:
[
indexMixin
],
...
@@ -426,7 +427,7 @@ export default {
...
@@ -426,7 +427,7 @@ export default {
this
.
platform
=
sign
;
this
.
platform
=
sign
;
if
(
sign
.
platform
==
"mini"
)
{
if
(
sign
.
platform
==
"mini"
)
{
this
.
tabText
=
[
"直充优惠"
,
"附近优惠"
];
this
.
tabText
=
[
"直充优惠"
,
"附近优惠"
];
this
.
activeItem
=
'直充优惠'
this
.
activeItem
=
"直充优惠"
;
document
.
title
=
"权益中心"
;
document
.
title
=
"权益中心"
;
}
}
this
.
getMemberInfoData
();
this
.
getMemberInfoData
();
...
@@ -449,7 +450,18 @@ export default {
...
@@ -449,7 +450,18 @@ export default {
// 页面入口判断
// 页面入口判断
this
.
judgeFrom
(
routerQuery
,
result
);
this
.
judgeFrom
(
routerQuery
,
result
);
this
.
getRechargeList
();
this
.
getRechargeList
();
// 小程序端不默认定位
if
(
this
.
platform
.
platform
!=
"mini"
)
{
this
.
initLocation
();
this
.
initLocation
();
}
else
{
let
address
=
this
.
getLocalStorage
(
"addressInfo"
);
if
(
address
)
{
// 如果首页已经定位过,则不需要重新定位
console
.
log
(
1111
);
this
.
addressInfo
=
address
;
this
.
getBusinessList
();
}
}
},
},
methods
:
{
methods
:
{
// 轮播图当前指标index
// 轮播图当前指标index
...
@@ -714,6 +726,16 @@ export default {
...
@@ -714,6 +726,16 @@ export default {
changeTab
(
index
,
item
)
{
changeTab
(
index
,
item
)
{
this
.
curTabIndex
=
index
;
this
.
curTabIndex
=
index
;
this
.
activeItem
=
item
;
this
.
activeItem
=
item
;
let
showLocation
=
this
.
getLocalStorage
(
"isShowLoacationModal"
);
if
(
showLocation
)
{
this
.
showAuthBtn
=
true
;
return
;
}
let
address
=
this
.
getLocalStorage
(
"addressInfo"
);
if
(
item
==
"附近优惠"
&&
this
.
platform
.
platform
==
"mini"
&&!
address
)
{
this
.
initLocation
();
this
.
setLocalStorage
(
"isShowLoacationModal"
,
true
);
}
},
},
// 初始化定位环境---考虑到存在位置移动情况,所以每次页面返回都定位请求一次
// 初始化定位环境---考虑到存在位置移动情况,所以每次页面返回都定位请求一次
initLocation
()
{
initLocation
()
{
...
@@ -752,6 +774,9 @@ export default {
...
@@ -752,6 +774,9 @@ export default {
this
.
getBusinessList
();
this
.
getBusinessList
();
this
.
$store
.
commit
(
"setAddress"
,
this
.
addressInfo
);
this
.
$store
.
commit
(
"setAddress"
,
this
.
addressInfo
);
this
.
setLocalStorage
(
"addressInfo"
,
this
.
addressInfo
);
this
.
setLocalStorage
(
"addressInfo"
,
this
.
addressInfo
);
if
(
this
.
platform
.
platform
==
"mini"
)
{
this
.
setLocalStorage
(
"isShowLoacationModal"
,
false
);
}
}
else
{
}
else
{
console
.
log
(
"获取定位失败"
,
info
);
console
.
log
(
"获取定位失败"
,
info
);
}
}
...
@@ -832,7 +857,7 @@ export default {
...
@@ -832,7 +857,7 @@ export default {
// 跳转到权益页面
// 跳转到权益页面
toNewPage
(
item
)
{
toNewPage
(
item
)
{
let
{
sessionId
}
=
this
.
$store
.
state
;
let
{
sessionId
}
=
this
.
$store
.
state
;
let
{
latitude
,
longitude
}
=
this
.
addressInfo
;
//
let { latitude, longitude } = this.addressInfo;
if
(
item
.
appearance
==
1
)
{
if
(
item
.
appearance
==
1
)
{
let
[
href
]
=
window
.
location
.
href
.
split
(
"/#/"
);
let
[
href
]
=
window
.
location
.
href
.
split
(
"/#/"
);
let
url
=
`
${
href
}
/#/commodity/business?sessionId=
${
sessionId
}
&supplier=
${
item
.
supplier
}
&brandName=
${
item
.
brandName
}
`
;
let
url
=
`
${
href
}
/#/commodity/business?sessionId=
${
sessionId
}
&supplier=
${
item
.
supplier
}
&brandName=
${
item
.
brandName
}
`
;
...
@@ -840,8 +865,8 @@ export default {
...
@@ -840,8 +865,8 @@ export default {
sessionId
:
sessionId
,
sessionId
:
sessionId
,
supplier
:
item
.
supplier
,
supplier
:
item
.
supplier
,
brandName
:
item
.
brandName
,
brandName
:
item
.
brandName
,
lat
:
latitude
,
//
lat: latitude,
lng
:
longitude
,
//
lng: longitude,
};
};
this
.
openWindows
(
url
,
"commodity.business"
,
query
);
this
.
openWindows
(
url
,
"commodity.business"
,
query
);
}
else
if
(
item
.
appearance
==
2
)
{
}
else
if
(
item
.
appearance
==
2
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment