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

刷新

parent cd106b58
......@@ -14,7 +14,7 @@
transform: 'scale(1)'
}" itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;">
</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>
<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">
......@@ -158,7 +158,7 @@
export default {
data() {
return {
list:[],
list: [],
option: {
size: 10,
auto: true
......@@ -191,6 +191,17 @@ export default {
})
},
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) {
//console.log(paging)
......@@ -198,19 +209,21 @@ export default {
let list = [];
let order = {}
//订单状态: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;
}else if(this.current == 2){
} else if (this.current == 2) {
order.orderStatus = 20;
}else if(this.current == 3){
} else if (this.current == 3) {
order.orderStatus = 50;
}else if(this.current == 4){
} else if (this.current == 4) {
order.orderStatus = 30;
}else{
}
let opts = { url: '/app/user/order/list?pageSize='+paging.size+'&pageNum='+paging.page, method: 'get' };
} else {}
let opts = {
url: '/app/user/order/list?pageSize=' + paging.size + '&pageNum=' + paging.page,
method: 'get'
};
this.http.httpTokenRequest(opts, order).then(res => {
if (res.data.code == 200) {
list = res.data.data.rows
......@@ -231,31 +244,34 @@ export default {
url: '/pagesD/pages/personal/pull?orderId=' + orderId
});
},
goCarTime(id){
goCarTime(id) {
console.log("123")
console.log(id)
uni.navigateTo({
url: '/pagesD/pages/personal/carTime?orderId=' + id
})
},
showDel(id){
showDel(id) {
//
this.showDelModal = true
this.deleteId = id
},
cancelModal(){
cancelModal() {
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 => {
if (res.data.code == 200) {
uni.showToast({
title: '删除成功',
icon: "success"
});
}else{
} else {
uni.showToast({
title: '删除失败',
icon: "error"
......@@ -274,26 +290,28 @@ export default {
this.current = v.index
this.getOrderList()
},
getOrderList(){
getOrderList() {
let order = {}
//订单状态: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;
}else if(this.current == 2){
} else if (this.current == 2) {
order.orderStatus = 20;
}else if(this.current == 3){
} else if (this.current == 3) {
order.orderStatus = 50;
}else if(this.current == 4){
} else if (this.current == 4) {
order.orderStatus = 30;
}else{
}
let opts = { url: '/app/user/order/list', method: 'get' };
} else {}
let opts = {
url: '/app/user/order/list',
method: 'get'
};
this.http.httpTokenRequest(opts, order).then(res => {
if (res.data.code == 200) {
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 {
//this.load()
},
onLoad(e) {
if(e.current) {
if (e.current) {
this.current = parseInt(e.current)
}
......@@ -315,9 +333,11 @@ export default {
uni-view {
background: #fff;
}
.order__content {
padding:0 40rpx;
padding: 0 40rpx;
z-index: 999999;
.order__items {
background: #FFFFFF;
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