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
89a1ff17
Commit
89a1ff17
authored
Jan 03, 2024
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化加载
parent
8051a704
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
42 deletions
+49
-42
src/pages/home/index.vue
+49
-42
No files found.
src/pages/home/index.vue
View file @
89a1ff17
<
template
>
<
template
>
<div
class=
"domain"
:style=
"
{'--main-color':themeColor['--main-color'],'--minor-color':themeColor['--minor-color']}">
<div
class=
"domain"
:style=
"
{'--main-color':themeColor['--main-color'],'--minor-color':themeColor['--minor-color']}">
<pageLoading
v-if=
"pageLoading"
></pageLoading>
<!-- 自定义导航头 -->
<!-- 自定义导航头 -->
<div
style=
"position:relative;"
>
<div
style=
"position:relative;"
>
<div
v-if=
"showSpokesManHome"
>
<
!--
<
div
v-if=
"showSpokesManHome"
>
<get-index-homepage
class=
"getIndexHomePage"
></get-index-homepage>
<get-index-homepage
class=
"getIndexHomePage"
></get-index-homepage>
</div>
</div>
-->
<CustomNav
:customBgOpacity=
"customBgOpacity"
></CustomNav>
<CustomNav
:customBgOpacity=
"customBgOpacity"
></CustomNav>
<StoreAddr
@
toUpdate=
"reloadEnterShopRule"
@
toPageLoading=
"toPageLoading"
ref=
"StoreAddr"
></StoreAddr>
<StoreAddr
v-if=
"showStoreAddr"
@
toUpdate=
"reloadEnterShopRule"
@
toPageLoading=
"toPageLoading"
ref=
"StoreAddr"
></StoreAddr>
<ThemeDataPlant></ThemeDataPlant>
<ThemeDataPlant></ThemeDataPlant>
<div
v-for=
"(item,index) in pageData"
:key=
"index"
>
<div
v-for=
"(item,index) in pageData"
:key=
"index"
>
<div
v-if=
"item.componentCode=='banner' && item.componentInfo.visible == 1"
>
<div
v-if=
"item.componentCode=='banner' && item.componentInfo.visible == 1"
>
...
@@ -126,6 +125,7 @@
...
@@ -126,6 +125,7 @@
<
template
>
<
template
>
</
template
>
</
template
>
</div>
</div>
<pageLoading
v-if=
"pageLoading"
></pageLoading>
<share-popup></share-popup>
<share-popup></share-popup>
<div
v-if=
"showMyCard"
>
<div
v-if=
"showMyCard"
>
<my-card></my-card>
<my-card></my-card>
...
@@ -235,9 +235,11 @@ export default {
...
@@ -235,9 +235,11 @@ export default {
pageLoading
:
true
,
pageLoading
:
true
,
firstOpenPage
:
true
,
//首次打开页面
firstOpenPage
:
true
,
//首次打开页面
h5Params
:
{},
//params
h5Params
:
{},
//params
pageOptions
:
{},
fromPage
:
""
,
fromPage
:
""
,
customBgOpacity
:
true
,
// 沉浸式风格
customBgOpacity
:
true
,
// 沉浸式风格
reloadPage
:
false
,
// 切换门店进入首页重新获取相关配置
reloadPage
:
false
,
// 切换门店进入首页重新获取相关配置
showStoreAddr
:
false
,
};
};
},
},
components
:{
components
:{
...
@@ -359,8 +361,47 @@ export default {
...
@@ -359,8 +361,47 @@ export default {
if
(
this
.
$options
)
{
if
(
this
.
$options
)
{
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
}
}
this
.
pageOptions
=
options
;
console
.
log
(
new
Date
().
getTime
(),
'load-----home-onLoad'
)
console
.
log
(
new
Date
().
getTime
(),
'load-----home-onLoad'
)
console
.
log
(
options
,
this
.
firstOpenPage
,
'---------home----options'
)
console
.
log
(
options
,
this
.
firstOpenPage
,
'---------home----options'
)
this
.
pageInit
(
options
);
},
onShow
()
{
console
.
log
(
new
Date
().
getTime
(),
'load-----home-onShow'
)
console
.
log
(
this
.
reloadPage
,
'-reloadPage2'
)
// if (this.reloadPage) {
// console.log("refreshInit--------1")
// this.refreshInit();
// this.reloadPage = false;
// }
// 设置显示条件
log
.
info
(
'--------on--------------show'
)
//分销隔流
if
(
this
.
toHomePage
)
{
let
linkVal
=
'/personalCenter/spokesmanCenter/mine/spokesmanHomePage?from=_goodsInfo'
app
.
$themeToLink
({
type
:
1
,
link
:
linkVal
,
});
}
this
.
getCartNum
();
if
(
checkTabbarPage
(
'/'
)
!=-
1
){
this
.
active
=
checkTabbarPage
(
'/'
)
}
// this.$mp.page.onPageScroll= (el)=>{
// throttle(this.scrolls(el),100)
// };
},
// 滚动节流方法
onPageScroll
:
tool
.
throttle
(
function
(
el
)
{
// console.log(el);
this
.
scrolls
(
el
[
0
])
},
200
),
methods
:
{
async
pageInit
(
options
)
{
log
.
info
(
options
,
'---------home----options'
)
log
.
info
(
options
,
'---------home----options'
)
let
h5Params
=
options
&&
options
.
params
?
JSON
.
parse
(
decodeURIComponent
(
options
.
params
))
:
{};
let
h5Params
=
options
&&
options
.
params
?
JSON
.
parse
(
decodeURIComponent
(
options
.
params
))
:
{};
this
.
h5Params
=
h5Params
;
this
.
h5Params
=
h5Params
;
...
@@ -413,6 +454,7 @@ export default {
...
@@ -413,6 +454,7 @@ export default {
offlineShopName
:
paramsObj
.
offlineShopName
,
offlineShopName
:
paramsObj
.
offlineShopName
,
});
});
}
}
this
.
showStoreAddr
=
true
;
wx
.
setStorageSync
(
'attractingCustomerChannelId'
,
sceneObj
.
attractingCustomerChannelId
);
wx
.
setStorageSync
(
'attractingCustomerChannelId'
,
sceneObj
.
attractingCustomerChannelId
);
wx
.
setStorageSync
(
this
.
$store
.
state
.
mixid
+
'storeId'
,
sceneObj
.
storeId
);
wx
.
setStorageSync
(
this
.
$store
.
state
.
mixid
+
'storeId'
,
sceneObj
.
storeId
);
wx
.
setStorageSync
(
this
.
$store
.
state
.
mixid
+
'sellerId'
,
sceneObj
.
sellerId
);
wx
.
setStorageSync
(
this
.
$store
.
state
.
mixid
+
'sellerId'
,
sceneObj
.
sellerId
);
...
@@ -435,8 +477,8 @@ export default {
...
@@ -435,8 +477,8 @@ export default {
})
})
}
}
}
}
wx
.
nextTick
(()
=>
{
}
else
{
})
;
this
.
showStoreAddr
=
true
;
}
}
if
(
options
.
from
&&
options
.
from
==
"logout"
)
{
if
(
options
.
from
&&
options
.
from
==
"logout"
)
{
//来自用户登出
//来自用户登出
...
@@ -522,41 +564,6 @@ export default {
...
@@ -522,41 +564,6 @@ export default {
}
}
})
})
},
},
onShow
()
{
console
.
log
(
new
Date
().
getTime
(),
'load-----home-onShow'
)
console
.
log
(
this
.
reloadPage
,
'-reloadPage2'
)
// if (this.reloadPage) {
// console.log("refreshInit--------1")
// this.refreshInit();
// this.reloadPage = false;
// }
// 设置显示条件
log
.
info
(
'--------on--------------show'
)
//分销隔流
if
(
this
.
toHomePage
)
{
let
linkVal
=
'/personalCenter/spokesmanCenter/mine/spokesmanHomePage?from=_goodsInfo'
app
.
$themeToLink
({
type
:
1
,
link
:
linkVal
,
});
}
this
.
getCartNum
();
if
(
checkTabbarPage
(
'/'
)
!=-
1
){
this
.
active
=
checkTabbarPage
(
'/'
)
}
// this.$mp.page.onPageScroll= (el)=>{
// throttle(this.scrolls(el),100)
// };
},
// 滚动节流方法
onPageScroll
:
tool
.
throttle
(
function
(
el
)
{
// console.log(el);
this
.
scrolls
(
el
[
0
])
},
200
),
methods
:
{
setPageLoading
()
{
setPageLoading
()
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
pageLoading
=
false
;
this
.
pageLoading
=
false
;
...
@@ -564,7 +571,6 @@ export default {
...
@@ -564,7 +571,6 @@ export default {
},
},
reloadEnterShopRule
()
{
reloadEnterShopRule
()
{
console
.
log
(
'eloadEnterShopRule'
,
this
.
h5Params
)
console
.
log
(
'eloadEnterShopRule'
,
this
.
h5Params
)
// 进店规则--首次进店调用
if
(
this
.
h5Params
&&
this
.
h5Params
.
offlineShopCode
)
{
if
(
this
.
h5Params
&&
this
.
h5Params
.
offlineShopCode
)
{
console
.
log
(
"refreshInit--------2"
)
console
.
log
(
"refreshInit--------2"
)
this
.
refreshInit
();
this
.
refreshInit
();
...
@@ -572,6 +578,7 @@ export default {
...
@@ -572,6 +578,7 @@ export default {
return
;
return
;
};
};
console
.
log
(
'home-methods-reloadEnterShopRule'
)
console
.
log
(
'home-methods-reloadEnterShopRule'
)
// 进店规则--首次进店调用
if
(
wx
.
getStorageSync
(
"firstView"
)
==
1
)
{
if
(
wx
.
getStorageSync
(
"firstView"
)
==
1
)
{
console
.
log
(
'reloadEnterShopRule-------1'
)
console
.
log
(
'reloadEnterShopRule-------1'
)
wx
.
removeStorageSync
(
"firstView"
);
wx
.
removeStorageSync
(
"firstView"
);
...
...
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