1212
This commit is contained in:
@@ -98,6 +98,7 @@
|
||||
|
||||
data() {
|
||||
return {
|
||||
getSiteListTimer:null,
|
||||
TabCur: 0,
|
||||
search: '',
|
||||
status: {
|
||||
@@ -214,118 +215,126 @@
|
||||
}
|
||||
},
|
||||
onRequest() {
|
||||
if (this.TabCur == 0) {
|
||||
this.currentPage.currentPage = 1
|
||||
this.list = []
|
||||
this.getOrder('全部', this.currentPage.currentPage,'onRequest')
|
||||
} else if (this.TabCur == 1) {
|
||||
this.currentPage.currentPage0 = 1
|
||||
this.list0 = []
|
||||
this.getOrder('0', this.currentPage.currentPage0,'onRequest')
|
||||
} else if (this.TabCur == 2) {
|
||||
this.currentPage.currentPage1 = 1
|
||||
this.list1 = []
|
||||
this.getOrder('1', this.currentPage.currentPage1,'onRequest')
|
||||
} else if (this.TabCur == 3) {
|
||||
this.currentPage.currentPage2 = 1
|
||||
this.list2 = []
|
||||
this.getOrder('2', this.currentPage.currentPage2,'onRequest')
|
||||
} else if (this.TabCur == 4) {
|
||||
this.currentPage.currentPage3 = 1
|
||||
this.list3 = []
|
||||
this.getOrder('3', this.currentPage.currentPage3,'onRequest')
|
||||
}
|
||||
|
||||
if (this.TabCur == 0) {
|
||||
this.currentPage.currentPage = 1
|
||||
this.list = []
|
||||
this.getOrder('全部', this.currentPage.currentPage,'onRequest')
|
||||
} else if (this.TabCur == 1) {
|
||||
this.currentPage.currentPage0 = 1
|
||||
this.list0 = []
|
||||
this.getOrder('0', this.currentPage.currentPage0,'onRequest')
|
||||
} else if (this.TabCur == 2) {
|
||||
this.currentPage.currentPage1 = 1
|
||||
this.list1 = []
|
||||
this.getOrder('1', this.currentPage.currentPage1,'onRequest')
|
||||
} else if (this.TabCur == 3) {
|
||||
this.currentPage.currentPage2 = 1
|
||||
this.list2 = []
|
||||
this.getOrder('2', this.currentPage.currentPage2,'onRequest')
|
||||
} else if (this.TabCur == 4) {
|
||||
this.currentPage.currentPage3 = 1
|
||||
this.list3 = []
|
||||
this.getOrder('3', this.currentPage.currentPage3,'onRequest')
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
getOrder(id, page, tip) {
|
||||
let postData = {
|
||||
currentPage: page, //类型:Number 必有字段 备注:无
|
||||
pageSize: 10, //类型:Number 必有字段 备注:无
|
||||
index: (page - 1) * 10,
|
||||
params: { //类型:Object 必有字段 备注:无
|
||||
clientBelong:'ZHONGPIN',
|
||||
orderStatus: id == '全部' ? '' : (id +''), //类型:String 必有字段 备注:订单状态 0:待支付, 1:已支付 ,-1:支付失败 ,2:已取消,3:已退款
|
||||
search: this.search //类型:String 必有字段 备注:搜索 ( 油站名称/ 订单编号/ 油品)
|
||||
},
|
||||
}
|
||||
console.log('tip',id,tip)
|
||||
orderApi.getOrderInfoByPage(postData).then(res => {
|
||||
if (res.code == 20000) {
|
||||
// console.log('订单列表厂房发', page, res.data.list.length)
|
||||
// 0:待支付, 1:已支付 ,-1:支付失败 ,2:已取消,3:已退款
|
||||
if (id == '0') {
|
||||
// 0:待支付 list0
|
||||
this.list0 = this.list0.concat(res.data.list)
|
||||
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.status.loadOrderStatus0 = 'nomore'
|
||||
uni.showToast({
|
||||
title: '就这么多啦',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.currentPage.currentPage0++
|
||||
this.status.loadOrderStatus0 = 'load'
|
||||
}
|
||||
} else if (id == '1') {
|
||||
// 1:已支付 list1
|
||||
this.list1 = this.list1.concat(res.data.list)
|
||||
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.status.loadOrderStatus1 = 'nomore'
|
||||
uni.showToast({
|
||||
title: '就这么多啦',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.currentPage.currentPage1++
|
||||
this.status.loadOrderStatus1 = 'load'
|
||||
this.$emit('changeOrderLoadStatus', id, 'load', false)
|
||||
|
||||
|
||||
}
|
||||
} else if (id == '2') {
|
||||
//2:已取消 list2
|
||||
this.list2 = this.list2.concat(res.data.list)
|
||||
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.status.loadOrderStatus2 = 'nomore'
|
||||
uni.showToast({
|
||||
title: '就这么多啦',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.currentPage.currentPage2++
|
||||
this.status.loadOrderStatus2 = 'load'
|
||||
this.$emit('changeOrderLoadStatus', id, 'load', false)
|
||||
|
||||
}
|
||||
} else if (id == '3') {
|
||||
// 3:已退款 list3
|
||||
this.list3 = this.list3.concat(res.data.list)
|
||||
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.status.loadOrderStatus3 = 'nomore'
|
||||
uni.showToast({
|
||||
title: '就这么多啦',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.currentPage.currentPage3++
|
||||
this.status.loadOrderStatus3 = 'load'
|
||||
|
||||
}
|
||||
} else if (id == '全部') {
|
||||
// 全部 list
|
||||
this.list = this.list.concat(res.data.list)
|
||||
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.status.loadOrderStatus = 'nomore'
|
||||
uni.showToast({
|
||||
title: '就这么多啦',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.currentPage.currentPage++
|
||||
this.status.loadOrderStatus = 'load'
|
||||
clearTimeout(this.getSiteListTimer);
|
||||
this.getSiteListTimer = setTimeout(()=>{
|
||||
|
||||
let postData = {
|
||||
currentPage: page, //类型:Number 必有字段 备注:无
|
||||
pageSize: 10, //类型:Number 必有字段 备注:无
|
||||
index: (page - 1) * 10,
|
||||
params: { //类型:Object 必有字段 备注:无
|
||||
clientBelong:'ZHONGPIN',
|
||||
orderStatus: id == '全部' ? '' : (id +''), //类型:String 必有字段 备注:订单状态 0:待支付, 1:已支付 ,-1:支付失败 ,2:已取消,3:已退款
|
||||
search: this.search //类型:String 必有字段 备注:搜索 ( 油站名称/ 订单编号/ 油品)
|
||||
},
|
||||
}
|
||||
console.log('tip',id,tip)
|
||||
orderApi.getOrderInfoByPage(postData).then(res => {
|
||||
if (res.code == 20000) {
|
||||
// console.log('订单列表厂房发', page, res.data.list.length)
|
||||
// 0:待支付, 1:已支付 ,-1:支付失败 ,2:已取消,3:已退款
|
||||
if (id == '0') {
|
||||
// 0:待支付 list0
|
||||
this.list0 = this.list0.concat(res.data.list)
|
||||
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.status.loadOrderStatus0 = 'nomore'
|
||||
uni.showToast({
|
||||
title: '就这么多啦',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.currentPage.currentPage0++
|
||||
this.status.loadOrderStatus0 = 'load'
|
||||
}
|
||||
} else if (id == '1') {
|
||||
// 1:已支付 list1
|
||||
this.list1 = this.list1.concat(res.data.list)
|
||||
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.status.loadOrderStatus1 = 'nomore'
|
||||
uni.showToast({
|
||||
title: '就这么多啦',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.currentPage.currentPage1++
|
||||
this.status.loadOrderStatus1 = 'load'
|
||||
this.$emit('changeOrderLoadStatus', id, 'load', false)
|
||||
|
||||
|
||||
}
|
||||
} else if (id == '2') {
|
||||
//2:已取消 list2
|
||||
this.list2 = this.list2.concat(res.data.list)
|
||||
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.status.loadOrderStatus2 = 'nomore'
|
||||
uni.showToast({
|
||||
title: '就这么多啦',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.currentPage.currentPage2++
|
||||
this.status.loadOrderStatus2 = 'load'
|
||||
this.$emit('changeOrderLoadStatus', id, 'load', false)
|
||||
|
||||
}
|
||||
} else if (id == '3') {
|
||||
// 3:已退款 list3
|
||||
this.list3 = this.list3.concat(res.data.list)
|
||||
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.status.loadOrderStatus3 = 'nomore'
|
||||
uni.showToast({
|
||||
title: '就这么多啦',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.currentPage.currentPage3++
|
||||
this.status.loadOrderStatus3 = 'load'
|
||||
|
||||
}
|
||||
} else if (id == '全部') {
|
||||
// 全部 list
|
||||
this.list = this.list.concat(res.data.list)
|
||||
if (res.data.list.length < 10) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||||
this.status.loadOrderStatus = 'nomore'
|
||||
uni.showToast({
|
||||
title: '就这么多啦',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
this.currentPage.currentPage++
|
||||
this.status.loadOrderStatus = 'load'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},500)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user