refactor: 统一调用 showComingSoon & 防止重复触发
- coming-soon-mixin: 全局 \.info 配置 3s 自动关闭、顶部居中 - fwsc/xqsc: 禁用 tab 改走 showComingSoon - qych: 卡片按钮使用 showComingSoon,外部链接固定 _blank 打开 - hyzt: 进入专题时加 messageShowing 锁,避免连点产生重复 toast Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
cbb4096ea4
commit
b57a015ae4
@ -15,6 +15,11 @@ export default {
|
|||||||
prev.close()
|
prev.close()
|
||||||
this[COMING_SOON_INSTANCE] = null
|
this[COMING_SOON_INSTANCE] = null
|
||||||
}
|
}
|
||||||
|
this.$message.config({
|
||||||
|
duration: 3000, // 3s后自动关闭
|
||||||
|
placement: 'top', // 顶部居中
|
||||||
|
offset: [0, 100], // 离顶部100px
|
||||||
|
})
|
||||||
this.$message.info(text).then((instance) => {
|
this.$message.info(text).then((instance) => {
|
||||||
this[COMING_SOON_INSTANCE] = instance
|
this[COMING_SOON_INSTANCE] = instance
|
||||||
})
|
})
|
||||||
|
|||||||
@ -424,7 +424,7 @@ export default {
|
|||||||
},
|
},
|
||||||
goToTab({path, disable}) {
|
goToTab({path, disable}) {
|
||||||
if (disable) {
|
if (disable) {
|
||||||
this.$message.info('敬请期待');
|
this.showComingSoon();
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$router.push(path);
|
this.$router.push(path);
|
||||||
|
|||||||
@ -40,6 +40,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { mapState } from 'vuex';
|
import { mapState } from 'vuex';
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'hyzt',
|
name: 'hyzt',
|
||||||
data() {
|
data() {
|
||||||
@ -55,11 +56,15 @@ export default {
|
|||||||
return index === 2 ? '进入交易大厅' : '进入专题';
|
return index === 2 ? '进入交易大厅' : '进入专题';
|
||||||
},
|
},
|
||||||
goToHref(href) {
|
goToHref(href) {
|
||||||
if (href) {
|
if (this.messageShowing) return;
|
||||||
window.open(href, '_blank');
|
|
||||||
} else {
|
this.messageShowing = true;
|
||||||
|
|
||||||
this.$message.info('敬请期待');
|
this.$message.info('敬请期待');
|
||||||
}
|
|
||||||
|
setTimeout(() => {
|
||||||
|
this.messageShowing = false;
|
||||||
|
}, 3000);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -325,10 +325,10 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
goPage(url) {
|
goPage(url) {
|
||||||
if (url) {
|
if (url) {
|
||||||
window.open(url);
|
window.open(url, '_blank');
|
||||||
} else {
|
return;
|
||||||
this.$message.info('敬请期待')
|
|
||||||
}
|
}
|
||||||
|
this.showComingSoon();
|
||||||
},
|
},
|
||||||
handleCardBtnClick(item) {
|
handleCardBtnClick(item) {
|
||||||
if (item.externalLink) {
|
if (item.externalLink) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user