fix: 立即续费不跳转
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 59s

This commit is contained in:
luo
2026-07-28 16:02:40 +08:00
parent 64bccffe28
commit 34ca1c5eca
8 changed files with 431 additions and 12 deletions

View File

@@ -99,6 +99,9 @@
<NotificationPopup :show="notificationPopupShow" :items="notificationItems"
:current="notificationPopupCurrent" @change="onNotificationChange" @close="closeNotificationPopup" />
<RenewalPaymentPopup ref="renewalPopupRef" :identifier="userStore.state.identifier"
paymentRefreshTarget="home" @completed="loadAssetInfo" />
<!-- 日期选择器弹窗 -->
<up-datetime-picker v-if="!userInfo.isDevice" :show="showStartDatePicker" v-model="startDateTimestamp"
mode="date" @confirm="onStartDateConfirm" @cancel="showStartDatePicker=false"
@@ -128,6 +131,7 @@
import FunctionCard from '@/components/FunctionCard.vue';
import FloatingButton from '@/components/FloatingButton.vue';
import NotificationPopup from '@/components/NotificationPopup.vue';
import RenewalPaymentPopup from '@/components/RenewalPaymentPopup.vue';
import {
assetApi,
deviceApi,
@@ -136,6 +140,7 @@
import {
useUserStore
} from '@/store/index.js';
import { consumePendingPaymentRefresh, PAYMENT_REFRESH_TARGETS } from '@/utils/payment.js';
const userStore = useUserStore();
@@ -225,6 +230,7 @@
let notificationPopupShow = ref(false);
let notificationItems = ref([]);
let notificationPopupCurrent = ref(0);
let renewalPopupRef = ref(null);
const notificationReadPending = new Set();
const formatDate = (dateStr) => {
@@ -360,8 +366,7 @@
}
const packageName = deviceInfo.packageName === '-' ? '' : deviceInfo.packageName;
const query = `renewal_package_ids=${encodeURIComponent(String(packageId))}&renewal_package_names=${encodeURIComponent(packageName)}`;
uni.navigateTo({ url: `/pages/package-order/package-order?${query}` });
renewalPopupRef.value?.open([packageId], [packageName]);
};
const modifyWifi = () => {
@@ -861,6 +866,9 @@
});
onShow(() => {
if (consumePendingPaymentRefresh(PAYMENT_REFRESH_TARGETS.HOME)) {
loadAssetInfo();
}
handleIndexEntry();
loadNotificationUnreadCount();
loadUnreadNotifications();

View File

@@ -68,7 +68,7 @@
{{ isOrderPaying(item) ? '处理中...' : '立即支付' }}
</button>
<button class="btn-pay btn-renew" :disabled="orderPayingId !== null"
@tap.stop="startHistoricalRenewal(item)">立即续费</button>
@tap.stop="startOrderRenewal(item)">立即续费</button>
</view>
</view>
</view>
@@ -80,6 +80,9 @@
</view>
</view>
</scroll-view>
<RenewalPaymentPopup ref="renewalPopupRef" :identifier="userStore.state.identifier"
paymentRefreshTarget="order-list" @completed="resetOrderListAndLoad" />
</view>
</template>
@@ -87,6 +90,7 @@
import { ref, reactive, onMounted, computed } from 'vue';
import { onShow } from '@dcloudio/uni-app';
import { assetApi, orderApi } from '@/api/index.js';
import RenewalPaymentPopup from '@/components/RenewalPaymentPopup.vue';
import { useUserStore } from '@/store/index.js';
import {
consumePendingPaymentRefresh,
@@ -108,6 +112,7 @@
const noMore = ref(false);
const page = ref(1);
const orderPayingId = ref(null);
const renewalPopupRef = ref(null);
const pageSize = 10;
const filterIndex = ref(0);
const allowedPaymentMethods = ref([]);
@@ -234,15 +239,14 @@
uni.navigateTo({ url: `/pages/order-detail/order-detail?id=${order.order_id}` });
};
const startHistoricalRenewal = (order) => {
const startOrderRenewal = (order) => {
const packageIds = Array.isArray(order?.package_ids) ? order.package_ids.filter(Boolean) : [];
if (!packageIds.length) {
uni.showToast({ title: '当前订单暂无可续费套餐', icon: 'none' });
return;
}
const packageNames = Array.isArray(order.package_names) ? order.package_names : [];
const query = `renewal_package_ids=${encodeURIComponent(packageIds.join(','))}&renewal_package_names=${encodeURIComponent(packageNames.join('|'))}`;
uni.navigateTo({ url: `/pages/package-order/package-order?${query}` });
renewalPopupRef.value?.open(packageIds, packageNames);
};
const showOrderPaymentMethods = async (order) => {