|
|
@ -177,7 +177,7 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</u-waterfall> |
|
|
|
</u-waterfall> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- <u-empty text="暂无数据显示哦~" v-if="list.data.length==0" mode="list"></u-empty> --> |
|
|
|
<u-empty text="暂无数据显示哦~" v-if="list.data.length==0 && total == 0" mode="list"></u-empty> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</mescroll-body> |
|
|
|
</mescroll-body> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -202,7 +202,8 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
mixins: [MescrollMixin, WxofficialMixin], |
|
|
|
mixins: [MescrollMixin, WxofficialMixin], |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
|
|
|
|
total: 1, |
|
|
|
searchText: '', |
|
|
|
searchText: '', |
|
|
|
banrdType: [], |
|
|
|
banrdType: [], |
|
|
|
keyName1: '', |
|
|
|
keyName1: '', |
|
|
@ -286,7 +287,8 @@ |
|
|
|
this.keyName2 = item.name |
|
|
|
this.keyName2 = item.name |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.list.data = [] |
|
|
|
|
|
|
|
this.$refs.uWaterfall1.clear(); |
|
|
|
this.getGoodsList() |
|
|
|
this.getGoodsList() |
|
|
|
}, |
|
|
|
}, |
|
|
|
/** |
|
|
|
/** |
|
|
@ -310,7 +312,16 @@ |
|
|
|
setShowView() { |
|
|
|
setShowView() { |
|
|
|
this.showView = uni.getStorageSync(showViewKey) || false |
|
|
|
this.showView = uni.getStorageSync(showViewKey) || false |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
//数组对象去重 |
|
|
|
|
|
|
|
arrayUnique(arr, name) { |
|
|
|
|
|
|
|
var hash = {}; |
|
|
|
|
|
|
|
return arr.reduce(function (item, next) { |
|
|
|
|
|
|
|
hash[next[name]] |
|
|
|
|
|
|
|
? "" |
|
|
|
|
|
|
|
: (hash[next[name]] = true && item.push(next)); |
|
|
|
|
|
|
|
return item; |
|
|
|
|
|
|
|
}, []); |
|
|
|
|
|
|
|
}, |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取商品列表 |
|
|
|
* 获取商品列表 |
|
|
|
* @param {number} pageNo 页码 |
|
|
|
* @param {number} pageNo 页码 |
|
|
@ -337,8 +348,17 @@ |
|
|
|
GoodsApi.list(param) |
|
|
|
GoodsApi.list(param) |
|
|
|
.then(result => { |
|
|
|
.then(result => { |
|
|
|
// 合并新数据 |
|
|
|
// 合并新数据 |
|
|
|
const newList = result.data.list |
|
|
|
const newList = result.data.list |
|
|
|
app.list.data = getMoreListData(newList, app.list, pageNo) |
|
|
|
console.log(newList) |
|
|
|
|
|
|
|
let arr = getMoreListData(newList, app.list, pageNo); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log("arr",arr) |
|
|
|
|
|
|
|
app.list.data = app.arrayUnique(arr,'goods_id') |
|
|
|
|
|
|
|
app.total = result.data.list.total; |
|
|
|
|
|
|
|
console.log("app.total",app.total) |
|
|
|
|
|
|
|
console.log("app.list.data",app.list.data) |
|
|
|
|
|
|
|
// console.log("app.list.data",app.list.data) |
|
|
|
|
|
|
|
// console.log("newList",newList) |
|
|
|
resolve(newList) |
|
|
|
resolve(newList) |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(reject) |
|
|
|
.catch(reject) |
|
|
@ -350,7 +370,9 @@ |
|
|
|
const app = this |
|
|
|
const app = this |
|
|
|
const newSortPrice = newSortType === 'price' ? !app.sortPrice : true |
|
|
|
const newSortPrice = newSortType === 'price' ? !app.sortPrice : true |
|
|
|
app.sortType = newSortType |
|
|
|
app.sortType = newSortType |
|
|
|
app.sortPrice = newSortPrice |
|
|
|
app.sortPrice = newSortPrice |
|
|
|
|
|
|
|
app.$refs.uWaterfall1.clear(); |
|
|
|
|
|
|
|
app.list.data = [] |
|
|
|
// 刷新列表数据 |
|
|
|
// 刷新列表数据 |
|
|
|
app.list = getEmptyPaginateObj() |
|
|
|
app.list = getEmptyPaginateObj() |
|
|
|
app.mescroll.resetUpScroll() |
|
|
|
app.mescroll.resetUpScroll() |
|
|
|