export function toCertificationPage() {
  const navigate = wx.navigateTo({
    url: `/module/user/pages/user-certification/user-certification?hide=true`,
    events: {
      update: (data: { patientId: string }) => {
        if (data.patientId) {
          wx.setStorageSync('patientId', data.patientId);
          toChats('questionnaire')
        }
      }
    }
  })
  // navigate.then(res => { res.eventChannel.emit('navigateBack', { hide: true }); })
  return navigate;
}

export function toChats(component: 'guide' | 'questionnaire') {
  const navigate = wx.navigateTo({ url: `/module/chats/pages/index/index?component=${component}` })
  return navigate;
}