|
|
const $ = require('jquery');
|
|
|
const lazyload = require('../plugins/lazyload');
|
|
|
window.jQuery = $;
|
|
|
|
|
|
let moreObj = {
|
...
|
...
|
@@ -29,17 +30,33 @@ let moreObj = { |
|
|
},
|
|
|
getMore: function () {
|
|
|
this.loading = true;
|
|
|
let ajaxData = {
|
|
|
page: this.page,
|
|
|
row: 10
|
|
|
};
|
|
|
if ($('#businessAreaId').val()) {
|
|
|
Object.assign(ajaxData, {businessAreaId: $('#businessAreaId').val()});
|
|
|
}
|
|
|
if ($('#cityId').val()) {
|
|
|
Object.assign(ajaxData, {cityId: $('#cityId').val()});
|
|
|
}
|
|
|
if ($('#tagId').val()) {
|
|
|
Object.assign(ajaxData, {tagId: $('#tagId').val()});
|
|
|
}
|
|
|
$.ajax({
|
|
|
method: 'GET',
|
|
|
url: window.$ajaxPath,
|
|
|
data: {
|
|
|
page: this.page,
|
|
|
row: 10,
|
|
|
businessAreaId: 44
|
|
|
},
|
|
|
data: ajaxData,
|
|
|
success: (result) => {
|
|
|
if (result) {
|
|
|
this.el.$listContainer.append(result);
|
|
|
if ($(result).length > 0) {
|
|
|
let $result = $(result);
|
|
|
let $lazyImg = $result.find('img.lazy');
|
|
|
|
|
|
this.el.$listContainer.append($result);
|
|
|
lazyload($lazyImg, {
|
|
|
threshold: 1000,
|
|
|
q: 80
|
|
|
});
|
|
|
this.loading = false;
|
|
|
} else {
|
|
|
this.end = true;
|
...
|
...
|
|