收藏
回答

openChannelsUserProfile A到B到视频号,视频号返回B,B返回A,A页面重复?

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()

      },

    })

  },

})


回答关注问题邀请回答
收藏

1 个回答

  • 智能回答 智能回答 本次回答由AI生成
    03-05
    有用
    回复 1
    • 胡倩
      胡倩
      03-05
      没有报错
      03-05
      回复
登录 后发表内容