1.新增分页门店数据

yj-dev
杨杰 3 years ago
parent fb57c33cbe
commit 5c703beec6
  1. 22
      pages/goods/coupon-details/coupon-details.vue
  2. 22
      pages/pay/success/success.vue
  3. 65
      pages/tabBar/category/category.vue

@ -90,7 +90,10 @@
oneTime: '',
twoTime: '',
threeTime: '',
menddesId: ''
menddesId: '',
pageNum: 1,
pageSize: 10,
isNoMoreData: false
}
},
onLoad(option) {
@ -164,16 +167,27 @@
uni.showLoading({
title: '加载中...'
})
if (this.isNoMoreData) {
uni.hideLoading()
return false;
}
let pagenum = this.pageNum;
let params = {
couponId: this.menddesId,
longitude: app.globalData.longitude,
latitude: app.globalData.latitude
latitude: app.globalData.latitude,
pageNum: pagenum,
pageSize: this.pageSize
}
getStoreListByCoupon(params).then(res => {
if (res.return_code == '000000' && res.return_data.list != '') {
uni.hideLoading();
this.storeList = res.return_data;
this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true;
this.storeList = this.storeList.concat(res.return_data.list);
if (res.return_data.total == (this.pageNum * this.pageSize)) {
this.isNoMoreData = true;
}
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum;
} else {
this.storeList = [];
uni.hideLoading()

@ -96,7 +96,10 @@
storeList: [],
oneTime: '',
twoTime: '',
threeTime: ''
threeTime: '',
pageNum: 1,
pageSize: 10,
isNoMoreData: false
}
},
onLoad(option) {
@ -169,16 +172,27 @@
uni.showLoading({
title: '加载中...'
})
if (this.isNoMoreData) {
uni.hideLoading()
return false;
}
let pagenum = this.pageNum;
let params = {
couponId: this.couDesId,
longitude: app.globalData.longitude,
latitude: app.globalData.latitude
latitude: app.globalData.latitude,
pageNum: pagenum,
pageSize: this.pageSize
}
getStoreListByCoupon(params).then(res => {
if (res.return_code == '000000' && res.return_data.list != '') {
uni.hideLoading();
this.storeList = res.return_data;
this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true;
this.storeList = this.storeList.concat(res.return_data.list);
if (res.return_data.total == (this.pageNum * this.pageSize)) {
this.isNoMoreData = true;
}
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum;
} else {
this.storeList = [];
uni.hideLoading()

@ -61,33 +61,6 @@
</view>
</view>
</view>
<!-- 左侧分类导航 -->
<!-- <scroll-view scroll-y="true" class="left">
<view class="row" v-for="(mers,index) in MerchantList" :key="mers.id"
:class="[index==showCategoryIndex?'on':'']" @click="showCategory(index,mers.id)">
<view class="text">
<view class="block"></view>
{{mers.merchantName}}
</view>
</view>
</scroll-view> -->
<!-- 右侧子导航 -->
<!-- <scroll-view scroll-y="true" class="right">
<view class="category">
<view v-if="categoryList == '' " class="mart60 fotct font14 fcor666">
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres1"></image>
</view>
<view class="list">
<view class="box" v-for="(box,i) in categoryList" :key="i" @tap="toCategory(box)"
v-show="i==showCategoryIndex">
<image :src="imageUrl+box.ext1"></image>
<view class="text">{{box.storeName}}</view>
</view>
</view>
</view>
</scroll-view> -->
<!-- </view> -->
<wybPopup ref="popup" type="top" height="800" width="500" radius="6" :showCloseIcon="false">
<view class="fotct font18 fontwig6 fcor333 mart10 height30">筛选门店</view>
<view class="mart15">
@ -114,6 +87,7 @@
data() {
return {
showCategoryIndex: '',
showCategoryIndexId: '',
headerPosition: "fixed",
imagewxUrl: app.globalData.imageWxImg,
imgadres: 'jt.png',
@ -152,6 +126,10 @@
}
},
//page.json"onReachBottomDistance"
onReachBottom() {
this.getStoreListByMerchant();
},
methods: {
//
showPopup() {
@ -213,7 +191,8 @@
if (res.return_code == '000000' && res.return_data != '') {
this.MerchantList = res.return_data;
this.showCategoryIndex = res.return_data[0].merchantName;
this.getStoreListByMerchant(res.return_data[0].id);
this.showCategoryIndexId = res.return_data[0].id;
this.getStoreListByMerchant();
} else {
this.MerchantList = [];
@ -251,20 +230,33 @@
})
},
//
getStoreListByMerchant(item) {
getStoreListByMerchant() {
uni.showLoading({
title: '加载中...'
})
if (this.isNoMoreData) {
uni.hideLoading()
return false;
}
let pagenum = this.pageNum;
let params = {
merchantId: item,
merchantId: this.showCategoryIndexId,
longitude: app.globalData.longitude,
latitude: app.globalData.latitude
latitude: app.globalData.latitude,
pageNum: pagenum,
pageSize: this.pageSize
}
getStoreListByMerchant(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
this.categoryList = res.return_data
uni.hideLoading();
this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true;
this.categoryList = this.categoryList.concat(res.return_data.list);
if (res.return_data.total == (this.pageNum * this.pageSize)) {
this.isNoMoreData = true;
}
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum;
} else {
this.categoryList = [];
}
@ -275,7 +267,12 @@
showCategory(index, item) {
this.showCategoryIndex = index;
this.$refs.popup.hide();
this.getStoreListByMerchant(item);
this.showCategoryIndexId = item;
this.pageNum = 1;
this.pageSize = 10;
this.isNoMoreData = false;
this.categoryList = [];
this.getStoreListByMerchant();
},
toCategory(e) {
uni.navigateTo({

Loading…
Cancel
Save