share.622205d9.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import { T as a, D as l } from './vendor.3506a68e.js'
  2. import { b as n, s as u, p as t } from './index.9e4b607f.js'
  3. const c = (e, i) => {
  4. const s = {
  5. url: e,
  6. action: (i == null ? void 0 : i.action) || 'h5',
  7. pageTag: (i == null ? void 0 : i.pageTag) || 1
  8. },
  9. o = encodeURIComponent(JSON.stringify(s))
  10. console.log(o, 'query'),
  11. /(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)
  12. ? (window.location.href = `ColexiuStudent://linkUrl=${o}`)
  13. : /(Android)/i.test(navigator.userAgent)
  14. ? (window.location.href = `colexiustudent://html:8888/SplashActivity?url=${o}`)
  15. : a(
  16. '\u8BF7\u7528\u624B\u673A\u6216\u79FB\u52A8\u8BBE\u5907\u6253\u5F00'
  17. )
  18. },
  19. d = e => {
  20. if (n().isApp)
  21. if (u.platformType === 'STUDENT') {
  22. window.location.replace(e),
  23. n().ios
  24. ? window.location.replace(e)
  25. : (t({
  26. api: 'openWebView',
  27. content: { url: e, orientation: 1, isHideTitle: !1 }
  28. }),
  29. t({ api: 'back' }))
  30. return
  31. } else
  32. u.platformType === 'TEACHER' &&
  33. l
  34. .alert({
  35. title: '\u63D0\u793A',
  36. message:
  37. '\u8BF7\u4F7F\u7528\u9177\u4E50\u79C0\u5B66\u751F\u7AEF\u626B\u7801\u6253\u5F00',
  38. confirmButtonColor: '#01C1B5'
  39. })
  40. .then(() => {
  41. t({ api: 'back' })
  42. })
  43. else c(e)
  44. }
  45. export { d as i, c as s }