修复订单状态刷新错误,修复订单数据展示错误

This commit is contained in:
唐明明
2023-05-09 17:02:18 +08:00
parent 88055e6052
commit 95452cea60
4 changed files with 63 additions and 14 deletions

View File

@@ -191,6 +191,9 @@
return
}
umsState(this.trade_id).then(res => {
console.log(res)
resNumb++
if(res.state === 'success'){
clearInterval(outTime)
@@ -322,7 +325,7 @@
title: '加载中...',
mask : true
})
diffDgPay(this.orderId, {
diffDgPay(this.diffId, {
type,
use_fire : this.isDeduction ? 1 : 0,
fire : this.deductionVal || 0,
@@ -543,6 +546,8 @@
},
// 更新订单列表
onRrmoveItem(){
console.log(this.orderId)
this.$store.commit('setOrderId', this.orderId)
this.$Router.back()
}

View File

@@ -172,9 +172,6 @@
status: this.tabs[this.tabsCurrent].val,
type : this.type
}).then(res => {
console.log(res)
let { data } = res;
this.orders = data
}).catch(err => {

View File

@@ -40,6 +40,8 @@
</view>
</view>
</view>
<!-- 分页 -->
<u-loadmore v-if="pagesShow" :status="status" />
</block>
<block v-else>
<view class="null">
@@ -58,8 +60,14 @@
export default {
data() {
return {
orders: [],
page : ''
orders : [],
// 分页
page : {
current : 1,
has_more: false,
},
pagesShow : false,
status : ''
}
},
created() {
@@ -87,10 +95,15 @@
},
// 获取订单列表
getList(){
ordersDiffs().then(res => {
ordersDiffs({
page : this.page.current
}).then(res => {
let { data, page } = res;
this.orders = data
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,
@@ -101,12 +114,22 @@
// 变更当前列表状态
removeListVal(id){
let ListArr = this.orders
let ListIndex = ListArr.findIndex(val => val.business_order_id == id)
let ListIndex = ListArr.findIndex(val => val.order_id == id)
if(ListIndex >= 0){
this.orders.splice(ListIndex, 1)
}
this.$store.commit('setOrderId', null)
},
},
onReachBottom() {
this.pagesShow = true;
if(this.page.has_more){
this.status = 'loading';
this.page.current++
this.getList()
return
}
this.status = 'nomore';
}
}
</script>

View File

@@ -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>