【功能优化】支付:查询支付订单时,增加 sync 主动轮询,解决支付宝、微信存在延迟的问题

pull/105/MERGE
YunaiV 2024-09-24 13:00:46 +08:00
parent a1995c88e8
commit ca1926a732
6 changed files with 26 additions and 18 deletions

View File

@ -121,7 +121,7 @@
} }
state.id = options.id; state.id = options.id;
const { code, data } = await OrderApi.getOrder(state.id); const { code, data } = await OrderApi.getOrderDetail(state.id);
if (code !== 0) { if (code !== 0) {
sheep.$helper.toast('无待评价订单'); sheep.$helper.toast('无待评价订单');
return; return;

View File

@ -208,7 +208,7 @@
state.itemId = parseInt(options.itemId); state.itemId = parseInt(options.itemId);
// //
const { code, data } = await OrderApi.getOrder(state.orderId); const { code, data } = await OrderApi.getOrderDetail(state.orderId);
if (code !== 0) { if (code !== 0) {
return; return;
} }

View File

@ -127,7 +127,11 @@
</view> </view>
<!-- 自提核销 --> <!-- 自提核销 -->
<PickUpVerify :order-info="state.orderInfo" :systemStore="systemStore" ref="pickUpVerifyRef"></PickUpVerify> <PickUpVerify
:order-info="state.orderInfo"
:systemStore="systemStore"
ref="pickUpVerifyRef"
></PickUpVerify>
<!-- 订单信息 --> <!-- 订单信息 -->
<view class="notice-box"> <view class="notice-box">
@ -305,7 +309,7 @@
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '确定要取消订单吗?', content: '确定要取消订单吗?',
success: async function(res) { success: async function (res) {
if (!res.confirm) { if (!res.confirm) {
return; return;
} }
@ -394,11 +398,11 @@
let res; let res;
if (state.comeinType === 'wechat') { if (state.comeinType === 'wechat') {
// TODO // TODO
res = await OrderApi.getOrder(id, { res = await OrderApi.getOrderDetail(id, {
merchant_trade_no: state.merchantTradeNo, merchant_trade_no: state.merchantTradeNo,
}); });
} else { } else {
res = await OrderApi.getOrder(id); res = await OrderApi.getOrderDetail(id);
} }
if (res.code === 0) { if (res.code === 0) {
state.orderInfo = res.data; state.orderInfo = res.data;

View File

@ -13,10 +13,10 @@
</uni-swiper-dot> </uni-swiper-dot>
<view class="log-card-msg"> <view class="log-card-msg">
<!-- TODO 芋艿物流优化点展示状态 --> <!-- TODO 芋艿物流优化点展示状态 -->
<!-- <view class="ss-flex ss-m-b-8">--> <!-- <view class="ss-flex ss-m-b-8">-->
<!-- <view>物流状态</view>--> <!-- <view>物流状态</view>-->
<!-- <view class="warning-color">{{ state.info.status_text }}</view>--> <!-- <view class="warning-color">{{ state.info.status_text }}</view>-->
<!-- </view>--> <!-- </view>-->
<view class="ss-m-b-8">快递单号{{ state.info.logisticsNo }}</view> <view class="ss-m-b-8">快递单号{{ state.info.logisticsNo }}</view>
<view>快递公司{{ state.info.logisticsName }}</view> <view>快递公司{{ state.info.logisticsName }}</view>
</view> </view>
@ -35,9 +35,9 @@
</view> </view>
<view class="log-content-msg"> <view class="log-content-msg">
<!-- TODO 芋艿物流优化点展示状态 --> <!-- TODO 芋艿物流优化点展示状态 -->
<!-- <view class="log-msg-title ss-m-b-20">--> <!-- <view class="log-msg-title ss-m-b-20">-->
<!-- {{ item.status_text }}--> <!-- {{ item.status_text }}-->
<!-- </view>--> <!-- </view>-->
<view class="log-msg-desc ss-m-b-16">{{ item.content }}</view> <view class="log-msg-desc ss-m-b-16">{{ item.content }}</view>
<view class="log-msg-date ss-m-b-40"> <view class="log-msg-date ss-m-b-40">
{{ sheep.$helper.timeFormat(item.time, 'yyyy-mm-dd hh:MM:ss') }} {{ sheep.$helper.timeFormat(item.time, 'yyyy-mm-dd hh:MM:ss') }}
@ -78,7 +78,7 @@
} }
async function getOrderDetail(id) { async function getOrderDetail(id) {
const { data } = await OrderApi.getOrder(id) const { data } = await OrderApi.getOrderDetail(id);
state.info = data; state.info = data;
} }

View File

@ -126,7 +126,10 @@
// #endif // #endif
// //
if (state.orderType === 'goods') { if (state.orderType === 'goods') {
const { data, code } = await OrderApi.getOrder(state.orderInfo.merchantOrderId); const { data, code } = await OrderApi.getOrderDetail(
state.orderInfo.merchantOrderId,
true,
);
if (code === 0) { if (code === 0) {
state.tradeOrder = data; state.tradeOrder = data;
} }

View File

@ -73,13 +73,14 @@ const OrderApi = {
data, data,
}); });
}, },
// 获得订单 // 获得订单详细sync 是可选参数
getOrder: (id) => { getOrderDetail: (id, sync) => {
return request({ return request({
url: `/trade/order/get-detail`, url: `/trade/order/get-detail`,
method: 'GET', method: 'GET',
params: { params: {
id, id,
sync,
}, },
custom: { custom: {
showLoading: false, showLoading: false,