列表瀑布流插件清空问题

version/0412
syt 9 months ago
parent 792fc6c7b3
commit 00012f2e07
  1. 36
      pages/goods/list.vue
  2. 16
      pages/invite/index.vue

@ -177,7 +177,7 @@
</template>
</u-waterfall>
</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>
</mescroll-body>
</view>
@ -202,7 +202,8 @@
},
mixins: [MescrollMixin, WxofficialMixin],
data() {
return {
return {
total: 1,
searchText: '',
banrdType: [],
keyName1: '',
@ -286,7 +287,8 @@
this.keyName2 = item.name
}
}
this.list.data = []
this.$refs.uWaterfall1.clear();
this.getGoodsList()
},
/**
@ -310,7 +312,16 @@
setShowView() {
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 页码
@ -337,8 +348,17 @@
GoodsApi.list(param)
.then(result => {
//
const newList = result.data.list
app.list.data = getMoreListData(newList, app.list, pageNo)
const newList = result.data.list
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)
})
.catch(reject)
@ -350,7 +370,9 @@
const app = this
const newSortPrice = newSortType === 'price' ? !app.sortPrice : true
app.sortType = newSortType
app.sortPrice = newSortPrice
app.sortPrice = newSortPrice
app.$refs.uWaterfall1.clear();
app.list.data = []
//
app.list = getEmptyPaginateObj()
app.mescroll.resetUpScroll()

@ -286,7 +286,7 @@
left: 50%;
margin-left: -336rpx;
top: 50%;
margin-top: -456rpx;
margin-top: -556rpx;
z-index: 2;
.bg {
@ -307,15 +307,19 @@
}
.tips {
width: 100%;
height: 30rpx;
width: 600rpx;
height: 80rpx;
position: absolute;
text-align: center;
font-size: 30rpx;
color: #FFFFFF;
left: 0;
bottom: -50rpx;
line-height: 80rpx;
border-radius: 10rpx;
color: #212121;
left: 50%;
margin-left: -300rpx;
bottom: -120rpx;
z-index: 2;
background-color: #FFFFFF;
}
.close {

Loading…
Cancel
Save