index-legacy.27d82f88.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  1. ;(function () {
  2. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  3. try {
  4. var info = gen[key](arg)
  5. var value = info.value
  6. } catch (error) {
  7. reject(error)
  8. return
  9. }
  10. if (info.done) {
  11. resolve(value)
  12. } else {
  13. Promise.resolve(value).then(_next, _throw)
  14. }
  15. }
  16. function _asyncToGenerator(fn) {
  17. return function () {
  18. var self = this,
  19. args = arguments
  20. return new Promise(function (resolve, reject) {
  21. var gen = fn.apply(self, args)
  22. function _next(value) {
  23. asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value)
  24. }
  25. function _throw(err) {
  26. asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err)
  27. }
  28. _next(undefined)
  29. })
  30. }
  31. }
  32. var __vite_style__ = document.createElement('style')
  33. __vite_style__.innerHTML =
  34. '._live-detail_1vd6e_1 ._introduction_1vd6e_1{color:#7a7a7a;line-height:.61333rem;padding-bottom:.21333rem}._live-detail_1vd6e_1 .van-tabs__wrap{margin-bottom:.4rem}._live-detail_1vd6e_1 ._wxpopup_1vd6e_9{width:100%;height:100vh;position:fixed;top:0;left:0;background:rgba(0,0,0,.5);z-index:9999}._live-detail_1vd6e_1 ._wxpopup_1vd6e_9 img{width:88%;margin:0 6%}\n'
  35. document.head.appendChild(__vite_style__)
  36. System.register(
  37. [
  38. './icon_discount-legacy.e2eed755.js',
  39. './share-vip-tips-legacy.2d9caa16.js',
  40. './wx_bg-legacy.3b62a53a.js',
  41. './index-legacy.91b80b61.js',
  42. './index-legacy.f9759ffc.js',
  43. './index-legacy.34e07a99.js',
  44. './index-legacy.53480b15.js',
  45. './index-legacy.595c24c3.js',
  46. './vendor-legacy.09f20d09.js',
  47. './share-legacy.bdbb3344.js',
  48. './index-legacy.c75fe8a2.js',
  49. './index-legacy.69ca4eed.js',
  50. './index-legacy.f25f109a.js',
  51. './index-legacy.f25f109a4.js',
  52. './index-legacy.f25f109a2.js',
  53. './icon_teacher-legacy.e765b7f7.js',
  54. './icon_timer2-legacy.b6c78faa.js',
  55. './icon-jiaozi-legacy.dd5ed0e2.js'
  56. ],
  57. function (exports) {
  58. 'use strict'
  59. var __glob_17_0,
  60. __glob_17_1,
  61. __glob_17_2,
  62. __glob_17_3,
  63. __glob_17_5,
  64. __glob_17_4,
  65. __glob_17_6,
  66. CoursePlanStep,
  67. SectionDetail,
  68. UserDetail,
  69. ColSticky,
  70. browser,
  71. state,
  72. postMessage,
  73. request,
  74. defineComponent,
  75. dayjs,
  76. Dialog,
  77. createVNode,
  78. Button,
  79. createTextVNode,
  80. shareCall,
  81. qs
  82. return {
  83. setters: [
  84. function (module) {
  85. __glob_17_0 = module._
  86. __glob_17_1 = module.c
  87. __glob_17_2 = module.d
  88. },
  89. function (module) {
  90. __glob_17_3 = module._
  91. __glob_17_5 = module.a
  92. },
  93. function (module) {
  94. __glob_17_4 = module._
  95. __glob_17_6 = module.a
  96. },
  97. function (module) {
  98. CoursePlanStep = module.C
  99. },
  100. function (module) {
  101. SectionDetail = module.S
  102. },
  103. function (module) {
  104. UserDetail = module.U
  105. },
  106. function (module) {
  107. ColSticky = module.C
  108. },
  109. function (module) {
  110. browser = module.b
  111. state = module.s
  112. postMessage = module.p
  113. request = module.r
  114. },
  115. function (module) {
  116. defineComponent = module.d
  117. dayjs = module.g
  118. Dialog = module.D
  119. createVNode = module.a
  120. Button = module.B
  121. createTextVNode = module.j
  122. },
  123. function (module) {
  124. shareCall = module.s
  125. },
  126. function (module) {
  127. qs = module.q
  128. },
  129. function () {},
  130. function () {},
  131. function () {},
  132. function () {},
  133. function () {},
  134. function () {},
  135. function () {}
  136. ],
  137. execute: function execute() {
  138. var introduction = '_introduction_1vd6e_1'
  139. var wxpopup = '_wxpopup_1vd6e_9'
  140. var styles = {
  141. 'live-detail': '_live-detail_1vd6e_1',
  142. introduction: introduction,
  143. wxpopup: wxpopup
  144. }
  145. var getAssetsHomeFile = exports(
  146. 'getAssetsHomeFile',
  147. function (fileName) {
  148. var path = '../images/'.concat(fileName)
  149. var modules = {
  150. '../images/icon-cert.png': __glob_17_0,
  151. '../images/icon_discount.png': __glob_17_1,
  152. '../images/icon_music.png': __glob_17_2,
  153. '../images/music-share-banner.png': __glob_17_3,
  154. '../images/share-banner.png': __glob_17_4,
  155. '../images/share-vip-tips.png': __glob_17_5,
  156. '../images/wx_bg.png': __glob_17_6
  157. }
  158. return modules[path].default
  159. }
  160. )
  161. var index = exports(
  162. 'default',
  163. defineComponent({
  164. name: 'LiveDetail',
  165. data: function data() {
  166. var query = this.$route.query
  167. return {
  168. recomUserId: query.recomUserId, // 分享人编号
  169. groupId: query.groupId,
  170. live: {},
  171. wxStatus: false
  172. }
  173. },
  174. computed: {
  175. userInfo: function userInfo() {
  176. var _planList$, _planList$2
  177. var live = this.live
  178. var planList = live.planList || []
  179. var startTime =
  180. ((_planList$ = planList[0]) === null ||
  181. _planList$ === void 0
  182. ? void 0
  183. : _planList$.startTime) || new Date()
  184. var endTime =
  185. ((_planList$2 = planList[0]) === null ||
  186. _planList$2 === void 0
  187. ? void 0
  188. : _planList$2.endTime) || new Date()
  189. return {
  190. headUrl: live.avatar,
  191. username: live.userName,
  192. id: live.teacherId,
  193. startTime:
  194. ''
  195. .concat(dayjs(startTime).format('YYYY-MM-DD'), ' ')
  196. .concat(dayjs(startTime).format('HH:mm'), '~')
  197. .concat(dayjs(endTime).format('HH:mm')) || '',
  198. lessonPrice: live.coursePrice,
  199. buyNum: live.studentCount || 0,
  200. lessonNum: live.courseNum || 0, // 课时数
  201. lessonDesc: live.courseIntroduce,
  202. lessonCoverUrl:
  203. live.backgroundPic || live.backgroundPicTemplate,
  204. lessonName: live.courseGroupName,
  205. auditVersion: 0
  206. }
  207. },
  208. courseInfo: function courseInfo() {
  209. var tempArr = []
  210. var coursePlanList = this.live.planList || []
  211. coursePlanList.forEach(function (item) {
  212. var startTime = item.startTime || new Date()
  213. var endTime = item.endTime || new Date()
  214. tempArr.push({
  215. courseTime: ''
  216. .concat(dayjs(startTime).format('YYYY-MM-DD'), ' ')
  217. .concat(dayjs(startTime).format('HH:mm'), '~')
  218. .concat(dayjs(endTime).format('HH:mm')),
  219. coursePlan: item.plan,
  220. roomUid: item.roomUid,
  221. liveState: item.liveState,
  222. id: item.courseId
  223. })
  224. })
  225. return tempArr || []
  226. }
  227. },
  228. created: function created() {
  229. if (browser().isApp) {
  230. if (state.platformType === 'STUDENT') {
  231. // 自动跳转到学生端视频课详情购买页
  232. if (browser().ios) {
  233. window.location.replace(
  234. ''
  235. .concat(location.origin, '/student/#/liveDetail??')
  236. .concat(qs.stringify(this.$route.query))
  237. )
  238. } else {
  239. postMessage({
  240. api: 'openWebView',
  241. content: {
  242. url: ''
  243. .concat(location.origin, '/student/#/liveDetail??')
  244. .concat(qs.stringify(this.$route.query)),
  245. orientation: 1,
  246. isHideTitle: false
  247. }
  248. })
  249. postMessage({ api: 'back' })
  250. }
  251. } else if (state.platformType === 'TEACHER') {
  252. Dialog.alert({
  253. title: '提示',
  254. message: '请使用酷乐秀学生端扫码打开',
  255. confirmButtonColor: '#01C1B5'
  256. }).then(function () {
  257. postMessage({ api: 'back' })
  258. })
  259. }
  260. } else {
  261. // 如果不在app里面则不需要唤起操作
  262. this.reCall()
  263. }
  264. },
  265. mounted: function mounted() {
  266. var _this = this
  267. return _asyncToGenerator(
  268. /*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
  269. var res
  270. return regeneratorRuntime.wrap(
  271. function _callee$(_context) {
  272. while (1) {
  273. switch ((_context.prev = _context.next)) {
  274. case 0:
  275. _context.prev = 0
  276. _context.next = 3
  277. return request.post(
  278. '/api-teacher/open/liveShareProfit',
  279. {
  280. data: {
  281. bizId: _this.groupId,
  282. userId: _this.recomUserId
  283. }
  284. }
  285. )
  286. case 3:
  287. res = _context.sent
  288. _this.live = res.data.liveCourseGroup || {}
  289. _context.next = 9
  290. break
  291. case 7:
  292. _context.prev = 7
  293. _context.t0 = _context['catch'](0)
  294. case 9:
  295. case 'end':
  296. return _context.stop()
  297. }
  298. }
  299. },
  300. _callee,
  301. null,
  302. [[0, 7]]
  303. )
  304. })
  305. )()
  306. },
  307. methods: {
  308. locationReplace: function locationReplace(url) {
  309. if (history.replaceState) {
  310. history.replaceState(null, document.title, url)
  311. window.location.reload()
  312. } else {
  313. location.replace(url)
  314. }
  315. },
  316. reCall: function reCall() {
  317. var _location = location,
  318. origin = _location.origin
  319. var str = origin + '/student/#/liveDetail'
  320. var params = this.$route.query
  321. str += '?recomUserId='
  322. .concat(this.recomUserId, '&groupId=')
  323. .concat(params.groupId)
  324. shareCall(str, {})
  325. },
  326. onShare: function onShare() {
  327. if (browser().weixin) {
  328. this.wxStatus = true
  329. return
  330. }
  331. this.reCall()
  332. setTimeout(function () {
  333. window.location.href =
  334. location.origin + '/student/#/download'
  335. }, 3000)
  336. }
  337. },
  338. render: function render() {
  339. var _this2 = this
  340. return createVNode(
  341. 'div',
  342. { class: [styles['live-detail'], 'mb12'] },
  343. [
  344. createVNode(
  345. UserDetail,
  346. { userInfo: this.userInfo, showBuy: false },
  347. null
  348. ),
  349. createVNode(
  350. SectionDetail,
  351. { border: true },
  352. {
  353. default: function _default() {
  354. return [
  355. createVNode('p', { class: styles.introduction }, [
  356. _this2.userInfo.lessonDesc
  357. ])
  358. ]
  359. }
  360. }
  361. ),
  362. createVNode(
  363. SectionDetail,
  364. { title: '课程列表', icon: 'courseList', border: true },
  365. {
  366. default: function _default() {
  367. return [
  368. createVNode(
  369. CoursePlanStep,
  370. { courseInfo: _this2.courseInfo },
  371. null
  372. )
  373. ]
  374. }
  375. }
  376. ),
  377. createVNode(
  378. ColSticky,
  379. { position: 'bottom' },
  380. {
  381. default: function _default() {
  382. return [
  383. createVNode(
  384. 'div',
  385. {
  386. class: ['btnGroup'],
  387. style: { paddingTop: '12px' }
  388. },
  389. [
  390. createVNode(
  391. Button,
  392. {
  393. block: true,
  394. round: true,
  395. type: 'primary',
  396. onClick: _this2.onShare
  397. },
  398. {
  399. default: function _default() {
  400. return [
  401. createTextVNode(
  402. '\u4E0B\u8F7D\u9177\u4E50\u79C0\u8FDB\u5165\u8BFE\u7A0B'
  403. )
  404. ]
  405. }
  406. }
  407. )
  408. ]
  409. )
  410. ]
  411. }
  412. }
  413. ),
  414. this.wxStatus &&
  415. createVNode(
  416. 'div',
  417. {
  418. class: styles.wxpopup,
  419. onClick: function onClick() {
  420. _this2.wxStatus = false
  421. }
  422. },
  423. [
  424. createVNode(
  425. 'img',
  426. { src: getAssetsHomeFile('wx_bg.png'), alt: '' },
  427. null
  428. )
  429. ]
  430. )
  431. ]
  432. )
  433. }
  434. })
  435. )
  436. }
  437. }
  438. }
  439. )
  440. })()