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
49fcb96d
Commit
49fcb96d
authored
Mar 10, 2021
by
程智春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
a9f186ef
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
25 deletions
+48
-25
src/App.vue
+2
-2
src/pages/home/index.vue
+6
-6
static/nativeComponents/MerchantsList/index.js
+40
-17
No files found.
src/App.vue
View file @
49fcb96d
...
...
@@ -12,8 +12,8 @@ export default {
JSON
.
stringify
(
extConfig
)
==
"{}"
)
{
// extConfig = { mixid: "jordan", shopid: 471 };
extConfig
=
{
"mixid"
:
"
xyyx
"
,
"shopid"
:
133
};
extConfig
=
{
"mixid"
:
"
antgood
"
,
"shopid"
:
67
};
}
console
.
log
(
"1444444444"
,
extConfig
);
this
.
$store
.
commit
(
"setExtConfig"
,
extConfig
.
mixid
);
...
...
src/pages/home/index.vue
View file @
49fcb96d
...
...
@@ -10,7 +10,7 @@
<banner
:datas=
"item"
></banner>
</div>
<div
v-else-if=
"item.componentCode=='goods-list' && item.componentInfo.visible == 1"
style=
"height:100%;"
>
<goods-list
class=
"merchants-list
"
:datas=
"item"
></goods-list>
<goods-list
:class=
"'goodsListItem' + index
"
:datas=
"item"
></goods-list>
</div>
<div
v-else-if=
"item.componentCode == 'area-navigation' && item.componentInfo.visible == 1"
>
<area-navigation
:datas=
"item"
:changeLocation=
"changeLocation"
></area-navigation>
...
...
@@ -82,7 +82,7 @@
<share-picture
:datas=
"item"
></share-picture>
</div>
<div
v-if=
"item.componentCode == 'merchants-list' && item.componentInfo.visible == 1"
>
<merchants-list
class=
"goodsListItem
"
:datas=
"item"
></merchants-list>
<merchants-list
:class=
"'merchants-list' +index
"
:datas=
"item"
></merchants-list>
</div>
</div>
<bottomCont></bottomCont>
...
...
@@ -269,12 +269,12 @@ export default {
let
com
=
this
.
$mp
.
page
.
selectComponent
(
".time-limited-discount"
+
i
)
;
com
&&
com
.
getScroll
(
el
);
}
if
(
element
.
componentCode
==
"
merchant
s-list"
){
let
com
=
this
.
$mp
.
page
.
selectComponent
(
".
merchants-list
"
+
i
)
;
if
(
element
.
componentCode
==
"
good
s-list"
){
let
com
=
this
.
$mp
.
page
.
selectComponent
(
".
goodsListItem
"
+
i
)
;
com
&&
com
.
getScroll
(
el
);
}
if
(
element
.
componentCode
==
"
goodsListItem
"
){
let
com
=
this
.
$mp
.
page
.
selectComponent
(
".
goodsListItem
"
+
i
)
;
if
(
element
.
componentCode
==
"
merchants-list
"
){
let
com
=
this
.
$mp
.
page
.
selectComponent
(
".
merchants-list
"
+
i
)
;
com
&&
com
.
getScroll
(
el
);
}
...
...
static/nativeComponents/MerchantsList/index.js
View file @
49fcb96d
...
...
@@ -162,34 +162,57 @@ Component({
},
getScroll
(
el
)
{
let
_this
=
this
this
.
createSelectorQuery
().
select
(
"#ItemModule0"
).
boundingClientRect
(
function
(
res
){
let
query
=
wx
.
createSelectorQuery
().
in
(
this
)
let
{
windowHeight
}
=
wx
.
getSystemInfoSync
()
query
.
select
(
"#ItemModule0"
).
boundingClientRect
(
function
(
res
){
if
(
res
){
let
scrollTop
=
parseInt
(
el
.
scrollTop
);
let
domHeight
=
parseInt
(
res
.
height
);
if
(
scrollTop
+
_this
.
data
.
clientHeight
>=
domHeight
-
150
&&
_this
.
data
.
finished
==
false
)
{
// let scrollTop = parseInt(el.scrollTop);
// let domHeight = parseInt(res.height);
if
(
res
.
top
<
windowHeight
&&
res
.
top
+
res
.
height
>
0
&&
_this
.
data
.
finished
==
false
)
{
_this
.
loadHandle
(
2
);
}
// if (
// scrollTop + _this.data.clientHeight >= domHeight - 150 &&
// _this.data.finished == false
// ) {
// console.log(scrollTop + _this.data.clientHeight, '44444444444')
// _this.loadHandle(2);
// }
}
}).
exec
()
this
.
createSelectorQuery
().
select
(
"#ItemModule1"
).
boundingClientRect
(
function
(
res
){
query
.
select
(
"#ItemModule1"
).
boundingClientRect
(
function
(
res
)
{
if
(
res
)
{
let
scrollTop
=
parseInt
(
el
.
scrollTop
);
let
domHeight
=
parseInt
(
res
.
height
);
// 窗口高度+滚动高度等于 = 元素整体高度 -(预留一段距离加载) 触发父组件查询接口
if
(
scrollTop
+
_this
.
data
.
clientHeight
>=
domHeight
-
150
&&
_this
.
data
.
finished
==
false
)
{
// let scrollTop = parseInt(el.scrollTop);
// let domHeight = parseInt(res.height);
if
(
res
.
top
<
windowHeight
&&
res
.
top
+
res
.
height
>
0
&&
_this
.
data
.
finished
==
false
)
{
_this
.
loadHandle
(
2
);
}
// if (
// scrollTop + _this.data.clientHeight >= domHeight - 150 &&
// _this.data.finished == false
// ) {
// console.log(scrollTop + _this.data.clientHeight, '44444444444')
// _this.loadHandle(2);
// }
}
}).
exec
()
// wx.createSelectorQuery().in(this).select("#ItemModule1").boundingClientRect(function(res){
// if (res) {
// let scrollTop = parseInt(el.scrollTop);
// let domHeight = parseInt(res.height);
// // 窗口高度+滚动高度等于 = 元素整体高度 -(预留一段距离加载) 触发父组件查询接口
// if (
// scrollTop + _this.data.clientHeight >= domHeight - 150 &&
// _this.data.finished == false
// ) {
// _this.loadHandle(2);
// }
// }
// }).exec()
},
scrolltolower
(){
if
(
this
.
data
.
finished
==
false
){
...
...
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