feat: 添加postMessage传递数据,宁波银行系统内部新开tab标签支持
This commit is contained in:
parent
68c27a904f
commit
b3a9ff3671
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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,
|
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
// 宁波银行系统内部新开tab标签,通过postMessage传递数据,父页面监听到数据后打开新标签页
|
||||||
|
// 海外资讯的menuKey是OverseaNews, 智能复核是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) {
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
// 宁波银行系统内部新开tab标签,通过postMessage传递数据,父页面监听到数据后打开新标签页
|
||||||
|
// 海外资讯的menuKey是OverseaNews, 智能复核是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>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue