index.ts 385 B

1234567891011121314151617181920
  1. /**
  2. * 获取当前页面路径
  3. * @returns 当前页面路径
  4. */
  5. export function getCurrentPath() {
  6. const pages = getCurrentPages()
  7. const currentPage = pages[pages.length - 1]
  8. return currentPage.route || ''
  9. }
  10. /**
  11. * 统一跳转小程序方法
  12. * @param appid
  13. *
  14. */
  15. export function navCommonMiniProgram(appid: string) {
  16. uni.navigateToMiniProgram({
  17. appId: appid,
  18. })
  19. }