feat: 添加跳转
This commit is contained in:
parent
6961b3c804
commit
3995f7a613
@ -55,11 +55,11 @@
|
||||
<div class="option-item-box-title">碳数字身份证</div>
|
||||
<div class="option-btn-box ">
|
||||
<div class="btn" @click="handleNavigate(buttonLinks['办证指南'])">办证指南</div>
|
||||
<div class="btn" @click="handleNavigate(buttonLinks['碳证查询'])">碳证查询</div>
|
||||
<div class="btn" @click="handleIframeNavigate(buttonLinks['碳证查询'])">碳证查询</div>
|
||||
</div>
|
||||
<div class="option-btn-box">
|
||||
<div class="btn" @click="handleNavigate(buttonLinks['碳证核验'])">碳证核验</div>
|
||||
<div class="btn" @click="handleNavigate(buttonLinks['碳证核验'])">碳证核验</div>
|
||||
<div class="btn" @click="handleIframeNavigate(buttonLinks['碳证核验'])">碳证核验</div>
|
||||
<div class="btn" @click="handleNavigate(buttonLinks['跨境互通'])">跨境互通</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="option-item-box blue">
|
||||
@ -80,7 +80,7 @@
|
||||
<div class="btn" @click="handleNavigate(buttonLinks['需求市场'])">需求市场</div>
|
||||
</div>
|
||||
<div class="option-btn-box">
|
||||
<div class="btn" @click="handleNavigate(buttonLinks['数据市场'])">数据市场</div>
|
||||
<div class="btn" @click="handleNavigate(buttonLinks['金融市场'])">金融市场</div>
|
||||
<div class="btn" @click="handleNavigate(buttonLinks['数据市场'])">数据市场</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -255,16 +255,18 @@ export default {
|
||||
buttonLinks: {
|
||||
// 碳数字身份证
|
||||
'办证指南': 'https://www.kdocs.cn/l/cr5aavNI1Brn',
|
||||
'碳证查询': '/yhzx/qyrenzheng',
|
||||
'碳证核验': '/yhzx/qyrenzheng',
|
||||
'碳证查询': 'https://ctn-web-pre.lingshu.net/trustedCarbonQuery/list?type=carbon-query',
|
||||
'碳证核验': 'https://ctn-web-pre.lingshu.net/carbon-verify',
|
||||
'跨境互通': '',
|
||||
// 国家可信碳链
|
||||
'上链指南': 'https://www.kdocs.cn/l/xxx1',
|
||||
'上链标准': 'https://www.kdocs.cn/l/xxx2',
|
||||
'上链工具': 'https://www.kdocs.cn/l/xxx3',
|
||||
'碳证中心': '/yhzx/qyrenzheng',
|
||||
'上链指南': '',
|
||||
'上链标准': '',
|
||||
'上链工具': '',
|
||||
'碳证中心': '',
|
||||
// 绿色服务
|
||||
'服务市场': '/tfwsc',
|
||||
'需求市场': '/txqsc',
|
||||
'金融市场': '/tjrsc',
|
||||
'数据市场': '/tsjsc',
|
||||
},
|
||||
};
|
||||
@ -273,18 +275,25 @@ export default {
|
||||
Footer,
|
||||
},
|
||||
methods: {
|
||||
// 封装跳转方法
|
||||
// 封装跳转方法 - 外部链接新窗口,内部链接当前窗口
|
||||
handleNavigate(link) {
|
||||
if (!link) return;
|
||||
// 判断是外部链接还是内部链接
|
||||
if (link.startsWith('http://') || link.startsWith('https://')) {
|
||||
// 外部链接,打开新窗口
|
||||
window.open(link, '_blank');
|
||||
} else {
|
||||
// 内部链接,当前窗口跳转
|
||||
this.$router.push(link);
|
||||
}
|
||||
},
|
||||
// iframe页面跳转 - 通过parent事件触发main.vue的iframe显示
|
||||
handleIframeNavigate(url) {
|
||||
console.log('url', url);
|
||||
if (!url) return;
|
||||
if (url.startsWith('http://') || url.startsWith('https://')) {
|
||||
this.$emit('gotoIfreamPage', url);
|
||||
} else {
|
||||
this.$router.push(url);
|
||||
}
|
||||
},
|
||||
// 快捷搜索
|
||||
handleSearch() {
|
||||
if (this.inputValue) {
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<iframe v-if="iframeUrl" :src="iframeUrl" width="100%" height="100%" frameborder="0" scrolling="yes">
|
||||
</iframe>
|
||||
<keep-alive v-else>
|
||||
<router-view />
|
||||
<router-view @gotoIfreamPage="gotoIfreamPage" @gotoPage="gotoPage" />
|
||||
</keep-alive>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user