feat: 添加postMessage传递数据,宁波银行系统内部新开tab标签支持

This commit is contained in:
傅光孟 2026-04-08 16:30:57 +08:00
parent 68c27a904f
commit b3a9ff3671
3 changed files with 50 additions and 26 deletions

View File

@ -3,12 +3,12 @@
<!-- <PageTop></PageTop> --> <!-- <PageTop></PageTop> -->
<div class="content"> <div class="content">
<div class="top" @click="goBack"> <!-- <div class="top" @click="goBack">
<el-icon><ArrowLeft /></el-icon> <el-icon><ArrowLeft /></el-icon>
<text>返回列表</text> <text>返回列表</text>
</div> </div>
<div class="line"></div> <div class="line"></div> -->
<div class="title"> <div class="title">
{{ infoData?.title }} {{ infoData?.title }}
@ -201,7 +201,7 @@ onMounted(async () => {
font-weight: bold; font-weight: bold;
font-size: 24px; font-size: 24px;
color: #1a1a1a; color: #1a1a1a;
margin-top: 25px; margin-top: 12px;
} }
.sub_title { .sub_title {

View File

@ -54,7 +54,7 @@
</div> </div>
</template> </template>
<script setup> <script setup lang="ts">
import { ref, onMounted, onUnmounted, reactive } from 'vue'; import { ref, onMounted, onUnmounted, reactive } from 'vue';
// import PageTop from "@/pages/realtimeInfo/pc/components/PageTop.vue"; // import PageTop from "@/pages/realtimeInfo/pc/components/PageTop.vue";
import dayjs from 'dayjs/esm/index'; import dayjs from 'dayjs/esm/index';
@ -97,6 +97,7 @@ async function getNewsList() {
newsList.value = data.list; newsList.value = data.list;
form.total = data.total; form.total = data.total;
data.list.forEach((item) => { data.list.forEach((item) => {
item._title_ = item.title;
item.summary = item.summary.replace(form.keyword, "<span style='color: #007aff'>" + form.keyword + '</span>'); item.summary = item.summary.replace(form.keyword, "<span style='color: #007aff'>" + form.keyword + '</span>');
item.title = item.title.replace(form.keyword, "<span style='color: #007aff'>" + form.keyword + '</span>'); item.title = item.title.replace(form.keyword, "<span style='color: #007aff'>" + form.keyword + '</span>');
}); });
@ -111,16 +112,27 @@ function goDetail(item) {
id = item.id; id = item.id;
} }
router.push({ // router.push({
path: '/indexPC', // path: '/indexPC',
query: { // query: {
id: id, // id: id,
type: pageType.value, // type: pageType.value,
}, // },
});
// uni.navigateTo({
// url: '/pages/realtimeInfo/pc/indexPC?id=' + id + '&type=' + pageType.value,
// }); // });
// tabpostMessage
// menuKeyOverseaNews, SmartReview FinancialNews
let message: any = {
type: 'navigation',
menuKey: 'OverseaNews',
name: item._title_,
path: `${window.location.origin}/#/indexPC?id=${id}&type=${pageType.value}&token=${window?.token}&phone=${window?.phone}`,
};
console.log('output >>>>> message',message);
message = JSON.stringify(message);
window.parent.postMessage(message, '*');
} }
function currentChange(page) { function currentChange(page) {

View File

@ -235,16 +235,31 @@ function showUploadDialog() {
} }
function goDetail(item) { function goDetail(item) {
router.push({ // router.push({
path: '/detail', // path: '/detail',
query: { // query: {
id: item.id, // id: item.id,
fromPath: route.path, // fromPath: route.path,
type: 1, // type 0 1 // type: 1, // type 0 1
reportType: item.reportType, // reportType: item.reportType,
fileName: item.fileName, // fileName: item.fileName,
}, // },
}); // });
// tabpostMessage
// menuKeyOverseaNews, SmartReview FinancialNews
let message: any = {
type: 'navigation',
menuKey: 'SmartReview',
name: '智能复核详情',
path: `${window.location.origin}/#/detail?id=${item.id}&fromPath=${route.path}&type=1&reportType=${item.reportType}&fileName=${encodeURIComponent(
item.fileName
)}&token=${window?.token}&phone=${window?.phone}`,
};
console.log('output >>>>> message',message);
message = JSON.stringify(message);
window.parent.postMessage(message, '*');
} }
// //
@ -570,8 +585,6 @@ onUnmounted(() => {
margin-left: 20px; margin-left: 20px;
} }
.el_form_item { .el_form_item {
width: 250px; width: 250px;
height: 70px; height: 70px;
@ -663,5 +676,4 @@ onUnmounted(() => {
:deep(.el-button) { :deep(.el-button) {
} }
</style> </style>