返回问题

This commit is contained in:
lf 2024-06-17 16:28:39 +08:00
parent 0098cbee1c
commit 6e2fdc6bd7
1 changed files with 7 additions and 2 deletions

View File

@ -53,7 +53,10 @@ interface SrcListType {
title?: string title?: string
} }
const srcList = reactive<SrcListType>({}) const srcList = reactive<SrcListType>({
url: '',
title: '',
})
const dataObj = reactive({}) const dataObj = reactive({})
function handleMessage(event: any) { function handleMessage(event: any) {
@ -87,6 +90,7 @@ const getUrlPathName = () => {
window.parent.addEventListener('message', function (event) { window.parent.addEventListener('message', function (event) {
let srcData = {} let srcData = {}
const timestamp = new Date().getTime()
if (event.data.data.type === 'login') { if (event.data.data.type === 'login') {
srcData = { srcData = {
url: contentData.content_templates.source + `?activity_code=${query.value}`, url: contentData.content_templates.source + `?activity_code=${query.value}`,
@ -115,7 +119,8 @@ window.parent.addEventListener('message', function (event) {
title: contentData.login_content_templates.moduledesc, title: contentData.login_content_templates.moduledesc,
} }
} }
Object.assign(srcList, {}) srcList.url =
srcList.url + (srcList.url.includes('?') ? '&timestamp=' : '?timestamp=') + timestamp
nextTick(() => { nextTick(() => {
Object.assign(srcList, srcData) Object.assign(srcList, srcData)
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({