tianyi 3 weeks ago
parent
commit
f4f8caa3e1
  1. 23
      pages/index/index.vue

23
pages/index/index.vue

@ -266,7 +266,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="title-sort" v-if="(lastScrollTop>583 || getAreaData.id != undefined || putAreaData.id != undefined || checkYongjin)" :class="{'title-sort--sticky': lastScrollTop>583}" <view class="title-sort" v-if="(lastScrollTop>300 || getAreaData.id != undefined || putAreaData.id != undefined || checkYongjin)" :class="{'title-sort--sticky': lastScrollTop>583}"
:style="{'top': (navBarHeight+90) + 'px'}"> :style="{'top': (navBarHeight+90) + 'px'}">
<view class="sort-member" style="position: relative;"> <view class="sort-member" style="position: relative;">
<view @tap="checkAdd"> <view @tap="checkAdd">
@ -329,7 +329,7 @@
</view> </view>
</view> </view>
<view class="delivery-list-wrap"> <scroll-view @scrolltolower="onReachPage" :scroll-y="lastScrollTop>583" class="delivery-list-wrap">
<view class="empty-delivery" v-if="deliveryItem.length <= 0"> <view class="empty-delivery" v-if="deliveryItem.length <= 0">
<view class="empty-delivery-icon">校园</view> <view class="empty-delivery-icon">校园</view>
<view class="empty-delivery-title">暂时没有可抢订单</view> <view class="empty-delivery-title">暂时没有可抢订单</view>
@ -442,7 +442,7 @@
</view> </view>
</view> </view>
</view> </view>
</view> </scroll-view>
</view> </view>
</view> </view>
@ -694,6 +694,7 @@
checkYongjin: false, checkYongjin: false,
getshopArea: [], getshopArea: [],
putshopArea: [], putshopArea: [],
totalPages: 1,
swipeOrderDefaultStyle: { swipeOrderDefaultStyle: {
progress: 'width: 0%;', progress: 'width: 0%;',
thumb: 'left: 0%; transform: translateX(-0%);' thumb: 'left: 0%; transform: translateX(-0%);'
@ -1044,7 +1045,11 @@
} }
} }
} }
that.deliveryItem = res.result.records; if (that.searchForm.pageNum == 1) {
that.deliveryItem = res.result.records;
} else {
that.deliveryItem = [...that.deliveryItem, ...res.result.records]
}
if (res.result.orderCount != null) { if (res.result.orderCount != null) {
for (let i = 0; i < res.result.orderCount.length; i++) { for (let i = 0; i < res.result.orderCount.length; i++) {
if (res.result.orderCount[i].deliveryType == 1) { if (res.result.orderCount[i].deliveryType == 1) {
@ -1059,6 +1064,7 @@
if (res.result.zhipaiCount != undefined && res.result.zhipaiCount != null) { if (res.result.zhipaiCount != undefined && res.result.zhipaiCount != null) {
that.zhipaiCount = res.result.zhipaiCount that.zhipaiCount = res.result.zhipaiCount
} }
that.totalPages = res.result.pages; // pages =
that.$forceUpdate(); that.$forceUpdate();
} else { } else {
that.tui.toast(res.message); that.tui.toast(res.message);
@ -1187,6 +1193,12 @@
} }
}).catch((res) => {}) }).catch((res) => {})
}, },
onReachPage() {
console.log("11111")
if (this.searchForm.pageNum >= this.totalPages) return;
this.searchForm.pageNum++;
this.getDelivery();
},
searchOrder(type, value) { searchOrder(type, value) {
if (type == 'getarea') { if (type == 'getarea') {
if (this.searchForm.getAreaId == value.id) { if (this.searchForm.getAreaId == value.id) {
@ -2025,7 +2037,6 @@
border-radius: 34rpx; border-radius: 34rpx;
margin: 22rpx auto 0; margin: 22rpx auto 0;
overflow: hidden; overflow: hidden;
box-shadow: 0 16rpx 38rpx rgba(0, 35, 28, 0.07);
} }
.daoda-time { .daoda-time {
@ -2508,7 +2519,7 @@
} }
.delivery-list-wrap { .delivery-list-wrap {
min-height: 1200rpx; height: 1200rpx;
} }
.empty-delivery { .empty-delivery {

Loading…
Cancel
Save