修复订单状态刷新错误,修复订单数据展示错误
This commit is contained in:
@@ -38,6 +38,8 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 分页 -->
|
||||
<u-loadmore v-if="pagesShow" :status="status" />
|
||||
</view>
|
||||
<!-- 订单是空的 -->
|
||||
<view class="order-null" v-else>
|
||||
@@ -56,7 +58,14 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orders: []
|
||||
orders : [],
|
||||
// 分页
|
||||
page : {
|
||||
current : 1,
|
||||
has_more: false,
|
||||
},
|
||||
pagesShow : false,
|
||||
status : ''
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@@ -66,10 +75,15 @@
|
||||
// 获取列表
|
||||
getList(){
|
||||
refunds({
|
||||
status: ''
|
||||
status: '',
|
||||
page : this.page.current
|
||||
}).then(res => {
|
||||
let { data } = res;
|
||||
this.orders = data
|
||||
let { data, page } = res;
|
||||
let atList = page.current == 1 ? [] : this.orders
|
||||
|
||||
this.orders = atList.concat(data)
|
||||
this.page = page
|
||||
this.pagesShow = false
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
@@ -77,6 +91,16 @@
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.pagesShow = true;
|
||||
if(this.page.has_more){
|
||||
this.status = 'loading';
|
||||
this.page.current++
|
||||
this.getList()
|
||||
return
|
||||
}
|
||||
this.status = 'nomore';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user