|
|
|
@ -263,7 +263,7 @@ |
|
|
|
|
options: {}, // 当前页面参数 |
|
|
|
|
list: [], // 商品列表数据 |
|
|
|
|
// list: getEmptyPaginateObj(), // 商品列表数据 |
|
|
|
|
|
|
|
|
|
isFirstLoad: true, // 用于标记是否是首次加载 |
|
|
|
|
// 上拉加载配置 |
|
|
|
|
upOption: { |
|
|
|
|
// 首次自动执行 |
|
|
|
@ -314,11 +314,14 @@ |
|
|
|
|
// 设置微信公众号链接分享卡片内容 |
|
|
|
|
this.setWxofficialShareData() |
|
|
|
|
if (options.categoryId != 'undefined') { |
|
|
|
|
this.upOption.auto = false |
|
|
|
|
this.isFirstLoad = false; |
|
|
|
|
this.getGoodsTypeList(options.categoryId) |
|
|
|
|
} else { |
|
|
|
|
this.upOption.auto = true |
|
|
|
|
this.isFirstLoad = true; |
|
|
|
|
this.mescroll.resetUpScroll() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
methods: { |
|
|
|
@ -344,6 +347,7 @@ |
|
|
|
|
that.isBanrdActive = 0 |
|
|
|
|
that.list = []; |
|
|
|
|
if (this.options.categoryId) { |
|
|
|
|
this.list.data = [] |
|
|
|
|
that.onChage(that.tabbar[0], 1, 0) |
|
|
|
|
} else { |
|
|
|
|
// this.$refs.uWaterfall1.clear(); |
|
|
|
@ -400,14 +404,18 @@ |
|
|
|
|
*/ |
|
|
|
|
upCallback(page) { |
|
|
|
|
const app = this |
|
|
|
|
// 设置列表数据 |
|
|
|
|
app.getGoodsList(page.num) |
|
|
|
|
.then(list => { |
|
|
|
|
const curPageLen = list.data.length |
|
|
|
|
const totalSize = list.data.total |
|
|
|
|
app.mescroll.endBySize(curPageLen, totalSize) |
|
|
|
|
}) |
|
|
|
|
.catch(() => app.mescroll.endErr()) |
|
|
|
|
if (app.isFirstLoad) { |
|
|
|
|
// 设置列表数据 |
|
|
|
|
app.getGoodsList(page.num) |
|
|
|
|
.then(list => { |
|
|
|
|
const curPageLen = list.data.length |
|
|
|
|
const totalSize = list.data.total |
|
|
|
|
app.mescroll.endBySize(curPageLen, totalSize) |
|
|
|
|
}) |
|
|
|
|
.catch(() => app.mescroll.endErr()) |
|
|
|
|
} else { |
|
|
|
|
app.isFirstLoad = true |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 设置默认列表显示方式 |
|
|
|
@ -449,23 +457,17 @@ |
|
|
|
|
keyword: app.options.search || '', |
|
|
|
|
// goods_source: this.multiIndex > -1 ? this.multiArray[this.multiIndex].value : '' |
|
|
|
|
} |
|
|
|
|
console.log(param) |
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
GoodsApi.list(param) |
|
|
|
|
.then(result => { |
|
|
|
|
selectorQuery.selectAll('.head').boundingClientRect((rects) => { |
|
|
|
|
console.log("rects", rects) |
|
|
|
|
app.blheight = rects[0].height |
|
|
|
|
}).exec(); |
|
|
|
|
// 合并新数据 |
|
|
|
|
console.log(app.list) |
|
|
|
|
const newList = result.data.list |
|
|
|
|
console.log(newList) |
|
|
|
|
let arr = getMoreListData(newList, app.list, pageNo); |
|
|
|
|
// app.list.data = app.arrayUnique(arr, 'goods_id') |
|
|
|
|
app.list.data = arr; |
|
|
|
|
app.total = result.data.list.total; |
|
|
|
|
console.log(newList) |
|
|
|
|
resolve(newList) |
|
|
|
|
}) |
|
|
|
|
.catch(reject) |
|
|
|
|