get_productsList:function () {
//
var _this=this;
//
let sw = true;
let adrObj = {
"path": misslove.path,
"page":1
}
console.log(adrObj)
this.$http.post(misslove.host+"/index.php?route=product/category/get_products",adrObj,{emulateJSON:true}).then(
function (res) {
//
console.log(res.data)
var re = res.data;
if(re.code=="200"){
_this.products= re.products;
}
},function (err) {
//
console.log(err)
});
let isLoading = false
window.onscroll = () => {
// 200px
let bottomOfWindow = document.documentElement.offsetHeight - document.documentElement.scrollTop - window.innerHeight <= 200
if (bottomOfWindow && isLoading == false) {
//
isLoading = true
this.$http.post(misslove.host+"/index.php?route=product/category/get_products",{"path": misslove.path,"page":pagePP},{emulateJSON:true}).then(
function (res) {
console.log(res)
//
var pists = res.data.products;
if (!pists) pists = [];
var $arr = _this.products;
for (let i = 0; i < pists.length; iPP) {
if (pists[i].Access != 0) {
$arr.push(pists[i]);
/ / _ this.products.push (thanks [I])
}
}
_this.products = $arr;
console.log(_this.products)
},function (err) {
//
console.log(err)
});
//
isLoading = false
}
}
},
there are 26 pieces of data, and 20 items are displayed on one page. Now res renders 20 pieces first and then 6 pieces, and then repeats 20 pieces of data.