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
8564c70f
Commit
8564c70f
authored
Sep 09, 2023
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页渲染优化
parent
824b5d99
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
104 additions
and
79 deletions
+104
-79
src/components/basicTool/embed-module/index.vue
+1
-0
src/components/common/StoreAddr.vue
+18
-12
src/components/common/pageLoading.vue
+14
-6
src/components/content/text.vue
+0
-1
src/pages/home/index.vue
+68
-52
src/pages/pages_subpack/paySuccess/index.vue
+0
-1
src/utils/log.js
+0
-1
static/nativeComponents/Banner/index.js
+0
-2
static/nativeComponents/CubeNav/index.js
+0
-1
static/nativeComponents/GoodsList/index.wxml
+1
-1
static/nativeComponents/GoodsList/index.wxss
+2
-2
No files found.
src/components/basicTool/embed-module/index.vue
View file @
8564c70f
...
...
@@ -53,6 +53,7 @@ export default {
mounted
()
{
},
methods
:
{
init
()
{
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
)
:
[];
...
...
src/components/common/StoreAddr.vue
View file @
8564c70f
...
...
@@ -39,20 +39,26 @@ export default {
};
},
async
onLoad
()
{
let
shopInfo
=
await
shop
.
getShopInfo
(
JSON
.
parse
(
wx
.
getStorageSync
(
"extConfig"
)));
console
.
log
(
shopInfo
,
'-------------shopInfo'
)
if
(
shopInfo
.
data
.
code
==
200
)
{
this
.
openThousandsStoresFlag
=
shopInfo
.
data
.
data
.
openThousandsStoresFlag
==
1
;
this
.
logoUrl
=
DFSImg
(
shopInfo
.
data
.
data
.
logoUrl
,
400
,
400
);
console
.
log
(
this
.
openThousandsStoresFlag
,
this
.
logoUrl
,
'-------------shopInfo'
)
}
if
(
this
.
openThousandsStoresFlag
)
{
this
.
getLocationHandle
(()
=>
{
try
{
let
shopInfo
=
await
shop
.
getShopInfo
(
JSON
.
parse
(
wx
.
getStorageSync
(
"extConfig"
)));
console
.
log
(
shopInfo
,
'-------------shopInfo'
)
if
(
shopInfo
.
data
.
code
==
200
)
{
this
.
openThousandsStoresFlag
=
shopInfo
.
data
.
data
.
openThousandsStoresFlag
==
1
;
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.getShopList();
});
}
this
.
reloadName
();
}
catch
(
error
)
{
this
.
$emit
(
"toUpdate"
);
}
this
.
reloadName
();
},
filters
:
{
formatDistance
(
val
)
{
...
...
src/components/common/pageLoading.vue
View file @
8564c70f
<
template
>
<div
class=
"loadings"
v-if=
"shopLogo"
>
<div
class=
"loadings"
>
<div
class=
"img flex"
>
<image
:src=
"shopLogo"
alt=
""
mode=
"aspectFill"
></image>
<van-loading
color=
"
black
"
size=
"60px"
/>
<van-loading
color=
"
#333
"
size=
"60px"
/>
</div>
</div>
</
template
>
...
...
@@ -22,12 +22,20 @@ export default {
},
computed
:
{
shopLogo
()
{
let
logoUrl
=
app
.
globalData
&&
app
.
globalData
.
shopInfo
&&
app
.
globalData
.
shopInfo
.
logoUrl
;
let
logoUrl
=
""
;
if
(
wx
.
getStorageSync
(
"logoUrl"
))
{
logoUrl
=
wx
.
getStorageSync
(
"logoUrl"
);
}
else
{
logoUrl
=
app
.
globalData
&&
app
.
globalData
.
shopInfo
&&
app
.
globalData
.
shopInfo
.
logoUrl
;
}
return
logoUrl
?
DFSImg
(
logoUrl
):
""
;
},
},
created
()
{
},
mounted
()
{
}
mounted
()
{
},
methods
:
{
}
};
</
script
>
...
...
@@ -39,13 +47,13 @@ export default {
left
:
0
;
width
:
100%
;
height
:
100%
;
z-index
:
3000
;
z-index
:
9999
;
.img{
width
:
50px
;
height
:
50px
;
position
:
relative
;
padding
:
2px
;
margin
:
60%
auto
0
;
margin
:
40vh
auto
0
;
justify-content
:
center
;
align-items
:
center
;
image{
...
...
src/components/content/text.vue
View file @
8564c70f
...
...
@@ -78,7 +78,6 @@ export default {
},
onLoad
(){
console
.
log
(
this
.
datas
,
'iu'
)
},
computed
:
{
getPaddingList
()
{
...
...
src/pages/home/index.vue
View file @
8564c70f
...
...
@@ -521,7 +521,6 @@ export default {
},
onShow
()
{
console
.
log
(
new
Date
().
getTime
(),
'load-----home-onShow'
)
this
.
pageLoading
=
false
;
console
.
log
(
this
.
reloadPage
,
'-reloadPage2'
)
if
(
this
.
reloadPage
)
{
this
.
refreshInit
();
...
...
@@ -555,8 +554,12 @@ export default {
methods
:
{
reloadEnterShopRule
()
{
console
.
log
(
'eloadEnterShopRule'
)
// 进店规则--首次进店调用
if
(
this
.
h5Params
&&
this
.
h5Params
.
offlineShopCode
)
return
;
if
(
this
.
h5Params
&&
this
.
h5Params
.
offlineShopCode
)
{
this
.
pageLoading
=
false
;
return
;
};
console
.
log
(
'home-methods-reloadEnterShopRule'
)
if
(
wx
.
getStorageSync
(
"firstView"
))
{
console
.
log
(
'reloadEnterShopRule-------1'
)
...
...
@@ -568,48 +571,53 @@ export default {
}
},
async
enterStoreRule
()
{
let
shopInfo
=
await
shop
.
getShopInfo
(
JSON
.
parse
(
wx
.
getStorageSync
(
"extConfig"
)));
let
openThousandsStoresFlag
=
shopInfo
.
data
.
data
.
openThousandsStoresFlag
==
1
;
if
(
!
openThousandsStoresFlag
)
return
;
console
.
log
(
wx
.
getStorageSync
(
"locationObj"
),
'--locationObj'
)
let
locationObj
=
wx
.
getStorageSync
(
"locationObj"
)
?
JSON
.
parse
(
wx
.
getStorageSync
(
"locationObj"
))
:
{};
let
query
=
{
channelType
:
2
,
//设备类型(0:pc,1:app,2:小程序)
consumerLongitude
:
locationObj
.
longitude
?
locationObj
.
longitude
.
toString
()
:
""
,
//经度,小程序和app可以获取到就要传,没有不传
consumerLatitude
:
locationObj
.
latitude
?
locationObj
.
latitude
.
toString
()
:
""
,
//纬度,小程序和app可以获取到就要传,没有不传
distributionOfficerShopCode
:
this
.
h5Params
.
offlineShopCode
||
""
//分销员门店id,没有不传
}
console
.
log
(
`%cgetEnterShopId---query
${
JSON
.
stringify
(
query
)}
`
,
'color:yellow;font-size:20px;'
)
let
res
=
await
shop
.
getEnterShopId
(
query
);
console
.
log
(
`%cgetEnterShopId
${
JSON
.
stringify
(
res
)}
`
,
'color:yellow;font-size:20px;'
)
if
(
res
.
data
.
code
==
200
)
{
let
enterShopId
=
res
.
data
.
data
;
console
.
log
(
enterShopId
,
'--enterShopId'
)
if
(
enterShopId
)
{
let
storeDetail
=
await
shop
.
getOfflineStoreDetail
({
shopId
:
enterShopId
,
});
if
(
storeDetail
.
data
.
code
==
200
)
{
setStoreInfo
({
offlineShopCode
:
storeDetail
.
data
.
data
.
shopCode
,
offlineShopName
:
storeDetail
.
data
.
data
.
shopName
,
});
this
.
$refs
.
StoreAddr
.
reloadName
();
this
.
refreshInit
();
}
console
.
log
(
storeDetail
,
'-------storeDetail'
);
let
loginUserInfo
=
wx
.
getStorageSync
(
"loginUserInfo"
)
||
null
;
let
query2
=
{
telephoneNum
:
loginUserInfo
&&
loginUserInfo
.
mobilephone
,
enterShopSource
:
"买家直接进入"
,
hitRule
:
"首页进入"
,
shopName
:
storeDetail
.
data
.
data
.
shopName
,
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
=
{
channelType
:
2
,
//设备类型(0:pc,1:app,2:小程序)
consumerLongitude
:
locationObj
.
longitude
?
locationObj
.
longitude
.
toString
()
:
""
,
//经度,小程序和app可以获取到就要传,没有不传
consumerLatitude
:
locationObj
.
latitude
?
locationObj
.
latitude
.
toString
()
:
""
,
//纬度,小程序和app可以获取到就要传,没有不传
distributionOfficerShopCode
:
this
.
h5Params
.
offlineShopCode
||
""
//分销员门店id,没有不传
}
log
.
info
(
"进店规则-----"
,
query2
)
shop
.
saveEnterShopRecord
(
query2
);
console
.
log
(
`%cgetEnterShopId---query
${
JSON
.
stringify
(
query
)}
`
,
'color:yellow;font-size:20px;'
)
let
res
=
await
shop
.
getEnterShopId
(
query
);
console
.
log
(
`%cgetEnterShopId
${
JSON
.
stringify
(
res
)}
`
,
'color:yellow;font-size:20px;'
)
if
(
res
.
data
.
code
==
200
)
{
let
enterShopId
=
res
.
data
.
data
;
console
.
log
(
enterShopId
,
'--enterShopId'
)
if
(
enterShopId
)
{
let
storeDetail
=
await
shop
.
getOfflineStoreDetail
({
shopId
:
enterShopId
,
});
if
(
storeDetail
.
data
.
code
==
200
)
{
setStoreInfo
({
offlineShopCode
:
storeDetail
.
data
.
data
.
shopCode
,
offlineShopName
:
storeDetail
.
data
.
data
.
shopName
,
});
this
.
$refs
.
StoreAddr
.
reloadName
();
this
.
refreshInit
();
}
console
.
log
(
storeDetail
,
'-------storeDetail'
);
let
loginUserInfo
=
wx
.
getStorageSync
(
"loginUserInfo"
)
||
null
;
let
query2
=
{
telephoneNum
:
loginUserInfo
&&
loginUserInfo
.
mobilephone
,
enterShopSource
:
"买家直接进入"
,
hitRule
:
"首页进入"
,
shopName
:
storeDetail
.
data
.
data
.
shopName
,
}
log
.
info
(
"进店规则-----"
,
query2
)
shop
.
saveEnterShopRecord
(
query2
);
}
}
}
}
catch
(
error
)
{
}
//
this.pageLoading = false;
this
.
pageLoading
=
false
;
},
toPageLoading
()
{
// this.pageLoading = true;
...
...
@@ -895,7 +903,6 @@ export default {
}
if
(
this
.
$mp
.
page
&&
this
.
$mp
.
page
.
selectAllComponents
(
".transverse-label-goodsListItem"
)){
this
.
$mp
.
page
.
selectAllComponents
(
".transverse-label-goodsListItem"
).
forEach
(
item
=>
{
console
.
log
(
item
,
'-this.$mp.page.selectComponent(".goodsListItem")'
)
item
.
getScroll
(
el
)
})
}
...
...
@@ -1094,20 +1101,29 @@ export default {
async
getThemeList
()
{
console
.
log
(
"getThemeList"
)
this
.
pageLoading
=
true
;
await
app
.
getThemePage
(
this
.
$store
.
state
.
extConfig
);
try
{
await
app
.
getThemePage
(
this
.
$store
.
state
.
extConfig
);
}
catch
(
error
)
{
}
setTimeout
(()
=>
{
this
.
pageLoading
=
false
;
},
500
);
console
.
log
(
"加载完成了"
);
},
1500
);
},
refreshInit
()
{
this
.
pageLoading
=
true
;
setTimeout
(()
=>
{
async
refreshInit
()
{
// this.pageLoading = true;
// setTimeout(() => {
// this.pageLoading = false;
// }, 1500);
log
.
info
(
'onPullDownRefresh'
,
this
.
$store
.
state
.
extConfig
)
app
.
getShopInfo
(
this
.
$store
.
state
.
extConfig
);
try
{
await
this
.
getThemeList
();
}
catch
(
error
)
{
}
wx
.
stopPullDownRefresh
();
this
.
pageLoading
=
false
;
},
1500
);
log
.
info
(
'onPullDownRefresh'
,
this
.
$store
.
state
.
extConfig
)
app
.
getShopInfo
(
this
.
$store
.
state
.
extConfig
);
this
.
getThemeList
();
}
},
async
onShareAppMessage
(
res
){
...
...
src/pages/pages_subpack/paySuccess/index.vue
View file @
8564c70f
...
...
@@ -284,7 +284,6 @@ export default {
}
if
(
this
.
$mp
.
page
&&
this
.
$mp
.
page
.
selectAllComponents
(
".transverse-label-goodsListItem"
)){
this
.
$mp
.
page
.
selectAllComponents
(
".transverse-label-goodsListItem"
).
forEach
(
item
=>
{
console
.
log
(
item
,
'-this.$mp.page.selectComponent(".goodsListItem")'
)
item
.
getScroll
(
el
)
})
}
...
...
src/utils/log.js
View file @
8564c70f
...
...
@@ -8,7 +8,6 @@ module.exports = {
log
.
debug
.
apply
(
log
,
arguments
)
},
info
()
{
console
.
log
(
'日志log级别'
);
if
(
!
log
)
return
log
.
info
.
apply
(
log
,
arguments
)
},
...
...
static/nativeComponents/Banner/index.js
View file @
8564c70f
...
...
@@ -27,14 +27,12 @@ Component({
newArr
:
[]
},
ready
()
{
console
.
log
(
app
.
setHomeBgImg
,
"----------------------30"
);
this
.
setData
({
newArr
:
this
.
newList
()
});
this
.
bannerChange
({
detail
:
{
current
:
0
}
});
console
.
log
(
this
.
data
.
newArr
,
this
.
newList
(),
"--------32"
);
},
methods
:
{
newList
()
{
...
...
static/nativeComponents/CubeNav/index.js
View file @
8564c70f
...
...
@@ -43,7 +43,6 @@ Component({
let
columnWidthArr
=
[
'100%'
,
'50%'
,
'33.3%'
,
'25%'
,
'20%'
,
'16.6%'
]
this
.
data
.
datas
.
componentData
.
imgList
.
forEach
(
item
=>
{
console
.
log
(
item
,
'---------------44'
)
item
.
imageUrl
=
item
.
imageUrl
?
app
.
DFSImg
(
item
.
imageUrl
,
400
,
400
)
:
''
})
this
.
setData
({
...
...
static/nativeComponents/GoodsList/index.wxml
View file @
8564c70f
...
...
@@ -179,7 +179,7 @@
<view
class="moreBottom"
bindtap="viewMore"
wx:if="{{datas.componentData['moreShow'] && datas.componentData.moreButtonSite=='bottom' && datas.componentData['goodsSource']!='assign' && datas.componentData['goodsSource']!='intelligenceRec'}}"
wx:if="{{datas.componentData['moreShow'] && datas.componentData.moreButtonSite=='bottom' && datas.componentData['goodsSource']!='assign' && datas.componentData['goodsSource']!='intelligenceRec'
&& !loading
}}"
>
查看更多
<text class="jt"></text>
...
...
static/nativeComponents/GoodsList/index.wxss
View file @
8564c70f
...
...
@@ -44,8 +44,8 @@ image{
display: inline-block;
border-top: 1px solid;
border-right: 1px solid;
width:
10
px;
height:
10
px;
width:
8
px;
height:
8
px;
-webkit-transform: rotate(-135deg);
transform: rotate(405deg);
margin-left: 0px;
...
...
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