|
|
@@ -6,10 +6,21 @@
|
|
|
</div>
|
|
|
</scroll-view>
|
|
|
<block v-for="(item,index) in tabbar" :key="index">
|
|
|
- <scroll-view scroll-y class="right-box" :style="{height:height+'px'}" v-if="currentTab==index">
|
|
|
+ <scroll-view
|
|
|
+ scroll-y
|
|
|
+ class="right-box"
|
|
|
+ :style="{height:height+'px'}"
|
|
|
+ @scrolltolower="onReachBottoms"
|
|
|
+ v-if="currentTab==index">
|
|
|
<!--内容部分 start -->
|
|
|
- <div class="page-view" v-if="!$util.isEmpty(list.data)">
|
|
|
- <div class="goods-list" v-for="(items, subIndex) in list.data" :key="items.id" @click="pageTo(`/pages/goods/detail?id=${items.id}`)">
|
|
|
+ <div
|
|
|
+ class="page-view"
|
|
|
+ v-if="!$util.isEmpty(list.data)">
|
|
|
+ <div
|
|
|
+ class="goods-list"
|
|
|
+ v-for="(items, subIndex) in list.data"
|
|
|
+ :key="items.id"
|
|
|
+ @click="pageTo(`/pages/goods/detail?id=${items.id}`)">
|
|
|
<div class="img-blo">
|
|
|
<app-img :src="items.smallImgList[0]" alt="商品图" mode="aspectFit" :height="200" />
|
|
|
</div>
|
|
|
@@ -54,21 +65,54 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- onLoad: function() {
|
|
|
- if (this.$util.isLogin()) {
|
|
|
- setTimeout(() => {
|
|
|
- uni.getSystemInfo({
|
|
|
- success: res => {
|
|
|
- this.height = res.windowHeight
|
|
|
- this.sInit()
|
|
|
- }
|
|
|
- })
|
|
|
- }, 50)
|
|
|
- }
|
|
|
- },
|
|
|
+ ceshi(){
|
|
|
+ console.log(1232)
|
|
|
+ },
|
|
|
+// onPullDownRefresh() {
|
|
|
+// this.resetList();
|
|
|
+// this._list().then(res => {
|
|
|
+// uni.stopPullDownRefresh();
|
|
|
+// });
|
|
|
+// },
|
|
|
+// // 加载更多
|
|
|
+// onReachBottom() {
|
|
|
+// console.log(1212)
|
|
|
+// if (this.list.moreData == 1) {
|
|
|
+// this._list().then(res => {
|
|
|
+// uni.stopPullDownRefresh();
|
|
|
+// });
|
|
|
+// } else {
|
|
|
+// uni.stopPullDownRefresh();
|
|
|
+// }
|
|
|
+// },
|
|
|
+ onLoad: function() {
|
|
|
+ if (this.$util.isLogin()) {
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.getSystemInfo({
|
|
|
+ success: res => {
|
|
|
+ this.height = res.windowHeight
|
|
|
+ this.sInit()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }, 50)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
methods: {
|
|
|
+ onReachBottoms(){
|
|
|
+ console.log(789)
|
|
|
+ console.log(this.list)
|
|
|
+ if (!this.list.finished) {
|
|
|
+ this._list().then(res => {
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
+ }
|
|
|
+ },
|
|
|
async sInit() {
|
|
|
- this._getClass().then(res => {
|
|
|
+ this._getClass()
|
|
|
+ .then(res => {
|
|
|
this._list()
|
|
|
})
|
|
|
},
|
|
|
@@ -82,7 +126,11 @@ export default {
|
|
|
},
|
|
|
// 列表
|
|
|
_list() {
|
|
|
- return getList(this.form).then(res => {
|
|
|
+ return getList({
|
|
|
+ ...this.form,
|
|
|
+ page:this.list.page
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
this.completes(res)
|
|
|
})
|
|
|
},
|