diff --git a/components/NotificationPopup.vue b/components/NotificationPopup.vue index 0e4d4a6..1fe42aa 100644 --- a/components/NotificationPopup.vue +++ b/components/NotificationPopup.vue @@ -20,6 +20,11 @@ + + + 左右滑动切换通知 + + @@ -150,6 +155,22 @@ text-align: center; } + .popup-swipe-hint { + display: flex; + align-items: center; + justify-content: center; + gap: 8rpx; + margin-bottom: 16rpx; + color: var(--primary); + font-size: 24rpx; + font-weight: 500; + } + + .swipe-arrow { + font-size: 34rpx; + line-height: 1; + } + .popup-dots { display: flex; justify-content: center; @@ -166,7 +187,7 @@ .popup-dot.active { width: 28rpx; border-radius: 8rpx; background: var(--primary); } .popup-counter { - margin-top: 16rpx; + margin-top: 12rpx; color: var(--text-tertiary); font-size: 22rpx; } diff --git a/components/RenewalPaymentPopup.vue b/components/RenewalPaymentPopup.vue new file mode 100644 index 0000000..096f5f5 --- /dev/null +++ b/components/RenewalPaymentPopup.vue @@ -0,0 +1,374 @@ + + + + + diff --git a/openspec/changes/update-july-h5-c-iteration/specs/c-notification-reminders/spec.md b/openspec/changes/update-july-h5-c-iteration/specs/c-notification-reminders/spec.md index f6b9894..188418a 100644 --- a/openspec/changes/update-july-h5-c-iteration/specs/c-notification-reminders/spec.md +++ b/openspec/changes/update-july-h5-c-iteration/specs/c-notification-reminders/spec.md @@ -53,3 +53,14 @@ When the user views or activates a notification, the client SHALL call `PUT /api - **WHEN** marking a notification read fails - **THEN** the client SHALL retain the unread state or refresh it from the backend - **AND** the failure SHALL not prevent the user from viewing other asset or notification content + +### Requirement: Multi-notification popup SHALL communicate horizontal navigation + +When the homepage notification popup contains more than one notification, the client SHALL make the horizontal swipe interaction visible to the user and SHALL retain the current-position indicator. + +#### Scenario: User opens multiple unread notifications + +- **WHEN** the homepage popup contains two or more notifications +- **THEN** the popup SHALL display an explicit `左右滑动切换通知` hint +- **AND** the user SHALL be able to move between notifications by swiping horizontally +- **AND** the popup SHALL display the current notification position diff --git a/openspec/changes/update-july-h5-c-iteration/specs/legacy-package-renewal/spec.md b/openspec/changes/update-july-h5-c-iteration/specs/legacy-package-renewal/spec.md index 736dd88..d0f29b2 100644 --- a/openspec/changes/update-july-h5-c-iteration/specs/legacy-package-renewal/spec.md +++ b/openspec/changes/update-july-h5-c-iteration/specs/legacy-package-renewal/spec.md @@ -13,12 +13,12 @@ The H5/C client SHALL keep discontinued packages out of the ordinary package cat - **WHEN** asset info returns a discontinued package through `current_package_id` - **THEN** the client SHALL expose that ID only in the eligible renewal context -- **AND** the client SHALL allow the customer to continue through the existing package-order flow +- **AND** the client SHALL allow the customer to continue through the existing standard order/payment flow without navigating to the package catalog #### Scenario: Existing customer renews from a historical order - **WHEN** a historical order returns one or more valid `package_ids` -- **THEN** the client SHALL use those IDs for the renewal selection when the existing renewal flow provides that entry +- **THEN** the client SHALL use those IDs for the renewal selection when the order-list renewal entry is used - **AND** the client SHALL preserve the historical order data unchanged ### Requirement: Renewal SHALL reuse the standard order creation contract @@ -45,13 +45,13 @@ The client SHALL show an `立即续费` button in the homepage asset summary and - **WHEN** the homepage asset summary is displayed - **THEN** the client SHALL show an `立即续费` button -- **AND** tapping it SHALL start the standard renewal flow for the asset's current package ID when one is available +- **AND** tapping it SHALL directly start the standard order/payment flow for the asset's current package ID when one is available #### Scenario: Customer renews from an order card - **WHEN** an order is displayed in the order list - **THEN** the client SHALL show an `立即续费` button for that order -- **AND** tapping it SHALL use the order's package IDs for the standard renewal flow +- **AND** tapping it SHALL directly start the standard order/payment flow for that order's package IDs without navigating to the package-order page #### Scenario: Customer views another page diff --git a/openspec/changes/update-july-h5-c-iteration/tasks.md b/openspec/changes/update-july-h5-c-iteration/tasks.md index 17805aa..2d73278 100644 --- a/openspec/changes/update-july-h5-c-iteration/tasks.md +++ b/openspec/changes/update-july-h5-c-iteration/tasks.md @@ -19,7 +19,7 @@ - [x] 3.2 Keep discontinued packages out of the ordinary package catalog for new customers and agents - [x] 3.3 Add the eligible existing-customer renewal path using `current_package_id` or historical `package_ids` - [x] 3.4 Reuse `POST /api/c/v1/orders/create` for renewal and preserve selected identifier, package IDs, payment method, and existing payment result handling -- [x] 3.5 Show `立即续费` only on the homepage asset summary and every order-list card +- [x] 3.5 Show `立即续费` only on the homepage asset summary and every order-list card, with direct order/payment handling ## 4. Wallet recharge and payment completion diff --git a/pages/index/index.vue b/pages/index/index.vue index 7633528..9735e40 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -99,6 +99,9 @@ + + { @@ -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(); diff --git a/pages/order-list/order-list.vue b/pages/order-list/order-list.vue index 5dc8db7..46a2164 100644 --- a/pages/order-list/order-list.vue +++ b/pages/order-list/order-list.vue @@ -68,7 +68,7 @@ {{ isOrderPaying(item) ? '处理中...' : '立即支付' }} + @tap.stop="startOrderRenewal(item)">立即续费 @@ -80,6 +80,9 @@ + + @@ -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) => { diff --git a/utils/payment.js b/utils/payment.js index b4180bb..5651f56 100644 --- a/utils/payment.js +++ b/utils/payment.js @@ -2,6 +2,7 @@ const ALIPAY_PENDING_REFRESH_KEY = 'pending_alipay_payment_refresh'; const ALIPAY_PAYMENT_DATA_KEY = 'pending_alipay_payment_data'; export const PAYMENT_REFRESH_TARGETS = { + HOME: 'home', PACKAGE_ORDER: 'package-order', ORDER_LIST: 'order-list', MY_WALLET: 'my-wallet'