import create from '../../../../utils/omix/create'
import store from '../../../../store/store'
import ctrl from '../../../../utils/ctrl'
let app = getApp()
create.Page(store, {
data: {
accountId: '',
hasJumped: false,
},
onLoad() {
wx.hideShareMenu()
this.setData({
accountId: this.options.accountId || 'sphpS0TfNvew4XM',
})
this.jumpToChannelsProfile()
},
onShow() {
console.log(9999991, getCurrentPages())
if (this.data.hasJumped) {
// 延迟返回避免闪烁,确保页面渲染完成
this.backForA()
}
},
back() {
ctrl.back(`/pages/activity/activity`)
},
backForA() {
wx.navigateBack({
delta: 1,
}).then(()=> {
console.log(999999, getCurrentPages())
}).catch(() => {
wx.switchTab({
url: '/pages/activity/activity',
})
})
},
jumpToChannelsProfile() {
wx.openChannelsUserProfile({
finderUserName: this.data.accountId,
success: (res) => {
this.setData({
hasJumped: true,
})
},
fail: (err) => {
console.error('跳转失败', err)
this.back()
},
})
},
})
