music.ts 1011 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { orderStatus } from '@/views/order-detail/orderStatus'
  2. import { postMessage } from '@/helpers/native-message'
  3. import { Dialog } from 'vant'
  4. import qs from 'query-string'
  5. import { browser } from '@/helpers/utils'
  6. const browserInfo = browser()
  7. export const getRandomKey = () => {
  8. const key = '' + new Date().getTime() + Math.floor(Math.random() * 1000000)
  9. return key
  10. }
  11. export const musicBuy = (item: any, callBack?: any, moreQuery = {}) => {
  12. const behaviorId = localStorage.getItem('behaviorId') || ''
  13. const url = qs.stringifyUrl({
  14. url: location.origin + '/accompany',
  15. query: {
  16. id: item.id,
  17. behaviorId,
  18. client: browserInfo.isStudent ? 'student' : 'teacher',
  19. ...moreQuery
  20. }
  21. })
  22. console.log(url)
  23. postMessage({
  24. api: 'openAccompanyWebView',
  25. content: {
  26. url,
  27. // url: 'http://192.168.3.13:3000/colexiu.html?id=' + item.id,
  28. orientation: 0,
  29. isHideTitle: true,
  30. statusBarTextColor: false,
  31. isOpenLight: true
  32. }
  33. })
  34. }