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 {
...
@@ -12,8 +12,8 @@ export default {
JSON
.
stringify
(
extConfig
)
==
"{}"
JSON
.
stringify
(
extConfig
)
==
"{}"
)
{
)
{
// extConfig = { mixid: "jordan", shopid: 471 };
// extConfig = { mixid: "jordan", shopid: 471 };
extConfig
=
{
"mixid"
:
"
xyyx
"
,
extConfig
=
{
"mixid"
:
"
antgood
"
,
"shopid"
:
133
};
"shopid"
:
67
};
}
}
console
.
log
(
"1444444444"
,
extConfig
);
console
.
log
(
"1444444444"
,
extConfig
);
this
.
$store
.
commit
(
"setExtConfig"
,
extConfig
.
mixid
);
this
.
$store
.
commit
(
"setExtConfig"
,
extConfig
.
mixid
);
...
...
src/pages/home/index.vue
View file @
49fcb96d
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,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=
"merchants-list
"
:datas=
"item"
></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>
...
@@ -82,7 +82,7 @@
...
@@ -82,7 +82,7 @@
<share-picture
:datas=
"item"
></share-picture>
<share-picture
:datas=
"item"
></share-picture>
</div>
</div>
<div
v-if=
"item.componentCode == 'merchants-list' && item.componentInfo.visible == 1"
>
<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>
</div>
</div>
<bottomCont></bottomCont>
<bottomCont></bottomCont>
...
@@ -269,12 +269,12 @@ export default {
...
@@ -269,12 +269,12 @@ export default {
let
com
=
this
.
$mp
.
page
.
selectComponent
(
".time-limited-discount"
+
i
)
;
let
com
=
this
.
$mp
.
page
.
selectComponent
(
".time-limited-discount"
+
i
)
;
com
&&
com
.
getScroll
(
el
);
com
&&
com
.
getScroll
(
el
);
}
}
if
(
element
.
componentCode
==
"
merchant
s-list"
){
if
(
element
.
componentCode
==
"
good
s-list"
){
let
com
=
this
.
$mp
.
page
.
selectComponent
(
".
merchants-list
"
+
i
)
;
let
com
=
this
.
$mp
.
page
.
selectComponent
(
".
goodsListItem
"
+
i
)
;
com
&&
com
.
getScroll
(
el
);
com
&&
com
.
getScroll
(
el
);
}
}
if
(
element
.
componentCode
==
"
goodsListItem
"
){
if
(
element
.
componentCode
==
"
merchants-list
"
){
let
com
=
this
.
$mp
.
page
.
selectComponent
(
".
goodsListItem
"
+
i
)
;
let
com
=
this
.
$mp
.
page
.
selectComponent
(
".
merchants-list
"
+
i
)
;
com
&&
com
.
getScroll
(
el
);
com
&&
com
.
getScroll
(
el
);
}
}
...
...
static/nativeComponents/MerchantsList/index.js
View file @
49fcb96d
...
@@ -162,34 +162,57 @@ Component({
...
@@ -162,34 +162,57 @@ Component({
},
},
getScroll
(
el
)
{
getScroll
(
el
)
{
let
_this
=
this
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
){
if
(
res
){
let
scrollTop
=
parseInt
(
el
.
scrollTop
);
// let scrollTop = parseInt(el.scrollTop);
let
domHeight
=
parseInt
(
res
.
height
);
// let domHeight = parseInt(res.height);
if
(
if
(
res
.
top
<
windowHeight
&&
res
.
top
+
res
.
height
>
0
&&
_this
.
data
.
finished
==
false
)
{
scrollTop
+
_this
.
data
.
clientHeight
>=
domHeight
-
150
&&
_this
.
data
.
finished
==
false
)
{
_this
.
loadHandle
(
2
);
_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
()
}).
exec
()
query
.
select
(
"#ItemModule1"
).
boundingClientRect
(
function
(
res
)
{
this
.
createSelectorQuery
().
select
(
"#ItemModule1"
).
boundingClientRect
(
function
(
res
){
if
(
res
)
{
if
(
res
)
{
// let scrollTop = parseInt(el.scrollTop);
let
scrollTop
=
parseInt
(
el
.
scrollTop
);
// let domHeight = parseInt(res.height);
let
domHeight
=
parseInt
(
res
.
height
);
if
(
res
.
top
<
windowHeight
&&
res
.
top
+
res
.
height
>
0
&&
_this
.
data
.
finished
==
false
)
{
// 窗口高度+滚动高度等于 = 元素整体高度 -(预留一段距离加载) 触发父组件查询接口
if
(
scrollTop
+
_this
.
data
.
clientHeight
>=
domHeight
-
150
&&
_this
.
data
.
finished
==
false
)
{
_this
.
loadHandle
(
2
);
_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
()
}).
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
(){
scrolltolower
(){
if
(
this
.
data
.
finished
==
false
){
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