Commit e07c2fe5 by zhanghaozhe

跳转分享落地页

parent 20a31c99
import React, {Component} from 'react' import React, { Component } from 'react'
import HeaderBar from '@/common/HeaderBar' import HeaderBar from '@/common/HeaderBar'
import './video.scss' import './video.scss'
import { NavLink, Route, Redirect, Switch } from 'react-router-dom' import { NavLink, Route, Redirect, Switch, Link } from 'react-router-dom'
import { http, getParam } from '@/utils' import { http, getParam } from '@/utils'
import Recommendation from './recommendation' import Recommendation from './recommendation'
import VideoCatalog from './video-catalog' import VideoCatalog from './video-catalog'
import DatumCatalog from './datum-catalog' import DatumCatalog from './datum-catalog'
import {Toast} from 'antd-mobile' import { Toast } from 'antd-mobile'
import videojs from 'video.js' import videojs from 'video.js'
import 'video.js/dist/video-js.min.css' import 'video.js/dist/video-js.min.css'
import {Modal} from "antd-mobile" import { Modal } from "antd-mobile"
import {Loading} from '@/common' import { Loading } from '@/common'
import {connect} from "react-redux" import { connect } from "react-redux"
import jsCookie from 'js-cookie' import jsCookie from 'js-cookie'
import io from 'socket.io-client' import io from 'socket.io-client'
import Single from "@/components/detail/single"; import Single from "@/components/detail/single";
...@@ -19,6 +19,7 @@ import Single from "@/components/detail/single"; ...@@ -19,6 +19,7 @@ import Single from "@/components/detail/single";
let alert = Modal.alert let alert = Modal.alert
function ProgressShareModal(props) { function ProgressShareModal(props) {
console.log(props.data.url);
return ( return (
props.isShow && props.isShow &&
<div className='progress-share-modal-wrapper'> <div className='progress-share-modal-wrapper'>
...@@ -39,12 +40,16 @@ function ProgressShareModal(props) { ...@@ -39,12 +40,16 @@ function ProgressShareModal(props) {
<div className="title">分享到</div> <div className="title">分享到</div>
<ul> <ul>
<li className='share-icon'> <li className='share-icon'>
<div className="icon"><i className='iconfont iconweixinzhifu'></i></div> <a style={{display: 'block'}} href={props.data.url}>
<div className='text'>微信好友</div> <div className="icon"><i className='iconfont iconweixinzhifu'/></div>
<div className='text'>微信好友</div>
</a>
</li> </li>
<li className='share-icon'> <li className='share-icon'>
<div className="icon"><i className='iconfont iconpengyouquaniconx'></i></div> <a style={{display: 'block'}} href={props.data.url}>
<div className='text'>朋友圈</div> <div className="icon"><i className='iconfont iconpengyouquaniconx'/></div>
<div className='text'>朋友圈</div>
</a>
</li> </li>
</ul> </ul>
</div> </div>
...@@ -96,7 +101,7 @@ class Video extends Component { ...@@ -96,7 +101,7 @@ class Video extends Component {
componentDidMount() { componentDidMount() {
this.courseID = getParam('id') this.courseID = getParam('id')
if(!this.courseID){ if (!this.courseID) {
this.props.history.replace('/') this.props.history.replace('/')
return return
} }
...@@ -311,7 +316,7 @@ class Video extends Component { ...@@ -311,7 +316,7 @@ class Video extends Component {
activeIndex: index activeIndex: index
}, },
() => { () => {
if(this.hasAuth()){ if (this.hasAuth()) {
this.setPlayerSrc(this.state.videoList[index]['play_url']) this.setPlayerSrc(this.state.videoList[index]['play_url'])
this.sendLastRecord() this.sendLastRecord()
this.playVideo() this.playVideo()
...@@ -377,7 +382,7 @@ class Video extends Component { ...@@ -377,7 +382,7 @@ class Video extends Component {
} }
setPlayerSrc = src => { setPlayerSrc = src => {
if(!this.player){ if (!this.player) {
this.initializePlayer() this.initializePlayer()
} }
this.player.src({ this.player.src({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment