123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511 |
- ;(function () {
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
- try {
- var info = gen[key](arg)
- var value = info.value
- } catch (error) {
- reject(error)
- return
- }
- if (info.done) {
- resolve(value)
- } else {
- Promise.resolve(value).then(_next, _throw)
- }
- }
- function _asyncToGenerator(fn) {
- return function () {
- var self = this,
- args = arguments
- return new Promise(function (resolve, reject) {
- var gen = fn.apply(self, args)
- function _next(value) {
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value)
- }
- function _throw(err) {
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err)
- }
- _next(undefined)
- })
- }
- }
- var __vite_style__ = document.createElement('style')
- __vite_style__.innerHTML =
- '._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'
- document.head.appendChild(__vite_style__)
- System.register(
- [
- './index-legacy.141c974d.js',
- './index-legacy.f9759ffc.js',
- './index-legacy.34e07a99.js',
- './vendor-legacy.09f20d09.js',
- './index-legacy.595c24c3.js',
- './index-legacy.fa4145a4.js',
- './orderStatus-legacy.6131dfb6.js',
- './tradeOrder-legacy.a0642d41.js',
- './index-legacy.53480b15.js',
- './index-legacy.f25f109a.js',
- './index-legacy.f25f109a2.js',
- './bars-legacy.9085ff9b.js',
- './index-legacy.f25f109a4.js',
- './icon_teacher-legacy.e765b7f7.js',
- './icon_timer2-legacy.b6c78faa.js',
- './icon-jiaozi-legacy.dd5ed0e2.js',
- './index-legacy.f25f109a8.js',
- './index-legacy.9dfebfce.js'
- ],
- function (exports) {
- 'use strict'
- var CourseVideoItem,
- SectionDetail,
- UserDetail,
- defineComponent,
- Dialog,
- createVNode,
- isVNode,
- Button,
- request,
- ColHeader,
- orderStatus,
- onSubmitZero,
- tradeOrder,
- ColSticky
- return {
- setters: [
- function (module) {
- CourseVideoItem = module.C
- },
- function (module) {
- SectionDetail = module.S
- },
- function (module) {
- UserDetail = module.U
- },
- function (module) {
- defineComponent = module.d
- Dialog = module.D
- createVNode = module.a
- isVNode = module.x
- Button = module.B
- },
- function (module) {
- request = module.r
- },
- function (module) {
- ColHeader = module.C
- },
- function (module) {
- orderStatus = module.o
- onSubmitZero = module.a
- },
- function (module) {
- tradeOrder = module.t
- },
- function (module) {
- ColSticky = module.C
- },
- function () {},
- function () {},
- function () {},
- function () {},
- function () {},
- function () {},
- function () {},
- function () {},
- function () {}
- ],
- execute: function execute() {
- var introduction = '_introduction_lw312_1'
- var btnGroup = '_btnGroup_lw312_6'
- var btnMore = '_btnMore_lw312_10'
- var videoItem = '_videoItem_lw312_17'
- var styles = {
- 'video-detail': '_video-detail_lw312_1',
- introduction: introduction,
- btnGroup: btnGroup,
- btnMore: btnMore,
- videoItem: videoItem,
- 'van-cell__title': '_van-cell__title_lw312_17'
- }
- function _isSlot(s) {
- return (
- typeof s === 'function' ||
- (Object.prototype.toString.call(s) === '[object Object]' &&
- !isVNode(s))
- )
- }
- var videoDetail = exports(
- 'default',
- defineComponent({
- name: 'VideoDetail',
- data: function data() {
- var query = this.$route.query
- return {
- userInfo: {},
- detailList: [],
- recomUserId: query.recomUserId, // 推荐人id
- params: { groupId: query.groupId }
- }
- },
- mounted: function mounted() {
- var _this = this
- return _asyncToGenerator(
- /*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
- return regeneratorRuntime.wrap(function _callee$(_context) {
- while (1) {
- switch ((_context.prev = _context.next)) {
- case 0:
- _context.next = 2
- return _this._init()
- case 2:
- case 'end':
- return _context.stop()
- }
- }
- }, _callee)
- })
- )()
- },
- methods: {
- _init: function _init() {
- var _this2 = this
- return _asyncToGenerator(
- /*#__PURE__*/ regeneratorRuntime.mark(function _callee2() {
- var res, result, lessonGroup, teachertTag
- return regeneratorRuntime.wrap(
- function _callee2$(_context2) {
- while (1) {
- switch ((_context2.prev = _context2.next)) {
- case 0:
- _context2.prev = 0
- _context2.next = 3
- return request.get(
- '/api-student/videoLesson/selectVideoLesson',
- { params: { groupId: _this2.params.groupId } }
- )
- case 3:
- res = _context2.sent
- result = res.data || {}
- lessonGroup = result.lessonGroup || {}
- teachertTag = result.teachertTag || ''
- _this2.userInfo = {
- alreadyBuy: result.alreadyBuy,
- username:
- lessonGroup.username ||
- '\u6E38\u5BA2'.concat(
- lessonGroup.teacherId || ''
- ),
- headUrl: lessonGroup.avatar,
- buyNum: lessonGroup.countStudent,
- id: lessonGroup.id,
- lessonNum: lessonGroup.lessonCount,
- lessonName: lessonGroup.lessonName,
- lessonDesc: lessonGroup.lessonDesc,
- lessonPrice: lessonGroup.lessonPrice,
- teacherId: lessonGroup.teacherId,
- lessonCoverUrl: lessonGroup.lessonCoverUrl,
- auditVersion: lessonGroup.auditVersion,
- isDegree: result.degreeFlag ? true : false,
- isTeacher: result.teacherFlag ? true : false
- }
- _this2.detailList = result.detailList || []
- _context2.next = 13
- break
- case 11:
- _context2.prev = 11
- _context2.t0 = _context2['catch'](0)
- case 13:
- case 'end':
- return _context2.stop()
- }
- }
- },
- _callee2,
- null,
- [[0, 11]]
- )
- })
- )()
- },
- onPlay: function onPlay(detail) {
- this.$router.push({
- path: '/videoClassDetail',
- query: { groupId: this.params.groupId, classId: detail.id }
- })
- },
- onBuy: function onBuy() {
- var _this3 = this
- return _asyncToGenerator(
- /*#__PURE__*/ regeneratorRuntime.mark(function _callee4() {
- var userInfo, res, result
- return regeneratorRuntime.wrap(
- function _callee4$(_context4) {
- while (1) {
- switch ((_context4.prev = _context4.next)) {
- case 0:
- _context4.prev = 0
- userInfo = _this3.userInfo
- orderStatus.orderObject.orderType = 'VIDEO'
- orderStatus.orderObject.orderName = '视频课购买'
- orderStatus.orderObject.orderDesc = '视频课购买'
- orderStatus.orderObject.actualPrice =
- userInfo.lessonPrice
- orderStatus.orderObject.recomUserId =
- _this3.recomUserId
- orderStatus.orderObject.orderNo = ''
- orderStatus.orderObject.orderList = [
- {
- orderType: 'VIDEO',
- goodsName: '视频课购买',
- courseGroupId: userInfo.id,
- courseGroupName: userInfo.lessonName,
- coursePrice: userInfo.lessonPrice,
- teacherName:
- userInfo.username ||
- '\u6E38\u5BA2'.concat(
- userInfo.teacherId || ''
- ),
- teacherId: userInfo.teacherId,
- avatar: userInfo.headUrl,
- courseInfo: _this3.detailList,
- recomUserId: _this3.recomUserId
- }
- ] // 判断是否是0无订单
- if (!(userInfo.lessonPrice <= 0)) {
- _context4.next = 13
- break
- }
- _context4.next = 12
- return onSubmitZero(function () {
- Dialog.alert({
- message: '领取成功',
- confirmButtonText: '确定',
- confirmButtonColor: '#01C1B5'
- }).then(function () {
- _this3._init()
- })
- })
- case 12:
- return _context4.abrupt('return')
- case 13:
- _context4.next = 15
- return request.post(
- '/api-student/userOrder/getPendingOrder',
- {
- data: {
- goodType: 'VIDEO',
- bizId: _this3.params.groupId
- }
- }
- )
- case 15:
- res = _context4.sent
- result = res.data
- if (result) {
- Dialog.confirm({
- title: '提示',
- message:
- '您有一个未支付的订单,是否继续支付?',
- confirmButtonColor: '#269a93',
- cancelButtonText: '取消订单',
- confirmButtonText: '继续支付'
- })
- .then(
- /*#__PURE__*/ _asyncToGenerator(
- /*#__PURE__*/ regeneratorRuntime.mark(
- function _callee3() {
- return regeneratorRuntime.wrap(
- function _callee3$(_context3) {
- while (1) {
- switch (
- (_context3.prev =
- _context3.next)
- ) {
- case 0:
- tradeOrder(
- result,
- _this3.routerTo
- )
- case 1:
- case 'end':
- return _context3.stop()
- }
- }
- },
- _callee3
- )
- }
- )
- )
- )
- .catch(function () {
- Dialog.close() // 只用取消订单,不用做其它处理
- _this3.cancelPayment(result.orderNo)
- })
- } else {
- _this3.routerTo()
- }
- _context4.next = 22
- break
- case 20:
- _context4.prev = 20
- _context4.t0 = _context4['catch'](0)
- case 22:
- case 'end':
- return _context4.stop()
- }
- }
- },
- _callee4,
- null,
- [[0, 20]]
- )
- })
- )()
- },
- routerTo: function routerTo() {
- this.$router.push({
- path: '/orderDetail',
- query: {
- orderType: 'VIDEO',
- courseGroupId: this.params.groupId
- }
- })
- },
- cancelPayment: function cancelPayment(orderNo) {
- return _asyncToGenerator(
- /*#__PURE__*/ regeneratorRuntime.mark(function _callee5() {
- return regeneratorRuntime.wrap(
- function _callee5$(_context5) {
- while (1) {
- switch ((_context5.prev = _context5.next)) {
- case 0:
- _context5.prev = 0
- _context5.next = 3
- return request.post(
- '/api-student/userOrder/orderCancel',
- { data: { orderNo: orderNo } }
- )
- case 3:
- _context5.next = 7
- break
- case 5:
- _context5.prev = 5
- _context5.t0 = _context5['catch'](0)
- case 7:
- case 'end':
- return _context5.stop()
- }
- }
- },
- _callee5,
- null,
- [[0, 5]]
- )
- })
- )()
- }
- },
- render: function render() {
- var _this4 = this
- var _slot
- return createVNode('div', { class: [styles['video-detail']] }, [
- createVNode(ColHeader, null, null),
- createVNode(UserDetail, { userInfo: this.userInfo }, null),
- createVNode(
- SectionDetail,
- { border: true },
- {
- default: function _default() {
- return [
- createVNode('p', { class: styles.introduction }, [
- _this4.userInfo.lessonDesc
- ])
- ]
- }
- }
- ),
- createVNode(
- SectionDetail,
- {
- title: '课程列表',
- icon: 'courseList',
- class: 'mb12',
- border: true
- },
- _isSlot(
- (_slot = this.detailList.map(function (item) {
- return createVNode(
- CourseVideoItem,
- {
- class: ['mb12', styles.videoItem],
- detail: {
- id: item.id,
- title: item.videoTitle,
- content: item.videoContent,
- imgUrl: item.coverUrl
- },
- onPlay: _this4.onPlay
- },
- null
- )
- }))
- )
- ? _slot
- : {
- default: function _default() {
- return [_slot]
- }
- }
- ),
- this.userInfo.id &&
- !this.userInfo.alreadyBuy && // <Sticky offsetBottom={0} position="bottom">
- // <div class={['btnGroup', styles.btnMore]}>
- // <Button block round type="primary" onClick={this.onBuy}>
- // {this.userInfo.lessonPrice <= 0 ? '免费领取' : `立即购买`}
- // </Button>
- // </div>
- // </Sticky>
- createVNode(
- ColSticky,
- { position: 'bottom', background: 'white' },
- {
- default: function _default() {
- return [
- createVNode(
- 'div',
- { class: ['btnGroup', styles.btnMore] },
- [
- createVNode(
- Button,
- {
- block: true,
- round: true,
- type: 'primary',
- onClick: _this4.onBuy
- },
- {
- default: function _default() {
- return [
- _this4.userInfo.lessonPrice <= 0
- ? '免费领取'
- : '\u7ACB\u5373\u8D2D\u4E70'
- ]
- }
- }
- )
- ]
- )
- ]
- }
- }
- )
- ])
- }
- })
- )
- }
- }
- }
- )
- })()
|