Commit df61f3fb authored by 程新智's avatar 程新智 👽

刷新

parent cd106b58
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
transform: 'scale(1)' transform: 'scale(1)'
}" itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;"> }" itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;">
</u-tabs> </u-tabs>
<scroll-list ref="list" :option="option" @load="load"> <scroll-list ref="list" :option="option" @load="load" @refresh="refresh">
<u-gap bgColor="transparent" height="15"></u-gap> <u-gap bgColor="transparent" height="15"></u-gap>
<div class="order__content" v-for="(item,index) in orderList" :key="index"> <div class="order__content" v-for="(item,index) in orderList" :key="index">
<div class="order__items" @click="orderDetail(item.id)" v-if="(current===0||current===1) && item.orderStatus == 10"> <div class="order__items" @click="orderDetail(item.id)" v-if="(current===0||current===1) && item.orderStatus == 10">
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
export default { export default {
data() { data() {
return { return {
list:[], list: [],
option: { option: {
size: 10, size: 10,
auto: true auto: true
...@@ -191,6 +191,17 @@ export default { ...@@ -191,6 +191,17 @@ export default {
}) })
}, },
methods: { methods: {
// 刷新刷剧
async refresh(paging) {
// 刷新成功 参数对象{list: 当前列表,total: 数据总长度(后端查询的total)}
await this.getOrderList()
this.$refs.list.refreshSuccess({
list:this.list,
total:this.orderList.length
});
// 刷新失败
// this.$refs.list.refreshFail()
},
// 加载数据 // 加载数据
load(paging) { load(paging) {
//console.log(paging) //console.log(paging)
...@@ -198,19 +209,21 @@ export default { ...@@ -198,19 +209,21 @@ export default {
let list = []; let list = [];
let order = {} let order = {}
//订单状态:0-未支付,10-待发货,20-待收货,30-退款/售后,50-已完成 //订单状态:0-未支付,10-待发货,20-待收货,30-退款/售后,50-已完成
if(this.current == 0){ if (this.current == 0) {
}else if(this.current == 1){ } else if (this.current == 1) {
order.orderStatus = 10; order.orderStatus = 10;
}else if(this.current == 2){ } else if (this.current == 2) {
order.orderStatus = 20; order.orderStatus = 20;
}else if(this.current == 3){ } else if (this.current == 3) {
order.orderStatus = 50; order.orderStatus = 50;
}else if(this.current == 4){ } else if (this.current == 4) {
order.orderStatus = 30; order.orderStatus = 30;
}else{ } else {}
} let opts = {
let opts = { url: '/app/user/order/list?pageSize='+paging.size+'&pageNum='+paging.page, method: 'get' }; url: '/app/user/order/list?pageSize=' + paging.size + '&pageNum=' + paging.page,
method: 'get'
};
this.http.httpTokenRequest(opts, order).then(res => { this.http.httpTokenRequest(opts, order).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
list = res.data.data.rows list = res.data.data.rows
...@@ -231,31 +244,34 @@ export default { ...@@ -231,31 +244,34 @@ export default {
url: '/pagesD/pages/personal/pull?orderId=' + orderId url: '/pagesD/pages/personal/pull?orderId=' + orderId
}); });
}, },
goCarTime(id){ goCarTime(id) {
console.log("123") console.log("123")
console.log(id) console.log(id)
uni.navigateTo({ uni.navigateTo({
url: '/pagesD/pages/personal/carTime?orderId=' + id url: '/pagesD/pages/personal/carTime?orderId=' + id
}) })
}, },
showDel(id){ showDel(id) {
// //
this.showDelModal = true this.showDelModal = true
this.deleteId = id this.deleteId = id
}, },
cancelModal(){ cancelModal() {
this.showDelModal = false this.showDelModal = false
}, },
confirmDel(){ confirmDel() {
let opts = { url: '/app/user/order/remove/' + this.deleteId, method: 'get' }; let opts = {
url: '/app/user/order/remove/' + this.deleteId,
method: 'get'
};
this.http.httpTokenRequest(opts, {}).then(res => { this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
uni.showToast({ uni.showToast({
title: '删除成功', title: '删除成功',
icon: "success" icon: "success"
}); });
}else{ } else {
uni.showToast({ uni.showToast({
title: '删除失败', title: '删除失败',
icon: "error" icon: "error"
...@@ -274,26 +290,28 @@ export default { ...@@ -274,26 +290,28 @@ export default {
this.current = v.index this.current = v.index
this.getOrderList() this.getOrderList()
}, },
getOrderList(){ getOrderList() {
let order = {} let order = {}
//订单状态:0-未支付,10-待发货,20-待收货,30-退款/售后,50-已完成 //订单状态:0-未支付,10-待发货,20-待收货,30-退款/售后,50-已完成
if(this.current == 0){ if (this.current == 0) {
}else if(this.current == 1){ } else if (this.current == 1) {
order.orderStatus = 10; order.orderStatus = 10;
}else if(this.current == 2){ } else if (this.current == 2) {
order.orderStatus = 20; order.orderStatus = 20;
}else if(this.current == 3){ } else if (this.current == 3) {
order.orderStatus = 50; order.orderStatus = 50;
}else if(this.current == 4){ } else if (this.current == 4) {
order.orderStatus = 30; order.orderStatus = 30;
}else{ } else {}
} let opts = {
let opts = { url: '/app/user/order/list', method: 'get' }; url: '/app/user/order/list',
method: 'get'
};
this.http.httpTokenRequest(opts, order).then(res => { this.http.httpTokenRequest(opts, order).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.orderList = res.data.data.rows this.orderList = res.data.data.rows
this.orderList.length>0?this.$refs.list.toggle():this.$refs.list.show() this.orderList.length > 0 ? this.$refs.list.toggle() : this.$refs.list.show()
} }
}) })
}, },
...@@ -302,7 +320,7 @@ export default { ...@@ -302,7 +320,7 @@ export default {
//this.load() //this.load()
}, },
onLoad(e) { onLoad(e) {
if(e.current) { if (e.current) {
this.current = parseInt(e.current) this.current = parseInt(e.current)
} }
...@@ -315,9 +333,11 @@ export default { ...@@ -315,9 +333,11 @@ export default {
uni-view { uni-view {
background: #fff; background: #fff;
} }
.order__content { .order__content {
padding:0 40rpx; padding: 0 40rpx;
z-index: 999999; z-index: 999999;
.order__items { .order__items {
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0rpx 0rpx 28rpx 1rpx rgba(232, 232, 232, 0.2); box-shadow: 0rpx 0rpx 28rpx 1rpx rgba(232, 232, 232, 0.2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment