This commit is contained in:
@@ -62,7 +62,9 @@
|
||||
</view> -->
|
||||
|
||||
<view v-if="item.payment_status === 1" class="card-footer">
|
||||
<button class="btn-pay" @tap="handleOrderPayment(item)">立即支付</button>
|
||||
<button class="btn-pay" :disabled="orderPayingId !== null" @tap="handleOrderPayment(item)">
|
||||
{{ isOrderPaying(item) ? '处理中...' : '立即支付' }}
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -97,6 +99,7 @@
|
||||
let loading = ref(false);
|
||||
let noMore = ref(false);
|
||||
let page = ref(1);
|
||||
let orderPayingId = ref(null);
|
||||
const pageSize = 10;
|
||||
let filterIndex = ref(0);
|
||||
let filterOptions = [{
|
||||
@@ -188,7 +191,12 @@
|
||||
}
|
||||
};
|
||||
|
||||
const isOrderPaying = (order) => orderPayingId.value === order.order_id;
|
||||
|
||||
const handleOrderPayment = async (order) => {
|
||||
if (orderPayingId.value !== null || !order?.order_id) return;
|
||||
orderPayingId.value = order.order_id;
|
||||
|
||||
uni.showLoading({
|
||||
title: '处理中...',
|
||||
mask: true
|
||||
@@ -230,6 +238,8 @@
|
||||
title: errorMsg,
|
||||
icon: 'none'
|
||||
});
|
||||
} finally {
|
||||
orderPayingId.value = null;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -445,6 +455,10 @@
|
||||
font-weight: 500;
|
||||
width:100%;
|
||||
|
||||
&[disabled] {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
&::after {
|
||||
border: none;
|
||||
}
|
||||
@@ -486,4 +500,4 @@
|
||||
color: #999;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user