Commit 502ab4c7 by FE

pull

parents 7538e5bf f67e8b1f
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no,user-scalable=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/manifest.json"/><title>七月在线 - 国内领先的人工智能教育平台</title><link href="/mrstatic/css/36.2c1f7d7c.chunk.css" rel="stylesheet"><link href="/mrstatic/css/main.458b4211.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script src="/api.js"></script><script>!function(d){function e(e){for(var r,t,a=e[0],n=e[1],o=e[2],i=0,c=[];i<a.length;i++)t=a[i],l[t]&&c.push(l[t][0]),l[t]=0;for(r in n)Object.prototype.hasOwnProperty.call(n,r)&&(d[r]=n[r]);for(p&&p(e);c.length;)c.shift()();return f.push.apply(f,o||[]),s()}function s(){for(var e,r=0;r<f.length;r++){for(var t=f[r],a=!0,n=1;n<t.length;n++){var o=t[n];0!==l[o]&&(a=!1)}a&&(f.splice(r--,1),e=b(b.s=t[0]))}return e}var t={},u={30:0},l={30:0},f=[];function b(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return d[e].call(r.exports,r,r.exports,b),r.l=!0,r.exports}b.e=function(f){var e=[];u[f]?e.push(u[f]):0!==u[f]&&{2:1,3:1,4:1,5:1,6:1,7:1,8:1,9:1,10:1,12:1,14:1,15:1,16:1,17:1,18:1,19:1,20:1,21:1,22:1,23:1,24:1,25:1,27:1,28:1,29:1,31:1,32:1,33:1,34:1,35:1,37:1,38:1,39:1,40:1,41:1,42:1}[f]&&e.push(u[f]=new Promise(function(e,a){for(var r="mrstatic/css/"+({3:"Activity",4:"BargainMiddlePage",5:"Classify",6:"Country",7:"CourseList",8:"DrawDocument",9:"Examination",10:"Invite",11:"MyEdit",12:"Order",13:"Orderinfo",14:"PayOrder",15:"Preferential",16:"SearchResult",17:"ShareCourse",18:"ShopCart",19:"aist-share",20:"blessing-preheat",21:"blessing-rank",22:"coupons",23:"deposit-order",24:"deposit-pay-order",25:"detail",27:"myorders",28:"prize-winner-list",29:"purchased",31:"search",32:"shareposter",33:"study",34:"togroup",35:"video"}[f]||f)+"."+{0:"31d6cfe0",1:"31d6cfe0",2:"1133c967",3:"30b38ae5",4:"2a913483",5:"127d35ae",6:"400393b7",7:"fed92c83",8:"1bd3da48",9:"17af9370",10:"30b38ae5",11:"31d6cfe0",12:"83a999aa",13:"31d6cfe0",14:"68a25070",15:"f17f508d",16:"6d7d1b77",17:"6e885738",18:"887eb690",19:"affb05d7",20:"9024461d",21:"45c1e3e5",22:"0ce3fd3d",23:"2e5f43c4",24:"e8363b32",25:"55b938da",27:"cbaaf942",28:"82276023",29:"7558403e",31:"efa1dd44",32:"cde549fc",33:"62b8863b",34:"ffd8be6c",35:"b3755c1b",37:"0710e3e3",38:"51412fcd",39:"e292ab6b",40:"37fb0c23",41:"56b04545",42:"ce17075b"}[f]+".chunk.css",n=b.p+r,t=document.getElementsByTagName("link"),o=0;o<t.length;o++){var i=(d=t[o]).getAttribute("data-href")||d.getAttribute("href");if("stylesheet"===d.rel&&(i===r||i===n))return e()}var c=document.getElementsByTagName("style");for(o=0;o<c.length;o++){var d;if((i=(d=c[o]).getAttribute("data-href"))===r||i===n)return e()}var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.onload=e,s.onerror=function(e){var r=e&&e.target&&e.target.src||n,t=new Error("Loading CSS chunk "+f+" failed.\n("+r+")");t.request=r,delete u[f],s.parentNode.removeChild(s),a(t)},s.href=n,document.getElementsByTagName("head")[0].appendChild(s)}).then(function(){u[f]=0}));var t=l[f];if(0!==t)if(t)e.push(t[2]);else{var r=new Promise(function(e,r){t=l[f]=[e,r]});e.push(t[2]=r);var a,o=document.createElement("script");o.charset="utf-8",o.timeout=120,b.nc&&o.setAttribute("nonce",b.nc),o.src=b.p+"mrstatic/js/"+({3:"Activity",4:"BargainMiddlePage",5:"Classify",6:"Country",7:"CourseList",8:"DrawDocument",9:"Examination",10:"Invite",11:"MyEdit",12:"Order",13:"Orderinfo",14:"PayOrder",15:"Preferential",16:"SearchResult",17:"ShareCourse",18:"ShopCart",19:"aist-share",20:"blessing-preheat",21:"blessing-rank",22:"coupons",23:"deposit-order",24:"deposit-pay-order",25:"detail",27:"myorders",28:"prize-winner-list",29:"purchased",31:"search",32:"shareposter",33:"study",34:"togroup",35:"video"}[f]||f)+"."+{0:"19bf510b",1:"1ae9bc37",2:"713de1c4",3:"19eb88a7",4:"aebd2bce",5:"726a8544",6:"9fe65a29",7:"57c6499f",8:"2b37d013",9:"9f48701b",10:"2be9603b",11:"a6b17939",12:"5ad3b7ca",13:"d94b7289",14:"857a9122",15:"0e5301b8",16:"01b88ecc",17:"610cf7a9",18:"b0b9d3c5",19:"f897c965",20:"fdc86a7b",21:"3cd2f40a",22:"149e3745",23:"1db4bc28",24:"1ea01718",25:"6112c440",27:"67916535",28:"baaff1be",29:"172cf22a",31:"2fab4238",32:"41581870",33:"a9aa0d30",34:"844ed002",35:"9e524ec2",37:"60ac9e86",38:"c570d159",39:"67ebbf88",40:"d8997143",41:"7eb8f559",42:"b5f20c5a"}[f]+".chunk.js",a=function(e){o.onerror=o.onload=null,clearTimeout(i);var r=l[f];if(0!==r){if(r){var t=e&&("load"===e.type?"missing":e.type),a=e&&e.target&&e.target.src,n=new Error("Loading chunk "+f+" failed.\n("+t+": "+a+")");n.type=t,n.request=a,r[1](n)}l[f]=void 0}};var i=setTimeout(function(){a({type:"timeout",target:o})},12e4);o.onerror=o.onload=a,document.head.appendChild(o)}return Promise.all(e)},b.m=d,b.c=t,b.d=function(e,r,t){b.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},b.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},b.t=function(r,e){if(1&e&&(r=b(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(b.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var a in r)b.d(t,a,function(e){return r[e]}.bind(null,a));return t},b.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return b.d(r,"a",r),r},b.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},b.p="/",b.oe=function(e){throw console.error(e),e};var r=window.webpackJsonp=window.webpackJsonp||[],a=r.push.bind(r);r.push=e,r=r.slice();for(var n=0;n<r.length;n++)e(r[n]);var p=a;s()}([])</script><script src="/mrstatic/js/36.06195a23.chunk.js"></script><script src="/mrstatic/js/main.9650d8e3.chunk.js"></script></body></html>
\ No newline at end of file
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
/**
* Welcome to your Workbox-powered service worker!
*
* You'll need to register this file in your web app and you should
* disable HTTP caching for this file too.
* See https://goo.gl/nhQhGp
*
* The rest of the code is auto-generated. Please don't update this file
* directly; instead, make changes to your Workbox build configuration
* and re-run your build process.
* See https://goo.gl/2aRDsh
*/
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");
importScripts(
"/precache-manifest.56520aa67ea03bebc3283c095437ff0e.js"
);
workbox.clientsClaim();
/**
* The workboxSW.precacheAndRoute() method efficiently caches and responds to
* requests for URLs in the manifest.
* See https://goo.gl/S9QRab
*/
self.__precacheManifest = [].concat(self.__precacheManifest || []);
workbox.precaching.suppressWarnings();
workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
workbox.routing.registerNavigationRoute("/index.html", {
blacklist: [/^\/_/,/\/[^/]+\.[^/]+$/],
});
...@@ -11,8 +11,8 @@ class Activity extends Component { ...@@ -11,8 +11,8 @@ class Activity extends Component {
} }
componentWillMount() { componentWillMount() {
jsCookie.set('blessing_invite_uid', getParam('shareuid')); jsCookie.set('blessing_invite_uid', getParam('shareuid'), {domain: '.julyedu.com'});
jsCookie.set('blessing_invite_code', getParam('inviteCode')); jsCookie.set('blessing_invite_code', getParam('inviteCode'), {domain: '.julyedu.com'});
} }
getGift = () => { getGift = () => {
......
...@@ -15,6 +15,7 @@ class Invite extends Component { ...@@ -15,6 +15,7 @@ class Invite extends Component {
hotValue: 0, hotValue: 0,
hot_schedule: '', hot_schedule: '',
userList: [], userList: [],
inviteCode: '',
} }
} }
...@@ -33,19 +34,16 @@ class Invite extends Component { ...@@ -33,19 +34,16 @@ class Invite extends Component {
if(!this.props.user.hasError) { if(!this.props.user.hasError) {
this.getUserList(); this.getUserList();
this.getHotValue(); this.getHotValue();
this.getInviteCode();
} }
wxShare({
title: 'AI充电节,积福气享1折秒课,超10万元奖品来就送!!',
desc: '把这门超5万人报名的【Python基础入门 升级版】课程送给你,附200元红包,请笑纳!--七月在线',
link: encodeURI(location.origin + `/invite?shareuid=${jsCookie.get('uid')}&new=1&inviteCode=${inviteCode}`),
imgUrl: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/index-share-img.png',
});
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
console.log('componentWillReceiveProps');
if(!nextProps.user.hasError) { if(!nextProps.user.hasError) {
this.getUserList(); this.getUserList();
this.getHotValue(); this.getHotValue();
this.getInviteCode();
} }
} }
...@@ -76,8 +74,33 @@ class Invite extends Component { ...@@ -76,8 +74,33 @@ class Invite extends Component {
}); });
} }
getInviteCode = () => {
http.get(`${API.home}/sys/user/invite/link`).then(res => {
let {code, data, msg} = res.data;
if(code === 200) {
let inviteCode = data.blessing_invite_code;
if(is_weixin()) {
wxShare({
title: 'AI充电节,积福气享1折秒课,超10万元奖品来就送!!',
desc: '把这门超5万人报名的【Python基础入门 升级版】课程送给你,附200元红包,请笑纳!--七月在线',
link: encodeURI(location.origin + `/invite?shareuid=${jsCookie.get('uid')}&new=1&inviteCode=${inviteCode}`),
imgUrl: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/index-share-img.png',
});
}
this.setState(()=>({
inviteCode: inviteCode
}))
}else if(code === 4030 || code === 4040) {
history.push('/passport');
}else{
Toast.info(msg, 2);
}
});
}
inviteFriends = () => { inviteFriends = () => {
const { user, history } = this.props; const { user, history } = this.props;
const {inviteCode} = this.state;
// 未登录先去登录 // 未登录先去登录
if (getParam('version')) { if (getParam('version')) {
if(user.hasError) { if(user.hasError) {
...@@ -95,33 +118,23 @@ class Invite extends Component { ...@@ -95,33 +118,23 @@ class Invite extends Component {
if(user.hasError) { if(user.hasError) {
history.push('/passport'); history.push('/passport');
}else { }else {
http.get(`${API.home}/sys/user/invite/link`).then(res => { if(is_weixin()) {
let {code, data, msg} = res.data; wxShare({
if(code === 200) { title: 'AI充电节,积福气享1折秒课,超10万元奖品来就送!!',
let inviteCode = data.blessing_invite_code; desc: '把这门超5万人报名的【Python基础入门 升级版】课程送给你,附200元红包,请笑纳!--七月在线',
if(is_weixin()) { link: encodeURI(location.origin + `/invite?shareuid=${jsCookie.get('uid')}&new=1&inviteCode=${inviteCode}`),
wxShare({ imgUrl: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/index-share-img.png',
title: 'AI充电节,积福气享1折秒课,超10万元奖品来就送!!', });
desc: '把这门超5万人报名的【Python基础入门 升级版】课程送给你,附200元红包,请笑纳!--七月在线', this.setState({
link: encodeURI(location.origin + `/invite?shareuid=${jsCookie.get('uid')}&new=1&inviteCode=${inviteCode}`), showTip: true,
imgUrl: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/index-share-img.png', isWeiXin: true,
}); });
this.setState({ }else{
showTip: true, history.push(`/invite?shareuid=${jsCookie.get('uid')}&new=1&inviteCode=${inviteCode}`);
isWeiXin: true, this.setState({
}); showTip: true,
}else{ });
history.push(`/invite?shareuid=${jsCookie.get('uid')}&new=1&inviteCode=${inviteCode}`) }
this.setState({
showTip: true,
});
}
}else if(code === 4030 || code === 4040) {
history.push('/passport');
}else{
Toast.info(msg, 2);
}
});
} }
} }
} }
......
...@@ -519,7 +519,7 @@ class BlessingPreheat extends Component { ...@@ -519,7 +519,7 @@ class BlessingPreheat extends Component {
<RankList></RankList> <RankList></RankList>
<Live isFormal={isFormal}></Live> <Live isFormal={isFormal} isLogin={isLogin}></Live>
</div> </div>
) )
} }
......
...@@ -35,14 +35,22 @@ class Live extends Component { ...@@ -35,14 +35,22 @@ class Live extends Component {
} }
return accu return accu
}, {}) }, {})
const preheatLives = data.data['data_hot'].reduce((accu, current) => {
if (!(current.date in accu)) {
accu[current.date] = [current]
} else {
accu[current.date].push(current)
}
return accu
}, {})
let tabs, today let tabs, today
if (this.props.isFormal) { if (this.props.isFormal) {
tabs = Object.keys(lives).map(item => ({title: item})) tabs = Object.keys(lives).map(item => ({title: item}))
today = uniqBy(data.data['data_active'], value => value.date).findIndex(item => item['is_today']) today = uniqBy(data.data['data_active'], value => value.date).findIndex(item => item['is_today'])
} else { } else {
tabs = data.data['data_hot'].map(item => ({title: item.date})) tabs = Object.keys(preheatLives).map(item => ({title: item}))
today = data.data['data_hot'].findIndex(item => item['is_today']) today = uniqBy(data.data['data_hot'], value => value.date).findIndex(item => item['is_today'])
} }
...@@ -50,7 +58,7 @@ class Live extends Component { ...@@ -50,7 +58,7 @@ class Live extends Component {
tabs, tabs,
lives, lives,
today, today,
preheatLives: data.data['data_hot'] preheatLives
}) })
} else { } else {
...@@ -61,10 +69,19 @@ class Live extends Component { ...@@ -61,10 +69,19 @@ class Live extends Component {
} }
toLiveRoom = id => { toLiveRoom = id => {
const {history,isLogin} = this.props;
if (this.state.isApp) { if (this.state.isApp) {
SendMessageToApp('toLiveRoom', id) if(isLogin){
SendMessageToApp('toLiveRoom', id)
}else {
SendMessageToApp("toLogin")
}
} else { } else {
window.location.href = `${window.location.protocol}//www.julyedu.com/live/m_room/${id}` if(isLogin){
window.location.href = `${window.location.protocol}//www.julyedu.com/live/m_room/${id}`
}else {
history.push('/passport')
}
} }
} }
...@@ -119,24 +136,27 @@ class Live extends Component { ...@@ -119,24 +136,27 @@ class Live extends Component {
{ {
todayLives.map((item, index) => { todayLives.map((item, index) => {
return ( return (
<LiveContent item={item} key={index} makeSubscribe={this.makeSubscribe}/> <LiveContent item={item} key={index} makeSubscribe={this.makeSubscribe} toLiveRoom={this.toLiveRoom}/>
) )
}) })
} }
</div> </div>
) )
}) })
: preheatLives.map((item, index) => { :tabs.map((item, index) => {
return ( const todayLives = preheatLives[item.title]
<div key={index}> return (
{ <div key={index}>
preheatLives.map((item, index) => { {
return <LiveContent key={index} item={item} makeSubscribe={this.makeSubscribe} toLiveRoom={this.toLiveRoom}/> todayLives.map((item, index) => {
}) return (
} <LiveContent item={item} key={index} makeSubscribe={this.makeSubscribe} toLiveRoom={this.toLiveRoom}/>
</div> )
) })
}) }
</div>
)
})
} }
</Tabs> </Tabs>
...@@ -181,7 +201,7 @@ function LiveContent({item, makeSubscribe, toLiveRoom}) { ...@@ -181,7 +201,7 @@ function LiveContent({item, makeSubscribe, toLiveRoom}) {
</div> </div>
{ {
item['on_live'] item['on_live']
? <button className={'on-living'} onClick={() => {toLiveRoom(item['live_id'])}}>正在直播</button> ? <button className={'on-living'} onClick={() => {toLiveRoom(item['room_url'])}}>正在直播</button>
: :
item['is_end'] item['is_end']
? <button className={'subscribed'}>已结束</button> ? <button className={'subscribed'}>已结束</button>
......
...@@ -21,6 +21,7 @@ class ToGroup extends Component { ...@@ -21,6 +21,7 @@ class ToGroup extends Component {
number: 0, // 差几人成团 number: 0, // 差几人成团
isBuy: false, isBuy: false,
modal: false, modal: false,
pddOrderId:''
} }
} }
...@@ -57,6 +58,7 @@ class ToGroup extends Component { ...@@ -57,6 +58,7 @@ class ToGroup extends Component {
person_num: res.data.data.person_num, person_num: res.data.data.person_num,
course_list: res.data.data.course_list, course_list: res.data.data.course_list,
number: res.data.data.number, number: res.data.data.number,
pddOrderId: res.data.data.pdd_order_id,
countdown: '', countdown: '',
isBuy: res.data.data.is_buy isBuy: res.data.data.is_buy
}); });
...@@ -101,7 +103,8 @@ class ToGroup extends Component { ...@@ -101,7 +103,8 @@ class ToGroup extends Component {
history.push( history.push(
`/order?id=${data.course_id}`, `/order?id=${data.course_id}`,
{ {
group: 1 group: 1,
pdd_order_id:this.state.pddOrderId
} }
) )
} else { } else {
......
...@@ -703,16 +703,16 @@ class Detail extends Component { ...@@ -703,16 +703,16 @@ class Detail extends Component {
* 拼团价格为1分钱时,不允许参团 * 拼团价格为1分钱时,不允许参团
*/ */
} }
{/*双十一期间不需要显示*/} {/*双十一期间不需要显示 不要删除*/}
{/*{*/} {
{/*isCent && !course_info.is_aist && (course_info.group_status === 3 || course_info.group_status === 4) &&*/} isCent && !course_info.is_aist && (course_info.group_status === 3 || course_info.group_status === 4) &&
{/*<Group*/} <Group
{/*courseInfo={course_info}*/} courseInfo={course_info}
{/*history={this.props.history}*/} history={this.props.history}
{/*countdown={countdown}*/} countdown={countdown}
{/*invitedFriends={this.invitedFriends}*/} invitedFriends={this.invitedFriends}
{/*/>*/} />
{/*}*/} }
{/* {/*
* 砍价 * 砍价
......
...@@ -135,6 +135,7 @@ class Order extends Component { ...@@ -135,6 +135,7 @@ class Order extends Component {
Toast.info('请完善报名信息!'); Toast.info('请完善报名信息!');
} }
const { location: { state ={} } } = this.props; const { location: { state ={} } } = this.props;
if(state.group === 1) { if(state.group === 1) {
let params = state.pdd_order_id? { let params = state.pdd_order_id? {
course_id: getParam("id"), course_id: getParam("id"),
...@@ -153,7 +154,10 @@ class Order extends Component { ...@@ -153,7 +154,10 @@ class Order extends Component {
} }
this.props.history.push(`/payorder?oid=${res.data.data.oid}`, {group: 1}); this.props.history.push(`/payorder?oid=${res.data.data.oid}`, {group: 1});
}else { }else if(Number(res.data.errno) === 0){
Toast.info(res.data.data.msg, 2);
return;
} else {
Toast.info(res.data.msg, 2); Toast.info(res.data.msg, 2);
return; return;
} }
......
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