修复分页请求逻辑以及变量大小写错误。

fix
游梦婷 11 months ago
parent 1817c25a2f
commit e0d29a0ac0
  1. 55
      pages/index/bindScan/bindScan.vue
  2. 3
      pages/index/equity-activities-details/equity-activities-details.vue
  3. 8
      pages/index/equity-activities/equity-activities.vue
  4. 25
      pages/index/normal-Merchant/normal-Merchant.vue
  5. 23
      pages/index/scanList/scanList.vue

@ -34,7 +34,7 @@
return { return {
serviceList: [], serviceList: [],
pageNum: 1, pageNum: 1,
pagesize: 15, pageSize: 15,
isLoadMore: false, // isLoadMore: false, //
userInfo: app.globalData.userInfo, // userInfo: app.globalData.userInfo, //
typeId: '', // typeId: '', //
@ -43,15 +43,11 @@
} }
}, },
onReachBottom() { // onReachBottom() { //
if (!this.isLoadMore) { //
this.isLoadMore = true
this.pageNum += 1
if (this.typeId == 2) { if (this.typeId == 2) {
this.getStoreQrCodeList(); this.getStoreQrCodeList();
} else { } else {
this.getSalesmanQrCodeList(); this.getSalesmanQrCodeList();
} }
}
}, },
onLoad(options) { onLoad(options) {
this.typeId = options.type; this.typeId = options.type;
@ -68,7 +64,6 @@
methods: { methods: {
toSearch() { toSearch() {
this.pageNum = 1; this.pageNum = 1;
this.pageSize = 10;
this.isLoadMore = false; this.isLoadMore = false;
this.serviceList = []; this.serviceList = [];
if (this.typeId == 2) { if (this.typeId == 2) {
@ -79,59 +74,75 @@
}, },
// //
getStoreQrCodeList() { getStoreQrCodeList() {
if (this.isLoadMore) {
return false;
}
uni.showLoading({ uni.showLoading({
title: '加载中...' title: '加载中...'
}) })
let params = { let params = {
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: this.pagesize, pageSize: this.pageSize,
serialNumber: this.scanNo, serialNumber: this.scanNo,
storeId: this.storeId storeId: this.storeId
} }
getStoreQrCodeList(params).then(res => { getStoreQrCodeList(params).then(res => {
uni.hideLoading(); uni.hideLoading();
if (res.return_code == '000000' && res.return_data.list) { if (res.return_code == '000000' && res.return_data.list) {
this.isLoadMore = res.return_data.list.length == this.pageSize ? false : true;
this.serviceList = this.serviceList.concat(res.return_data.list); this.serviceList = this.serviceList.concat(res.return_data.list);
if (res.return_data.total == (this.pageNum * this.pageSize)) { if (res.return_data.total == this.serviceList.length) {
this.isLoadMore = true; this.isLoadMore = true;
}else{
this.isLoadMore = false;
} }
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum; this.pageNum = this.pageNum + 1;
} else { } else {
this.serviceList = []; this.serviceList = [];
this.isLoadMore = true this.isLoadMore = true;
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
} }
}); });
}, },
// //
getSalesmanQrCodeList() { getSalesmanQrCodeList() {
uni.showLoading({
title: '加载中...'
})
if (this.isLoadMore) { if (this.isLoadMore) {
uni.hideLoading()
return false; return false;
} }
let pagenum = this.pageNum; uni.showLoading({
title: '加载中...'
})
let datas = { let datas = {
salesmanId: this.userInfo.salesman.id, salesmanId: this.userInfo.salesman.id,
isAssignStore: false, isAssignStore: false,
serialNumber: this.scanNo, serialNumber: this.scanNo,
pageNum: pagenum, pageNum: this.pageNum,
pageSize: this.pagesize, pageSize: this.pageSize,
} }
getSalesmanQrCodeList(datas).then(res => { getSalesmanQrCodeList(datas).then(res => {
uni.hideLoading(); uni.hideLoading();
if (res.return_code == '000000' && res.return_data.list) { if (res.return_code == '000000' && res.return_data.list) {
this.isLoadMore = res.return_data.list.length == this.pageSize ? false : true;
this.serviceList = this.serviceList.concat(res.return_data.list); this.serviceList = this.serviceList.concat(res.return_data.list);
if (res.return_data.total == (this.pageNum * this.pageSize)) { if (res.return_data.total == this.serviceList.length) {
this.isLoadMore = true; this.isLoadMore = true;
}else{
this.isLoadMore = false;
} }
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum; this.pageNum = this.pageNum + 1;
} else { } else {
this.serviceList = []; this.serviceList = [];
this.isLoadMore = true this.isLoadMore = true;
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
} }
}); });
}, },

@ -22,7 +22,7 @@
<view class="width90 mart20 marb15 fcor333 fontwig6 font16" v-if="activitydetails.bankActivityRoster ==null"> <view class="width90 mart20 marb15 fcor333 fontwig6 font16" v-if="activitydetails.bankActivityRoster ==null">
商户信息 商户信息
</view> </view>
<template v-if="merDetailInfo">
<view class="username"> <view class="username">
<view class="namecont">商户名称</view> <view class="namecont">商户名称</view>
<view class="font14 fcor333 text2 width75 fotrt">{{merDetailInfo.mer.merName}}</view> <view class="font14 fcor333 text2 width75 fotrt">{{merDetailInfo.mer.merName}}</view>
@ -35,6 +35,7 @@
<view class="namecont">支行行号</view> <view class="namecont">支行行号</view>
<view class="font14 fcor333 text2 width75 fotrt">{{merDetailInfo.mer.merSettleAcct.openningBankCode}}</view> <view class="font14 fcor333 text2 width75 fotrt">{{merDetailInfo.mer.merSettleAcct.openningBankCode}}</view>
</view> </view>
</template>
<!-- <view class="username"> <!-- <view class="username">
<view class="namecont">银行地址</view> <view class="namecont">银行地址</view>
<pickRegions :defaultRegion="defaultRegionCodes" class="width70" @getRegion="handleBankCityCode"> <pickRegions :defaultRegion="defaultRegionCodes" class="width70" @getRegion="handleBankCityCode">

@ -59,8 +59,7 @@
} }
], // ], //
activityList: [], // activityList: [], //
pageNum: 1,
pagesize: 15,
statusid: 1, // statusid: 1, //
isLoadMore: false, // isLoadMore: false, //
merId: '' // id merId: '' // id
@ -68,17 +67,12 @@
}, },
onLoad(options) { onLoad(options) {
this.merId = options.id; this.merId = options.id;
},
onShow() {
this.pageNum = 1;
this.activityList = [];
this.queryActivityList(); this.queryActivityList();
}, },
methods: { methods: {
//id //id
switchid(item) { switchid(item) {
this.statusid = item.id; this.statusid = item.id;
this.pageNum = 1;
}, },
// //
queryActivityList() { queryActivityList() {

@ -5,7 +5,7 @@
<input placeholder="请输入商户名称" v-model="mersearchName" placeholder-style="color:#c0c0c0;" <input placeholder="请输入商户名称" v-model="mersearchName" placeholder-style="color:#c0c0c0;"
@input="getMerListBySalesman()" /> @input="getMerListBySalesman()" />
</view> </view>
<view class="mart20 width100"> <view class="paddbotm10 width100 ">
<view v-if="merchantlist == '' " class="mart60 fotct font14 fcor666"> <view v-if="merchantlist == '' " class="mart60 fotct font14 fcor666">
<image mode="widthFix" style="width: 70vw;" src="../../../static/img/noorder.png"></image> <image mode="widthFix" style="width: 70vw;" src="../../../static/img/noorder.png"></image>
</view> </view>
@ -50,7 +50,7 @@
return { return {
merchantlist: [], merchantlist: [],
pageNum: 1, pageNum: 1,
pagesize: 10, pageSize: 10,
isLoadMore: false, // isLoadMore: false, //
mersearchName: '' // mersearchName: '' //
} }
@ -58,19 +58,18 @@
onShow() { onShow() {
this.merchantlist = []; this.merchantlist = [];
this.pageNum = 1; this.pageNum = 1;
this.isLoadMore = false;
this.getMerListBySalesman(); this.getMerListBySalesman();
}, },
onReachBottom() { // onReachBottom() { //
if (!this.isLoadMore) { //
this.isLoadMore = true
this.pageNum += 1
this.getMerListBySalesman() this.getMerListBySalesman()
}
}, },
methods: { methods: {
// //
getMerListBySalesman() { getMerListBySalesman() {
this.merchantlist = []; if(this.isLoadMore){
return
}
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'
}) })
@ -78,7 +77,7 @@
merStatus: 1, merStatus: 1,
merName: this.mersearchName, merName: this.mersearchName,
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: this.pagesize, pageSize: this.pageSize,
} }
getMerListBySalesman(datas).then(res => { getMerListBySalesman(datas).then(res => {
uni.hideLoading(); uni.hideLoading();
@ -87,11 +86,17 @@
if (res.return_data.pages == this.pageNum) { if (res.return_data.pages == this.pageNum) {
this.isLoadMore = true; this.isLoadMore = true;
} else { } else {
this.isLoadMore = false this.isLoadMore = false;
} }
this.pageNum = this.pageNum+1;
} else { } else {
this.merchantlist = []; this.merchantlist = [];
this.isLoadMore = true this.isLoadMore = true;
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
} }
}); });
}, },

@ -36,7 +36,7 @@
return { return {
serviceList: [], serviceList: [],
pageNum: 1, pageNum: 1,
pagesize: 15, pageSize: 15,
isLoadMore: false, // isLoadMore: false, //
userInfo: app.globalData.userInfo, // userInfo: app.globalData.userInfo, //
scanNo: '' ,// scanNo: '' ,//
@ -44,11 +44,12 @@
} }
}, },
onReachBottom() { // onReachBottom() { //
if (!this.isLoadMore) { // // if (!this.isLoadMore) { //
this.isLoadMore = true // this.isLoadMore = true
this.pageNum += 1 // this.pageNum += 1
// this.getStoreQrCodeList();
// }
this.getStoreQrCodeList(); this.getStoreQrCodeList();
}
}, },
onLoad(options) { onLoad(options) {
this.getStoreQrCodeList(); this.getStoreQrCodeList();
@ -56,7 +57,6 @@
methods: { methods: {
toSearch() { toSearch() {
this.pageNum = 1; this.pageNum = 1;
this.pageSize = 10;
this.isLoadMore = false; this.isLoadMore = false;
this.serviceList = []; this.serviceList = [];
this.getStoreQrCodeList(); this.getStoreQrCodeList();
@ -68,21 +68,26 @@
}) })
let params = { let params = {
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: this.pagesize, pageSize: this.pageSize,
serialNumber: this.scanNo, serialNumber: this.scanNo,
storeId: this.userInfo.store.id storeId: this.userInfo.store.id
} }
getStoreQrCodeList(params).then(res => { getStoreQrCodeList(params).then(res => {
uni.hideLoading(); uni.hideLoading();
if (res.return_code == '000000' && res.return_data.list) { if (res.return_code == '000000' && res.return_data.list) {
this.receiverList = this.receiverList.concat(res.return_data.list); this.serviceList = this.serviceList.concat(res.return_data.list);
if (res.return_data.pages == this.pageNum) { if (res.return_data.pages == this.pageNum) {
this.isLoadMore = true; this.isLoadMore = true;
} else { } else {
this.isLoadMore = false this.isLoadMore = false
} }
this.pageNum = this.pageNum+1;
} else { } else {
this.isLoadMore = true uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
} }
}); });
}, },

Loading…
Cancel
Save