;(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_q1sek_1 ._introduction_q1sek_1{color:#7a7a7a;line-height:.61333rem;padding-bottom:.21333rem}._video-detail_q1sek_1 .van-tabs__wrap{margin-bottom:.4rem}._video-detail_q1sek_1 ._wxpopup_q1sek_9{width:100%;height:100vh;position:fixed;top:0;left:0;background:rgba(0,0,0,.5);z-index:9999}._video-detail_q1sek_1 ._wxpopup_q1sek_9 img{width:88%;margin:0 6%}\n'
  document.head.appendChild(__vite_style__)
  System.register(
    [
      './icon_discount-legacy.e2eed755.js',
      './share-vip-tips-legacy.2d9caa16.js',
      './wx_bg-legacy.3b62a53a.js',
      './index-legacy.141c974d.js',
      './index-legacy.f9759ffc.js',
      './index-legacy.34e07a99.js',
      './vendor-legacy.09f20d09.js',
      './index-legacy.595c24c3.js',
      './index-legacy.53480b15.js',
      './share-legacy.bdbb3344.js',
      './index-legacy.c75fe8a2.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'
    ],
    function (exports) {
      'use strict'
      var __glob_17_0,
        __glob_17_1,
        __glob_17_2,
        __glob_17_3,
        __glob_17_5,
        __glob_17_4,
        __glob_17_6,
        CourseVideoItem,
        SectionDetail,
        UserDetail,
        defineComponent,
        Dialog,
        createVNode,
        isVNode,
        Button,
        createTextVNode,
        browser,
        state,
        postMessage,
        request,
        ColSticky,
        shareCall,
        qs
      return {
        setters: [
          function (module) {
            __glob_17_0 = module._
            __glob_17_1 = module.c
            __glob_17_2 = module.d
          },
          function (module) {
            __glob_17_3 = module._
            __glob_17_5 = module.a
          },
          function (module) {
            __glob_17_4 = module._
            __glob_17_6 = module.a
          },
          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
            createTextVNode = module.j
          },
          function (module) {
            browser = module.b
            state = module.s
            postMessage = module.p
            request = module.r
          },
          function (module) {
            ColSticky = module.C
          },
          function (module) {
            shareCall = module.s
          },
          function (module) {
            qs = module.q
          },
          function () {},
          function () {},
          function () {},
          function () {},
          function () {},
          function () {},
          function () {}
        ],
        execute: function execute() {
          var introduction = '_introduction_q1sek_1'
          var wxpopup = '_wxpopup_q1sek_9'
          var styles = {
            'video-detail': '_video-detail_q1sek_1',
            introduction: introduction,
            wxpopup: wxpopup
          }
          function _isSlot(s) {
            return (
              typeof s === 'function' ||
              (Object.prototype.toString.call(s) === '[object Object]' &&
                !isVNode(s))
            )
          }
          var getAssetsHomeFile = exports(
            'getAssetsHomeFile',
            function (fileName) {
              var path = '../images/'.concat(fileName)
              var modules = {
                '../images/icon-cert.png': __glob_17_0,
                '../images/icon_discount.png': __glob_17_1,
                '../images/icon_music.png': __glob_17_2,
                '../images/music-share-banner.png': __glob_17_3,
                '../images/share-banner.png': __glob_17_4,
                '../images/share-vip-tips.png': __glob_17_5,
                '../images/wx_bg.png': __glob_17_6
              }
              return modules[path].default
            }
          )
          var index = exports(
            'default',
            defineComponent({
              name: 'VideoDetail',
              data: function data() {
                var query = this.$route.query
                return {
                  userInfo: {},
                  detailList: [],
                  buyUserList: [], // 购买学生数
                  dataShow: true, // 判断是否有数据
                  loading: false,
                  finished: false,
                  recomUserId: query.recomUserId, // 分享人编号
                  params: {
                    videoLessonGroupId: query.groupId,
                    page: 1,
                    rows: 20
                  },
                  wxStatus: false
                }
              },
              created: function created() {
                if (browser().isApp) {
                  if (state.platformType === 'STUDENT') {
                    // 自动跳转到学生端视频课详情购买页
                    window.location.replace(
                      ''
                        .concat(location.origin, '/student/#/videoDetail?')
                        .concat(qs.stringify(this.$route.query))
                    ) // 为了处理andoird webview的跳转问题
                    if (browser().ios) {
                      window.location.replace(
                        ''
                          .concat(location.origin, '/student/#/videoDetail?')
                          .concat(qs.stringify(this.$route.query))
                      )
                    } else {
                      postMessage({
                        api: 'openWebView',
                        content: {
                          url: ''
                            .concat(location.origin, '/student/#/videoDetail?')
                            .concat(qs.stringify(this.$route.query)),
                          orientation: 1,
                          isHideTitle: false
                        }
                      })
                      postMessage({ api: 'back' })
                    } // this.locationReplace(
                    //   `${location.origin}/student/#/videoDetail?${qs.stringify(
                    //     this.$route.query
                    //   )}`
                    // )
                    return
                  } else if (state.platformType === 'TEACHER') {
                    Dialog.alert({
                      title: '提示',
                      message: '请使用酷乐秀学生端扫码打开',
                      confirmButtonColor: '#01C1B5'
                    }).then(function () {
                      postMessage({ api: 'back' })
                    })
                  }
                } else {
                  // 如果不在app里面则不需要唤起操作
                  this.reCall()
                }
              },
              mounted: function mounted() {
                var _this = this
                return _asyncToGenerator(
                  /*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
                    var res, result, _result$videoGroup, lessonGroup, detailList
                    return regeneratorRuntime.wrap(
                      function _callee$(_context) {
                        while (1) {
                          switch ((_context.prev = _context.next)) {
                            case 0:
                              _context.prev = 0
                              _context.next = 3
                              return request.post(
                                '/api-teacher/open/videoShareProfit',
                                {
                                  data: {
                                    bizId: _this.params.videoLessonGroupId,
                                    userId: _this.recomUserId
                                  }
                                }
                              )
                            case 3:
                              res = _context.sent
                              result = res.data || {}
                              ;(_result$videoGroup = result.videoGroup),
                                (lessonGroup = _result$videoGroup.lessonGroup),
                                (detailList = _result$videoGroup.detailList)
                              _this.userInfo = {
                                username: result.name,
                                headUrl: result.avatar,
                                buyNum: lessonGroup.countStudent,
                                lessonNum: lessonGroup.lessonCount,
                                lessonName: lessonGroup.lessonName,
                                lessonDesc: lessonGroup.lessonDesc,
                                lessonPrice: lessonGroup.lessonPrice,
                                lessonCoverUrl: lessonGroup.lessonCoverUrl
                              }
                              _this.detailList = detailList || []
                              _context.next = 12
                              break
                            case 10:
                              _context.prev = 10
                              _context.t0 = _context['catch'](0)
                            case 12:
                            case 'end':
                              return _context.stop()
                          }
                        }
                      },
                      _callee,
                      null,
                      [[0, 10]]
                    )
                  })
                )()
              },
              methods: {
                locationReplace: function locationReplace(url) {
                  // alert(url)
                  if (history.replaceState) {
                    history.replaceState(null, document.title, url)
                    window.location.reload()
                  } else {
                    location.replace(url)
                  }
                },
                reCall: function reCall() {
                  var _location = location,
                    origin = _location.origin
                  var str = origin + '/student/#/videoDetail'
                  var params = this.$route.query
                  str += '?recomUserId='
                    .concat(this.recomUserId, '&groupId=')
                    .concat(params.groupId)
                  console.log(str)
                  shareCall(str, {})
                },
                onShare: function onShare() {
                  if (browser().weixin) {
                    this.wxStatus = true
                    return
                  }
                  this.reCall()
                  setTimeout(function () {
                    window.location.href =
                      location.origin + '/student/#/download'
                  }, 3000)
                }
              },
              render: function render() {
                var _this2 = this
                var _slot
                return createVNode(
                  'div',
                  { class: [styles['video-detail'], 'mb12'] },
                  [
                    createVNode(
                      UserDetail,
                      { userInfo: this.userInfo, showBuy: false },
                      null
                    ),
                    createVNode(
                      SectionDetail,
                      { border: true },
                      {
                        default: function _default() {
                          return [
                            createVNode('p', { class: styles.introduction }, [
                              _this2.userInfo.lessonDesc
                            ])
                          ]
                        }
                      }
                    ),
                    createVNode(
                      SectionDetail,
                      {
                        title: '课程列表',
                        icon: 'courseList',
                        contentStyle: { paddingTop: '0' }
                      },
                      _isSlot(
                        (_slot = this.detailList.map(function (item) {
                          return createVNode(
                            CourseVideoItem,
                            {
                              class: 'mb12',
                              detail: {
                                id: item.id,
                                title: item.videoTitle,
                                content: item.videoContent,
                                imgUrl: item.coverUrl
                              }
                            },
                            null
                          )
                        }))
                      )
                        ? _slot
                        : {
                            default: function _default() {
                              return [_slot]
                            }
                          }
                    ),
                    createVNode(
                      ColSticky,
                      { position: 'bottom' },
                      {
                        default: function _default() {
                          return [
                            createVNode(
                              'div',
                              {
                                class: ['btnGroup'],
                                style: { paddingTop: '12px' }
                              },
                              [
                                createVNode(
                                  Button,
                                  {
                                    block: true,
                                    round: true,
                                    type: 'primary',
                                    onClick: _this2.onShare
                                  },
                                  {
                                    default: function _default() {
                                      return [
                                        createTextVNode(
                                          '\u4E0B\u8F7D\u9177\u4E50\u79C0\u8FDB\u5165\u8BFE\u7A0B'
                                        )
                                      ]
                                    }
                                  }
                                )
                              ]
                            )
                          ]
                        }
                      }
                    ),
                    this.wxStatus &&
                      createVNode(
                        'div',
                        {
                          class: styles.wxpopup,
                          onClick: function onClick() {
                            _this2.wxStatus = false
                          }
                        },
                        [
                          createVNode(
                            'img',
                            { src: getAssetsHomeFile('wx_bg.png'), alt: '' },
                            null
                          )
                        ]
                      )
                  ]
                )
              }
            })
          )
        }
      }
    }
  )
})()
