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

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

View File

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

View File

@@ -40,6 +40,8 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 分页 -->
<u-loadmore v-if="pagesShow" :status="status" />
</block> </block>
<block v-else> <block v-else>
<view class="null"> <view class="null">
@@ -59,7 +61,13 @@
data() { data() {
return { return {
orders : [], orders : [],
page : '' // 分页
page : {
current : 1,
has_more: false,
},
pagesShow : false,
status : ''
} }
}, },
created() { created() {
@@ -87,10 +95,15 @@
}, },
// 获取订单列表 // 获取订单列表
getList(){ getList(){
ordersDiffs().then(res => { ordersDiffs({
page : this.page.current
}).then(res => {
let { data, page } = res; let { data, page } = res;
this.orders = data let atList = page.current == 1 ? [] : this.orders
this.orders = atList.concat(data)
this.page = page this.page = page
this.pagesShow = false
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
@@ -101,12 +114,22 @@
// 变更当前列表状态 // 变更当前列表状态
removeListVal(id){ removeListVal(id){
let ListArr = this.orders 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){ if(ListIndex >= 0){
this.orders.splice(ListIndex, 1) this.orders.splice(ListIndex, 1)
} }
this.$store.commit('setOrderId', null) 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> </script>

View File

@@ -38,6 +38,8 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 分页 -->
<u-loadmore v-if="pagesShow" :status="status" />
</view> </view>
<!-- 订单是空的 --> <!-- 订单是空的 -->
<view class="order-null" v-else> <view class="order-null" v-else>
@@ -56,7 +58,14 @@
export default { export default {
data() { data() {
return { return {
orders: [] orders : [],
// 分页
page : {
current : 1,
has_more: false,
},
pagesShow : false,
status : ''
}; };
}, },
created() { created() {
@@ -66,10 +75,15 @@
// 获取列表 // 获取列表
getList(){ getList(){
refunds({ refunds({
status: '' status: '',
page : this.page.current
}).then(res => { }).then(res => {
let { data } = 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 => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, 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> </script>