live.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. _Http.basic({
  29. "accesstoken": wx.getStorageSync('userData').token,
  30. "classname": "enterprise.live.live",
  31. "method": "liveauthorization",
  32. "content": {
  33. "tliveid": item.tliveid
  34. }
  35. }).then(res => {
  36. if (res.data != '成功') return wx.showToast({
  37. title: res.data,
  38. icon: "none"
  39. })
  40. let str = res.msg;
  41. const url = str.slice(0, 8) + '04de51d4c1.' + str.slice(8);
  42. wx.navigateTo({
  43. url: '/pages/webView/index?url=' + encodeURIComponent(url),
  44. })
  45. })
  46. } else {
  47. let str = item.fliveshowurl;
  48. const url = str.slice(0, 8) + '04de51d4c1.' + str.slice(8)
  49. wx.navigateTo({
  50. url: '/pages/webView/index?url=' + url,
  51. })
  52. }
  53. },
  54. }
  55. })