From e2fee1d9c5d37404783d0195fd33edd0847516e5 Mon Sep 17 00:00:00 2001 From: zlwu <704541015@qq.com> Date: Sat, 17 Oct 2026 10:55:59 +0800 Subject: [PATCH] feat(mobile-oa-h5): open protocol from payment as readonly detail Co-authored-by: Cursor --- .../src/market/mobile-parity-ui.test.js | 13 ++++++++++++ .../src/views/market/MarketModuleDetail.vue | 20 ++++++++++++++----- .../src/views/market/MarketModuleList.vue | 6 +++++- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/mobile-oa-h5/src/market/mobile-parity-ui.test.js b/mobile-oa-h5/src/market/mobile-parity-ui.test.js index ff2d4ddb..996f25ff 100644 --- a/mobile-oa-h5/src/market/mobile-parity-ui.test.js +++ b/mobile-oa-h5/src/market/mobile-parity-ui.test.js @@ -779,3 +779,16 @@ test('presign delete action calls the delete API exactly once', () => { assert.ok(deleteBranch) assert.equal((deleteBranch[1].match(/deletePresignOrder\(/g) || []).length, 1) }) + +test('payment list openProtocol passes from=payment', () => { + const list = source('../views/market/MarketModuleList.vue') + + assert.match(list, /from:\s*['"]payment['"]|from:\s*'payment'/) + assert.match(list, /openProtocol/) +}) + +test('protocol detail filters actions when from=payment', () => { + const detail = source('../views/market/MarketModuleDetail.vue') + + assert.match(detail, /isPaymentEntryView|filterProtocolActionsForPaymentEntry/) +}) diff --git a/mobile-oa-h5/src/views/market/MarketModuleDetail.vue b/mobile-oa-h5/src/views/market/MarketModuleDetail.vue index 5e18e962..9162fabf 100644 --- a/mobile-oa-h5/src/views/market/MarketModuleDetail.vue +++ b/mobile-oa-h5/src/views/market/MarketModuleDetail.vue @@ -55,6 +55,10 @@ import { withdrawPresignTransfer } from '../../api/market.js' import { collectAllowedActions } from '../../market/action-policy.js' +import { + isPaymentEntryView, + filterProtocolActionsForPaymentEntry +} from '../../market/payment-entry.js' import { marketErrorMessage } from '../../market/market-error.js' import { getMarketModule } from '../../market/module-registry.js' import { resolveStatusTone } from '../../market/status-tone.js' @@ -105,11 +109,17 @@ const statusTone = computed(() => resolveStatusTone( )) const actionPending = ref(false) const pendingAction = ref('') -const allowedActions = computed(() => collectAllowedActions( - context.value.module, - context.value.marketRole, - detail.value -)) +const allowedActions = computed(() => { + const raw = collectAllowedActions( + context.value.module, + context.value.marketRole, + detail.value + ) + if (context.value.module === 'protocol' && isPaymentEntryView(route.query)) { + return filterProtocolActionsForPaymentEntry(raw) + } + return raw +}) const sections = computed(() => { if (moduleContract.value.detailSections) return moduleContract.value.detailSections(detail.value) if (Array.isArray(detail.value?.sections)) return detail.value.sections diff --git a/mobile-oa-h5/src/views/market/MarketModuleList.vue b/mobile-oa-h5/src/views/market/MarketModuleList.vue index 597e90a2..0f197cf8 100644 --- a/mobile-oa-h5/src/views/market/MarketModuleList.vue +++ b/mobile-oa-h5/src/views/market/MarketModuleList.vue @@ -423,7 +423,11 @@ function openProtocol(item) { router.push({ name: `market-${context.value.marketRole}-protocol-detail`, params: { id }, - query: { ...pickMarketNavigationQuery(route.query), source: item.source || 'cell_storage' } + query: { + ...pickMarketNavigationQuery(route.query), + source: item.source || 'cell_storage', + ...(context.value.module === 'payment' ? { from: 'payment' } : {}) + } }) }