Commit 49fcb96d by 程智春

fix

parent a9f186ef
...@@ -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);
......
...@@ -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=="merchants-list"){ if(element.componentCode=="goods-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);
} }
......
...@@ -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){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment