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

View File

@ -54,7 +54,7 @@
</div>
</template>
<script setup>
<script setup lang="ts">
import { ref, onMounted, onUnmounted, reactive } from 'vue';
// import PageTop from "@/pages/realtimeInfo/pc/components/PageTop.vue";
import dayjs from 'dayjs/esm/index';
@ -97,6 +97,7 @@ async function getNewsList() {
newsList.value = data.list;
form.total = data.total;
data.list.forEach((item) => {
item._title_ = item.title;
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>');
});
@ -111,16 +112,27 @@ function goDetail(item) {
id = item.id;
}
router.push({
path: '/indexPC',
query: {
id: id,
type: pageType.value,
},
});
// uni.navigateTo({
// url: '/pages/realtimeInfo/pc/indexPC?id=' + id + '&type=' + pageType.value,
// router.push({
// path: '/indexPC',
// query: {
// 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) {

View File

@ -235,16 +235,31 @@ function showUploadDialog() {
}
function goDetail(item) {
router.push({
path: '/detail',
query: {
id: item.id,
fromPath: route.path,
type: 1, // type 0 1
reportType: item.reportType,
fileName: item.fileName,
},
});
// router.push({
// path: '/detail',
// query: {
// id: item.id,
// fromPath: route.path,
// type: 1, // type 0 1
// reportType: item.reportType,
// 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;
}
.el_form_item {
width: 250px;
height: 70px;
@ -663,5 +676,4 @@ onUnmounted(() => {
:deep(.el-button) {
}
</style>