Commit f8a9ec96 authored by 王炽's avatar 王炽

Merge branch 'xingmaLab20250820' of http://gitlab2.dui88.com/fh/20250528_FHQ1...

Merge branch 'xingmaLab20250820' of http://gitlab2.dui88.com/fh/20250528_FHQ1 into xingmaLab20250820
parents bf69e3d2 359cf8ba
...@@ -217,16 +217,21 @@ const handleGoBack = () => { ...@@ -217,16 +217,21 @@ const handleGoBack = () => {
const pages = getCurrentPages() const pages = getCurrentPages()
console.log('pages', pages) console.log('pages', pages)
if (pages.length > 1) { if (pages.length > 1) {
let prevPage = pages[pages.length - 2]
prevPage.setData({
isFavorite: detailData.value.collection ? 1 : -1
})
// 有上一页,返回上一页 // 有上一页,返回上一页
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })
} else { } else {
// 没有上一页,跳转到星妈实验室页面 // 没有上一页,跳转到星妈实验室页面,并传递index参数
uni.redirectTo({ uni.redirectTo({
url: '/pages/xingmaLab/xingmaLab' url: `/pages/xingmaLab/xingmaLab`
}) })
} }
} }
...@@ -236,11 +241,10 @@ onMounted(async () => { ...@@ -236,11 +241,10 @@ onMounted(async () => {
// 调用 home 接口获取登录状态 // 调用 home 接口获取登录状态
await homeStore.loadHomeInfo() await homeStore.loadHomeInfo()
// 获取页面跳转参数中的 id // 获取页面跳转参数中的 id 和 index
const pages = getCurrentPages() const pages = getCurrentPages()
const currentPage = pages[pages.length - 1] const currentPage = pages[pages.length - 1]
const id = currentPage.options?.id || '' const id = currentPage.options?.id || ''
if (id) { if (id) {
console.log('🔍 获取到页面参数 id:', id) console.log('🔍 获取到页面参数 id:', id)
recordId.value = id // 立即保存ID,确保分享时能获取到 recordId.value = id // 立即保存ID,确保分享时能获取到
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment