巴青农资商城

messageNav.js 880B

12345678910111213141516171819202122232425262728293031
  1. import { PAGE_MESSAGE_LIST, PAGE_MESSAGE_DETAIL, PAGE_ENTRY_DETAIL } from '@/utils/pageRoute'
  2. import { MESSAGE_LINK_MERCHANT_ENTRY } from '@/constants/message'
  3. /** 消息列表 */
  4. export function goMessageList() {
  5. uni.navigateTo({ url: PAGE_MESSAGE_LIST })
  6. }
  7. /** 消息详情 */
  8. export function goMessageDetail(messageId) {
  9. if (!messageId) return
  10. uni.navigateTo({
  11. url: `${PAGE_MESSAGE_DETAIL}?messageId=${messageId}`
  12. })
  13. }
  14. /** 按 linkType 跳转关联业务 */
  15. export function goMessageLink(detail) {
  16. if (!detail || !detail.linkAvailable) {
  17. uni.showToast({ title: '关联内容不存在', icon: 'none' })
  18. return
  19. }
  20. if (detail.linkType === MESSAGE_LINK_MERCHANT_ENTRY && detail.bizId) {
  21. uni.navigateTo({
  22. url: `${PAGE_ENTRY_DETAIL}?applyId=${detail.bizId}`
  23. })
  24. return
  25. }
  26. uni.showToast({ title: '暂不支持跳转', icon: 'none' })
  27. }