fanfan 5 months ago
parent afe344afb2
commit ff7604a3d6
  1. 34
      pages/goods/list.vue
  2. 2
      pages/merchantTutorial/tutorial.vue
  3. 2
      pages/shopList/shopPage.vue

@ -263,7 +263,7 @@
options: {}, // options: {}, //
list: [], // list: [], //
// list: getEmptyPaginateObj(), // // list: getEmptyPaginateObj(), //
isFirstLoad: true, //
// //
upOption: { upOption: {
// //
@ -314,11 +314,14 @@
// //
this.setWxofficialShareData() this.setWxofficialShareData()
if (options.categoryId != 'undefined') { if (options.categoryId != 'undefined') {
this.upOption.auto = false
this.isFirstLoad = false;
this.getGoodsTypeList(options.categoryId) this.getGoodsTypeList(options.categoryId)
} else { } else {
this.upOption.auto = true
this.isFirstLoad = true;
this.mescroll.resetUpScroll() this.mescroll.resetUpScroll()
} }
}, },
methods: { methods: {
@ -344,6 +347,7 @@
that.isBanrdActive = 0 that.isBanrdActive = 0
that.list = []; that.list = [];
if (this.options.categoryId) { if (this.options.categoryId) {
this.list.data = []
that.onChage(that.tabbar[0], 1, 0) that.onChage(that.tabbar[0], 1, 0)
} else { } else {
// this.$refs.uWaterfall1.clear(); // this.$refs.uWaterfall1.clear();
@ -400,14 +404,18 @@
*/ */
upCallback(page) { upCallback(page) {
const app = this const app = this
// if (app.isFirstLoad) {
app.getGoodsList(page.num) //
.then(list => { app.getGoodsList(page.num)
const curPageLen = list.data.length .then(list => {
const totalSize = list.data.total const curPageLen = list.data.length
app.mescroll.endBySize(curPageLen, totalSize) const totalSize = list.data.total
}) app.mescroll.endBySize(curPageLen, totalSize)
.catch(() => app.mescroll.endErr()) })
.catch(() => app.mescroll.endErr())
} else {
app.isFirstLoad = true
}
}, },
// //
@ -449,23 +457,17 @@
keyword: app.options.search || '', keyword: app.options.search || '',
// goods_source: this.multiIndex > -1 ? this.multiArray[this.multiIndex].value : '' // goods_source: this.multiIndex > -1 ? this.multiArray[this.multiIndex].value : ''
} }
console.log(param)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
GoodsApi.list(param) GoodsApi.list(param)
.then(result => { .then(result => {
selectorQuery.selectAll('.head').boundingClientRect((rects) => { selectorQuery.selectAll('.head').boundingClientRect((rects) => {
console.log("rects", rects)
app.blheight = rects[0].height app.blheight = rects[0].height
}).exec(); }).exec();
//
console.log(app.list)
const newList = result.data.list const newList = result.data.list
console.log(newList)
let arr = getMoreListData(newList, app.list, pageNo); let arr = getMoreListData(newList, app.list, pageNo);
// app.list.data = app.arrayUnique(arr, 'goods_id') // app.list.data = app.arrayUnique(arr, 'goods_id')
app.list.data = arr; app.list.data = arr;
app.total = result.data.list.total; app.total = result.data.list.total;
console.log(newList)
resolve(newList) resolve(newList)
}) })
.catch(reject) .catch(reject)

@ -66,7 +66,7 @@
loadText: { loadText: {
loadmore: '上拉加载更多', loadmore: '上拉加载更多',
loading: '正在加载', loading: '正在加载',
nomore: '没有更多了 ' nomore: '亲,没有更多了 '
} }
} }
}, },

@ -582,7 +582,7 @@
transform: translateY(-50%); transform: translateY(-50%);
left: 0; left: 0;
width: 4rpx; width: 4rpx;
height: calc(100% - 60rpx); height: calc(100% - 40rpx);
background: #F34A40; background: #F34A40;
} }
} }

Loading…
Cancel
Save