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
5c005e5d
Commit
5c005e5d
authored
Sep 10, 2023
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
328d5c65
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
129 additions
and
123 deletions
+129
-123
config/xhyx_prod.env.js
+1
-0
src/components/common/CustomNav.vue
+1
-1
src/components/common/pageLoading.vue
+3
-1
src/pages/home/index.vue
+124
-121
No files found.
config/xhyx_prod.env.js
View file @
5c005e5d
...
@@ -28,6 +28,7 @@ module.exports = merge(prodEnv, {//zjgyl
...
@@ -28,6 +28,7 @@ module.exports = merge(prodEnv, {//zjgyl
POSTHOG_HOST
:
'"https://posthog.mayi118.com"'
,
POSTHOG_HOST
:
'"https://posthog.mayi118.com"'
,
MANALYTICS_HOST
:
'"http://bi.xinhuabest.com/log/xinhua.gif"'
,
MANALYTICS_HOST
:
'"http://bi.xinhuabest.com/log/xinhua.gif"'
,
AREA_JSON
:
'"https://new-xhyx.obs.cidc-rp-2005.joint.cmecloud.cn/product/json/f7746156-6329-4130-b724-eda06215ddea.json"'
,
AREA_JSON
:
'"https://new-xhyx.obs.cidc-rp-2005.joint.cmecloud.cn/product/json/f7746156-6329-4130-b724-eda06215ddea.json"'
,
SHOP_LOGO
:
'"https://new-xhyx.obs.cidc-rp-2005.joint.cmecloud.cn/product/png/dca9f433-bf71-4c0c-bf7a-bc7efbce311d.png"'
// IMG_DOMAIN: '"http://cdn.mayi888.com"',
// IMG_DOMAIN: '"http://cdn.mayi888.com"',
})
})
src/components/common/CustomNav.vue
View file @
5c005e5d
...
@@ -113,7 +113,7 @@ export default {
...
@@ -113,7 +113,7 @@ export default {
display
:
flex
;
display
:
flex
;
justify-content
:
center
;
justify-content
:
center
;
align-items
:
center
;
align-items
:
center
;
font-size
:
1
3px
;
font-size
:
1
em
;
font-family
:
"PingFangSC-Medium, PingFang SC"
;
font-family
:
"PingFangSC-Medium, PingFang SC"
;
}
}
}
}
...
...
src/components/common/pageLoading.vue
View file @
5c005e5d
...
@@ -23,7 +23,9 @@ export default {
...
@@ -23,7 +23,9 @@ export default {
computed
:
{
computed
:
{
shopLogo
()
{
shopLogo
()
{
let
logoUrl
=
""
;
let
logoUrl
=
""
;
if
(
wx
.
getStorageSync
(
"logoUrl"
))
{
if
(
process
.
env
.
SHOP_LOGO
)
{
logoUrl
=
process
.
env
.
SHOP_LOGO
;
}
else
if
(
wx
.
getStorageSync
(
"logoUrl"
))
{
logoUrl
=
wx
.
getStorageSync
(
"logoUrl"
);
logoUrl
=
wx
.
getStorageSync
(
"logoUrl"
);
}
else
{
}
else
{
logoUrl
=
app
.
globalData
&&
app
.
globalData
.
shopInfo
&&
app
.
globalData
.
shopInfo
.
logoUrl
;
logoUrl
=
app
.
globalData
&&
app
.
globalData
.
shopInfo
&&
app
.
globalData
.
shopInfo
.
logoUrl
;
...
...
src/pages/home/index.vue
View file @
5c005e5d
...
@@ -9,117 +9,119 @@
...
@@ -9,117 +9,119 @@
<CustomNav
:customBgOpacity=
"customBgOpacity"
></CustomNav>
<CustomNav
:customBgOpacity=
"customBgOpacity"
></CustomNav>
<StoreAddr
@
toUpdate=
"reloadEnterShopRule"
@
toPageLoading=
"toPageLoading"
ref=
"StoreAddr"
></StoreAddr>
<StoreAddr
@
toUpdate=
"reloadEnterShopRule"
@
toPageLoading=
"toPageLoading"
ref=
"StoreAddr"
></StoreAddr>
<ThemeDataPlant></ThemeDataPlant>
<ThemeDataPlant></ThemeDataPlant>
<div
v-for=
"(item,index) in pageData"
:key=
"index"
>
<template
v-if=
"!componentsLoading"
>
<div
v-if=
"item.componentCode=='banner' && item.componentInfo.visible == 1"
>
<div
v-for=
"(item,index) in pageData"
:key=
"index"
>
<banner
:datas=
"item"
></banner>
<div
v-if=
"item.componentCode=='banner' && item.componentInfo.visible == 1"
>
<banner
:datas=
"item"
></banner>
</div>
<div
v-else-if=
"item.componentCode=='goods-list' && item.componentInfo.visible == 1"
style=
"height:100%;"
>
<!-- ***这个商品列表组件中需要对数据做缓存,可能有多个地方同时引用此组件
必须在缓存前加个唯一标识不然所有组件全部操作同一个缓存
-->
<goods-list
:storageKey=
"'home'+index"
:class=
"['goodsListItem' + index,'goodsListItemIndex0']"
:datas=
"item"
:datasIndex=
"0"
:goodsListIndex=
"0"
></goods-list>
</div>
<div
v-else-if=
"item.componentCode == 'ranking-list' && item.componentInfo.visible == 1"
>
<ranking-list
:datas=
"item"
></ranking-list>
</div>
<div
v-else-if=
"item.componentCode == 'area-navigation' && item.componentInfo.visible == 1"
>
<area-navigation
:datas=
"item"
:changeLocation=
"changeLocation"
></area-navigation>
</div>
<div
v-else-if=
"item.componentCode == 'cube-nav' && item.componentInfo.visible == 1"
>
<cube-nav
:datas=
"item"
></cube-nav>
</div>
<!-- 五粮液的餐厅推荐 -->
<div
v-else-if=
"item.componentCode == 'restaurant-list' && item.componentInfo.visible == 1"
>
<restaurant-list
:datas=
"item"
></restaurant-list>
</div>
<div
v-else-if=
"item.componentCode == 'time-limited-discount' && item.componentInfo.visible == 1"
>
<time-limited-discount
:class=
"'time-limited-discount'+index"
:datas=
"item"
:k=
"index"
></time-limited-discount>
</div>
<div
v-if=
"item.componentCode == 'links' && item.componentInfo.visible == 1"
>
<links
:datas=
"item"
></links>
</div>
<div
v-if=
"item.componentCode == 'interval' && item.componentInfo.visible == 1"
>
<interval
:datas=
"item"
></interval>
</div>
<div
v-if=
"item.componentCode == 'partition' && item.componentInfo.visible == 1"
>
<partition
:datas=
"item"
></partition>
</div>
<div
v-if=
"item.componentCode == 'shop-popup' && item.componentInfo.visible == 1"
>
<shop-popup
:datas=
"item"
></shop-popup>
</div>
<div
v-if=
"item.componentCode == 'float-button' && item.componentInfo.visible == 1"
>
<float-button
:datas=
"item"
></float-button>
</div>
<div
v-if=
"item.componentCode == 'text-text' && item.componentInfo.visible == 1"
>
<text-text
:datas=
"item"
></text-text>
</div>
<div
v-if=
"item.componentCode == 'img-text' && item.componentInfo.visible == 1"
>
<img-text
:datas=
"item"
></img-text>
</div>
<div
v-if=
"item.componentCode == 'goods-search' && item.componentInfo.visible == 1"
>
<goods-search
:datas=
"item"
></goods-search>
</div>
<div
v-if=
"item.componentCode == 'notice' && item.componentInfo.visible == 1"
>
<notice
:datas=
"item"
></notice>
</div>
<div
v-if=
"item.componentCode == 'pop-up' && item.componentInfo.visible == 1"
>
<pop-up
:datas=
"item"
></pop-up>
</div>
<div
v-if=
"item.componentCode == 'coupon' && item.componentInfo.visible == 1"
>
<coupon
:datas=
"item"
></coupon>
</div>
<div
v-if=
"item.componentCode == 'integral-turntable' && item.componentInfo.visible == 1"
>
<integralTurntable
:datas=
"item"
></integralTurntable>
</div>
<div
v-if=
"item.componentCode == 'speedy-nav' && item.componentInfo.visible == 1"
>
<speedy-nav
:datas=
"item"
></speedy-nav>
</div>
<div
v-if=
"item.componentCode == 'video-player' && item.componentInfo.visible == 1"
>
<video-player
:class=
"'VideoPlayer' + index"
:datas=
"item"
:indexs=
"index"
></video-player>
</div>
<div
v-if=
"item.componentCode == 'official-account' && item.componentInfo.visible == 1"
>
<official-account></official-account>
</div>
<div
v-if=
"item.componentCode == 'transverse-label' && item.componentInfo.visible == 1"
>
<transverse-label
:datas=
"item"
:componentIndex=
"index"
></transverse-label>
</div>
<div
v-if=
"item.componentCode == 'photo-gallery' && item.componentInfo.visible == 1"
>
<photo-gallery
:datas=
"item"
></photo-gallery>
</div>
<div
v-if=
"item.componentCode == 'live-broadcast' && item.componentInfo.visible == 1"
>
<live-broadcast
:datas=
"item"
></live-broadcast>
</div>
<div
v-if=
"item.componentCode == 'information' && item.componentInfo.visible == 1"
>
<information
:datas=
"item"
></information>
</div>
<div
v-if=
"item.componentCode == 'share-picture' && item.componentInfo.visible == 1"
>
<share-picture
:datas=
"item"
></share-picture>
</div>
<div
v-if=
"item.componentCode == 'merchants-list' && item.componentInfo.visible == 1"
>
<merchants-list
:class=
"'merchants-list' +index"
:datas=
"item"
></merchants-list>
</div>
<div
v-if=
"item.componentCode == 'spell-group' && item.componentInfo.visible == 1"
>
<spell-group
:datas=
"item"
></spell-group>
</div>
<div
v-if=
"item.componentCode == 'wo-timeout' && item.componentInfo.visible == 1"
>
<wo-timeout
:datas=
"item"
></wo-timeout>
</div>
<div
v-if=
"item.componentCode == 'custom-list' && item.componentInfo.visible == 1"
>
<custom-list
:datas=
"item"
></custom-list>
</div>
<div
v-if=
"item.componentCode == 'rich-text' && item.componentInfo.visible == 1"
>
<rich-text
:datas=
"item"
></rich-text>
</div>
<div
v-if=
"item.componentCode == 'member-info' && item.componentInfo.visible == 1"
>
<member-info
:datas=
"item"
></member-info>
</div>
<div
v-if=
"item.componentCode == 'brand-list' && item.componentInfo.visible == 1"
>
<brandList
:datas=
"item"
></brandList>
</div>
<div
v-if=
"item.componentCode == 'embed-module' && item.componentInfo.visible == 1"
>
<embedModule
:datas=
"item"
:componentIndex=
"index"
></embedModule>
</div>
</div>
</div>
<div
v-else-if=
"item.componentCode=='goods-list' && item.componentInfo.visible == 1"
style=
"height:100%;"
>
</
template
>
<!-- ***这个商品列表组件中需要对数据做缓存,可能有多个地方同时引用此组件
必须在缓存前加个唯一标识不然所有组件全部操作同一个缓存
-->
<goods-list
:storageKey=
"'home'+index"
:class=
"['goodsListItem' + index,'goodsListItemIndex0']"
:datas=
"item"
:datasIndex=
"0"
:goodsListIndex=
"0"
></goods-list>
</div>
<div
v-else-if=
"item.componentCode == 'ranking-list' && item.componentInfo.visible == 1"
>
<ranking-list
:datas=
"item"
></ranking-list>
</div>
<div
v-else-if=
"item.componentCode == 'area-navigation' && item.componentInfo.visible == 1"
>
<area-navigation
:datas=
"item"
:changeLocation=
"changeLocation"
></area-navigation>
</div>
<div
v-else-if=
"item.componentCode == 'cube-nav' && item.componentInfo.visible == 1"
>
<cube-nav
:datas=
"item"
></cube-nav>
</div>
<!-- 五粮液的餐厅推荐 -->
<div
v-else-if=
"item.componentCode == 'restaurant-list' && item.componentInfo.visible == 1"
>
<restaurant-list
:datas=
"item"
></restaurant-list>
</div>
<div
v-else-if=
"item.componentCode == 'time-limited-discount' && item.componentInfo.visible == 1"
>
<time-limited-discount
:class=
"'time-limited-discount'+index"
:datas=
"item"
:k=
"index"
></time-limited-discount>
</div>
<div
v-if=
"item.componentCode == 'links' && item.componentInfo.visible == 1"
>
<links
:datas=
"item"
></links>
</div>
<div
v-if=
"item.componentCode == 'interval' && item.componentInfo.visible == 1"
>
<interval
:datas=
"item"
></interval>
</div>
<div
v-if=
"item.componentCode == 'partition' && item.componentInfo.visible == 1"
>
<partition
:datas=
"item"
></partition>
</div>
<div
v-if=
"item.componentCode == 'shop-popup' && item.componentInfo.visible == 1"
>
<shop-popup
:datas=
"item"
></shop-popup>
</div>
<div
v-if=
"item.componentCode == 'float-button' && item.componentInfo.visible == 1"
>
<float-button
:datas=
"item"
></float-button>
</div>
<div
v-if=
"item.componentCode == 'text-text' && item.componentInfo.visible == 1"
>
<text-text
:datas=
"item"
></text-text>
</div>
<div
v-if=
"item.componentCode == 'img-text' && item.componentInfo.visible == 1"
>
<img-text
:datas=
"item"
></img-text>
</div>
<div
v-if=
"item.componentCode == 'goods-search' && item.componentInfo.visible == 1"
>
<goods-search
:datas=
"item"
></goods-search>
</div>
<div
v-if=
"item.componentCode == 'notice' && item.componentInfo.visible == 1"
>
<notice
:datas=
"item"
></notice>
</div>
<div
v-if=
"item.componentCode == 'pop-up' && item.componentInfo.visible == 1"
>
<pop-up
:datas=
"item"
></pop-up>
</div>
<div
v-if=
"item.componentCode == 'coupon' && item.componentInfo.visible == 1"
>
<coupon
:datas=
"item"
></coupon>
</div>
<div
v-if=
"item.componentCode == 'integral-turntable' && item.componentInfo.visible == 1"
>
<integralTurntable
:datas=
"item"
></integralTurntable>
</div>
<div
v-if=
"item.componentCode == 'speedy-nav' && item.componentInfo.visible == 1"
>
<speedy-nav
:datas=
"item"
></speedy-nav>
</div>
<div
v-if=
"item.componentCode == 'video-player' && item.componentInfo.visible == 1"
>
<video-player
:class=
"'VideoPlayer' + index"
:datas=
"item"
:indexs=
"index"
></video-player>
</div>
<div
v-if=
"item.componentCode == 'official-account' && item.componentInfo.visible == 1"
>
<official-account></official-account>
</div>
<div
v-if=
"item.componentCode == 'transverse-label' && item.componentInfo.visible == 1"
>
<transverse-label
:datas=
"item"
:componentIndex=
"index"
></transverse-label>
</div>
<div
v-if=
"item.componentCode == 'photo-gallery' && item.componentInfo.visible == 1"
>
<photo-gallery
:datas=
"item"
></photo-gallery>
</div>
<div
v-if=
"item.componentCode == 'live-broadcast' && item.componentInfo.visible == 1"
>
<live-broadcast
:datas=
"item"
></live-broadcast>
</div>
<div
v-if=
"item.componentCode == 'information' && item.componentInfo.visible == 1"
>
<information
:datas=
"item"
></information>
</div>
<div
v-if=
"item.componentCode == 'share-picture' && item.componentInfo.visible == 1"
>
<share-picture
:datas=
"item"
></share-picture>
</div>
<div
v-if=
"item.componentCode == 'merchants-list' && item.componentInfo.visible == 1"
>
<merchants-list
:class=
"'merchants-list' +index"
:datas=
"item"
></merchants-list>
</div>
<div
v-if=
"item.componentCode == 'spell-group' && item.componentInfo.visible == 1"
>
<spell-group
:datas=
"item"
></spell-group>
</div>
<div
v-if=
"item.componentCode == 'wo-timeout' && item.componentInfo.visible == 1"
>
<wo-timeout
:datas=
"item"
></wo-timeout>
</div>
<div
v-if=
"item.componentCode == 'custom-list' && item.componentInfo.visible == 1"
>
<custom-list
:datas=
"item"
></custom-list>
</div>
<div
v-if=
"item.componentCode == 'rich-text' && item.componentInfo.visible == 1"
>
<rich-text
:datas=
"item"
></rich-text>
</div>
<div
v-if=
"item.componentCode == 'member-info' && item.componentInfo.visible == 1"
>
<member-info
:datas=
"item"
></member-info>
</div>
<div
v-if=
"item.componentCode == 'brand-list' && item.componentInfo.visible == 1"
>
<brandList
:datas=
"item"
></brandList>
</div>
<div
v-if=
"item.componentCode == 'embed-module' && item.componentInfo.visible == 1"
>
<embedModule
:datas=
"item"
:componentIndex=
"index"
></embedModule>
</div>
</div>
<bottomCont
v-if=
"showbottomCont"
></bottomCont>
<bottomCont
v-if=
"showbottomCont"
></bottomCont>
<
template
>
<
template
>
</
template
>
</
template
>
...
@@ -231,6 +233,7 @@ export default {
...
@@ -231,6 +233,7 @@ export default {
showbottomCont
:
false
,
//展示底部logo
showbottomCont
:
false
,
//展示底部logo
showSpe
:
false
,
showSpe
:
false
,
pageLoading
:
true
,
pageLoading
:
true
,
componentsLoading
:
true
,
firstOpenPage
:
true
,
//首次打开页面
firstOpenPage
:
true
,
//首次打开页面
h5Params
:
{},
//params
h5Params
:
{},
//params
fromPage
:
""
,
fromPage
:
""
,
...
@@ -553,11 +556,17 @@ export default {
...
@@ -553,11 +556,17 @@ export default {
},
200
),
},
200
),
methods
:
{
methods
:
{
setPageLoading
()
{
this
.
componentsLoading
=
false
;
setTimeout
(()
=>
{
this
.
pageLoading
=
false
;
},
3000
);
},
reloadEnterShopRule
()
{
reloadEnterShopRule
()
{
console
.
log
(
'eloadEnterShopRule'
)
console
.
log
(
'eloadEnterShopRule'
)
// 进店规则--首次进店调用
// 进店规则--首次进店调用
if
(
this
.
h5Params
&&
this
.
h5Params
.
offlineShopCode
)
{
if
(
this
.
h5Params
&&
this
.
h5Params
.
offlineShopCode
)
{
this
.
pageLoading
=
false
;
this
.
setPageLoading
()
;
return
;
return
;
};
};
console
.
log
(
'home-methods-reloadEnterShopRule'
)
console
.
log
(
'home-methods-reloadEnterShopRule'
)
...
@@ -567,7 +576,7 @@ export default {
...
@@ -567,7 +576,7 @@ export default {
this
.
enterStoreRule
();
this
.
enterStoreRule
();
}
else
{
}
else
{
console
.
log
(
'reloadEnterShopRule-------2'
)
console
.
log
(
'reloadEnterShopRule-------2'
)
this
.
pageLoading
=
false
;
this
.
setPageLoading
()
;
}
}
},
},
async
enterStoreRule
()
{
async
enterStoreRule
()
{
...
@@ -617,7 +626,7 @@ export default {
...
@@ -617,7 +626,7 @@ export default {
}
catch
(
error
)
{
}
catch
(
error
)
{
}
}
this
.
pageLoading
=
false
;
this
.
setPageLoading
()
;
},
},
toPageLoading
()
{
toPageLoading
()
{
// this.pageLoading = true;
// this.pageLoading = true;
...
@@ -1101,21 +1110,15 @@ export default {
...
@@ -1101,21 +1110,15 @@ export default {
async
getThemeList
()
{
async
getThemeList
()
{
console
.
log
(
"getThemeList"
)
console
.
log
(
"getThemeList"
)
this
.
pageLoading
=
true
;
this
.
pageLoading
=
true
;
this
.
componentsLoading
=
true
;
try
{
try
{
await
app
.
getThemePage
(
this
.
$store
.
state
.
extConfig
);
await
app
.
getThemePage
(
this
.
$store
.
state
.
extConfig
);
}
catch
(
error
)
{
}
catch
(
error
)
{
}
}
setTimeout
(()
=>
{
this
.
setPageLoading
();
this
.
pageLoading
=
false
;
console
.
log
(
"加载完成了"
);
},
1500
);
},
},
async
refreshInit
()
{
async
refreshInit
()
{
// this.pageLoading = true;
// setTimeout(() => {
// this.pageLoading = false;
// }, 1500);
log
.
info
(
'onPullDownRefresh'
,
this
.
$store
.
state
.
extConfig
)
log
.
info
(
'onPullDownRefresh'
,
this
.
$store
.
state
.
extConfig
)
app
.
getShopInfo
(
this
.
$store
.
state
.
extConfig
);
app
.
getShopInfo
(
this
.
$store
.
state
.
extConfig
);
try
{
try
{
...
...
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