live.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // pages/portal/portalLive/live.js
  2. Component({
  3. options: {
  4. addGlobalClass: true
  5. },
  6. /**
  7. * 组件的属性列表
  8. */
  9. properties: {
  10. list: {
  11. type: Array
  12. }
  13. },
  14. /**
  15. * 组件的初始数据
  16. */
  17. data: {
  18. },
  19. /**
  20. * 组件的方法列表
  21. */
  22. methods: {
  23. toViewLive(e) {
  24. const {
  25. item
  26. } = e.currentTarget.dataset;
  27. if (item.fisneedauth == 1) {
  28. console.log('需要授权')
  29. /* {
  30. "accesstoken": "5301810557137557e6a7ada3f2d96bba",
  31. "classname": "enterprise.live.live",
  32. "method": "liveauthorization",
  33. "content": {
  34. "tliveid": "2"
  35. }
  36. } */
  37. } else {
  38. let str = item.fliveshowurl;
  39. const url = str.slice(0, 8) + '04de51d4c1.' + str.slice(8)
  40. wx.navigateTo({
  41. url: '/pages/webView/index?url=' + url,
  42. })
  43. }
  44. },
  45. }
  46. })