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
788d50ad
Commit
788d50ad
authored
Aug 20, 2023
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
进入二级页面返回首页总重新渲染问题
parent
d385bc3e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
22 deletions
+37
-22
src/App.vue
+7
-8
src/pages/home/index.vue
+30
-14
No files found.
src/App.vue
View file @
788d50ad
...
@@ -15,10 +15,12 @@ export default {
...
@@ -15,10 +15,12 @@ export default {
console
.
log
(
extConfig
,
"-----------extConfig"
);
console
.
log
(
extConfig
,
"-----------extConfig"
);
if
(
JSON
.
stringify
(
extConfig
)
==
"{}"
)
{
if
(
JSON
.
stringify
(
extConfig
)
==
"{}"
)
{
let
shopItem
=
{
let
shopItem
=
{
// development: { mixid: "IR8rkL", "shopid": 3813}, //道可测试1
// development: { mixid: "iLntd3", "shopid": 3814}, //道可测试2
// development: { mixid: "ssa", "shopid": 2342}, //五粮液uat
// development: { mixid: "ssa", "shopid": 2342}, //五粮液uat
development
:
{
mixid
:
"antgood"
,
"shopid"
:
67
},
development
:
{
mixid
:
"antgood"
,
"shopid"
:
67
},
// production: { "mixid":"SWQ", "shopid": 1641 }, // 麦贝思
production
:
{
"mixid"
:
"qiyeCT"
,
"shopid"
:
1045
},
// 道可
production
:
{
"mixid"
:
"qiyeCT"
,
"shopid"
:
1045
},
// 道可
// production: { "mixid":"SWQ", "shopid": 1641 }, // 麦贝思
// production: { "mixid":"metasense_doctors", "shopid": 1238 }, // 册为医护端
// production: { "mixid":"metasense_doctors", "shopid": 1238 }, // 册为医护端
// production: { "mixid":"3QqsFT", "shopid": 1337 },
// production: { "mixid":"3QqsFT", "shopid": 1337 },
// production: { "mixid":"notSHOWROOM", "shopid": 1274 }, // 诸色
// production: { "mixid":"notSHOWROOM", "shopid": 1274 }, // 诸色
...
@@ -74,14 +76,11 @@ export default {
...
@@ -74,14 +76,11 @@ export default {
// 商城配置
// 商城配置
await
this
.
shopConfiguration
()
await
this
.
shopConfiguration
()
let
mpApp
=
getApp
();
console
.
log
(
mpApp
,
"this.mpApp"
);
mpApp
.
getShopInfo
=
this
.
getShopInfo
mpApp
.
getThemePage
=
this
.
getThemePage
setTimeout
(()
=>
{
setTimeout
(()
=>
{
let
mpApp
=
getApp
();
console
.
log
(
mpApp
,
"this.mpApp"
);
mpApp
.
getShopInfo
=
this
.
getShopInfo
mpApp
.
getThemePage
=
this
.
getThemePage
},
300
)
},
300
)
},
},
...
...
src/pages/home/index.vue
View file @
788d50ad
...
@@ -235,6 +235,7 @@ export default {
...
@@ -235,6 +235,7 @@ export default {
h5Params
:
{},
//params
h5Params
:
{},
//params
fromPage
:
""
,
fromPage
:
""
,
customBgOpacity
:
true
,
// 沉浸式风格
customBgOpacity
:
true
,
// 沉浸式风格
reloadPage
:
false
,
// 切换门店进入首页重新获取相关配置
};
};
},
},
components
:{
components
:{
...
@@ -319,7 +320,8 @@ export default {
...
@@ -319,7 +320,8 @@ export default {
// }
// }
// };
// };
},
},
onReady
(){
onReady
()
{
console
.
log
(
new
Date
().
getTime
(),
'load-----home-onReady'
)
// 上报首页打开时间
// 上报首页打开时间
if
(
wx
.
canIUse
(
'reportPerformance'
))
{
if
(
wx
.
canIUse
(
'reportPerformance'
))
{
const
performance
=
wx
.
getPerformance
()
const
performance
=
wx
.
getPerformance
()
...
@@ -353,19 +355,30 @@ export default {
...
@@ -353,19 +355,30 @@ export default {
this
.
firstOpenPage
=
false
;
this
.
firstOpenPage
=
false
;
},
},
onLoad
(
options
)
{
onLoad
(
options
)
{
if
(
this
.
$options
)
{
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
}
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'
)
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
;
console
.
log
(
h5Params
,
'--h5Params'
)
console
.
log
(
h5Params
,
'--h5Params'
)
if
(
Object
.
keys
(
h5Params
).
length
>
0
&&
h5Params
.
offlineShopCode
)
{
if
(
Object
.
keys
(
h5Params
).
length
>
0
&&
h5Params
.
offlineShopCode
)
{
// 存储h5url门店信息
console
.
log
(
"设置切换的门店"
,
h5Params
.
offlineShopCode
,
getStoreInfo
().
offlineShopCode
);
setStoreInfo
({
// 判断是否等于缓存门店,非缓存门店重新设置并初始化
offlineShopCode
:
h5Params
.
offlineShopCode
,
if
(
h5Params
.
offlineShopCode
!=
getStoreInfo
().
offlineShopCode
)
{
offlineShopName
:
h5Params
.
offlineShopName
,
// 存储h5url门店信息
});
setStoreInfo
({
offlineShopCode
:
h5Params
.
offlineShopCode
,
offlineShopName
:
h5Params
.
offlineShopName
,
});
this
.
reloadPage
=
true
;
}
}
else
{
this
.
reloadPage
=
false
;
}
}
console
.
log
(
this
.
reloadPage
,
'-reloadPage1'
)
//进页面存储需要绑定的信息
//进页面存储需要绑定的信息
if
(
options
.
userId
||
options
.
spokesmanRelId
)
{
if
(
options
.
userId
||
options
.
spokesmanRelId
)
{
wx
.
setStorage
({
wx
.
setStorage
({
...
@@ -415,9 +428,6 @@ export default {
...
@@ -415,9 +428,6 @@ export default {
})
})
});
});
}
}
if
(
this
.
$options
)
{
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
}
if
(
options
.
from
&&
options
.
from
==
"logout"
)
{
if
(
options
.
from
&&
options
.
from
==
"logout"
)
{
//来自用户登出
//来自用户登出
wx
.
removeStorage
({
wx
.
removeStorage
({
...
@@ -502,11 +512,14 @@ export default {
...
@@ -502,11 +512,14 @@ export default {
})
})
},
},
onShow
()
{
onShow
()
{
this
.
pageLoading
=
false
;
this
.
refreshInit
();
console
.
log
(
new
Date
().
getTime
(),
'load-----home-onShow'
)
console
.
log
(
new
Date
().
getTime
(),
'load-----home-onShow'
)
this
.
pageLoading
=
false
;
console
.
log
(
this
.
reloadPage
,
'-reloadPage2'
)
if
(
this
.
reloadPage
)
{
this
.
refreshInit
();
this
.
reloadPage
=
false
;
}
// 设置显示条件
// 设置显示条件
console
.
log
(
new
Date
().
getTime
(),
'--------on--------------show'
)
log
.
info
(
'--------on--------------show'
)
log
.
info
(
'--------on--------------show'
)
//分销隔流
//分销隔流
if
(
this
.
toHomePage
)
{
if
(
this
.
toHomePage
)
{
...
@@ -589,6 +602,7 @@ export default {
...
@@ -589,6 +602,7 @@ export default {
// this.pageLoading = false;
// this.pageLoading = false;
},
},
toUpdate
()
{
toUpdate
()
{
console
.
log
(
"toUpdate"
);
// 切换门店重新加载
// 切换门店重新加载
this
.
getThemeList
();
this
.
getThemeList
();
},
},
...
@@ -1073,6 +1087,7 @@ export default {
...
@@ -1073,6 +1087,7 @@ export default {
this
.
birthGifts
=
res
;
this
.
birthGifts
=
res
;
},
},
async
getThemeList
()
{
async
getThemeList
()
{
console
.
log
(
"getThemeList"
)
this
.
pageLoading
=
true
;
this
.
pageLoading
=
true
;
await
app
.
getThemePage
(
this
.
$store
.
state
.
extConfig
);
await
app
.
getThemePage
(
this
.
$store
.
state
.
extConfig
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -1163,7 +1178,8 @@ export default {
...
@@ -1163,7 +1178,8 @@ export default {
onShareTimeline
(
res
)
{
onShareTimeline
(
res
)
{
log
.
info
(
res
,
'-----onShareTimeline'
)
log
.
info
(
res
,
'-----onShareTimeline'
)
},
},
onPullDownRefresh
(){
onPullDownRefresh
()
{
console
.
log
(
"onPullDownRefresh"
);
this
.
refreshInit
();
this
.
refreshInit
();
}
}
};
};
...
...
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