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
2eed8a7b
Commit
2eed8a7b
authored
Feb 25, 2022
by
柳士祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页加载速度代码回滚
parent
080c37a3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
21 additions
and
255 deletions
+21
-255
project.config.json
+5
-5
src/components/basicTool/transverse-label/index.vue
+1
-2
src/pages/home/index.vue
+6
-24
static/nativeComponents/GoodsList/GoodsItem/index.wxml
+0
-11
static/nativeComponents/GoodsList/GoodsItem/index.wxss
+0
-2
static/nativeComponents/GoodsList/index.js
+6
-203
static/nativeComponents/GoodsList/index.wxml
+3
-8
No files found.
project.config.json
View file @
2eed8a7b
...
@@ -2,18 +2,18 @@
...
@@ -2,18 +2,18 @@
"description"
:
"项目配置文件。"
,
"description"
:
"项目配置文件。"
,
"setting"
:
{
"setting"
:
{
"urlCheck"
:
false
,
"urlCheck"
:
false
,
"es6"
:
fals
e
,
"es6"
:
tru
e
,
"enhance"
:
true
,
"enhance"
:
true
,
"postcss"
:
true
,
"postcss"
:
true
,
"preloadBackgroundData"
:
false
,
"preloadBackgroundData"
:
false
,
"minified"
:
true
,
"minified"
:
true
,
"newFeature"
:
fals
e
,
"newFeature"
:
tru
e
,
"coverView"
:
true
,
"coverView"
:
true
,
"nodeModules"
:
fals
e
,
"nodeModules"
:
tru
e
,
"autoAudits"
:
fals
e
,
"autoAudits"
:
tru
e
,
"showShadowRootInWxmlPanel"
:
true
,
"showShadowRootInWxmlPanel"
:
true
,
"scopeDataCheck"
:
false
,
"scopeDataCheck"
:
false
,
"uglifyFileName"
:
fals
e
,
"uglifyFileName"
:
tru
e
,
"checkInvalidKey"
:
true
,
"checkInvalidKey"
:
true
,
"checkSiteMap"
:
true
,
"checkSiteMap"
:
true
,
"uploadWithSourceMap"
:
true
,
"uploadWithSourceMap"
:
true
,
...
...
src/components/basicTool/transverse-label/index.vue
View file @
2eed8a7b
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
<banner
:datas=
"item1"
></banner>
<banner
:datas=
"item1"
></banner>
</div>
</div>
<div
v-else-if=
"item1.componentCode=='goods-list' && item1.componentInfo.visible == 1"
style=
"height:100%;"
>
<div
v-else-if=
"item1.componentCode=='goods-list' && item1.componentInfo.visible == 1"
style=
"height:100%;"
>
<goods-list
v-if=
"active == index"
:class=
"['goodsListItem','goodsListItemIndex'+index]"
:datas=
"item1"
:datasIndex=
"active"
:goodsListIndex=
"index
"
></goods-list>
<goods-list
:class=
"['goodsListItem']"
:datas=
"item1
"
></goods-list>
</div>
</div>
<div
v-else-if=
"item1.componentCode == 'area-navigation' && item1.componentInfo.visible == 1"
>
<div
v-else-if=
"item1.componentCode == 'area-navigation' && item1.componentInfo.visible == 1"
>
<area-navigation
:datas=
"item1"
:changeLocation=
"changeLocation"
></area-navigation>
<area-navigation
:datas=
"item1"
:changeLocation=
"changeLocation"
></area-navigation>
...
@@ -421,7 +421,6 @@ export default {
...
@@ -421,7 +421,6 @@ export default {
})
})
}
}
this
.
active
=
res
.
target
.
index
;
this
.
active
=
res
.
target
.
index
;
wx
.
setStorageSync
(
'datasIndex'
,
res
.
target
.
index
);
},
},
timeOutInitTabs
(
notGetAllTabWidth
)
{
timeOutInitTabs
(
notGetAllTabWidth
)
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
...
src/pages/home/index.vue
View file @
2eed8a7b
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<banner
:datas=
"item"
></banner>
<banner
:datas=
"item"
></banner>
</div>
</div>
<div
v-else-if=
"item.componentCode=='goods-list' && item.componentInfo.visible == 1"
style=
"height:100%;"
>
<div
v-else-if=
"item.componentCode=='goods-list' && item.componentInfo.visible == 1"
style=
"height:100%;"
>
<goods-list
:class=
"
['goodsListItem' + index,'goodsListItemIndex0']"
:datas=
"item"
:single=
"true
"
></goods-list>
<goods-list
:class=
"
'goodsListItem' + index"
:datas=
"item
"
></goods-list>
</div>
</div>
<div
v-else-if=
"item.componentCode == 'area-navigation' && item.componentInfo.visible == 1"
>
<div
v-else-if=
"item.componentCode == 'area-navigation' && item.componentInfo.visible == 1"
>
<area-navigation
:datas=
"item"
:changeLocation=
"changeLocation"
></area-navigation>
<area-navigation
:datas=
"item"
:changeLocation=
"changeLocation"
></area-navigation>
...
@@ -158,7 +158,7 @@ import indexApi from "@/api/index.js";
...
@@ -158,7 +158,7 @@ import indexApi from "@/api/index.js";
import
{
throttle
,
concatUrl
}
from
"../../utils/index.js"
import
{
throttle
,
concatUrl
}
from
"../../utils/index.js"
import
mpvueCropper
from
'@/components/mpvue-cropper'
import
mpvueCropper
from
'@/components/mpvue-cropper'
const
app
=
getApp
();
const
app
=
getApp
();
const
{
log
,
tool
}
=
app
;
const
{
log
}
=
app
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
...
@@ -382,24 +382,11 @@ export default {
...
@@ -382,24 +382,11 @@ export default {
this
.
themeColor
=
res
this
.
themeColor
=
res
}
}
}
}
// 不是冬奥会项目不调用此接口
// 不是冬奥会项目不调用此接口
if
(
this
.
$store
.
state
.
mixid
!=
'CL'
){
if
(
this
.
$store
.
state
.
mixid
!=
'CL'
){
// 新人有礼弹窗
// 新人有礼弹窗
this
.
newUserFun
();
this
.
newUserFun
();
}
}
//清除懒加载缓存
wx
.
removeStorage
({
key
:
'storageGoodsList'
})
wx
.
removeStorage
({
key
:
'storageDatasList'
})
wx
.
removeStorage
({
key
:
'datasIndex'
})
console
.
log
(
'storageGoodsList---detory'
);
},
},
onShow
()
{
onShow
()
{
// 设置显示条件
// 设置显示条件
...
@@ -421,14 +408,10 @@ export default {
...
@@ -421,14 +408,10 @@ export default {
this
.
active
=
checkTabbarPage
(
'/'
)
this
.
active
=
checkTabbarPage
(
'/'
)
}
}
//
this.$mp.page.onPageScroll= (el)=>{
this
.
$mp
.
page
.
onPageScroll
=
(
el
)
=>
{
//
throttle(this.scrolls(el),100)
throttle
(
this
.
scrolls
(
el
),
100
)
//
};
};
},
},
onPageScroll
:
tool
.
throttle
(
function
(
el
)
{
// console.log(el);
this
.
scrolls
(
el
)
},
1000
),
methods
:
{
methods
:
{
async
setVisible
(
pageList
,
cb
)
{
async
setVisible
(
pageList
,
cb
)
{
// 首页显示条件
// 首页显示条件
...
@@ -551,7 +534,6 @@ export default {
...
@@ -551,7 +534,6 @@ export default {
this
.
active
=
checkTabbarPage
(
'/'
);
this
.
active
=
checkTabbarPage
(
'/'
);
this
.
setVisible
(
this
.
mpApp
.
globalData
.
pageList
,(
res
)
=>
{
this
.
setVisible
(
this
.
mpApp
.
globalData
.
pageList
,(
res
)
=>
{
this
.
pageInfo
=
res
;
this
.
pageInfo
=
res
;
console
.
log
(
this
.
pageInfo
,
'this.pageInfo'
);
this
.
pageData
=
JSON
.
parse
(
this
.
pageInfo
.
pageData
);
this
.
pageData
=
JSON
.
parse
(
this
.
pageInfo
.
pageData
);
});
});
log
.
info
(
"36----------------------559"
,
this
.
pageData
,
this
.
pageInfo
.
pageSettingData
);
log
.
info
(
"36----------------------559"
,
this
.
pageData
,
this
.
pageInfo
.
pageSettingData
);
...
@@ -611,7 +593,7 @@ export default {
...
@@ -611,7 +593,7 @@ export default {
getSpokesmanInit
(
extConfig
)
{
getSpokesmanInit
(
extConfig
)
{
//绑定上下级关系
//绑定上下级关系
app
.
fenxiaoModel
.
becomeRelation
(
extConfig
).
then
(
res
=>
{
app
.
fenxiaoModel
.
becomeRelation
(
extConfig
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
'200'
)
{
if
(
res
)
{
wx
.
removeStorage
({
wx
.
removeStorage
({
key
:
"becomeInfo"
key
:
"becomeInfo"
});
});
...
...
static/nativeComponents/GoodsList/GoodsItem/index.wxml
View file @
2eed8a7b
<!-- 商品列表item -->
<!-- 商品列表item -->
<!-- {{items.loadState}}--{{items.loadProductImgUrl}}--{{items.productImgUrl}} -->
<view wx:if="{{items && datas.componentData['style'] == 'list' && items.loadState == false}}">
<view class="skeleton-animate">
<view class="skeleton-bg skeleton-img"></view>
<view class="skeleton-bg skeleton-title"></view>
<view class="skeleton-bg skeleton-detail"></view>
<view class="skeleton-bg skeleton-price"></view>
</view>
</view>
<view
<view
class="goodsItem {{datas.componentData.style==='rowList'?'goodsRowList':''}} {{datas.componentData.style==='heap'?'goodsRowList goodsHeapItem':''}}"
class="goodsItem {{datas.componentData.style==='rowList'?'goodsRowList':''}} {{datas.componentData.style==='heap'?'goodsRowList goodsHeapItem':''}}"
style="--proGap2:{{datas.componentData.proGap*2}}rpx;"
style="--proGap2:{{datas.componentData.proGap*2}}rpx;"
bindtap="onclickProduct"
bindtap="onclickProduct"
wx:else
>
>
<view class="goods-item-child {{datas.componentData['borderColorShow']?'goods-item-child-bd':''}}" style="border-radius:{{datas.componentData.borderRadius*2}}rpx;--border_color:{{datas.componentData['borderColor']}};box-shadow:{{datas.componentData['cardShadow']?'0rpx 0rpx 10rpx '+datas.componentData['cardShadowSize']*2+'rpx #ccc':''}};">
<view class="goods-item-child {{datas.componentData['borderColorShow']?'goods-item-child-bd':''}}" style="border-radius:{{datas.componentData.borderRadius*2}}rpx;--border_color:{{datas.componentData['borderColor']}};box-shadow:{{datas.componentData['cardShadow']?'0rpx 0rpx 10rpx '+datas.componentData['cardShadowSize']*2+'rpx #ccc':''}};">
<!-- 商户入口-顶部 -->
<!-- 商户入口-顶部 -->
...
@@ -66,7 +56,6 @@
...
@@ -66,7 +56,6 @@
<image mode="widthFix" src="{{datas.componentData['angleSignImg']}}" />
<image mode="widthFix" src="{{datas.componentData['angleSignImg']}}" />
</view>
</view>
<!-- 商品主图 -->
<!-- 商品主图 -->
<!-- {{items.loadState}}--{{items.loadProductImgUrl}}--{{items.productImgUrl}} -->
<image
<image
lazy-load
lazy-load
mode="{{datas.componentData.style==='rowList' || datas.componentData.style==='heap'?'aspectFit':'widthFix'}}"
mode="{{datas.componentData.style==='rowList' || datas.componentData.style==='heap'?'aspectFit':'widthFix'}}"
...
...
static/nativeComponents/GoodsList/GoodsItem/index.wxss
View file @
2eed8a7b
@import "/static/font/common_icon.wxss";
@import "/static/font/common_icon.wxss";
/* 商品列表骨架屏 */
@import "/static/css/skeleton.wxss";
.flex{
.flex{
display: flex;
display: flex;
}
}
...
...
static/nativeComponents/GoodsList/index.js
View file @
2eed8a7b
This diff is collapsed.
Click to expand it.
static/nativeComponents/GoodsList/index.wxml
View file @
2eed8a7b
...
@@ -25,19 +25,14 @@
...
@@ -25,19 +25,14 @@
style="margin-left:{{-datas.componentData.proGap*2}}rpx;"
style="margin-left:{{-datas.componentData.proGap*2}}rpx;"
>
>
<view
<view
wx:for="{{
pageGoodsList[datasIndex]
}}"
wx:for="{{
goodsList
}}"
wx:key="index"
wx:key="index"
class="goods-item
{{'goodsItemIndex'+index}}
"
class="goods-item"
style="width:{{100/datas.componentData.columnNum}}%;padding-left:{{datas.componentData.proGap*2}}rpx"
style="width:{{100/datas.componentData.columnNum}}%;padding-left:{{datas.componentData.proGap*2}}rpx"
>
>
<!-- <goods-item
datas="{{datas}}"
items="{{goodsList[index]}}"
indexs="{{index}}"
></goods-item> -->
<goods-item
<goods-item
items="{{pageGoodsList[datasIndex][index]}}"
datas="{{datas}}"
datas="{{datas}}"
items="{{goodsList[index]}}"
indexs="{{index}}"
indexs="{{index}}"
></goods-item>
></goods-item>
</view>
</view>
...
...
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