吆喝
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<view class="articles">
|
||||
<integral-articles :Commodity="listData"></integral-articles>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import integralArticles from "@/pagesA/components/integralArticles.vue"
|
||||
export default {
|
||||
components: {
|
||||
integralArticles
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
listData: [],
|
||||
pages: {
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
allPage: 1,
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: options.name
|
||||
})
|
||||
this.Commodity = this.list
|
||||
this.getgoods()
|
||||
},
|
||||
methods: {
|
||||
//获取 商品
|
||||
getgoods() {
|
||||
let that = this;
|
||||
that.$httpRequest({
|
||||
url: '/api/delivery/goods/list',
|
||||
methods: "POST",
|
||||
data: {
|
||||
page: that.pages.currentPage,
|
||||
limit: that.pages.pageSize,
|
||||
},
|
||||
}).then(res => {
|
||||
if (res.code == 1) {
|
||||
if (that.pages.currentPage == 1) {
|
||||
that.listData = res.data.list;
|
||||
that.pages.allPage = Math.ceil(res.data.total / that.pages.pageSize);
|
||||
} else {
|
||||
that.listData.push(...res.data.list)
|
||||
}
|
||||
this.pages.currentPage++;
|
||||
}
|
||||
// this.score = res.data.score
|
||||
// that.pages.allPage = Math.ceil(res.data.total / that.pages.pageSize);
|
||||
}).catch(err => {
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
if (this.pages.currentPage <= this.pages.allPage) {
|
||||
this.getgoods();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.articles {
|
||||
margin-top: 32rpx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user