Commit d617a11f by xuzhenghua

e

parent 4a180e48
self.__precacheManifest = [
{
"revision": "77ec57dd9b7b6e20f1f7",
"url": "/mrstatic/js/search.e1881957.chunk.js"
},
{
"revision": "a9ef0fb43dd748967bda",
"url": "/mrstatic/js/0.aef3cf26.chunk.js"
},
{
"revision": "de62aba8eb390a0e879a",
"url": "/mrstatic/js/BargainMiddlePage.f5bb0d59.chunk.js"
},
{
"revision": "8edaf2ff2566ed17e2dd22cf4f8ad7ae",
"url": "/mrstatic/media/redb_chai_bj@2x.8edaf2ff.png"
},
{
"revision": "da4c5b9c52d373ead12b",
"url": "/mrstatic/js/Classify.914a8251.chunk.js"
},
{
"revision": "c79abf5cb7ae8a82009cf68fe44d1078",
"url": "/mrstatic/media/redb_money_bj@2x.c79abf5c.png"
},
{
"revision": "a999eb7686c310c7ecd7",
"url": "/mrstatic/js/CourseList.ab1190ce.chunk.js"
},
{
"revision": "6902434f8f18a23319d57d0ac8aaea8c",
"url": "/mrstatic/media/redb_sp_bj@2x.6902434f.png"
},
{
"revision": "e82fbe8c3278f95eb101",
"url": "/mrstatic/js/DrawDocument.7730f3de.chunk.js"
},
{
"revision": "79139f6aad350256e151f9f73c226348",
"url": "/mrstatic/media/hb_bj.79139f6a.png"
},
{
"revision": "c909d0b78fa7f27cd2d7",
"url": "/mrstatic/js/Examination.df98c5b3.chunk.js"
},
{
"revision": "2f84d5508b8afa2dac0e",
"url": "/mrstatic/js/MyEdit.30ed911f.chunk.js"
},
{
"revision": "80011994e30adf599e5f47fcc81bc06d",
"url": "/mrstatic/media/progress-share-bg.80011994.png"
},
{
"revision": "6c8b5e269249316d8573",
"url": "/mrstatic/js/Order.c77bf267.chunk.js"
},
{
"revision": "8e131e92a3d484c570d2",
"url": "/mrstatic/js/Orderinfo.eaea6ad9.chunk.js"
},
{
"revision": "81a489ac63f2f2df5ab412e0782bd54c",
"url": "/mrstatic/media/kanjia_cg_icon.81a489ac.png"
},
{
"revision": "48bf7a978aee321aaf62",
"url": "/mrstatic/js/PayOrder.c0854efc.chunk.js"
},
{
"revision": "f983caa7c06f105373e7e1aec42da261",
"url": "/mrstatic/media/iconfont.f983caa7.svg"
},
{
"revision": "fd8433a5044a99f024ac",
"url": "/mrstatic/js/Preferential.c92167d3.chunk.js"
},
{
"revision": "145742789ab409c81f28938b15b5dee7",
"url": "/mrstatic/media/iconfont.14574278.ttf"
},
{
"revision": "7a83eae82a30deb3638a",
"url": "/mrstatic/js/SearchResult.0c0c9343.chunk.js"
},
{
"revision": "cd1c41437a2e35a283e4b16b620a8c9e",
"url": "/mrstatic/media/iconfont.cd1c4143.eot"
},
{
"revision": "f0cf90f514d5e6da0030",
"url": "/mrstatic/js/ShopCart.4c2987b1.chunk.js"
},
{
"revision": "7b542c778563daa7cc420d21ed1601b3",
"url": "/mrstatic/media/iconfont.7b542c77.woff"
},
{
"revision": "8d4fa98741a43b92d467",
"url": "/mrstatic/js/aist-share.ca8ee328.chunk.js"
},
{
"revision": "e6795a3dc4e414db9d5f",
"url": "/mrstatic/js/33.9869dd21.chunk.js"
},
{
"revision": "74bde9fd476c8eb4d3f4",
"url": "/mrstatic/js/coupons.d1a2510b.chunk.js"
},
{
"revision": "88a034d5fe29124ef41d",
"url": "/mrstatic/js/32.0e3712aa.chunk.js"
},
{
"revision": "5c74c002afa5976fedad",
"url": "/mrstatic/js/detail.85ffa494.chunk.js"
},
{
"revision": "deeaf6164c442e8cf2bb",
"url": "/mrstatic/js/31.66e2dea5.chunk.js"
},
{
"revision": "f05e6dba707ae1699a1d",
"url": "/mrstatic/js/main.4086b526.chunk.js"
},
{
"revision": "9105b19a74cb68a48004",
"url": "/mrstatic/js/30.58628dcc.chunk.js"
},
{
"revision": "bcb23b865678f9e65d12",
"url": "/mrstatic/js/myorders.328b8a1a.chunk.js"
},
{
"revision": "8a11abae4a8306952d79",
"url": "/mrstatic/js/29.cddce484.chunk.js"
},
{
"revision": "ff63d278ac912e9e7a66",
"url": "/mrstatic/js/purchased.bd243498.chunk.js"
},
{
"revision": "4731025fd1f5d2b28e7b",
"url": "/mrstatic/js/runtime~main.b6d922e4.js"
},
{
"revision": "6d70c0121fc329e49b58",
"url": "/mrstatic/js/28.a684e5c7.chunk.js"
},
{
"revision": "19f589443d3f9529c604",
"url": "/mrstatic/js/27.4948c8d6.chunk.js"
},
{
"revision": "c0cc6176b0423c03a2e5",
"url": "/mrstatic/js/26.b2e8d558.chunk.js"
},
{
"revision": "b7d57349c471562e76c5",
"url": "/mrstatic/js/shareposter.1e04a897.chunk.js"
},
{
"revision": "660d0d9314688d035bf1",
"url": "/mrstatic/js/25.9c12d055.chunk.js"
},
{
"revision": "1eb412596fb9bdce1266",
"url": "/mrstatic/js/study.08722869.chunk.js"
},
{
"revision": "b9c4a28f55c083c1db97",
"url": "/mrstatic/js/video.8f038845.chunk.js"
},
{
"revision": "f5caca41afe2d4a2eb85",
"url": "/mrstatic/js/togroup.03b425a3.chunk.js"
},
{
"revision": "88a034d5fe29124ef41d",
"url": "/mrstatic/css/32.278ad3b1.chunk.css"
},
{
"revision": "b9c4a28f55c083c1db97",
"url": "/mrstatic/css/video.b57a1aec.chunk.css"
},
{
"revision": "5c74c002afa5976fedad",
"url": "/mrstatic/css/detail.4c28ce89.chunk.css"
},
{
"revision": "660d0d9314688d035bf1",
"url": "/mrstatic/css/25.aebbab68.chunk.css"
},
{
"revision": "b7d57349c471562e76c5",
"url": "/mrstatic/css/shareposter.f09a5959.chunk.css"
},
{
"revision": "19f589443d3f9529c604",
"url": "/mrstatic/css/27.4c706a4e.chunk.css"
},
{
"revision": "de62aba8eb390a0e879a",
"url": "/mrstatic/css/BargainMiddlePage.718dff83.chunk.css"
},
{
"revision": "6d70c0121fc329e49b58",
"url": "/mrstatic/css/28.2471f477.chunk.css"
},
{
"revision": "77ec57dd9b7b6e20f1f7",
"url": "/mrstatic/css/search.fab97849.chunk.css"
},
{
"revision": "8a11abae4a8306952d79",
"url": "/mrstatic/css/29.0bb224f2.chunk.css"
},
{
"revision": "ff63d278ac912e9e7a66",
"url": "/mrstatic/css/purchased.1daf107b.chunk.css"
},
{
"revision": "9105b19a74cb68a48004",
"url": "/mrstatic/css/30.5ed15c7e.chunk.css"
},
{
"revision": "bcb23b865678f9e65d12",
"url": "/mrstatic/css/myorders.3ae12dec.chunk.css"
},
{
"revision": "deeaf6164c442e8cf2bb",
"url": "/mrstatic/css/31.ecbb6f9a.chunk.css"
},
{
"revision": "f05e6dba707ae1699a1d",
"url": "/mrstatic/css/main.649a5c2d.chunk.css"
},
{
"revision": "f5caca41afe2d4a2eb85",
"url": "/mrstatic/css/togroup.49988cae.chunk.css"
},
{
"revision": "1eb412596fb9bdce1266",
"url": "/mrstatic/css/study.5e9927d1.chunk.css"
},
{
"revision": "e6795a3dc4e414db9d5f",
"url": "/mrstatic/css/33.03fe7b57.chunk.css"
},
{
"revision": "74bde9fd476c8eb4d3f4",
"url": "/mrstatic/css/coupons.de0ae9dc.chunk.css"
},
{
"revision": "8d4fa98741a43b92d467",
"url": "/mrstatic/css/aist-share.bef8c404.chunk.css"
},
{
"revision": "f0cf90f514d5e6da0030",
"url": "/mrstatic/css/ShopCart.3a4dbb7a.chunk.css"
},
{
"revision": "7a83eae82a30deb3638a",
"url": "/mrstatic/css/SearchResult.2649d43f.chunk.css"
},
{
"revision": "fd8433a5044a99f024ac",
"url": "/mrstatic/css/Preferential.cda7a495.chunk.css"
},
{
"revision": "48bf7a978aee321aaf62",
"url": "/mrstatic/css/PayOrder.e5315535.chunk.css"
},
{
"revision": "6c8b5e269249316d8573",
"url": "/mrstatic/css/Order.8bb031ea.chunk.css"
},
{
"revision": "c909d0b78fa7f27cd2d7",
"url": "/mrstatic/css/Examination.f2cc3163.chunk.css"
},
{
"revision": "e82fbe8c3278f95eb101",
"url": "/mrstatic/css/DrawDocument.2e7d81ca.chunk.css"
},
{
"revision": "a999eb7686c310c7ecd7",
"url": "/mrstatic/css/CourseList.c0829f24.chunk.css"
},
{
"revision": "da4c5b9c52d373ead12b",
"url": "/mrstatic/css/Classify.f2f19957.chunk.css"
},
{
"revision": "c0588af28a992a0b90cf70fe26505455",
"url": "/index.html"
}
];
\ No newline at end of file
import React, {Component} from 'react'
import React, { Component } from 'react'
import Routes from './router'
import cookie from 'js-cookie'
import {connect} from "react-redux";
import {setCurrentUser, startFetchUser} from "@/store/userAction";
import {withRouter} from 'react-router-dom'
import {compose} from 'redux'
import {getParam, http, browser} from "@/utils";
import {Toast} from "antd-mobile";
import {addDays} from 'date-fns'
import { connect } from "react-redux";
import { setCurrentUser, startFetchUser } from "@/store/userAction";
import { withRouter } from 'react-router-dom'
import { compose } from 'redux'
import { getParam, http, browser } from "@/utils";
import { Toast } from "antd-mobile";
import { addDays } from 'date-fns'
//拦截ajax请求,返回mock数据
......@@ -70,12 +70,18 @@ class App extends Component {
return
}
location.state = {from: this.previousLocation};
} else {
this.removeShareCodeCookie()
}
})
}
removeShareCodeCookie = () => {
cookie.remove('share_code', {path: '/', domain: '.julyedu.com'})
}
setNavigationRecord = (location) => {
let {location: _location} = this.props
let {state: _state = {}} = _location
......@@ -165,6 +171,8 @@ class App extends Component {
transformUser = res => {
let payload
if (res.data.code === 200) {
//移除红包统计cookie
this.removeShareCodeCookie()
const {
msg, data: {
avatar_file: avatar,
......@@ -200,6 +208,8 @@ class App extends Component {
transformWxUser = res => {
let data = res.data
if (data.errno == 200) {
//移除红包统计cookie
this.removeShareCodeCookie()
let {uid, token, avatar_file: avatar, uname: username,} = data.data
return {
......
......@@ -214,6 +214,16 @@ class BtnStatus extends Component {
}
}
// 开始学习
toStudy=(vCourseId,isHaveVideo)=>{
const { history } = this.props;
if(isHaveVideo == 0){
Toast.info('尚未开课,开课后立即上传课程~', 2)
} else {
history.push(`/play/video?id=${vCourseId}`)
}
}
//获取砍价信息
getBargainInfo = () => {
......@@ -244,10 +254,10 @@ class BtnStatus extends Component {
{
info.is_baoming === 0 && info.group_status !== 3 &&
<div className='btns-box'>
<Link className='consult consult-s' to="https://q.url.cn/AB8aue?_type=wpa&qidian=true">
<a className='consult consult-s' href="https://q.url.cn/AB8aue?_type=wpa&qidian=true">
<i className='iconfont iconerji'></i>
<span>课程咨询</span>
</Link>
</a>
{
info.in_cart &&
<Link to='/shopcart' className='btn btn-s bg-FCCD05'>去购物车结算</Link>
......@@ -265,21 +275,23 @@ class BtnStatus extends Component {
{
info.is_baoming === 1 &&
<div className='btns-box'>
<Link className='consult consult-m' to="https://q.url.cn/AB8aue?_type=wpa&qidian=true">
<a className='consult consult-m' href="https://q.url.cn/AB8aue?_type=wpa&qidian=true">
<i className='iconfont iconerji' />
<span>课程咨询</span>
</Link>
<Link to={`/play/video?id=${info.v_course_id}`} className='btn btn-m bg-09f'>开始学习</Link>
</a>
<a className='btn btn-m bg-09f' onClick={() => this.toStudy(info.v_course_id,info.is_have_video)}>
开始学习
</a>
</div>
}
{/*拼团 未开团*/}
{
info.is_baoming === 0 && info.group_status === 3 &&
<div className='btns-box'>
<Link className='consult consult-s' to="https://q.url.cn/AB8aue?_type=wpa&qidian=true">
<a className='consult consult-s' href="https://q.url.cn/AB8aue?_type=wpa&qidian=true">
<i className='iconfont iconerji'></i>
<span>课程咨询</span>
</Link>
</a>
<button className='btn btn-s bg-F4AAA7' onClick={this.simpleCourse}>
<span>{${info.price1}`}</span>
<span>直接购买</span>
......@@ -297,10 +309,10 @@ class BtnStatus extends Component {
{
info.is_baoming === 0 && info.group_status === 4 &&
<div className='btns-box'>
<Link className='consult consult-s' to="https://q.url.cn/AB8aue?_type=wpa&qidian=true">
<a className='consult consult-s' href="https://q.url.cn/AB8aue?_type=wpa&qidian=true">
<i className='iconfont iconerji'></i>
<span>课程咨询</span>
</Link>
</a>
<div className='btn btn-l bg-E02E24' onClick={this.props.invitedFriends}>
邀请好友参团 {countdown} 后结束
</div>
......@@ -311,10 +323,10 @@ class BtnStatus extends Component {
{
info.is_baoming === 0 && this.props.data && this.props.data.is_bargain &&
<div className='btns-box'>
<Link className='consult consult-s' to="https://q.url.cn/AB8aue?_type=wpa&qidian=true">
<a className='consult consult-s' href="https://q.url.cn/AB8aue?_type=wpa&qidian=true">
<i className='iconfont iconerji'></i>
<span>课程咨询</span>
</Link>
</a>
<button className='btn btn-s bg-F4AAA7'>
<span>¥{info.price1}</span>
<span onClick={this.tobuy}>直接购买</span>
......@@ -339,10 +351,10 @@ class BtnStatus extends Component {
{
this.state.isbuy === 20 &&
<div className='btns-box'>
<Link className='consult-l' to="https://q.url.cn/AB8aue?_type=wpa&qidian=true">
<a className='consult-l' href="https://q.url.cn/AB8aue?_type=wpa&qidian=true">
<i className='iconfont iconerji'></i>
<span>课程咨询</span>
</Link>
</a>
</div>
}
......@@ -350,10 +362,10 @@ class BtnStatus extends Component {
{
(info.is_aist && (this.props.user.hasError || info.is_baoming === 0)) &&
<div className='btns-box'>
<Link className='consult consult-m' to="https://q.url.cn/AB8aue?_type=wpa&qidian=true">
<a className='consult consult-m' href="https://q.url.cn/AB8aue?_type=wpa&qidian=true">
<i className='iconfont iconerji'></i>
<span>课程咨询</span>
</Link>
</a>
<button className='btn sign-up-now' onClick={e => this.signUpNow()}>
<span>立即报名</span>
......@@ -364,18 +376,15 @@ class BtnStatus extends Component {
{
info.is_aist && !this.props.user.hasError && info.is_baoming === 1 &&
<div className='btns-box'>
<Link className='consult consult-m' to="https://q.url.cn/AB8aue?_type=wpa&qidian=true">
<a className='consult consult-m' href="https://q.url.cn/AB8aue?_type=wpa&qidian=true">
<i className='iconfont iconerji'></i>
<span>课程咨询</span>
</Link>
</a>
{
info.aist_start_time === "" ?
(
<Link to={`/play/video?id=${info.v_course_id}`} className='btn btn-m learn-now'>
<span>开始学习</span>
</Link>
<a className='btn btn-m bg-09f' onClick={() => this.toStudy(info.v_course_id,info.is_have_video)}>开始学习</a>
) : (
<button className='btn btn-m wait-open' >
<span>{this.formatDate(info.aist_start_time)}</span>
......
......@@ -9,6 +9,7 @@ import { Toast } from 'antd-mobile';
import Captcha from '@/common/Captcha';
import FollowQRcode from './../followQRcode';
import './index.scss';
import cookie from 'js-cookie'
class RedPacket extends PureComponent {
......@@ -54,9 +55,16 @@ class RedPacket extends PureComponent {
// 分享链接进入
this.judgePopupType();
window.addEventListener('beforeunload', this.removeStatisticsCookie)
// 微信进入
const isWechat = getParam('wechat');
const { userInfo } = this.props;
if(!userInfo || !userInfo.uid) {
this.setRelativeCookie()
}
if(isWechat === '1' && !browser.isWeixin) {
if(userInfo && userInfo.uid) {
const type = window.localStorage.getItem('redpacket-click');
......@@ -95,6 +103,7 @@ class RedPacket extends PureComponent {
window.localStorage.removeItem('redpacket-click');
}
}else {
this.setRelativeCookie()
this.setState({
type: 1
});
......@@ -103,6 +112,15 @@ class RedPacket extends PureComponent {
this.fetchShareInfo();
}
removeStatisticsCookie = () => {
cookie.remove('share_code', {path: '/', domain: '.julyedu.com'})
}
componentWillUnmount() {
window.removeEventListener('beforeunload', this.removeStatisticsCookie)
}
// 获取分享信息
fetchShareInfo = () => {
......@@ -290,8 +308,15 @@ class RedPacket extends PureComponent {
history.push(`/detail?id=${getParam('id')}&wechat=1`);
}else {
if(userInfo && userInfo.uid) {
this.setState({
type: 1
// 领取好友的后,再领取自己的 share_code 未更新
http.get(`${API.home}/sys/redPacket/shareUrl/${getParam('id')}`).then(res => {
const { code, data } = res.data;
if(code === 200) {
this.setState({
shareInfo: data,
type: 1
});
}
});
}else {
history.push('/passport/login');
......@@ -575,6 +600,13 @@ class RedPacket extends PureComponent {
});
}
//设置统计信息
setRelativeCookie = () => {
const config = {path: '/', domain: '.julyedu.com'}
cookie.set('share_code', getParam('share_code') ? getParam('share_code') : 'share_code', config)
}
render() {
// console.log(this.props);
const { history, userInfo } = this.props;
......
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