mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-14 09:38:13 +08:00
♻️ 对于部分点击外部事件进行特殊处理
This commit is contained in:
@@ -9,6 +9,7 @@ import { toRaw } from "vue";
|
||||
|
||||
import TGClient from "../../utils/TGClient";
|
||||
import showConfirm from "../func/confirm";
|
||||
import showSnackbar from "../func/snackbar";
|
||||
|
||||
interface TpMention {
|
||||
insert: {
|
||||
@@ -28,18 +29,26 @@ const props = defineProps<TpMentionProps>();
|
||||
console.log("tpMention", props.data.insert.mention.uid, toRaw(props.data).insert.mention);
|
||||
|
||||
async function toLink(): Promise<void> {
|
||||
let prefix = "";
|
||||
const uid = props.data.insert.mention.uid;
|
||||
const confirm = await showConfirm({
|
||||
title: "跳转提示",
|
||||
text: "是否采用内置 JSBridge 跳转?",
|
||||
});
|
||||
if (confirm) {
|
||||
const prefix = "https://m.miyoushe.com/ys/#/accountCenter/0?id=";
|
||||
await TGClient.open("mention", `${prefix}${uid}`);
|
||||
} else {
|
||||
const prefix = "https://www.miyoushe.com/ys/accountCenter/postList?id=";
|
||||
window.open(`${prefix}${uid}`);
|
||||
if (confirm === undefined) {
|
||||
showSnackbar({
|
||||
text: "已取消跳转",
|
||||
color: "info",
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (confirm === true) {
|
||||
prefix = "https://m.miyoushe.com/ys/#/accountCenter/0?id=";
|
||||
await TGClient.open("mention", `${prefix}${uid}`);
|
||||
return;
|
||||
}
|
||||
prefix = "https://www.miyoushe.com/ys/accountCenter/postList?id=";
|
||||
window.open(`${prefix}${uid}`);
|
||||
}
|
||||
</script>
|
||||
<style lang="css" scoped>
|
||||
|
||||
Reference in New Issue
Block a user