video-detail-legacy.3b0229af.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  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. '._video-detail_lw312_1 ._introduction_lw312_1{color:#7a7a7a;line-height:.61333rem;padding-bottom:.21333rem}._video-detail_lw312_1 ._btnGroup_lw312_6{padding:0 .37333rem .4rem}._video-detail_lw312_1 ._btnMore_lw312_10{display:flex;justify-content:space-around}._video-detail_lw312_1 ._btnMore_lw312_10 .van-button{width:55%}._video-detail_lw312_1 ._videoItem_lw312_17 ._van-cell__title_lw312_17{font-size:.58667rem}._video-detail_lw312_1 ._videoItem_lw312_17 ._van-cell__title_lw312_17 p{max-width:2.66667rem}\n'
  35. document.head.appendChild(__vite_style__)
  36. System.register(
  37. [
  38. './index-legacy.141c974d.js',
  39. './index-legacy.f9759ffc.js',
  40. './index-legacy.34e07a99.js',
  41. './vendor-legacy.09f20d09.js',
  42. './index-legacy.595c24c3.js',
  43. './index-legacy.fa4145a4.js',
  44. './orderStatus-legacy.6131dfb6.js',
  45. './tradeOrder-legacy.a0642d41.js',
  46. './index-legacy.53480b15.js',
  47. './index-legacy.f25f109a.js',
  48. './index-legacy.f25f109a2.js',
  49. './bars-legacy.9085ff9b.js',
  50. './index-legacy.f25f109a4.js',
  51. './icon_teacher-legacy.e765b7f7.js',
  52. './icon_timer2-legacy.b6c78faa.js',
  53. './icon-jiaozi-legacy.dd5ed0e2.js',
  54. './index-legacy.f25f109a8.js',
  55. './index-legacy.9dfebfce.js'
  56. ],
  57. function (exports) {
  58. 'use strict'
  59. var CourseVideoItem,
  60. SectionDetail,
  61. UserDetail,
  62. defineComponent,
  63. Dialog,
  64. createVNode,
  65. isVNode,
  66. Button,
  67. request,
  68. ColHeader,
  69. orderStatus,
  70. onSubmitZero,
  71. tradeOrder,
  72. ColSticky
  73. return {
  74. setters: [
  75. function (module) {
  76. CourseVideoItem = module.C
  77. },
  78. function (module) {
  79. SectionDetail = module.S
  80. },
  81. function (module) {
  82. UserDetail = module.U
  83. },
  84. function (module) {
  85. defineComponent = module.d
  86. Dialog = module.D
  87. createVNode = module.a
  88. isVNode = module.x
  89. Button = module.B
  90. },
  91. function (module) {
  92. request = module.r
  93. },
  94. function (module) {
  95. ColHeader = module.C
  96. },
  97. function (module) {
  98. orderStatus = module.o
  99. onSubmitZero = module.a
  100. },
  101. function (module) {
  102. tradeOrder = module.t
  103. },
  104. function (module) {
  105. ColSticky = module.C
  106. },
  107. function () {},
  108. function () {},
  109. function () {},
  110. function () {},
  111. function () {},
  112. function () {},
  113. function () {},
  114. function () {},
  115. function () {}
  116. ],
  117. execute: function execute() {
  118. var introduction = '_introduction_lw312_1'
  119. var btnGroup = '_btnGroup_lw312_6'
  120. var btnMore = '_btnMore_lw312_10'
  121. var videoItem = '_videoItem_lw312_17'
  122. var styles = {
  123. 'video-detail': '_video-detail_lw312_1',
  124. introduction: introduction,
  125. btnGroup: btnGroup,
  126. btnMore: btnMore,
  127. videoItem: videoItem,
  128. 'van-cell__title': '_van-cell__title_lw312_17'
  129. }
  130. function _isSlot(s) {
  131. return (
  132. typeof s === 'function' ||
  133. (Object.prototype.toString.call(s) === '[object Object]' &&
  134. !isVNode(s))
  135. )
  136. }
  137. var videoDetail = exports(
  138. 'default',
  139. defineComponent({
  140. name: 'VideoDetail',
  141. data: function data() {
  142. var query = this.$route.query
  143. return {
  144. userInfo: {},
  145. detailList: [],
  146. recomUserId: query.recomUserId, // 推荐人id
  147. params: { groupId: query.groupId }
  148. }
  149. },
  150. mounted: function mounted() {
  151. var _this = this
  152. return _asyncToGenerator(
  153. /*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
  154. return regeneratorRuntime.wrap(function _callee$(_context) {
  155. while (1) {
  156. switch ((_context.prev = _context.next)) {
  157. case 0:
  158. _context.next = 2
  159. return _this._init()
  160. case 2:
  161. case 'end':
  162. return _context.stop()
  163. }
  164. }
  165. }, _callee)
  166. })
  167. )()
  168. },
  169. methods: {
  170. _init: function _init() {
  171. var _this2 = this
  172. return _asyncToGenerator(
  173. /*#__PURE__*/ regeneratorRuntime.mark(function _callee2() {
  174. var res, result, lessonGroup, teachertTag
  175. return regeneratorRuntime.wrap(
  176. function _callee2$(_context2) {
  177. while (1) {
  178. switch ((_context2.prev = _context2.next)) {
  179. case 0:
  180. _context2.prev = 0
  181. _context2.next = 3
  182. return request.get(
  183. '/api-student/videoLesson/selectVideoLesson',
  184. { params: { groupId: _this2.params.groupId } }
  185. )
  186. case 3:
  187. res = _context2.sent
  188. result = res.data || {}
  189. lessonGroup = result.lessonGroup || {}
  190. teachertTag = result.teachertTag || ''
  191. _this2.userInfo = {
  192. alreadyBuy: result.alreadyBuy,
  193. username:
  194. lessonGroup.username ||
  195. '\u6E38\u5BA2'.concat(
  196. lessonGroup.teacherId || ''
  197. ),
  198. headUrl: lessonGroup.avatar,
  199. buyNum: lessonGroup.countStudent,
  200. id: lessonGroup.id,
  201. lessonNum: lessonGroup.lessonCount,
  202. lessonName: lessonGroup.lessonName,
  203. lessonDesc: lessonGroup.lessonDesc,
  204. lessonPrice: lessonGroup.lessonPrice,
  205. teacherId: lessonGroup.teacherId,
  206. lessonCoverUrl: lessonGroup.lessonCoverUrl,
  207. auditVersion: lessonGroup.auditVersion,
  208. isDegree: result.degreeFlag ? true : false,
  209. isTeacher: result.teacherFlag ? true : false
  210. }
  211. _this2.detailList = result.detailList || []
  212. _context2.next = 13
  213. break
  214. case 11:
  215. _context2.prev = 11
  216. _context2.t0 = _context2['catch'](0)
  217. case 13:
  218. case 'end':
  219. return _context2.stop()
  220. }
  221. }
  222. },
  223. _callee2,
  224. null,
  225. [[0, 11]]
  226. )
  227. })
  228. )()
  229. },
  230. onPlay: function onPlay(detail) {
  231. this.$router.push({
  232. path: '/videoClassDetail',
  233. query: { groupId: this.params.groupId, classId: detail.id }
  234. })
  235. },
  236. onBuy: function onBuy() {
  237. var _this3 = this
  238. return _asyncToGenerator(
  239. /*#__PURE__*/ regeneratorRuntime.mark(function _callee4() {
  240. var userInfo, res, result
  241. return regeneratorRuntime.wrap(
  242. function _callee4$(_context4) {
  243. while (1) {
  244. switch ((_context4.prev = _context4.next)) {
  245. case 0:
  246. _context4.prev = 0
  247. userInfo = _this3.userInfo
  248. orderStatus.orderObject.orderType = 'VIDEO'
  249. orderStatus.orderObject.orderName = '视频课购买'
  250. orderStatus.orderObject.orderDesc = '视频课购买'
  251. orderStatus.orderObject.actualPrice =
  252. userInfo.lessonPrice
  253. orderStatus.orderObject.recomUserId =
  254. _this3.recomUserId
  255. orderStatus.orderObject.orderNo = ''
  256. orderStatus.orderObject.orderList = [
  257. {
  258. orderType: 'VIDEO',
  259. goodsName: '视频课购买',
  260. courseGroupId: userInfo.id,
  261. courseGroupName: userInfo.lessonName,
  262. coursePrice: userInfo.lessonPrice,
  263. teacherName:
  264. userInfo.username ||
  265. '\u6E38\u5BA2'.concat(
  266. userInfo.teacherId || ''
  267. ),
  268. teacherId: userInfo.teacherId,
  269. avatar: userInfo.headUrl,
  270. courseInfo: _this3.detailList,
  271. recomUserId: _this3.recomUserId
  272. }
  273. ] // 判断是否是0无订单
  274. if (!(userInfo.lessonPrice <= 0)) {
  275. _context4.next = 13
  276. break
  277. }
  278. _context4.next = 12
  279. return onSubmitZero(function () {
  280. Dialog.alert({
  281. message: '领取成功',
  282. confirmButtonText: '确定',
  283. confirmButtonColor: '#01C1B5'
  284. }).then(function () {
  285. _this3._init()
  286. })
  287. })
  288. case 12:
  289. return _context4.abrupt('return')
  290. case 13:
  291. _context4.next = 15
  292. return request.post(
  293. '/api-student/userOrder/getPendingOrder',
  294. {
  295. data: {
  296. goodType: 'VIDEO',
  297. bizId: _this3.params.groupId
  298. }
  299. }
  300. )
  301. case 15:
  302. res = _context4.sent
  303. result = res.data
  304. if (result) {
  305. Dialog.confirm({
  306. title: '提示',
  307. message:
  308. '您有一个未支付的订单,是否继续支付?',
  309. confirmButtonColor: '#269a93',
  310. cancelButtonText: '取消订单',
  311. confirmButtonText: '继续支付'
  312. })
  313. .then(
  314. /*#__PURE__*/ _asyncToGenerator(
  315. /*#__PURE__*/ regeneratorRuntime.mark(
  316. function _callee3() {
  317. return regeneratorRuntime.wrap(
  318. function _callee3$(_context3) {
  319. while (1) {
  320. switch (
  321. (_context3.prev =
  322. _context3.next)
  323. ) {
  324. case 0:
  325. tradeOrder(
  326. result,
  327. _this3.routerTo
  328. )
  329. case 1:
  330. case 'end':
  331. return _context3.stop()
  332. }
  333. }
  334. },
  335. _callee3
  336. )
  337. }
  338. )
  339. )
  340. )
  341. .catch(function () {
  342. Dialog.close() // 只用取消订单,不用做其它处理
  343. _this3.cancelPayment(result.orderNo)
  344. })
  345. } else {
  346. _this3.routerTo()
  347. }
  348. _context4.next = 22
  349. break
  350. case 20:
  351. _context4.prev = 20
  352. _context4.t0 = _context4['catch'](0)
  353. case 22:
  354. case 'end':
  355. return _context4.stop()
  356. }
  357. }
  358. },
  359. _callee4,
  360. null,
  361. [[0, 20]]
  362. )
  363. })
  364. )()
  365. },
  366. routerTo: function routerTo() {
  367. this.$router.push({
  368. path: '/orderDetail',
  369. query: {
  370. orderType: 'VIDEO',
  371. courseGroupId: this.params.groupId
  372. }
  373. })
  374. },
  375. cancelPayment: function cancelPayment(orderNo) {
  376. return _asyncToGenerator(
  377. /*#__PURE__*/ regeneratorRuntime.mark(function _callee5() {
  378. return regeneratorRuntime.wrap(
  379. function _callee5$(_context5) {
  380. while (1) {
  381. switch ((_context5.prev = _context5.next)) {
  382. case 0:
  383. _context5.prev = 0
  384. _context5.next = 3
  385. return request.post(
  386. '/api-student/userOrder/orderCancel',
  387. { data: { orderNo: orderNo } }
  388. )
  389. case 3:
  390. _context5.next = 7
  391. break
  392. case 5:
  393. _context5.prev = 5
  394. _context5.t0 = _context5['catch'](0)
  395. case 7:
  396. case 'end':
  397. return _context5.stop()
  398. }
  399. }
  400. },
  401. _callee5,
  402. null,
  403. [[0, 5]]
  404. )
  405. })
  406. )()
  407. }
  408. },
  409. render: function render() {
  410. var _this4 = this
  411. var _slot
  412. return createVNode('div', { class: [styles['video-detail']] }, [
  413. createVNode(ColHeader, null, null),
  414. createVNode(UserDetail, { userInfo: this.userInfo }, null),
  415. createVNode(
  416. SectionDetail,
  417. { border: true },
  418. {
  419. default: function _default() {
  420. return [
  421. createVNode('p', { class: styles.introduction }, [
  422. _this4.userInfo.lessonDesc
  423. ])
  424. ]
  425. }
  426. }
  427. ),
  428. createVNode(
  429. SectionDetail,
  430. {
  431. title: '课程列表',
  432. icon: 'courseList',
  433. class: 'mb12',
  434. border: true
  435. },
  436. _isSlot(
  437. (_slot = this.detailList.map(function (item) {
  438. return createVNode(
  439. CourseVideoItem,
  440. {
  441. class: ['mb12', styles.videoItem],
  442. detail: {
  443. id: item.id,
  444. title: item.videoTitle,
  445. content: item.videoContent,
  446. imgUrl: item.coverUrl
  447. },
  448. onPlay: _this4.onPlay
  449. },
  450. null
  451. )
  452. }))
  453. )
  454. ? _slot
  455. : {
  456. default: function _default() {
  457. return [_slot]
  458. }
  459. }
  460. ),
  461. this.userInfo.id &&
  462. !this.userInfo.alreadyBuy && // <Sticky offsetBottom={0} position="bottom">
  463. // <div class={['btnGroup', styles.btnMore]}>
  464. // <Button block round type="primary" onClick={this.onBuy}>
  465. // {this.userInfo.lessonPrice <= 0 ? '免费领取' : `立即购买`}
  466. // </Button>
  467. // </div>
  468. // </Sticky>
  469. createVNode(
  470. ColSticky,
  471. { position: 'bottom', background: 'white' },
  472. {
  473. default: function _default() {
  474. return [
  475. createVNode(
  476. 'div',
  477. { class: ['btnGroup', styles.btnMore] },
  478. [
  479. createVNode(
  480. Button,
  481. {
  482. block: true,
  483. round: true,
  484. type: 'primary',
  485. onClick: _this4.onBuy
  486. },
  487. {
  488. default: function _default() {
  489. return [
  490. _this4.userInfo.lessonPrice <= 0
  491. ? '免费领取'
  492. : '\u7ACB\u5373\u8D2D\u4E70'
  493. ]
  494. }
  495. }
  496. )
  497. ]
  498. )
  499. ]
  500. }
  501. }
  502. )
  503. ])
  504. }
  505. })
  506. )
  507. }
  508. }
  509. }
  510. )
  511. })()