|
|
|
|
@ -103,10 +103,27 @@ const tips1 = ref('') |
|
|
|
|
const tips2 = ref('') |
|
|
|
|
const cmd = ref('') |
|
|
|
|
|
|
|
|
|
// 小程序 webview 里开放标签不生效(仅公众号 H5 可渲染),改为提取标签的 path |
|
|
|
|
// 用 wx.miniProgram.navigateTo 自动跳转;公众号 H5 环境仍靠用户点击开放标签 |
|
|
|
|
function autoLaunchWeapp() { |
|
|
|
|
if (props.isHistory) return |
|
|
|
|
if (!utils.isMiniProgram()) return |
|
|
|
|
const raw = String(props.introduce || props.itemlist?.msgText || '') |
|
|
|
|
const m = raw.match(/<wx-open-launch-weapp[^>]*\spath="([^"]+)"/) |
|
|
|
|
if (!m) return |
|
|
|
|
const key = `weapp_auto_jump_${props.itemlist?.timestamp || ''}` |
|
|
|
|
if (sessionStorage.getItem(key)) return |
|
|
|
|
sessionStorage.setItem(key, '1') |
|
|
|
|
setTimeout(() => { |
|
|
|
|
wx.miniProgram.navigateTo({ url: m[1] }) |
|
|
|
|
}, 300) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
|
processedEmoji() |
|
|
|
|
descHeightChange() |
|
|
|
|
cmd.value = props.itemlist.cmd |
|
|
|
|
autoLaunchWeapp() |
|
|
|
|
nextTick(() => { |
|
|
|
|
initGlobalCallbacks() |
|
|
|
|
}) |
|
|
|
|
|