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
61883d3e
Commit
61883d3e
authored
Sep 11, 2023
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页优化暂存
parent
b1620a23
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
61 additions
and
48 deletions
+61
-48
src/App.vue
+4
-5
src/api/index.js
+5
-0
src/components/basicTool/embed-module/index.vue
+14
-3
src/components/common/StoreAddr.vue
+4
-9
src/main.js
+2
-1
src/pages/home/index.vue
+12
-19
static/nativeComponents/CubeNav/index.wxml
+4
-4
static/nativeComponents/GoodsList/index.js
+3
-2
static/nativeComponents/Notice/index.wxml
+1
-1
static/nativeComponents/PhotoGallery/index.js
+5
-1
static/nativeComponents/PhotoGallery/index.wxml
+1
-1
static/nativeComponents/PhotoGallery/index.wxss
+6
-0
static/nativeComponents/custom-tab-bar/index.js
+0
-2
No files found.
src/App.vue
View file @
61883d3e
...
...
@@ -74,13 +74,11 @@ export default {
// 页面配置信息
this
.
getThemePage
(
extConfig
);
//
this.getThemePage(extConfig);
let
mpApp
=
getApp
();
console
.
log
(
mpApp
,
"this.mpApp"
);
mpApp
.
getShopInfo
=
this
.
getShopInfo
mpApp
.
getThemePage
=
this
.
getThemePage
setTimeout
(()
=>
{
},
300
)
},
async
mounted
()
{
...
...
@@ -301,7 +299,7 @@ export default {
},
//商城配置
async
shopConfiguration
(){
await
shop
.
get_shop_configuration
().
then
(
res
=>
{
shop
.
get_shop_configuration
().
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
let
mpApp
=
getApp
();
mpApp
.
shop_configuration
=
res
.
data
.
data
...
...
@@ -310,11 +308,12 @@ export default {
})
},
async
getThemePage
({
mixid
,
shopid
})
{
console
.
log
(
"getThemePage--App.vue"
)
let
{
offlineShopCode
}
=
getStoreInfo
();
await
shop
.
themePagesInfo
({
shopMixId
:
offlineShopCode
?
offlineShopCode
:
mixid
,
homePageFlag
:
fals
e
homePageFlag
:
tru
e
})
.
then
((
response
)
=>
{
if
(
response
.
data
.
code
==
200
)
{
...
...
src/api/index.js
View file @
61883d3e
...
...
@@ -88,6 +88,10 @@ console.log(process.env,'-----------------config------')
outDataSourceData
(
data
)
{
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/outDataSource/api`
,
data
)
},
// 上传文件
uploadFile
(
data
)
{
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/common/uploadFile`
,
data
)
},
}
\ No newline at end of file
src/components/basicTool/embed-module/index.vue
View file @
61883d3e
...
...
@@ -36,6 +36,7 @@ export default {
},
data
()
{
return
{
pageData
:
[],
contentList
:
[],
}
},
...
...
@@ -56,11 +57,21 @@ export default {
if
(
!
this
.
microPageId
)
return
;
shop
.
singlePageInfo
({
id
:
this
.
microPageId
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
this
.
contentList
=
res
.
data
.
data
.
pageData
?
JSON
.
parse
(
res
.
data
.
data
.
pageData
)
:
[];
console
.
log
(
this
.
contentList
,
'------------------------45'
)
this
.
pageData
=
res
.
data
.
data
.
pageData
?
JSON
.
parse
(
res
.
data
.
data
.
pageData
)
:
[];
this
.
contentList
.
push
(
this
.
pageData
[
0
]);
let
i
=
1
;
this
.
loadComponents
(
i
);
}
})
}
},
loadComponents
(
index
)
{
this
.
contentList
.
push
(
this
.
pageData
[
index
]);
index
++
;
if
(
index
>
this
.
pageData
.
length
)
return
console
.
log
(
"-微页面渲染结束-"
);
setTimeout
(()
=>
{
this
.
loadComponents
(
index
);
},
30
);
},
}
}
</
script
>
...
...
src/components/common/StoreAddr.vue
View file @
61883d3e
...
...
@@ -40,6 +40,9 @@ export default {
},
async
onLoad
()
{
try
{
this
.
getLocationHandle
(()
=>
{
this
.
$emit
(
"toUpdate"
);
});
let
shopInfo
=
await
shop
.
getShopInfo
(
JSON
.
parse
(
wx
.
getStorageSync
(
"extConfig"
)));
console
.
log
(
shopInfo
,
'-------------shopInfo'
)
if
(
shopInfo
.
data
.
code
==
200
)
{
...
...
@@ -47,14 +50,6 @@ export default {
this
.
logoUrl
=
DFSImg
(
shopInfo
.
data
.
data
.
logoUrl
,
400
,
400
);
console
.
log
(
this
.
openThousandsStoresFlag
,
this
.
logoUrl
,
'-------------shopInfo'
)
}
if
(
this
.
openThousandsStoresFlag
)
{
this
.
getLocationHandle
(()
=>
{
this
.
$emit
(
"toUpdate"
);
// this.getShopList();
});
}
else
{
this
.
$emit
(
"toUpdate"
);
}
this
.
reloadName
();
}
catch
(
error
)
{
this
.
$emit
(
"toUpdate"
);
...
...
@@ -87,8 +82,8 @@ export default {
_this
.
offlineStoreReq
.
latitude
=
res
.
latitude
;
_this
.
offlineStoreReq
.
longitude
=
res
.
longitude
;
// 存缓存
wx
.
setStorageSync
(
"locationObj"
,
JSON
.
stringify
(
res
));
callback
(
res
);
wx
.
setStorageSync
(
"locationObj"
,
JSON
.
stringify
(
res
));
},
fail
:
res
=>
{
log
.
info
(
"++++++++++2++++++"
,
res
);
...
...
src/main.js
View file @
61883d3e
...
...
@@ -155,7 +155,8 @@ mpApp.themeColor = {}
mpApp
.
log
=
log
mpApp
.
tool
=
tool
function
getThemePage
({
mixid
,
shopid
})
{
function
getThemePage
({
mixid
,
shopid
})
{
console
.
log
(
"getThemePage--main.js"
)
let
{
offlineShopCode
}
=
getStoreInfo
();
shop
.
themePagesInfo
({
...
...
src/pages/home/index.vue
View file @
61883d3e
...
...
@@ -9,8 +9,10 @@
<CustomNav
:customBgOpacity=
"customBgOpacity"
></CustomNav>
<StoreAddr
@
toUpdate=
"reloadEnterShopRule"
@
toPageLoading=
"toPageLoading"
ref=
"StoreAddr"
></StoreAddr>
<ThemeDataPlant></ThemeDataPlant>
<template
v-if=
"!componentsLoading"
>
<div
v-for=
"(item,index) in pageData"
:key=
"index"
>
<div
v-if=
"item.componentCode == 'embed-module' && item.componentInfo.visible == 1"
>
<embedModule
:datas=
"item"
:componentIndex=
"index"
></embedModule>
</div>
<div
v-if=
"item.componentCode=='banner' && item.componentInfo.visible == 1"
>
<banner
:datas=
"item"
></banner>
</div>
...
...
@@ -117,10 +119,8 @@
<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>
<template>
</
template
>
<bottomCont
v-if=
"showbottomCont"
></bottomCont>
<
template
>
...
...
@@ -233,7 +233,6 @@ export default {
showbottomCont
:
false
,
//展示底部logo
showSpe
:
false
,
pageLoading
:
true
,
componentsLoading
:
true
,
firstOpenPage
:
true
,
//首次打开页面
h5Params
:
{},
//params
fromPage
:
""
,
...
...
@@ -484,11 +483,12 @@ export default {
}
// 获取页面数据
if
(
this
.
mpApp
.
globalData
.
pageList
)
{
console
.
log
(
"获取页面数据-1"
)
that
.
init
(
this
.
mpApp
.
globalData
.
pageList
);
}
else
{
this
.
mpApp
.
pageCallBack
=
function
(
params
)
{
console
.
log
(
"获取页面数据-2"
)
that
.
init
(
params
);
};
}
...
...
@@ -557,16 +557,15 @@ export default {
methods
:
{
setPageLoading
()
{
this
.
componentsLoading
=
false
;
setTimeout
(()
=>
{
this
.
pageLoading
=
false
;
},
30
00
);
},
7
00
);
},
reloadEnterShopRule
()
{
console
.
log
(
'eloadEnterShopRule'
)
// 进店规则--首次进店调用
if
(
this
.
h5Params
&&
this
.
h5Params
.
offlineShopCode
)
{
this
.
setPageLoading
();
//
this.setPageLoading();
return
;
};
console
.
log
(
'home-methods-reloadEnterShopRule'
)
...
...
@@ -576,14 +575,11 @@ export default {
this
.
enterStoreRule
();
}
else
{
console
.
log
(
'reloadEnterShopRule-------2'
)
this
.
setPageLoading
();
//
this.setPageLoading();
}
},
async
enterStoreRule
()
{
try
{
let
shopInfo
=
await
shop
.
getShopInfo
(
JSON
.
parse
(
wx
.
getStorageSync
(
"extConfig"
)));
let
openThousandsStoresFlag
=
shopInfo
.
data
.
data
.
openThousandsStoresFlag
==
1
;
if
(
openThousandsStoresFlag
);
{
console
.
log
(
wx
.
getStorageSync
(
"locationObj"
),
'--locationObj'
)
let
locationObj
=
wx
.
getStorageSync
(
"locationObj"
)
?
JSON
.
parse
(
wx
.
getStorageSync
(
"locationObj"
))
:
{};
let
query
=
{
...
...
@@ -622,14 +618,12 @@ export default {
shop
.
saveEnterShopRecord
(
query2
);
}
}
}
}
catch
(
error
)
{
}
this
.
setPageLoading
();
//
this.setPageLoading();
},
toPageLoading
()
{
// this.pageLoading = true;
},
async
setVisible
(
pageList
,
cb
)
{
// 首页显示条件
...
...
@@ -745,6 +739,7 @@ export default {
return
JSON
.
stringify
(
pageData
);
},
init
(
pageList
)
{
console
.
log
(
"home-init"
);
this
.
getCartNum
();
this
.
active
=
checkTabbarPage
(
'/'
);
this
.
setVisible
(
this
.
mpApp
.
globalData
.
pageList
,(
res
)
=>
{
...
...
@@ -755,7 +750,7 @@ export default {
this
.
showbottomCont
=
true
;
},
100
);
log
.
info
(
"36----------------------559"
,
this
.
pageData
,
this
.
pageInfo
.
pageSettingData
);
this
.
setPageLoading
();
log
.
info
(
app
.
globalData
.
shopInfo
,
'app'
)
wx
.
setNavigationBarTitle
({
title
:
app
.
globalData
.
shopInfo
.
shopName
})
console
.
log
(
this
.
pageInfo
.
pageSettingData
,
'-this.pageInfo.pageSettingData'
)
...
...
@@ -1110,13 +1105,11 @@ export default {
async
getThemeList
()
{
console
.
log
(
"getThemeList"
)
this
.
pageLoading
=
true
;
this
.
componentsLoading
=
true
;
try
{
await
app
.
getThemePage
(
this
.
$store
.
state
.
extConfig
);
}
catch
(
error
)
{
}
this
.
setPageLoading
();
},
async
refreshInit
()
{
log
.
info
(
'onPullDownRefresh'
,
this
.
$store
.
state
.
extConfig
)
...
...
static/nativeComponents/CubeNav/index.wxml
View file @
61883d3e
...
...
@@ -2,7 +2,7 @@
<view style="overflow: hidden;" class="cubeNav">
<view wx:if="{{datas.componentData.styleType == 0}}" class="cube-nav" style="margin-top:{{datas.componentData.verticalMargin * 2}}rpx;margin-bottom:{{datas.componentData.verticalMargin * 2}}rpx;margin-left:{{datas.componentData.levelMargin * 2}}rpx;margin-right:{{datas.componentData.levelMargin * 2}}rpx;border-radius:{{datas.componentData.moduleRadius * 2}}rpx">
<view class="cube1 clearfix" wx:if="{{datas.componentData.layoutType == 0}}" style="margin-left:{{-datas.componentData.singleVerticalMargin*2}}rpx;background-color:{{datas.componentData.backgroundColor || ''}};">
<view class="cube-bg" wx:for="{{imgList}}" data-item="{{item}}" bindtap="onclickHandle" style="padding-left:{{datas.componentData.singleVerticalMargin*2}}rpx;width:{{getColumnWidth}};">
<view class="cube-bg" wx:for="{{imgList}}"
wx:key="index"
data-item="{{item}}" bindtap="onclickHandle" style="padding-left:{{datas.componentData.singleVerticalMargin*2}}rpx;width:{{getColumnWidth}};">
<view class="cube-item" style="padding-top:{{datas.componentData.singleLevelMargin * 2}}rpx;padding-bottom:{{datas.componentData.singleLevelMargin * 2}}rpx;position:relative;background:{{datas.componentData.singleBackground}};border-radius:{{datas.componentData.singleRadius*2}}rpx;margin-top:{{datas.componentData.lineHeight*2}}rpx">
<view style="padding-left:{{getImgSize}}%;padding-right:{{getImgSize}}%">
<view class="item-img {{item.imageUrl == '' ? 'item-bg' : ''}}">
...
...
@@ -17,7 +17,7 @@
<view wx:if="{{datas.componentData.layoutType == 1}}" style="position:relative;background-color:{{datas.componentData.backgroundColor || ''}};padding-bottom:{{navShow ? '10px' : '0'}}">
<view class="cube2 clearfix" style="overflow-x:auto;overflow-y:hidden" bindtouchmove="touchmove">
<view class="clearfix" style="width:{{wrapW}}px" id="wrapW">
<view class="cube-item" wx:for="{{imgList}}" style="padding-top:{{datas.componentData.lineHeight}}px;padding-bottom:{{datas.componentData.lineHeight}}px;width:{{w}}px;position:relative" bindtap="onclickHandle" data-item="{{item}}">
<view class="cube-item" wx:for="{{imgList}}"
wx:key="index"
style="padding-top:{{datas.componentData.lineHeight}}px;padding-bottom:{{datas.componentData.lineHeight}}px;width:{{w}}px;position:relative" bindtap="onclickHandle" data-item="{{item}}">
<view style="padding-left:{{getImgSize}}%;padding-right:{{getImgSize}}%">
<view class="item-img {{item.imageUrl == '' ? 'item-bg' : ''}}">
<image wx:if="{{item.imageUrl}}" src="{{item.imageUrl}}"></image>
...
...
@@ -38,8 +38,8 @@
<view class="cube3 clearfix" wx:if="{{datas.componentData.layoutType == 2}}" style="background-color:{{datas.componentData.backgroundColor || ''}};">
<swiper indicator-dots="{{true}}" indicator-active-color="var(--main-color)" style="height:{{cube3H}}px">
<swiper-item wx:for="{{swiperList}}" style="width:{{swiperItemW}}px">
<view class="cube-item" style="padding-top:{{datas.componentData.lineHeight}}px;padding-bottom:{{datas.componentData.lineHeight}}px;width:{{getColumnWidth}};position:relative" wx:for-item="item1" wx:for="{{item}}" data-item="{{item1}}" bindtap="onclickHandle">
<swiper-item wx:for="{{swiperList}}"
wx:key="index"
style="width:{{swiperItemW}}px">
<view class="cube-item" style="padding-top:{{datas.componentData.lineHeight}}px;padding-bottom:{{datas.componentData.lineHeight}}px;width:{{getColumnWidth}};position:relative" wx:for-item="item1" wx:for
-index="index1" wx:for
="{{item}}" data-item="{{item1}}" bindtap="onclickHandle">
<view style="padding-left:{{getImgSize}}%;padding-right:{{getImgSize}}%">
<view class="item-img {{item1.imageUrl == '' ? 'item-bg' : ''}}">
<image wx:if="{{item1.imageUrl}}" src="{{item1.imageUrl}}"></image>
...
...
static/nativeComponents/GoodsList/index.js
View file @
61883d3e
const
app
=
getApp
();
const
{
log
}
=
app
;
const
{
goodsApi
,
DFSImg
,
$themeToLink
}
=
app
;
const
{
goodsApi
,
DFSImg
,
$themeToLink
,
processEnv
}
=
app
;
function
random_string
(
len
)
{
len
=
len
||
32
;
var
chars
=
"ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678"
;
...
...
@@ -314,7 +314,7 @@ const componentOptions = {
query
.
minPrice
=
this
.
data
.
submitFliterVal
.
minPrice
;
query
.
maxPrice
=
this
.
data
.
submitFliterVal
.
maxPrice
;
}
goodsApi
.
queryProductInfo
(
query
).
then
(
res
=>
{
goodsApi
[
processEnv
.
NODE_ENV
==
'xhyx_prod'
?
'selectProductInfoOnEs'
:
'queryProductInfo'
]
(
query
).
then
(
res
=>
{
this
.
setData
({
loading
:
false
,
queryProductInfoLoading
:
false
});
if
(
res
.
data
.
code
==
200
)
{
let
goodsLists
=
res
.
data
.
data
.
list
;
...
...
@@ -541,6 +541,7 @@ const componentOptions = {
let
storageDatasList
=
this
.
getStorageSync
(
'storageDatasList'
)
||
[]
let
{
style
}
=
storageDatasList
[
that
.
data
.
datasIndex
];
if
(
!
style
)
return
;
let
type
=
''
if
(
style
==
'list'
||
style
==
'rowList'
){
type
=
'goods-item'
...
...
static/nativeComponents/Notice/index.wxml
View file @
61883d3e
<!--static/nativeComponents/Notice/index.wxml-->
<view class="notice" style="border-radius:{{datas.componentData.borderRadius}}px;background-color:{{datas.componentData.backgroundColor}};margin:{{NoticeMargin}};padding:{{NoticePadding}};height:{{(CommonHeight)}}">
<swiper autoplay interval="3000" vertical style="height:{{CommonHeight}}" circular>
<swiper-item wx:for="{{datas.componentData.noticeList}}" wx:key="
{{index}}
">
<swiper-item wx:for="{{datas.componentData.noticeList}}" wx:key="
index
">
<view class="container" bindtap="onclickHandle" data-index="{{index}}" style="width: 100%;height:{{CommonHeight}}">
<block wx:if="{{item.imageUrl||datas.componentData.singleImage}}">
<view wx:if="{{datas.componentData.styleType===1}}">
...
...
static/nativeComponents/PhotoGallery/index.js
View file @
61883d3e
...
...
@@ -34,7 +34,8 @@ Component({
imgArr
:
[],
lenI
:
0
,
WaterfallFlowListL
:
[],
WaterfallFlowListR
:
[]
WaterfallFlowListR
:
[],
showImg
:
false
,
},
ready
(){
if
(
this
.
data
.
datas
.
componentData
.
paddingList
){
...
...
@@ -130,6 +131,9 @@ Component({
[
'imgArr['
+
ii
+
'].height'
]:
it
.
height
/
b
})
})
this
.
setData
({
showImg
:
true
,
})
}
}
...
...
static/nativeComponents/PhotoGallery/index.wxml
View file @
61883d3e
...
...
@@ -15,7 +15,7 @@
<view class="next-btn" wx:if="{{datas.componentData.style==='across'}}">
<i class="iconfont-common common-iconyoujiantou"></i>
</view>
<view style="display:{{datas.componentData.style==='tiled' ? 'flex' : ''}}" class="ul {{datas.componentData.style==='tiled'?'isTiled':''}}">
<view style="display:{{datas.componentData.style==='tiled' ? 'flex' : ''}}" class="ul {{datas.componentData.style==='tiled'?'isTiled':''}}
{{showImg ? 'show': 'hide'}}
">
<view bindtap="itemClick" data-item="{{item}}" wx:for="{{datas.componentData.imgList}}" wx:key="index" style="margin-right:{{index===(datas.componentData.imgList.length-1)? '' : datas.componentData.imgPadding * 2 + 'rpx'}};width:{{datas.componentData.style==='across' ? datas.componentData.acrossPer+'%' : ''}}" class="li">
<image src="{{item.imageUrl}}" style="border-radius:{{2*(datas.componentData['radius']/100)}}em;width:{{datas.componentData.style==='tiled' ? imgArr[index].width : ''}}px;height:{{ datas.componentData.style==='tiled' ? imgArr[index].height : ''}}px" bindload="bindload" data-index="{{index}}" mode="{{datas.componentData.style==='across' ? 'widthFix' : ''}}"></image>
</view>
...
...
static/nativeComponents/PhotoGallery/index.wxss
View file @
61883d3e
...
...
@@ -9,6 +9,12 @@
font-size: 32rpx;
box-sizing: border-box;
}
.photo-gallery .show{
opacity: 1;
}
.photo-gallery .hide{
opacity: 0;
}
.textH{
text-align: center;
font-weight: bold;
...
...
static/nativeComponents/custom-tab-bar/index.js
View file @
61883d3e
...
...
@@ -44,7 +44,6 @@ Component({
console
.
log
(
app
.
globalData
.
footerVal
.
componentData
,
'-------app.globalData.footerVal.componentData'
)
componentData
.
list
.
forEach
(
item
=>
{
item
.
isAntt
=
item
.
icon
.
includes
(
'ant-'
)
console
.
log
(
'isAntt'
,
item
.
isAntt
)
})
// 处理默认样式
// 未选中
...
...
@@ -79,7 +78,6 @@ Component({
params
.
componentData
.
list
.
forEach
(
item
=>
{
item
.
isAntt
=
item
.
icon
.
includes
(
'ant-'
)
console
.
log
(
'isAntt'
,
item
.
isAntt
)
})
console
.
log
(
params
.
componentData
.
list
,
'app.globalData.footerVal.componentData.list'
)
...
...
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