Commit 7e67eb13 by wangshuo

合并PythonClass

parents 673ed84d 9ed5bccd
.python-container{padding:13.333333vw 2.133333vw 7.733333vw;background-image:url(https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/pythonCourse/h5/python-bg.png);background-size:cover}.python-header{position:relative;height:26.666667vw;padding-top:9.066667vw;box-sizing:border-box}.python-header .iconfont{position:absolute;top:-1.6vw;right:10.666667vw;font-size:10.133333vw;color:#fff}.python-wechat__title{margin:0;font-size:4.533333vw;color:#fcff1d;text-align:center;line-height:1}.python-content{padding-bottom:9.866667vw;background-image:url(https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/pythonCourse/h5/python-content-bg.png);background-size:cover}.python-user{position:relative;margin:0 1.333333vw;padding-top:12vw;border-bottom:1px dashed #000}.python-user__portrait{position:absolute;top:-8vw;left:0;right:0;width:16vw;height:16vw;margin:auto;padding:1.333333vw;border-radius:50%;box-sizing:border-box;background-color:#fff;background-size:cover}.python-user__portrait img{display:block;width:100%}.python-user__id{margin:0;font-size:4vw;font-weight:500;color:#111;text-align:center;line-height:1}.python-user__desc{height:12.8vw;margin:1.066667vw 0;font-size:4.266667vw;color:#333;text-align:center}.python-user__desc span{color:#2d57f0}.python-code__title{position:relative;margin:8.533333vw 4.266667vw 5.6vw;padding-left:4.266667vw;font-size:4.533333vw;font-weight:600;color:#2d56f0;line-height:1}.python-code__title:after{content:"";position:absolute;top:0;left:0;bottom:0;width:1.066667vw;height:3.2vw;margin:auto 0;background-color:#2d56f0}.python-code__content{position:relative;height:45.6vw;margin:0 4.266667vw;padding:0 2.666667vw;border-radius:1.333333vw;border:1px solid #67e4ff;box-sizing:border-box;font-size:3.733333vw;color:#fff;background-color:#272822}.python-button{padding:0;border-style:none;cursor:pointer;outline:none}.python-button__study{display:block;width:62.133333vw;height:11.733333vw;margin:9.333333vw auto 0;border-radius:5.866667vw;font-size:4.266667vw;color:#2d56f0;background-color:#fff95b;box-shadow:0 1.333333vw 0 #ffd200}.python-button__study,.python-button__tip{font-weight:500;line-height:11.733333vw;text-align:center}.python-button__tip{margin:9.333333vw 0 0;font-size:4vw;color:#fff}.python-button__execute{position:absolute;top:0;left:0;bottom:0;right:0;width:29.333333vw;height:8.533333vw;margin:auto;border-radius:4.266667vw;font-size:4vw;color:#fff;line-height:8.533333vw;background-color:#09f}.python-popup{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.3);z-index:99}.ace_mobile-menu{display:none}
/*# sourceMappingURL=51.05792370.chunk.css.map */
\ No newline at end of file
/*# sourceMappingURL=51.262f17a1.chunk.css.map */
\ No newline at end of file
{"version":3,"sources":["/Users/fe/frontCode/mr-julyedu/src/components/pythonShare/index.scss"],"names":[],"mappings":"AAmGA,kBACE,yCAAA,CACA,mGAAA,CACA,qBAAsB,CAOxB,eACE,iBAAA,CACA,kBAAA,CACA,sBAAA,CACA,qBAAsB,CAJxB,yBAOI,iBAAA,CACA,UAAA,CACA,iBAAA,CACA,qBAAA,CACA,UAAW,CAIf,sBACE,QAAA,CACA,oBAAA,CACA,aAAA,CACA,iBAAA,CACA,aAAc,CAGhB,gBACE,yBAAA,CACA,2GAAA,CACA,qBAAsB,CAGxB,aACE,iBAAA,CACA,mBAAA,CACA,gBAAA,CACA,6BAA8B,CAGhC,uBACE,iBAAA,CACA,QAAA,CACA,MAAA,CACA,OAAA,CACA,UAAA,CACA,WAAA,CACA,WAAA,CACA,kBAAA,CACA,iBAAA,CACA,qBAAA,CACA,qBAAA,CACA,qBAAsB,CAZxB,2BAeI,aAAA,CACA,UAAW,CAIf,iBACE,QAAA,CACA,aAAA,CACA,eAAA,CACA,UAAA,CACA,iBAAA,CACA,aAAc,CAGhB,mBACE,aAAA,CACA,mBAAA,CACA,oBAAA,CACA,UAAA,CACA,iBAAkB,CALpB,wBAQI,aAAc,CAIlB,oBACE,iBAAA,CACA,kCAAA,CACA,uBAAA,CACA,oBAAA,CACA,eAAA,CACA,aAAA,CACA,aAAc,CAPhB,0BAUI,UAAA,CACA,iBAAA,CACA,KAAA,CACA,MAAA,CACA,QAAA,CACA,gBAAA,CACA,YAAA,CACA,aAAA,CACA,wBAAyB,CAI7B,sBACE,iBAAA,CACA,aAAA,CACA,mBAAA,CACA,oBAAA,CACA,wBAAA,CACA,wBAAA,CACA,qBAAA,CACA,oBAAA,CACA,UAAA,CACA,wBAAyB,CAG3B,eACE,SAAA,CACA,iBAAA,CACA,cAAA,CACA,YAAa,CAEf,sBACE,aAAA,CACA,iBAAA,CACA,kBAAA,CACA,wBAAA,CACA,wBAAA,CACA,oBAAA,CAEA,aAAA,CAGA,wBAAA,CACA,iCAAyC,CAG3C,0CARE,eAAA,CAEA,uBAAA,CACA,iBAWkB,CANpB,oBACE,qBAAA,CACA,aAAA,CAEA,UAEkB,CAGpB,wBACE,iBAAA,CACA,KAAA,CACA,MAAA,CACA,QAAA,CACA,OAAA,CACA,iBAAA,CACA,iBAAA,CACA,WAAA,CACA,wBAAA,CACA,aAAA,CACA,UAAA,CACA,sBAAA,CACA,qBAAyB,CAG3B,cACE,cAAA,CACA,KAAA,CACA,MAAA,CACA,UAAA,CACA,WAAA,CACA,+BAAA,CACA,UAAW,CAGb,iBACE,YAAa","file":"51.262f17a1.chunk.css","sourcesContent":["@charset \"UTF-8\";\n/*\n * @ 文字颜色\n */\n/*\n * @ 文字大小\n */\n/*\n * @ 背景颜色\n */\n/*\n * @ 分割线颜色\n */\n/*\n * @ 边框颜色\n */\n/*\n * @ 标签颜色\n */\n.python-container {\n padding: 50px 8px 29px;\n background-image: url(\"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/pythonCourse/h5/python-bg.png\");\n background-size: cover; }\n\n.python-header {\n position: relative;\n height: 100px;\n padding-top: 34px;\n box-sizing: border-box; }\n .python-header .iconfont {\n position: absolute;\n top: -6px;\n right: 40px;\n font-size: 38px;\n color: #fff; }\n\n.python-wechat__title {\n margin: 0;\n font-size: 17px;\n color: #FCFF1D;\n text-align: center;\n line-height: 1; }\n\n.python-content {\n padding-bottom: 37px;\n background-image: url(\"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/pythonCourse/h5/python-content-bg.png\");\n background-size: cover; }\n\n.python-user {\n position: relative;\n margin: 0 5px;\n padding-top: 45px;\n border-bottom: 1px dashed #000; }\n\n.python-user__portrait {\n position: absolute;\n top: -30px;\n left: 0;\n right: 0;\n width: 60px;\n height: 60px;\n margin: auto;\n padding: 5px;\n border-radius: 50%;\n box-sizing: border-box;\n background-color: #fff;\n background-size: cover; }\n .python-user__portrait img {\n display: block;\n width: 100%; }\n\n.python-user__id {\n margin: 0;\n font-size: 15px;\n font-weight: 500;\n color: #111;\n text-align: center;\n line-height: 1; }\n\n.python-user__desc {\n height: 48px;\n margin: 4px 0;\n font-size: 16px;\n color: #333;\n text-align: center; }\n .python-user__desc span {\n color: #2D57F0; }\n\n.python-code__title {\n position: relative;\n margin: 32px 16px 21px;\n padding-left: 16px;\n font-size: 17px;\n font-weight: 600;\n color: #2D56F0;\n line-height: 1; }\n .python-code__title:after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n width: 4px;\n height: 12px;\n margin: auto 0;\n background-color: #2D56F0; }\n\n.python-code__content {\n position: relative;\n height: 171px;\n margin: 0 16px;\n padding: 0 10px;\n border-radius: 5px;\n border: 1px solid #67E4FF;\n box-sizing: border-box;\n font-size: 14px;\n color: #fff;\n background-color: #272822; }\n\n.python-button {\n padding: 0;\n border-style: none;\n cursor: pointer;\n outline: none; }\n\n.python-button__study {\n display: block;\n width: 233px;\n height: 44px;\n margin: 35px auto 0;\n border-radius: 22px;\n font-size: 16px;\n font-weight: 500;\n color: #2D56F0;\n line-height: 44px;\n text-align: center;\n background-color: #FFF95B;\n box-shadow: 0px 5px 0px #ffd200; }\n\n.python-button__tip {\n margin: 35px 0 0;\n font-size: 15px;\n font-weight: 500;\n color: #fff;\n line-height: 44px;\n text-align: center; }\n\n.python-button__execute {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n width: 110px;\n height: 32px;\n margin: auto;\n border-radius: 16px;\n font-size: 15px;\n color: #fff;\n line-height: 32px;\n background-color: #0099FF; }\n\n.python-popup {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.3);\n z-index: 99; }\n\n.ace_mobile-menu {\n display: none; }\n"]}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){function r(r){for(var n,a,d=r[0],i=r[1],f=r[2],s=0,l=[];s<d.length;s++)a=d[s],o[a]&&l.push(o[a][0]),o[a]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(u&&u(r);l.length;)l.shift()();return c.push.apply(c,f||[]),t()}function t(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,a=1;a<t.length;a++){var i=t[a];0!==o[i]&&(n=!1)}n&&(c.splice(r--,1),e=d(d.s=t[0]))}return e}var n={},a={35:0},o={35:0},c=[];function d(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,d),t.l=!0,t.exports}d.e=function(e){var r=[];a[e]?r.push(a[e]):0!==a[e]&&{1:1,2:1,3:1,4:1,5:1,6:1,7:1,8:1,9:1,10:1,11:1,13:1,15:1,16:1,17:1,18:1,19:1,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:1,29:1,30:1,31:1,32:1,33:1,34:1,36:1,37:1,38:1,39:1,40:1,41:1,44:1,45:1,47:1,48:1,49:1,50:1,51:1}[e]&&r.push(a[e]=new Promise(function(r,t){for(var n="mrstatic/css/"+({4:"Activity",5:"BargainMiddlePage",6:"Classify",7:"Country",8:"CourseList",9:"DrawDocument",10:"Examination",11:"Invite",12:"MyEdit",13:"Order",14:"Orderinfo",15:"PayOrder",16:"Preferential",17:"SearchResult",18:"ShareCourse",19:"ShopCart",20:"aist-share",21:"blessing-getPrize",22:"blessing-preheat",23:"blessing-rank",24:"coupons",25:"deposit-order",26:"deposit-pay-order",27:"detail",29:"myorders",30:"newyear-2019-landing",31:"newyear-yearIndex",32:"prize-winner-list",33:"purchased",34:"python-class",36:"search",37:"shareposter",38:"study",39:"system-notices",40:"togroup",41:"video"}[e]||e)+"."+{0:"31d6cfe0",1:"b4627248",2:"1133c967",3:"ac8fad1f",4:"5ad58b77",5:"2a913483",6:"127d35ae",7:"400393b7",8:"fed92c83",9:"1bd3da48",10:"17af9370",11:"5ad58b77",12:"31d6cfe0",13:"83a999aa",14:"31d6cfe0",15:"68a25070",16:"ccebc534",17:"6d7d1b77",18:"6e885738",19:"887eb690",20:"affb05d7",21:"32a9cccc",22:"0800b4f0",23:"39fb77c8",24:"0ce3fd3d",25:"2e5f43c4",26:"e8363b32",27:"633b10a8",29:"841d0cfb",30:"dc74ab02",31:"9039f86b",32:"ce85cb83",33:"7558403e",34:"13b5b2f3",36:"efa1dd44",37:"cde549fc",38:"62b8863b",39:"4fbf61d8",40:"ffd8be6c",41:"b3755c1b",43:"31d6cfe0",44:"976b2058",45:"51412fcd",46:"31d6cfe0",47:"e292ab6b",48:"37fb0c23",49:"56b04545",50:"ce17075b",51:"262f17a1"}[e]+".chunk.css",o=d.p+n,c=document.getElementsByTagName("link"),i=0;i<c.length;i++){var f=(u=c[i]).getAttribute("data-href")||u.getAttribute("href");if("stylesheet"===u.rel&&(f===n||f===o))return r()}var s=document.getElementsByTagName("style");for(i=0;i<s.length;i++){var u;if((f=(u=s[i]).getAttribute("data-href"))===n||f===o)return r()}var l=document.createElement("link");l.rel="stylesheet",l.type="text/css",l.onload=r,l.onerror=function(r){var n=r&&r.target&&r.target.src||o,c=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");c.request=n,delete a[e],l.parentNode.removeChild(l),t(c)},l.href=o,document.getElementsByTagName("head")[0].appendChild(l)}).then(function(){a[e]=0}));var t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise(function(r,n){t=o[e]=[r,n]});r.push(t[2]=n);var c,i=document.createElement("script");i.charset="utf-8",i.timeout=120,d.nc&&i.setAttribute("nonce",d.nc),i.src=function(e){return d.p+"mrstatic/js/"+({4:"Activity",5:"BargainMiddlePage",6:"Classify",7:"Country",8:"CourseList",9:"DrawDocument",10:"Examination",11:"Invite",12:"MyEdit",13:"Order",14:"Orderinfo",15:"PayOrder",16:"Preferential",17:"SearchResult",18:"ShareCourse",19:"ShopCart",20:"aist-share",21:"blessing-getPrize",22:"blessing-preheat",23:"blessing-rank",24:"coupons",25:"deposit-order",26:"deposit-pay-order",27:"detail",29:"myorders",30:"newyear-2019-landing",31:"newyear-yearIndex",32:"prize-winner-list",33:"purchased",34:"python-class",36:"search",37:"shareposter",38:"study",39:"system-notices",40:"togroup",41:"video"}[e]||e)+"."+{0:"a1f55c4b",1:"d9ed7166",2:"0fac390d",3:"92b68111",4:"e2fb033f",5:"cf95b372",6:"8163d312",7:"141c61f5",8:"f5ca4969",9:"0076a47c",10:"5cac77c0",11:"28851ee3",12:"dae94c7e",13:"6def7194",14:"78f26106",15:"e6c3479b",16:"0a7db7f8",17:"1d558834",18:"c519a5df",19:"58cf523e",20:"fe6680a0",21:"3af378d7",22:"f19da7b8",23:"60ea5af3",24:"2b77f2be",25:"b854048e",26:"e64172c9",27:"23a65933",29:"d820f269",30:"40e51d90",31:"daed575b",32:"b2af75ba",33:"89577d91",34:"3355a363",36:"32e22912",37:"9564bc99",38:"d02e3326",39:"d28438a2",40:"d2d6538f",41:"defefd9a",43:"f063ef63",44:"346f8d8b",45:"83264ccd",46:"7e77ddf7",47:"39c28519",48:"eb589f62",49:"40cd7435",50:"81199908",51:"eec1ec29"}[e]+".chunk.js"}(e),c=function(r){i.onerror=i.onload=null,clearTimeout(f);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src,c=new Error("Loading chunk "+e+" failed.\n("+n+": "+a+")");c.type=n,c.request=a,t[1](c)}o[e]=void 0}};var f=setTimeout(function(){c({type:"timeout",target:i})},12e4);i.onerror=i.onload=c,document.head.appendChild(i)}return Promise.all(r)},d.m=e,d.c=n,d.d=function(e,r,t){d.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},d.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.t=function(e,r){if(1&r&&(e=d(e)),8&r)return e;if(4&r&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(d.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)d.d(t,n,function(r){return e[r]}.bind(null,n));return t},d.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return d.d(r,"a",r),r},d.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},d.p="/",d.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],f=i.push.bind(i);i.push=r,i=i.slice();for(var s=0;s<i.length;s++)r(i[s]);var u=f;t()}([]);
//# sourceMappingURL=runtime~main.bdea35a8.js.map
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -14,7 +14,11 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");
importScripts(
<<<<<<< HEAD
"/precache-manifest.6b9920d1bc4e324d2d8e523a93498a4e.js"
=======
"/precache-manifest.bb914aae979aae5d5eed234d18a3a292.js"
>>>>>>> pythonClass
);
workbox.clientsClaim();
......@@ -30,5 +34,9 @@ workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
workbox.routing.registerNavigationRoute("/index.html", {
<<<<<<< HEAD
blacklist: [/^\/_/,/\/[^\/]+\.[^\/]+$/],
=======
blacklist: [/^\/_/,/\/[^/]+\.[^/]+$/],
>>>>>>> pythonClass
});
import React, {Component} from 'react'
import {http, getParam, SendMessageToApp} from '@/utils'
import {http, getParam, SendMessageToApp, brower} from '@/utils'
import PythonDes from './pythomDes'
import PythonStudy from './pythonStudy'
import {connect} from "react-redux"
......@@ -19,7 +19,8 @@ class Python extends Component {
this.state = {
isPay: '',
userInfoList: [],
isAppUpdate: false
isAppUpdate: false,
backwardVersion: false, // 默认是新版本
}
}
......@@ -89,19 +90,41 @@ class Python extends Component {
http.get(`${API.home}/m/course/detail/${id}`).then((res) => {
const {data, code} = res.data
if (code === 200) {
this.setState({
isPay: data.course_info.is_pay
})
let version = getParam('version')
if(version) {
version = version.replace(/\./g, '').slice(0, 3)
if(brower.isAndroidApp && version < 453) { // 安卓的低版本
this.setState({
backwardVersion: true,
isPay: 0,
})
}else{
this.setState({
isPay: data.course_info.is_pay
})
}
if(brower.isIOSApp && version < 380) { // ISO的低版本
this.setState({
backwardVersion: true,
isPay: 0,
})
}else{
this.setState({
isPay: data.course_info.is_pay
})
}
}
}
})
}
render() {
const {isPay, isAppUpdate} = this.state
const {isPay, isAppUpdate, backwardVersion} = this.state;
// 旧版本 无论购买未购买 都跳转到 未购买的详情页; 如果是已购买就提示更新APP
return (
<div>
{
isPay === 0 && <PythonDes history={this.props.history} isAppUpdate={isAppUpdate}></PythonDes>
isPay === 0 && <PythonDes history={this.props.history} isAppUpdate={isAppUpdate} backwardVersion={backwardVersion} isPay={isPay}></PythonDes>
}
{
(isPay === 1 && !getParam('version')) && <PythonStudy isAppUpdate={isAppUpdate}/>
......
......@@ -8,7 +8,7 @@ export default class Description extends Component {
<img className={'left'} src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/h5_python_class/left.png" alt=""/>
<img className={'right'} src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/h5_python_class/right.png" alt=""/>
<p className={'title'}> / / / </p>
<p className={'sub__title'}>对话式交互教学+课后实操,20节课全面掌握Python基础语法</p>
<p className={'sub__title'}>对话式交互教学+课后实操,17节课全面掌握Python基础语法</p>
<img src={'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/h5_python_class/diannao.png'} />
{
this.props.list.map((item, index)=>{
......
......@@ -3,18 +3,41 @@ import './index.scss'
export default class Experience extends Component {
render() {
const { isOnline, tryLearn } = this.props;
return (
<div className={'experience_container'}>
<p className={'title'}> / / / </p>
<div className={'experience'}>
<img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/h5_python_class/L%402x.png" alt=""/>
<div>
<p>限时福利免费试学</p>
<p>开始颠覆你想象的学习</p>
</div>
<img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/h5_python_class/r%402x.png" alt=""/>
</div>
<div className={'btn'} onClick={this.props.tryLearn}>立即体验</div>
{
isOnline
? (
<>
<div className={'experience'}>
<img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/h5_python_class/L%402x.png" alt=""/>
<div>
<p>限时福利免费试学</p>
<p>开始颠覆你想象的学习</p>
</div>
<img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/h5_python_class/r%402x.png" alt=""/>
</div>
<div className={'btn'} onClick={tryLearn}>立即体验</div>
</>
)
: (
<>
<div className={'experience'}>
<img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/h5_python_class/L%402x.png" alt=""/>
<div>
<p>上架后可免费试学</p>
<p>体验颠覆你想象的学习</p>
</div>
<img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/h5_python_class/r%402x.png" alt=""/>
</div>
<div className={'btn btn--online'}>即将上架敬请期待</div>
</>
)
}
</div>
)
}
......
......@@ -31,14 +31,22 @@
.btn {
width: 150px;
height: 36px;
background: rgba(0, 153, 255, 1);
box-shadow: 0px 6px 12px 0px rgba(0, 153, 255, 0.06);
margin: 0 auto;
border-radius: 18px;
font-size: 16px;
font-weight: 600;
color: rgba(255, 255, 255, 1);
line-height: 36px;
text-align: center;
margin: 0 auto;
line-height: 36px;
background: rgba(0, 153, 255, 1);
box-shadow: 0px 6px 12px 0px rgba(0, 153, 255, 0.06);
}
.btn--online {
width: 200px;
font-size: 15px;
color: #fff;
letter-spacing: 4px;
background-color: rgba(82,92,101,.6);
}
}
......@@ -16,7 +16,7 @@ export default class Progream extends Component {
q: '学习过程中遇到了困难怎么办?',
a: '我们为学员配备了专门的助教,有问题随时可以咨询助教老师。'
},{
q: '课程学习周期是多久?',
q: '需要自己安装代码运行环境吗?',
a: '在平台上学习不需要安装任何环境,该课程包含的知识点实操以及课后实操都可以在平台上完成。'
}
]
......
......@@ -2,13 +2,34 @@ import React, { Component } from 'react'
import './index.scss'
export default class Study extends Component {
Change = (data) => {
let cn = ["一", "二", "三", "四", "五", "六", "七", "八", "九", '十'];
let newStr = ''
let str = data.toString()
let ci = Number(str) % 10
let cs = Math.floor(Number(str) / 10)
let cv = ''
if (str.length > 1) {
if(cs==1){
cv = ci >= 1 ? cn[9] + cn[ci - 1] : cn[9]
} else {
cv = ci > 1 ? cn[cs - 1] + cn[9] + cn[ci - 1] : cn[cs - 1] + cn[9]
}
} else {
cv = cn[ci - 1]
}
newStr = str.replace(str, cv)
return newStr;
}
render() {
return (
<div className={'study__container'}>
<img className={'learn_left'} src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/h5_python_class/learn_left.png" alt=""/>
<img className={'learn_bottom'} src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/h5_python_class/learn_bottom.png" alt=""/>
<p className={'title'}> / / / </p>
<p className={'sub__title'}>20节课堂教学,带你掌握Python技术入门知识</p>
<p className={'sub__title'}>17节课堂教学,带你掌握Python技术入门知识</p>
<div className={'step__container'}>
<div className={'item__container'}>
<img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/h5_python_class/wanzheng.png" alt=""/>
......@@ -37,7 +58,8 @@ export default class Study extends Component {
this.props.syllabus.map((item, index)=>{
return (
<div className={'item__container'} key={index}>
<div className={'item__title'}>{item.name}</div>
<div className={'item__title'}>{
'第' + this.Change(index + 1) + '阶段 ' +item.name}</div>
{
item.lessons.map((item, index)=>{
return (
......
......@@ -74,8 +74,8 @@ class PythonDes extends Component {
},
{
url: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/h5_python_class/rumen.png',
title: '20天零基础入门',
subTitle: '降低学习门槛,20天入门人工智能'
title: '17天零基础入门',
subTitle: '降低学习门槛,17天入门人工智能'
},
],
worryList: [
......@@ -96,6 +96,7 @@ class PythonDes extends Component {
},
],
payMoney: 0,
isOnline: false, //课程是否上架
}
}
......@@ -120,6 +121,7 @@ class PythonDes extends Component {
}
toLearn = () => {
const {backwardVersion, isPay} = this.props;
http.post(`${API['home']}/m/it/user/trialCourse`, {course_id: getParam('id')}).then((res) => {
const {code, msg} = res.data
if (code == 200) {
......@@ -128,7 +130,11 @@ class PythonDes extends Component {
toApp: true
})
} else { // APP
SendMessageToApp("toLearn")
if(backwardVersion) {
Toast.info('当前版本不支持该课程模式,请升级到最新版本或前往PC端体验', 2)
} else {
SendMessageToApp("toLearn")
}
}
} else {
Toast.info(msg, 2)
......@@ -143,6 +149,7 @@ class PythonDes extends Component {
}
toDetail = () => {
const {backwardVersion, isPay} = this.props;
const id = getParam('id')
if (!getParam('version')) { // H5
http.get(`${API['base-api']}/m/cart/addtopreorder/[${id}]`).then((res) => {
......@@ -153,7 +160,16 @@ class PythonDes extends Component {
}
})
} else { // APP
SendMessageToApp('toPay', id)
if(backwardVersion) {
Toast.info('当前版本不支持该课程模式,请升级到最新版本或前往PC端购买', 2);
let onlyoneUse = setTimeout(() => {
clearTimeout(onlyoneUse);
onlyoneUse = null;
SendMessageToApp('toPay', id)
}, 2000);
} else {
SendMessageToApp('toPay', id)
}
}
}
......@@ -213,6 +229,11 @@ class PythonDes extends Component {
componentDidMount() {
this.getStatus()
const {backwardVersion, isPay} = this.props;
if(backwardVersion && isPay === 1) {
Toast.info('当前版本不支持该课程模式,请升级到最新版本或前往PC端学习', 2);
}
}
......@@ -225,7 +246,18 @@ class PythonDes extends Component {
}
render() {
const {defineList, desList, worryList, syllabus, practice, allSyllabusShow, allPracticeShow, toApp, payMoney} = this.state
const {
defineList,
desList,
worryList,
syllabus,
practice,
allSyllabusShow,
allPracticeShow,
toApp,
payMoney,
isOnline
} = this.state
return (
<div className={'python__des'}>
<div className={'des__start'}></div>
......@@ -242,31 +274,56 @@ class PythonDes extends Component {
}
</div>
<div className={'course__introduce'}></div>
<div className={'bottom__btn_group'}>
<div className={'course__price'}>
<div className={'money'}>{payMoney}<span style={{fontSize: '18px'}}></span></div>
<div className={'discount'}>
限时特惠
<div className={'triangle'}></div>
{
isOnline
? (
<div className={'bottom__btn_group'}>
<div className={'course__price'}>
<div className={'money'}>{payMoney}<span style={{fontSize: '18px'}}></span></div>
<div className={'discount'}>
限时特惠
<div className={'triangle'}></div>
</div>
</div>
<div className={'btn__group'}>
<div className={'try__study'} onClick={this.tryLearn}>免费试学</div>
<div className={'sign__now'} onClick={this.signUp}>立即报名</div>
</div>
</div>
)
: (
<div className="bottom__btn_group">
<p className="online__label">Python人工智能</p>
<button className="online__button">即将上架 敬请期待</button>
</div>
</div>
)
}
{/* 课程介绍 */}
<Description list={desList} />
<div className={'btn__group'}>
<div className={'try__study'} onClick={this.tryLearn}>免费试学</div>
<div className={'sign__now'} onClick={this.signUp}>立即报名</div>
</div>
</div>
<Description list={desList}></Description>
<NoWorry list={worryList}></NoWorry>
<Study syllabus={syllabus} allSyllabusShow={allSyllabusShow} show={this.showAll}
hide={this.hideSome}></Study>
<Test practice={practice} allPracticeShow={allPracticeShow} show={this.showAll}
hide={this.hideSome}></Test>
<Team/>
<Experience tryLearn={this.tryLearn}/>
<img style={{display: 'block', width: '100%', height: '8px'}}
src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/h5_python_class/changjian.png" alt=""/>
<Progream/>
{/* 试学体验 */}
<Experience tryLearn={this.tryLearn} isOnline={isOnline} />
<img
style={{
display: 'block',
width: '100%',
height: '8px'
}}
src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/h5_python_class/changjian.png"
alt=""
/>
{/* 常见问题 */}
<Progream />
{
toApp && (<Mask type={1} closePop={this.closePop}/>)
}
......
......@@ -86,6 +86,24 @@
padding: 0 14px;
background: #fff;
.online__label {
font-size: 18px;
font-weight: 600;
color: #525C65;
}
.online__button {
width: 160px;
height: 37px;
border-style: none;
border-radius: 19px;
font-size: 15px;
font-weight: 600;
color: #fff;
background-color: rgba(82,92,101,.6);
outline: none;
}
.course__price {
width: 100px;
font-size: 24px;
......
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