live-detail.bf83cdf3.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. import { C as f } from './index.9169d438.js'
  2. import { S as p } from './index.2778830d.js'
  3. import { U as E } from './index.fdb44d83.js'
  4. import { r as n, p as F } from './index.9e4b607f.js'
  5. import {
  6. d as I,
  7. g as a,
  8. T as A,
  9. D as l,
  10. a as r,
  11. K as v,
  12. j as c,
  13. B as h
  14. } from './vendor.3506a68e.js'
  15. import { o as s, a as D } from './orderStatus.81f9c36b.js'
  16. import { C as b } from './index.9a4c80cd.js'
  17. import { C as Y } from './index.e311a214.js'
  18. import './index.f15b595a.js'
  19. /* empty css */ /* empty css */ /* empty css */ import './icon_teacher.cb128c00.js'
  20. import './icon_timer2.5fb1750d.js'
  21. import './icon-jiaozi.20e415ca.js'
  22. /* empty css */ const g = '_introduction_17dsu_1',
  23. B = '_tips_17dsu_12',
  24. j = '_btnMore_17dsu_35'
  25. var d = {
  26. 'live-detail': '_live-detail_17dsu_1',
  27. introduction: g,
  28. tips: B,
  29. btnMore: j
  30. },
  31. T =
  32. 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAAXNSR0IArs4c6QAAASNQTFRFAAAA/wAA/4AA/6pV/5kz/4Ar/4BA/49A/445/4BA/4xA/4VD/4pA/4U9/4lA/4g7/4M+/4Y5/4Y9/4VA/4g+/4U9/4g8/4Y8/4Q+/4U//4U9/4g8/4Y+/4c9/4Y9/4c8/4c+/4c+/4U9/4Y+/4Y9/4Y8/4c+/4Y+/4c9/4Y9/4Y8/4Y9/4c9/4Y9/4Y8/4Y+/4U+/4U9/4c9/4Y8/4U+/4Y9/4c8/4Y8/4Y+/4Y9/4Y+/4c+/4c9/4Y9/4c+/4Y9/4Y9/4Y8/4c9/4Y9/4Y8/4Y9/4U9/4c9/4Y8/4c9/4Y9/4Y9/4Y9/4c9/4Y8/4Y+/4Y9/4Y9/4U8/4Y9/4Y9/4Y9/4Y8/4Y9/4Y9/4Y8/4Y9/4Y9/4Y9/4c9/4Y8/4Y9/4Y9qWZ60gAAAGB0Uk5TAAECAwUGEBASFBQXGBkcHiUoKiwtLi83OkFLTU5TVFVXYmRnaXJzdH1+h42Ok5SUlZeXmJmgoaWlp6qusLGys7u+w8rL0NbW19jZ3d7j5OTn7O3t8vP19/j5+fr7/P3+TBv5LQAAAThJREFUOMvF1OszQkEYx/FK6KakXMpBSDfkknIJSYUuKIVOl+P7//8VXmiOc057mDHTeF7t85vP7uzu7KzFMrE6eY3/jhQebD8Lf7IMdMtJvynx5oaMapjzik2oBdxnEonjO6AVEhmpD4Wlr/HiNfSlcRPsIG99t5tdOkGjsZb4WNcGawolqwFFYE+f7ELEgIq0Z/XJzAtFfeIYkDHu4IiBQxeEYewwEoR1QRTGzhKAqC6IgceIPBDTBXFwG5Eb4v+JUmKU0rS2LGJE1qa9AKXpNCJnU9FeQpW6T/TEfHWqatMjLX6saXrquEHNJTKuGg21SYD8LCgZkiqyX2JSV3bNwqvpU0EdSNY//QJzGwujidMr2/MmqA7tm7P9w4vbN3g0QUXtjvMmaGo5lq88vcutyvlOYEIf2ydPMlkWBCFozgAAAABJRU5ErkJggg==',
  33. H = I({
  34. name: 'LiveDetail',
  35. data() {
  36. const e = this.$route.query
  37. return {
  38. joinRoom: e.joinRoom,
  39. recomUserId: e.recomUserId,
  40. groupId: e.groupId,
  41. courseId: e.classId,
  42. live: {}
  43. }
  44. },
  45. computed: {
  46. userInfo() {
  47. var i, m
  48. const e = this.live,
  49. u = e.planList || [],
  50. t = ((i = u[0]) == null ? void 0 : i.startTime) || new Date(),
  51. o = ((m = u[0]) == null ? void 0 : m.endTime) || new Date()
  52. return {
  53. headUrl: e.avatar,
  54. username: e.userName || `\u6E38\u5BA2${e.teacherId || ''}`,
  55. startTime:
  56. `${a(t).format('YYYY-MM-DD')} ${a(t).format('HH:mm')}~${a(o).format(
  57. 'HH:mm'
  58. )}` || '',
  59. buyNum: e.studentCount,
  60. lessonPrice: e.coursePrice,
  61. lessonNum: e.courseNum,
  62. lessonDesc: e.courseIntroduce,
  63. lessonCoverUrl: e.backgroundPic || e.backgroundPicTemplate,
  64. lessonName: e.courseGroupName,
  65. auditVersion: e.auditVersion || 0,
  66. isDegree: !!e.degreeFlag,
  67. isTeacher: !!e.teacherFlag
  68. }
  69. },
  70. courseInfo() {
  71. const e = []
  72. return (
  73. (this.live.planList || []).forEach(t => {
  74. const o = t.startTime || new Date(),
  75. i = t.endTime || new Date()
  76. e.push({
  77. courseTime: `${a(o).format('YYYY-MM-DD')} ${a(o).format(
  78. 'HH:mm'
  79. )}~${a(i).format('HH:mm')}`,
  80. coursePlan: t.plan,
  81. roomUid: t.roomUid,
  82. liveState: t.liveState,
  83. id: t.courseId
  84. })
  85. }),
  86. e || []
  87. )
  88. },
  89. salesEndDate() {
  90. const e = this.live
  91. return a(e.salesEndDate || new Date()).format('YYYY-MM-DD')
  92. },
  93. liveStatus() {
  94. const e = this.live.planList || [],
  95. u = { status: !1, liveStatus: 0, roomUid: '' }
  96. return (
  97. e.forEach(t => {
  98. t.courseId === Number(this.courseId) &&
  99. ((u.status = !0),
  100. (u.liveStatus = t.liveStatus),
  101. (u.roomUid = t.roomUid))
  102. }),
  103. u
  104. )
  105. }
  106. },
  107. async mounted() {
  108. await this._init()
  109. },
  110. methods: {
  111. async _init() {
  112. try {
  113. const e = await n.get(
  114. '/api-student/courseGroup/queryLiveCourseInfo',
  115. { params: { groupId: this.groupId } }
  116. )
  117. this.live = e.data || {}
  118. } catch {}
  119. },
  120. async onJoinRoom() {
  121. try {
  122. const t =
  123. (
  124. (
  125. await n.get('/api-student/courseGroup/queryLiveCourseInfo', {
  126. params: { groupId: this.groupId }
  127. })
  128. ).data || {}
  129. ).planList || []
  130. let o = {}
  131. t.forEach(i => {
  132. i.courseId === Number(this.courseId) && (o = i)
  133. }),
  134. console.log(o, this.live, 'tempObj'),
  135. o && o.liveState === 1
  136. ? F({
  137. api: 'joinLiveRoom',
  138. content: { roomId: o.roomUid, teacherId: this.live.teacherId }
  139. })
  140. : o && o.liveState === 2
  141. ? setTimeout(() => {
  142. A('\u8BFE\u7A0B\u5DF2\u7ED3\u675F')
  143. }, 100)
  144. : setTimeout(() => {
  145. A(
  146. '\u8BFE\u7A0B\u5C1A\u672A\u5F00\u59CB\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5019'
  147. )
  148. }, 100)
  149. } catch {}
  150. },
  151. async onBuy() {
  152. try {
  153. const e = this.live
  154. if (
  155. ((s.orderObject.orderType = 'LIVE'),
  156. (s.orderObject.orderName = '\u76F4\u64AD\u8BFE\u8D2D\u4E70'),
  157. (s.orderObject.orderDesc = '\u76F4\u64AD\u8BFE\u8D2D\u4E70'),
  158. (s.orderObject.actualPrice = e.coursePrice),
  159. (s.orderObject.recomUserId = this.recomUserId),
  160. (s.orderObject.orderNo = ''),
  161. (s.orderObject.orderList = [
  162. {
  163. orderType: 'LIVE',
  164. goodsName: '\u76F4\u64AD\u8BFE\u8D2D\u4E70',
  165. courseGroupId: e.courseGroupId,
  166. courseGroupName: e.courseGroupName,
  167. coursePrice: e.coursePrice,
  168. teacherName: e.userName || `\u6E38\u5BA2${e.teacherId || ''}`,
  169. teacherId: e.teacherId,
  170. avatar: e.avatar,
  171. courseInfo: this.courseInfo,
  172. recomUserId: this.recomUserId
  173. }
  174. ]),
  175. e.coursePrice <= 0)
  176. ) {
  177. await D(() => {
  178. l.alert({
  179. message: '\u9886\u53D6\u6210\u529F',
  180. confirmButtonText: '\u786E\u5B9A',
  181. confirmButtonColor: '#01C1B5'
  182. }).then(() => {
  183. this._init()
  184. })
  185. })
  186. return
  187. }
  188. const t = (
  189. await n.post('/api-student/userOrder/getPendingOrder', {
  190. data: { goodType: 'LIVE', bizId: this.groupId }
  191. })
  192. ).data
  193. t
  194. ? l
  195. .confirm({
  196. title: '\u63D0\u793A',
  197. message:
  198. '\u60A8\u6709\u4E00\u4E2A\u672A\u652F\u4ED8\u7684\u8BA2\u5355\uFF0C\u662F\u5426\u7EE7\u7EED\u652F\u4ED8\uFF1F',
  199. confirmButtonColor: '#269a93',
  200. cancelButtonText: '\u53D6\u6D88\u8BA2\u5355',
  201. confirmButtonText: '\u7EE7\u7EED\u652F\u4ED8'
  202. })
  203. .then(async () => {
  204. ;(s.orderObject.orderNo = t.orderNo),
  205. (s.orderObject.actualPrice = t.actualPrice),
  206. (s.orderObject.discountPrice = t.discountPrice),
  207. this.routerTo()
  208. })
  209. .catch(() => {
  210. l.close(), this.cancelPayment(t.orderNo)
  211. })
  212. : this.routerTo()
  213. } catch {}
  214. },
  215. routerTo() {
  216. const e = this.live
  217. this.$router.push({
  218. path: '/orderDetail',
  219. query: { orderType: 'LIVE', courseGroupId: e.courseGroupId }
  220. })
  221. },
  222. async cancelPayment(e) {
  223. try {
  224. await n.post('/api-student/userOrder/orderCancel', {
  225. data: { orderNo: e }
  226. })
  227. } catch {}
  228. }
  229. },
  230. render() {
  231. return r('div', { class: [d['live-detail'], 'mb12'] }, [
  232. r(b, null, null),
  233. r(E, { userInfo: this.userInfo, showBuy: !1 }, null),
  234. r(
  235. p,
  236. { border: !0 },
  237. {
  238. default: () => [
  239. r('p', { class: d.introduction }, [this.userInfo.lessonDesc])
  240. ]
  241. }
  242. ),
  243. r(
  244. p,
  245. {
  246. title: '\u8BFE\u7A0B\u5217\u8868',
  247. icon: 'courseList',
  248. border: !0,
  249. contentStyle: { paddingTop: '0' }
  250. },
  251. {
  252. default: () => [
  253. this.courseInfo.length > 0 &&
  254. r(
  255. f,
  256. {
  257. courseInfo: this.courseInfo,
  258. courseId: Number(this.courseId) || 0
  259. },
  260. null
  261. )
  262. ]
  263. }
  264. ),
  265. r('div', { class: d.tips }, [
  266. r('h3', null, [
  267. r(v, { name: T, size: 15 }, null),
  268. c('\u6E29\u99A8\u63D0\u793A')
  269. ]),
  270. r('p', null, [
  271. c(
  272. '1\u3001\u8BE5\u76F4\u64AD\u8BFE\u7A0B\u9500\u552E\u622A\u6B62\u540E\uFF0C\u62A5\u540D\u4EBA\u6570\u82E5\u5C11\u4E8E'
  273. ),
  274. this.live.mixStudentNum || 0,
  275. c(
  276. '\u4EBA\u5C06\u53D6\u6D88\u5F00\u8BFE\uFF0C\u5DF2\u8D2D\u4E70\u5B66\u5458\u4ED8\u8D39\u91D1\u989D\u5C06\u81EA\u52A8\u8FD4\u8FD8\uFF0C\u8BF7\u60A8\u653E\u5FC3\u8D2D\u4E70\uFF1B'
  277. ),
  278. r('br', null, null),
  279. c(
  280. '2\u3001\u76F4\u64AD\u8BFE\u6559\u5B66\u8BA1\u5212\u4E2D\u7684\u4E0A\u8BFE\u65F6\u95F4\u4E3A\u8001\u5E08\u9884\u8BA1\u65F6\u95F4\uFF0C\u5B9E\u9645\u4E0A\u8BFE\u65F6\u95F4\u4EE5\u8001\u5E08\u5F00\u542F\u76F4\u64AD\u65F6\u95F4\u4E3A\u51C6\uFF1B'
  281. ),
  282. r('br', null, null),
  283. c(
  284. '3\u3001\u82E5\u60A8\u9519\u8FC7\u8001\u5E08\u76F4\u64AD\uFF0C\u53EF\u901A\u8FC7\u89C6\u9891\u56DE\u653E\u89C2\u770B\u5B8C\u6574\u8BFE\u7A0B\u3002'
  285. )
  286. ])
  287. ]),
  288. this.courseInfo.length > 0 &&
  289. this.live.existBuy !== 1 &&
  290. r(
  291. Y,
  292. { position: 'bottom', background: 'white' },
  293. {
  294. default: () => [
  295. r('div', { class: ['btnGroup', d.btnMore] }, [
  296. r(
  297. h,
  298. {
  299. block: !0,
  300. round: !0,
  301. type: 'primary',
  302. onClick: this.onBuy
  303. },
  304. {
  305. default: () => [
  306. this.live.coursePrice <= 0
  307. ? '\u514D\u8D39\u9886\u53D6'
  308. : '\u7ACB\u5373\u8D2D\u4E70'
  309. ]
  310. }
  311. )
  312. ])
  313. ]
  314. }
  315. ),
  316. this.joinRoom == '1' &&
  317. this.liveStatus.liveStatus !== 2 &&
  318. r(
  319. Y,
  320. { position: 'bottom', background: 'white' },
  321. {
  322. default: () => [
  323. r(
  324. 'div',
  325. { class: ['btnGroup'], style: { paddingTop: '12px' } },
  326. [
  327. r(
  328. h,
  329. {
  330. block: !0,
  331. round: !0,
  332. type: 'primary',
  333. onClick: this.onJoinRoom
  334. },
  335. { default: () => [c('\u8FDB\u5165\u76F4\u64AD\u95F4')] }
  336. )
  337. ]
  338. )
  339. ]
  340. }
  341. )
  342. ])
  343. }
  344. })
  345. export { H as default }