Commit be09e6ec by FE

pull pre

parent e7071d4f
self.__precacheManifest = [
{
"revision": "ec177fbb9ffe31847056",
"url": "/mrstatic/js/search.0eb73d60.chunk.js"
},
{
"revision": "13541f5d2fc1e1fb3660",
"url": "/mrstatic/js/0.3cda4082.chunk.js"
},
{
"revision": "49b0a41229fb9e0f9ae4",
"url": "/mrstatic/js/BargainMiddlePage.a40b4e11.chunk.js"
},
{
"revision": "185ff973fb6ba6709115b3428b02962b",
"url": "/mrstatic/media/redb_chai_bj.185ff973.png"
},
{
"revision": "c0cd2c92e8312db7e709",
"url": "/mrstatic/js/Classify.3292ccbb.chunk.js"
},
{
"revision": "79139f6aad350256e151f9f73c226348",
"url": "/mrstatic/media/hb_bj.79139f6a.png"
},
{
"revision": "575d5ab8f6d5efe53beb",
"url": "/mrstatic/js/CourseList.2a679f76.chunk.js"
},
{
"revision": "2edb3245777c87e5169d19aea9ea482c",
"url": "/mrstatic/media/redb_money_bj.2edb3245.png"
},
{
"revision": "a907ead4c683dc0d9f9c",
"url": "/mrstatic/js/DrawDocument.49cb2284.chunk.js"
},
{
"revision": "5f30ed5620a93a581089dd0296b90045",
"url": "/mrstatic/media/redb_sp_bj.5f30ed56.png"
},
{
"revision": "4c5bc74d171d536b1821",
"url": "/mrstatic/js/Examination.f4dd23d0.chunk.js"
},
{
"revision": "b9939ca384077a832303",
"url": "/mrstatic/js/MyEdit.f67f1942.chunk.js"
},
{
"revision": "80011994e30adf599e5f47fcc81bc06d",
"url": "/mrstatic/media/progress-share-bg.80011994.png"
},
{
"revision": "3ef15c7f8eb865e0eb13",
"url": "/mrstatic/js/Order.4c0d3f7a.chunk.js"
},
{
"revision": "7d6ca89d0843dad3c5c6",
"url": "/mrstatic/js/Orderinfo.8c52c0e8.chunk.js"
},
{
"revision": "81a489ac63f2f2df5ab412e0782bd54c",
"url": "/mrstatic/media/kanjia_cg_icon.81a489ac.png"
},
{
"revision": "0395b872524875f3c985",
"url": "/mrstatic/js/PayOrder.c8d0a5d0.chunk.js"
},
{
"revision": "f983caa7c06f105373e7e1aec42da261",
"url": "/mrstatic/media/iconfont.f983caa7.svg"
},
{
"revision": "470cf787c42e82e2818d",
"url": "/mrstatic/js/Preferential.e73386ed.chunk.js"
},
{
"revision": "145742789ab409c81f28938b15b5dee7",
"url": "/mrstatic/media/iconfont.14574278.ttf"
},
{
"revision": "0cf59d37a7894cfa7199",
"url": "/mrstatic/js/SearchResult.fb0c9ee6.chunk.js"
},
{
"revision": "cd1c41437a2e35a283e4b16b620a8c9e",
"url": "/mrstatic/media/iconfont.cd1c4143.eot"
},
{
"revision": "39876aa507a3952052bd",
"url": "/mrstatic/js/ShopCart.80f5d8c0.chunk.js"
},
{
"revision": "7b542c778563daa7cc420d21ed1601b3",
"url": "/mrstatic/media/iconfont.7b542c77.woff"
},
{
"revision": "f29813ae140d06cfcd39",
"url": "/mrstatic/js/aist-share.6dec7cef.chunk.js"
},
{
"revision": "1fe364ec5930912d1e03",
"url": "/mrstatic/js/33.4ff46866.chunk.js"
},
{
"revision": "b7ea4d4fd8d2d6719b63",
"url": "/mrstatic/js/coupons.fb8c16d0.chunk.js"
},
{
"revision": "74a3906bdd2c19ab0bc1",
"url": "/mrstatic/js/32.e01b776d.chunk.js"
},
{
"revision": "9c9f183249047d66170c",
"url": "/mrstatic/js/detail.b50d4a72.chunk.js"
},
{
"revision": "d42aa9478b940a74c102",
"url": "/mrstatic/js/31.e296385a.chunk.js"
},
{
"revision": "ce71b91477e8f28df608",
"url": "/mrstatic/js/main.60047f99.chunk.js"
},
{
"revision": "e9f572645903ce4a6ac0",
"url": "/mrstatic/js/30.9afd74d0.chunk.js"
},
{
"revision": "96e07414e718169ae4de",
"url": "/mrstatic/js/myorders.c1f7d4c9.chunk.js"
},
{
"revision": "b28abdf226bce6ffa6cd",
"url": "/mrstatic/js/29.f9c030b0.chunk.js"
},
{
"revision": "ca24eb8c2426cfcbabf6",
"url": "/mrstatic/js/purchased.f3669f4d.chunk.js"
},
{
"revision": "b0ed92ee7dfc91404590",
"url": "/mrstatic/js/runtime~main.42bb94d1.js"
},
{
"revision": "eb37f929b5f0d3353971",
"url": "/mrstatic/js/28.dedffa79.chunk.js"
},
{
"revision": "2f2dc3bfb5944bea91bd",
"url": "/mrstatic/js/27.a7aed5c1.chunk.js"
},
{
"revision": "07ee7fab8ac3d646fabf",
"url": "/mrstatic/js/26.56aeff83.chunk.js"
},
{
"revision": "dd814b9262cfe84fdbb5",
"url": "/mrstatic/js/shareposter.e3f17ca8.chunk.js"
},
{
"revision": "bd63c98eba803f975299",
"url": "/mrstatic/js/25.ecc6bb40.chunk.js"
},
{
"revision": "7f445b1054bc1c98887d",
"url": "/mrstatic/js/study.1cb7890b.chunk.js"
},
{
"revision": "3493b94fb4dd8231f74e",
"url": "/mrstatic/js/video.66ebe392.chunk.js"
},
{
"revision": "17d19e30945200c73c53",
"url": "/mrstatic/js/togroup.d928bd20.chunk.js"
},
{
"revision": "74a3906bdd2c19ab0bc1",
"url": "/mrstatic/css/32.8046fb41.chunk.css"
},
{
"revision": "3493b94fb4dd8231f74e",
"url": "/mrstatic/css/video.7340509f.chunk.css"
},
{
"revision": "9c9f183249047d66170c",
"url": "/mrstatic/css/detail.7bd3b531.chunk.css"
},
{
"revision": "bd63c98eba803f975299",
"url": "/mrstatic/css/25.2821b463.chunk.css"
},
{
"revision": "dd814b9262cfe84fdbb5",
"url": "/mrstatic/css/shareposter.76774ba4.chunk.css"
},
{
"revision": "2f2dc3bfb5944bea91bd",
"url": "/mrstatic/css/27.c76b300d.chunk.css"
},
{
"revision": "49b0a41229fb9e0f9ae4",
"url": "/mrstatic/css/BargainMiddlePage.417c8635.chunk.css"
},
{
"revision": "eb37f929b5f0d3353971",
"url": "/mrstatic/css/28.bff100af.chunk.css"
},
{
"revision": "ec177fbb9ffe31847056",
"url": "/mrstatic/css/search.5716d9b3.chunk.css"
},
{
"revision": "b28abdf226bce6ffa6cd",
"url": "/mrstatic/css/29.820320a6.chunk.css"
},
{
"revision": "ca24eb8c2426cfcbabf6",
"url": "/mrstatic/css/purchased.19e06a3f.chunk.css"
},
{
"revision": "e9f572645903ce4a6ac0",
"url": "/mrstatic/css/30.bf839917.chunk.css"
},
{
"revision": "96e07414e718169ae4de",
"url": "/mrstatic/css/myorders.67814bde.chunk.css"
},
{
"revision": "d42aa9478b940a74c102",
"url": "/mrstatic/css/31.35e22f8c.chunk.css"
},
{
"revision": "ce71b91477e8f28df608",
"url": "/mrstatic/css/main.b81f5cd5.chunk.css"
},
{
"revision": "17d19e30945200c73c53",
"url": "/mrstatic/css/togroup.f08bc5f3.chunk.css"
},
{
"revision": "7f445b1054bc1c98887d",
"url": "/mrstatic/css/study.e132441c.chunk.css"
},
{
"revision": "1fe364ec5930912d1e03",
"url": "/mrstatic/css/33.df59157b.chunk.css"
},
{
"revision": "b7ea4d4fd8d2d6719b63",
"url": "/mrstatic/css/coupons.fed0df3b.chunk.css"
},
{
"revision": "f29813ae140d06cfcd39",
"url": "/mrstatic/css/aist-share.a97e13d0.chunk.css"
},
{
"revision": "39876aa507a3952052bd",
"url": "/mrstatic/css/ShopCart.92ab48a3.chunk.css"
},
{
"revision": "0cf59d37a7894cfa7199",
"url": "/mrstatic/css/SearchResult.00f99b61.chunk.css"
},
{
"revision": "470cf787c42e82e2818d",
"url": "/mrstatic/css/Preferential.0c91fa43.chunk.css"
},
{
"revision": "0395b872524875f3c985",
"url": "/mrstatic/css/PayOrder.7eb7d317.chunk.css"
},
{
"revision": "3ef15c7f8eb865e0eb13",
"url": "/mrstatic/css/Order.c0945477.chunk.css"
},
{
"revision": "4c5bc74d171d536b1821",
"url": "/mrstatic/css/Examination.7bb0622b.chunk.css"
},
{
"revision": "a907ead4c683dc0d9f9c",
"url": "/mrstatic/css/DrawDocument.aeb3f822.chunk.css"
},
{
"revision": "575d5ab8f6d5efe53beb",
"url": "/mrstatic/css/CourseList.7b6f3dd7.chunk.css"
},
{
"revision": "c0cd2c92e8312db7e709",
"url": "/mrstatic/css/Classify.fb4bedde.chunk.css"
},
{
"revision": "8f1975ccc071f804bae72bca4f3977ee",
"url": "/index.html"
}
];
\ No newline at end of file
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js"); importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");
importScripts( importScripts(
"/precache-manifest.6105b22c9641cce5c08a9b994cd76caa.js" "/precache-manifest.9c17975beaeeab7dcfbdcb9aafc283c6.js"
); );
workbox.clientsClaim(); workbox.clientsClaim();
......
import React, { Component } from 'react' import React, {Component} from 'react'
import './bargain-middle-page.scss' import './bargain-middle-page.scss'
import { HeaderBar, VList } from '@common' import {HeaderBar, VList} from '@common'
import { Course } from '@common' import {Course} from '@common'
import {api, getParam, http, browser, wxShare} from "@/utils" import {api, getParam, http, browser, wxShare} from "@/utils"
import { Toast } from "antd-mobile" import {Toast} from "antd-mobile"
import { Link, withRouter } from "react-router-dom" import {Link, withRouter} from "react-router-dom"
import Ranking from './ranking' import Ranking from './ranking'
import { differenceInSeconds, differenceInMinutes, differenceInHours, differenceInDays } from "date-fns" import {differenceInSeconds, differenceInMinutes, differenceInHours, differenceInDays} from "date-fns"
import Overlay from '../detail/overlay' import Overlay from '../detail/overlay'
import { compose } from "redux" import {compose} from "redux"
import { connect } from "react-redux"; import {connect} from "react-redux";
import {getCourses} from './../detail/actions'; import {getCourses} from './../detail/actions';
import classnames from 'classnames'; import classnames from 'classnames';
...@@ -54,6 +54,17 @@ class BargainMiddlePage extends Component { ...@@ -54,6 +54,17 @@ class BargainMiddlePage extends Component {
this.getBargainInfo() this.getBargainInfo()
} }
componentDidUpdate(prevProps) {
let {user} = this.props
let {user: prevUser} = prevProps
if(!user.hasError && user.hasError !== prevUser.hasError){
this.getBargainRankList(getParam('id'), 1)
this.getBargainCourse()
this.getBargainInfo()
}
}
// 获取砍价信息 // 获取砍价信息
getBargainInfo = () => { getBargainInfo = () => {
...@@ -130,6 +141,7 @@ class BargainMiddlePage extends Component { ...@@ -130,6 +141,7 @@ class BargainMiddlePage extends Component {
list: res.data.data.list, list: res.data.data.list,
outList: newList outList: newList
}) })
} else if (res.data.code == 4030 || res.data.code == 4040) {
} else { } else {
Toast.info(res.data.msg, 2) Toast.info(res.data.msg, 2)
} }
...@@ -157,7 +169,7 @@ class BargainMiddlePage extends Component { ...@@ -157,7 +169,7 @@ class BargainMiddlePage extends Component {
// }) // })
} }
// 我要砍价列表的去支付 // 我要砍价列表的去支付
toCartBottom=(id)=>{ toCartBottom = (id) => {
http.get(`${API['base-api']}/m/cart/addtopreorder/[${id}]`).then((res) => { http.get(`${API['base-api']}/m/cart/addtopreorder/[${id}]`).then((res) => {
if (res.data.errno === 0) { if (res.data.errno === 0) {
this.props.history.push(`/order?id=[${getParam('id')}]`, {bargain: 1}); this.props.history.push(`/order?id=[${getParam('id')}]`, {bargain: 1});
...@@ -262,6 +274,18 @@ class BargainMiddlePage extends Component { ...@@ -262,6 +274,18 @@ class BargainMiddlePage extends Component {
this.getBargainInfo() this.getBargainInfo()
} else if (res.data.code == 4030 || res.data.code == 4040) {
if (browser.isWeixin) {
let redirectURI = window.location.href
if (redirectURI.includes('code=') && redirectURI.includes('state=STATE')) {
let index = redirectURI.lastIndexOf('code=');
redirectURI = redirectURI.substr(0, index - 1);
}
window.location.assign(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx23dac6775ac82877&redirect_uri=${encodeURIComponent(redirectURI)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`)
} else {
this.props.history.push('/passport')
}
} else { } else {
Toast.info(res.data.msg, 2) Toast.info(res.data.msg, 2)
} }
...@@ -305,10 +329,10 @@ class BargainMiddlePage extends Component { ...@@ -305,10 +329,10 @@ class BargainMiddlePage extends Component {
} }
toCourseDetail = (id) => { toCourseDetail = (id) => {
const { dispatch, history } = this.props; const {dispatch, history} = this.props;
// dispatch(getCourses(id, () => { // dispatch(getCourses(id, () => {
history.push(`/detail?id=${id}`); history.push(`/detail?id=${id}`);
return false; return false;
// })); // }));
} }
...@@ -355,10 +379,10 @@ class BargainMiddlePage extends Component { ...@@ -355,10 +379,10 @@ class BargainMiddlePage extends Component {
<VList <VList
img={this.state.course.course_img} img={this.state.course.course_img}
info={ info={
<CourseDes <CourseDes
isOriginator={this.state.isOriginator} isOriginator={this.state.isOriginator}
data={this.state.data} data={this.state.data}
toCart={this.toCart}/> toCart={this.toCart}/>
} }
/> />
</ul> </ul>
...@@ -457,11 +481,11 @@ class BargainMiddlePage extends Component { ...@@ -457,11 +481,11 @@ class BargainMiddlePage extends Component {
title={item.course_title} title={item.course_title}
toDetail={this.toCourseDetail} toDetail={this.toCourseDetail}
bottom={ bottom={
<CourseBottom <CourseBottom
item={item} item={item}
toCartBottom={this.toCartBottom.bind(this,item.course_id)} toCartBottom={this.toCartBottom.bind(this, item.course_id)}
toDetail={this.toCourseDetail} toDetail={this.toCourseDetail}
/> />
} }
/> />
}) })
...@@ -567,7 +591,8 @@ function CourseBottom(props) { ...@@ -567,7 +591,8 @@ function CourseBottom(props) {
// Buttons = <Link to={`/detail?id=${props.item.course_id}`} className={'bargain'}>我要砍价</Link> // Buttons = <Link to={`/detail?id=${props.item.course_id}`} className={'bargain'}>我要砍价</Link>
Buttons = <a onClick={() => props.toDetail(props.item.course_id)} className={'bargain bargian-study'}>我要砍价</a> Buttons = <a onClick={() => props.toDetail(props.item.course_id)} className={'bargain bargian-study'}>我要砍价</a>
} else if (props.item.bargain_status === 3) { } else if (props.item.bargain_status === 3) {
Buttons = <Link to={`/play/video?id=${props.item.v_course_id}`} className={classnames('bargain', 'button--study')}>去学习</Link> Buttons = <Link to={`/play/video?id=${props.item.v_course_id}`}
className={classnames('bargain', 'button--study')}>去学习</Link>
} else { } else {
Buttons = ( Buttons = (
<div className="btns"> <div className="btns">
......
import React, {Component} from 'react' import React, { Component } from 'react'
import {WingBlank} from 'antd-mobile' import { WingBlank } from 'antd-mobile'
import './index.scss' import './index.scss'
import {api, getParam, http} from "@/utils" import { getParam, http } from "@/utils"
// 课程页面滚动广告 // 课程页面滚动广告
class Carouselw extends Component { class Barrage extends Component {
timer timer
barageTimer barageTimer
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
...@@ -26,10 +27,9 @@ class Carouselw extends Component { ...@@ -26,10 +27,9 @@ class Carouselw extends Component {
] ]
const now = new Date(Date.now()).getHours() const now = new Date(Date.now()).getHours()
for (let period of periods) { for (let period of periods) {
if(now >= period.start && now <= period.end){ if (now >= period.start && now <= period.end) {
this.timer = setTimeout(() => { this.timer = setTimeout(() => {
this.getList() this.getList()
this.setupBarrage()
}, period.interval) }, period.interval)
break break
} }
...@@ -39,9 +39,11 @@ class Carouselw extends Component { ...@@ -39,9 +39,11 @@ class Carouselw extends Component {
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
const {isShow} = this.props const {isShow} = this.props
const {isShow: prevIsShow} = prevProps const {isShow: prevIsShow} = prevProps
if(prevIsShow !== isShow && isShow !== undefined){ if (prevIsShow !== isShow && isShow !== undefined) {
if(isShow){ if (isShow) {
this.setupBarrage() setTimeout(() => {
this.getList()
}, 5000)
} }
this.componentDidUpdate = null this.componentDidUpdate = null
} }
...@@ -66,6 +68,7 @@ class Carouselw extends Component { ...@@ -66,6 +68,7 @@ class Carouselw extends Component {
}, () => { }, () => {
this.barageTimer = setTimeout(() => { this.barageTimer = setTimeout(() => {
this.setState({isShowBarrage: !this.state.isShowBarrage}) this.setState({isShowBarrage: !this.state.isShowBarrage})
this.setupBarrage()
}, 5000) }, 5000)
}); });
} }
...@@ -84,7 +87,7 @@ class Carouselw extends Component { ...@@ -84,7 +87,7 @@ class Carouselw extends Component {
</div> </div>
} }
</div> </div>
{/* {/*
<Carousel className="my-carousel" <Carousel className="my-carousel"
vertical vertical
dots={false} dots={false}
...@@ -106,4 +109,4 @@ class Carouselw extends Component { ...@@ -106,4 +109,4 @@ class Carouselw extends Component {
} }
} }
export default Carouselw export default Barrage
\ No newline at end of file \ No newline at end of file
...@@ -75,6 +75,7 @@ class Video extends Component { ...@@ -75,6 +75,7 @@ class Video extends Component {
previousPlaybackRate = 1 previousPlaybackRate = 1
currentPlaybackRate = 1 currentPlaybackRate = 1
reconnect = true reconnect = true
timeEnough = false
recordSocket recordSocket
recordTimer recordTimer
...@@ -381,12 +382,24 @@ class Video extends Component { ...@@ -381,12 +382,24 @@ class Video extends Component {
}) })
this.ws.addEventListener('message', e => { this.ws.addEventListener('message', e => {
const data = JSON.parse(e.data); const data = JSON.parse(e.data);
data.code == 4040 && (this.reconnect = false) data.code == 4040 && (this.reconnect = false);
data.code == 5001 && (this.timeEnough = true);
}) })
} }
sendMessage = message => { sendMessage = message => {
this.ws && this.ws.send(JSON.stringify(message)) let readyState = this.ws.readyState, _this = this;
if(readyState === 1) {
this.ws && this.ws.send(JSON.stringify(message))
}else if(readyState === 3) {
this.ws.close();
this.ws = null;
let reconnect = setTimeout(function() {
clearTimeout(reconnect);
reconnect = null;
_this.ws = new WebSocket(PROCESS_URL);
}, 500);
}
} }
//视频结束请求接口 //视频结束请求接口
...@@ -407,6 +420,11 @@ class Video extends Component { ...@@ -407,6 +420,11 @@ class Video extends Component {
console.log('免费课程 拦截'); console.log('免费课程 拦截');
return; return;
} }
// 时间足够不发送
if(this.timeEnough) {
console.log('5001 时间足够');
return;
}
if(course.is_aist) { if(course.is_aist) {
// 返现课程 // 返现课程
this.sendMessage({ this.sendMessage({
...@@ -441,6 +459,11 @@ class Video extends Component { ...@@ -441,6 +459,11 @@ class Video extends Component {
if(Number(sec) === 0) { if(Number(sec) === 0) {
return; return;
} }
// 时间足够不发送
if(this.timeEnough) {
console.log('5001 时间足够');
return;
}
let info_type = 'c_watch_time'; let info_type = 'c_watch_time';
if(course.is_aist) { if(course.is_aist) {
info_type = 'watch_time'; info_type = 'watch_time';
...@@ -454,7 +477,7 @@ class Video extends Component { ...@@ -454,7 +477,7 @@ class Video extends Component {
v_course_id: vCourseId, v_course_id: vCourseId,
uid: this.props.user.data.uid, uid: this.props.user.data.uid,
token: this.token, token: this.token,
platform: 0 platform: 5
}) })
} }
...@@ -501,9 +524,13 @@ class Video extends Component { ...@@ -501,9 +524,13 @@ class Video extends Component {
this.previousPlaybackRate = this.currentPlaybackRate this.previousPlaybackRate = this.currentPlaybackRate
}) })
this.player.on('ended', () => { this.player.on('ended', () => {
console.log('ended');
this.sendWatchTime(this.watchSec, this.currentPlaybackRate) this.sendWatchTime(this.watchSec, this.currentPlaybackRate)
this.countSchedule(); // 计算进度 this.countSchedule(); // 计算进度
this.getShareProgressInfo() // 返现课程才出现打卡记录
if(this.state.course.is_aist) {
this.getShareProgressInfo()
}
clearInterval(this.timer) clearInterval(this.timer)
}) })
this.player.on('seeked', () => { this.player.on('seeked', () => {
...@@ -534,7 +561,7 @@ class Video extends Component { ...@@ -534,7 +561,7 @@ class Video extends Component {
if (index === this.state.activeIndex) { if (index === this.state.activeIndex) {
return return
} }
console.log('selectVideo');
this.countSchedule(); // 计算进度 this.countSchedule(); // 计算进度
this.setState( this.setState(
...@@ -592,9 +619,15 @@ class Video extends Component { ...@@ -592,9 +619,15 @@ class Video extends Component {
if (Number(course.course_id) === 0 || course.course_id === '') { if (Number(course.course_id) === 0 || course.course_id === '') {
console.log('免费课程 拦截'); console.log('免费课程 拦截');
}else{ }else{
let _this = this;
this.setupWS(); this.setupWS();
this.setupTimer(); this.setupTimer();
this.countSchedule(); console.log('playSetup');
let scheduleTime = setTimeout(function () {
clearTimeout(scheduleTime);
scheduleTime = null;
_this.countSchedule();
}, 1000);
} }
let index = this.getLastVideoIndex(course.last_video_id); let index = this.getLastVideoIndex(course.last_video_id);
index = index >= 0 ? index : 0; index = index >= 0 ? index : 0;
......
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