Commit b7919efb by xuzhenghua

bug

parent 25938f72
self.__precacheManifest = [
{
"revision": "b132b6bccd243a35818d",
"url": "/static/js/purchased.b4a99115.chunk.js"
},
{
"revision": "f8dd12b31edf9bfeb67a",
"url": "/static/css/BargainMiddlePage.e979bb6e.chunk.css"
},
{
"revision": "676c9301d25292e2c052",
"url": "/static/css/Classify.c8113023.chunk.css"
},
{
"revision": "676c9301d25292e2c052",
"url": "/static/js/Classify.749fe5f6.chunk.js"
},
{
"revision": "5f4c95fca1e117c9e207",
"url": "/static/css/CourseList.c5876381.chunk.css"
},
{
"revision": "5f4c95fca1e117c9e207",
"url": "/static/js/CourseList.d47fef34.chunk.js"
},
{
"revision": "3536f30ae26d12283255",
"url": "/static/css/DrawDocument.2e7d81ca.chunk.css"
},
{
"revision": "3536f30ae26d12283255",
"url": "/static/js/DrawDocument.39af102b.chunk.js"
},
{
"revision": "4a11e07b9a727b017b1e",
"url": "/static/css/Examination.f2cc3163.chunk.css"
},
{
"revision": "4a11e07b9a727b017b1e",
"url": "/static/js/Examination.fc6423bb.chunk.js"
},
{
"revision": "28db6059d4aaeab3fa8a",
"url": "/static/js/MyEdit.d0b19073.chunk.js"
},
{
"revision": "a15998ac11ee01575da3",
"url": "/static/css/Order.8bb031ea.chunk.css"
},
{
"revision": "a15998ac11ee01575da3",
"url": "/static/js/Order.223ff497.chunk.js"
},
{
"revision": "79ff6ddac2659cbafdba",
"url": "/static/js/Orderinfo.93f1f54f.chunk.js"
},
{
"revision": "c419c78df13d6b2aff5c",
"url": "/static/css/PayOrder.e5315535.chunk.css"
},
{
"revision": "c419c78df13d6b2aff5c",
"url": "/static/js/PayOrder.3da3f74a.chunk.js"
},
{
"revision": "e2f5998fe921b6803c97",
"url": "/static/css/Preferential.7456653e.chunk.css"
},
{
"revision": "e2f5998fe921b6803c97",
"url": "/static/js/Preferential.2858f20b.chunk.js"
},
{
"revision": "104ce11497ad0a0b6dc3",
"url": "/static/css/SearchResult.b69c9a27.chunk.css"
},
{
"revision": "104ce11497ad0a0b6dc3",
"url": "/static/js/SearchResult.92e26ce6.chunk.js"
},
{
"revision": "3a4a42c8f7b060bb1689",
"url": "/static/css/ShopCart.3a4dbb7a.chunk.css"
},
{
"revision": "3a4a42c8f7b060bb1689",
"url": "/static/js/ShopCart.02f02571.chunk.js"
},
{
"revision": "b204be02682877f2c265",
"url": "/static/css/aist-share.bef8c404.chunk.css"
},
{
"revision": "b204be02682877f2c265",
"url": "/static/js/aist-share.f41ca3e6.chunk.js"
},
{
"revision": "92a7c6baeaf88724eecd",
"url": "/static/css/coupons.9ece7350.chunk.css"
},
{
"revision": "92a7c6baeaf88724eecd",
"url": "/static/js/coupons.719ba7ec.chunk.js"
},
{
"revision": "7af9018de40584f2fa87",
"url": "/static/css/detail.089b65d2.chunk.css"
},
{
"revision": "7af9018de40584f2fa87",
"url": "/static/js/detail.5d65bb98.chunk.js"
},
{
"revision": "1c9c2775c9d4985fee42",
"url": "/static/css/main.c008e594.chunk.css"
},
{
"revision": "1c9c2775c9d4985fee42",
"url": "/static/js/main.cdab969f.chunk.js"
},
{
"revision": "804ad89d86ad495d89b9",
"url": "/static/css/myorders.3ae12dec.chunk.css"
},
{
"revision": "804ad89d86ad495d89b9",
"url": "/static/js/myorders.f0a72e79.chunk.js"
},
{
"revision": "b132b6bccd243a35818d",
"url": "/static/css/purchased.1daf107b.chunk.css"
},
{
"revision": "f8dd12b31edf9bfeb67a",
"url": "/static/js/BargainMiddlePage.2ebc4f3d.chunk.js"
},
{
"revision": "ee5c1905002a73ae1e7a",
"url": "/static/js/runtime~main.97f061bb.js"
},
{
"revision": "4c92b5aeac0139b4a08a",
"url": "/static/css/search.b9dfce93.chunk.css"
},
{
"revision": "4c92b5aeac0139b4a08a",
"url": "/static/js/search.56731f85.chunk.js"
},
{
"revision": "b18d5c0a4abd2ba354ed",
"url": "/static/css/shareposter.3c7cba2d.chunk.css"
},
{
"revision": "b18d5c0a4abd2ba354ed",
"url": "/static/js/shareposter.3edafb76.chunk.js"
},
{
"revision": "02397f5420ad9c656802",
"url": "/static/css/study.ac267001.chunk.css"
},
{
"revision": "02397f5420ad9c656802",
"url": "/static/js/study.570af356.chunk.js"
},
{
"revision": "c3b5a42e85ab77b4d4c6",
"url": "/static/css/togroup.49988cae.chunk.css"
},
{
"revision": "c3b5a42e85ab77b4d4c6",
"url": "/static/js/togroup.352df40d.chunk.js"
},
{
"revision": "3c419fe6612d382d70ff",
"url": "/static/css/video.35136da8.chunk.css"
},
{
"revision": "3c419fe6612d382d70ff",
"url": "/static/js/video.5e8ccab0.chunk.js"
},
{
"revision": "80011994e30adf599e5f47fcc81bc06d",
"url": "/static/media/progress-share-bg.80011994.png"
},
{
"revision": "a70e8fed61e69e9c9019",
"url": "/static/js/24.cb73f517.chunk.js"
},
{
"revision": "c2692b9ec65a7d644968",
"url": "/static/js/25.dc48eee8.chunk.js"
},
{
"revision": "81a489ac63f2f2df5ab412e0782bd54c",
"url": "/static/media/kanjia_cg_icon.81a489ac.png"
},
{
"revision": "d6c75fa71f34b8ec92f9",
"url": "/static/js/26.75bd453a.chunk.js"
},
{
"revision": "70bfbce71cee63bf63ce",
"url": "/static/js/27.451e15ff.chunk.js"
},
{
"revision": "f983caa7c06f105373e7e1aec42da261",
"url": "/static/media/iconfont.f983caa7.svg"
},
{
"revision": "88ee21ff981b7093f68b",
"url": "/static/js/28.6db31585.chunk.js"
},
{
"revision": "cd1c41437a2e35a283e4b16b620a8c9e",
"url": "/static/media/iconfont.cd1c4143.eot"
},
{
"revision": "3df38dc7a54f39248999",
"url": "/static/js/29.8d0f5030.chunk.js"
},
{
"revision": "145742789ab409c81f28938b15b5dee7",
"url": "/static/media/iconfont.14574278.ttf"
},
{
"revision": "a88224351f48eb4dbc88",
"url": "/static/js/30.4c226ed3.chunk.js"
},
{
"revision": "7b542c778563daa7cc420d21ed1601b3",
"url": "/static/media/iconfont.7b542c77.woff"
},
{
"revision": "a33df006d7247324f487",
"url": "/static/js/31.a98afee5.chunk.js"
},
{
"revision": "a33df006d7247324f487",
"url": "/static/css/31.bc06dce4.chunk.css"
},
{
"revision": "a88224351f48eb4dbc88",
"url": "/static/css/30.ecbb6f9a.chunk.css"
},
{
"revision": "3df38dc7a54f39248999",
"url": "/static/css/29.5ed15c7e.chunk.css"
},
{
"revision": "88ee21ff981b7093f68b",
"url": "/static/css/28.694b4628.chunk.css"
},
{
"revision": "d6c75fa71f34b8ec92f9",
"url": "/static/css/26.1b3a6258.chunk.css"
},
{
"revision": "a70e8fed61e69e9c9019",
"url": "/static/css/24.257b0329.chunk.css"
},
{
"revision": "b4efdc32f2ef8a8b5edd75c341ec8bea",
"url": "/index.html"
}
];
\ No newline at end of file
self.__precacheManifest = [
{
"revision": "e6e7df3cef8b43e70518",
"url": "/static/js/purchased.175c167a.chunk.js"
},
{
"revision": "40e72ca80fc8edb2c442",
"url": "/static/css/BargainMiddlePage.6d24aba4.chunk.css"
},
{
"revision": "168394c95f594b0140b5",
"url": "/static/css/Classify.b13bb9a5.chunk.css"
},
{
"revision": "168394c95f594b0140b5",
"url": "/static/js/Classify.18894bc2.chunk.js"
},
{
"revision": "fa30d371b54ccddef290",
"url": "/static/css/CourseList.49ca5e9b.chunk.css"
},
{
"revision": "fa30d371b54ccddef290",
"url": "/static/js/CourseList.3f68eae8.chunk.js"
},
{
"revision": "2a34a8f4ca1effab3622",
"url": "/static/css/DrawDocument.aeb3f822.chunk.css"
},
{
"revision": "2a34a8f4ca1effab3622",
"url": "/static/js/DrawDocument.7fd9d55d.chunk.js"
},
{
"revision": "3d862d898d465a7341f6",
"url": "/static/css/Examination.7bb0622b.chunk.css"
},
{
"revision": "3d862d898d465a7341f6",
"url": "/static/js/Examination.681b3739.chunk.js"
},
{
"revision": "ffebe892c93d41c54cb7",
"url": "/static/js/MyEdit.539ac99a.chunk.js"
},
{
"revision": "a1d5c86143b19c704fb6",
"url": "/static/css/Order.c0945477.chunk.css"
},
{
"revision": "a1d5c86143b19c704fb6",
"url": "/static/js/Order.4b65d01b.chunk.js"
},
{
"revision": "8b4b8f37fc9f072019b1",
"url": "/static/js/Orderinfo.7c4e2304.chunk.js"
},
{
"revision": "6ce01a91c5ee2dddb1bc",
"url": "/static/css/PayOrder.7eb7d317.chunk.css"
},
{
"revision": "6ce01a91c5ee2dddb1bc",
"url": "/static/js/PayOrder.5675e80b.chunk.js"
},
{
"revision": "4e106dff3e36a539b58b",
"url": "/static/css/Preferential.a285bc5d.chunk.css"
},
{
"revision": "4e106dff3e36a539b58b",
"url": "/static/js/Preferential.b29b960e.chunk.js"
},
{
"revision": "2d8fe1910303d0a2185a",
"url": "/static/css/SearchResult.b10912cf.chunk.css"
},
{
"revision": "2d8fe1910303d0a2185a",
"url": "/static/js/SearchResult.7e04325a.chunk.js"
},
{
"revision": "7720fd8df2b4bee35fcb",
"url": "/static/css/ShopCart.92ab48a3.chunk.css"
},
{
"revision": "7720fd8df2b4bee35fcb",
"url": "/static/js/ShopCart.64dc22e9.chunk.js"
},
{
"revision": "a2577ac9940b16b159e8",
"url": "/static/css/aist-share.a97e13d0.chunk.css"
},
{
"revision": "a2577ac9940b16b159e8",
"url": "/static/js/aist-share.966b948f.chunk.js"
},
{
"revision": "258db4eb2f82f9ef57c1",
"url": "/static/css/coupons.f2c7a13b.chunk.css"
},
{
"revision": "258db4eb2f82f9ef57c1",
"url": "/static/js/coupons.72b220db.chunk.js"
},
{
"revision": "37781649cdb6a23f22bc",
"url": "/static/css/detail.86066899.chunk.css"
},
{
"revision": "37781649cdb6a23f22bc",
"url": "/static/js/detail.c1881240.chunk.js"
},
{
"revision": "b2886cc0c6c295f57190",
"url": "/static/css/main.792d1aeb.chunk.css"
},
{
"revision": "b2886cc0c6c295f57190",
"url": "/static/js/main.495a608e.chunk.js"
},
{
"revision": "046d6fec138271cce2b4",
"url": "/static/css/myorders.67814bde.chunk.css"
},
{
"revision": "046d6fec138271cce2b4",
"url": "/static/js/myorders.0ab23f3d.chunk.js"
},
{
"revision": "e6e7df3cef8b43e70518",
"url": "/static/css/purchased.19e06a3f.chunk.css"
},
{
"revision": "40e72ca80fc8edb2c442",
"url": "/static/js/BargainMiddlePage.2137765b.chunk.js"
},
{
"revision": "0c4f6705ab33b561ba0a",
"url": "/static/js/runtime~main.4ae3216c.js"
},
{
"revision": "70c180e7e7d67f89dc7e",
"url": "/static/css/search.0f0e9639.chunk.css"
},
{
"revision": "70c180e7e7d67f89dc7e",
"url": "/static/js/search.865ccd81.chunk.js"
},
{
"revision": "62a56af7f3b8d6693f46",
"url": "/static/css/shareposter.9e774e45.chunk.css"
},
{
"revision": "62a56af7f3b8d6693f46",
"url": "/static/js/shareposter.2842f7fe.chunk.js"
},
{
"revision": "50c19e85642e18768983",
"url": "/static/css/study.fec862ed.chunk.css"
},
{
"revision": "50c19e85642e18768983",
"url": "/static/js/study.7b23d1e0.chunk.js"
},
{
"revision": "6d6fc1f9d379a60a29f9",
"url": "/static/css/togroup.f08bc5f3.chunk.css"
},
{
"revision": "6d6fc1f9d379a60a29f9",
"url": "/static/js/togroup.7ef56b86.chunk.js"
},
{
"revision": "d7402d028af655b77785",
"url": "/static/css/video.8c5a5b8c.chunk.css"
},
{
"revision": "d7402d028af655b77785",
"url": "/static/js/video.5608b62d.chunk.js"
},
{
"revision": "80011994e30adf599e5f47fcc81bc06d",
"url": "/static/media/progress-share-bg.80011994.png"
},
{
"revision": "d8aa9c2e61990dcc8f77",
"url": "/static/js/24.468d80a9.chunk.js"
},
{
"revision": "c36733f1a53eb4beb646",
"url": "/static/js/25.403aae65.chunk.js"
},
{
"revision": "81a489ac63f2f2df5ab412e0782bd54c",
"url": "/static/media/kanjia_cg_icon.81a489ac.png"
},
{
"revision": "27a708318078e1b354e8",
"url": "/static/js/26.f842ed87.chunk.js"
},
{
"revision": "2725cf82a2822752e44f",
"url": "/static/js/27.33496196.chunk.js"
},
{
"revision": "f983caa7c06f105373e7e1aec42da261",
"url": "/static/media/iconfont.f983caa7.svg"
},
{
"revision": "10c55d4d70c2fce60ccb",
"url": "/static/js/28.ab85697f.chunk.js"
},
{
"revision": "145742789ab409c81f28938b15b5dee7",
"url": "/static/media/iconfont.14574278.ttf"
},
{
"revision": "0ddb8222b83ddc441ccb",
"url": "/static/js/29.52529984.chunk.js"
},
{
"revision": "cd1c41437a2e35a283e4b16b620a8c9e",
"url": "/static/media/iconfont.cd1c4143.eot"
},
{
"revision": "e0787ad15d0a12c4d4fc",
"url": "/static/js/30.3e2101f4.chunk.js"
},
{
"revision": "7b542c778563daa7cc420d21ed1601b3",
"url": "/static/media/iconfont.7b542c77.woff"
},
{
"revision": "621924f12c94584bb3e7",
"url": "/static/js/31.1bf13040.chunk.js"
},
{
"revision": "621924f12c94584bb3e7",
"url": "/static/css/31.57d8b033.chunk.css"
},
{
"revision": "e0787ad15d0a12c4d4fc",
"url": "/static/css/30.35e22f8c.chunk.css"
},
{
"revision": "0ddb8222b83ddc441ccb",
"url": "/static/css/29.bf839917.chunk.css"
},
{
"revision": "10c55d4d70c2fce60ccb",
"url": "/static/css/28.42a89c77.chunk.css"
},
{
"revision": "27a708318078e1b354e8",
"url": "/static/css/26.73976871.chunk.css"
},
{
"revision": "d8aa9c2e61990dcc8f77",
"url": "/static/css/24.965d713a.chunk.css"
},
{
"revision": "2daebf207ca7cb045b9b4fe4df93fd00",
"url": "/index.html"
}
];
\ No newline at end of file
......@@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");
importScripts(
"/precache-manifest.73cc4eabeac54e267964a5a7b74e3b7c.js"
"/precache-manifest.69cf0469395a840afe68a9cf8b14f389.js"
);
workbox.clientsClaim();
......
import React from 'react';
import { NavLink } from 'react-router-dom'
import { NavLink, withRouter } from 'react-router-dom'
import './index.scss';
const navLinkConfig = [
......@@ -7,29 +7,33 @@ const navLinkConfig = [
to: '/',
exact: true,
icon: 'iconshouye-xianxing',
activeIcon: 'iconshouye1',
text: '首页'
},
{
to: '/classify',
exact: false,
icon: 'iconfenlei-xianxing',
activeIcon: 'iconfenlei-chunse',
text: '分类'
},
{
to: '/study',
exact: false,
icon: 'iconxuexi-xianxing',
activeIcon: 'iconxuexi-chunse',
text: '学习'
},
{
to: '/my',
exact: false,
icon: 'iconwode-xianxing',
activeIcon: 'iconwode-chunse',
text: '我的'
}
]
const NavBar = React.memo(() => {
const NavBar = React.memo(({location}) => {
return (
<div className="nav-bar">
{
......@@ -42,7 +46,7 @@ const NavBar = React.memo(() => {
key={icon}
{...rest}
>
<i className={`iconfont ${icon}`}/>
<i className={`iconfont ${location.pathname.startsWith(item.to) ? item.activeIcon : item.icon}`}/>
<span>{text}</span>
</NavLink>
)
......@@ -52,4 +56,4 @@ const NavBar = React.memo(() => {
)
})
export default NavBar
\ No newline at end of file
export default withRouter(NavBar)
\ No newline at end of file
......@@ -109,11 +109,11 @@ class Index extends Component {
}
toCourseDetail = (id) => {
const {dispatch, history} = this.props;
dispatch(getCourses(id, () => {
const { dispatch, history } = this.props;
// dispatch(getCourses(id, () => {
history.push(`/detail?id=${id}`);
return false;
}));
// }));
}
render() {
......
......@@ -307,10 +307,10 @@
.bargain {
width: 165px;
height: 30px;
background: $bg_FADD29;
background: $bg_077FD0;
border-radius: 2px;
border: none;
color: $color_FF4000;
color: $white;
-webkit-appearance: none;
display: inline-block;
text-align: center;
......
......@@ -285,10 +285,10 @@ class BargainMiddlePage extends Component {
toCourseDetail = (id) => {
const { dispatch, history } = this.props;
dispatch(getCourses(id, () => {
// dispatch(getCourses(id, () => {
history.push(`/detail?id=${id}`);
return false;
}));
// }));
}
render() {
......@@ -447,7 +447,7 @@ class BargainMiddlePage extends Component {
}
</ul>
</div>
<Link to={'/preferential'} className={'preferential'}>查看更多精品课程 >></Link>
<Link to={'/classify'} className={'preferential'}>查看更多精品课程 >></Link>
{/*更多好友砍价*/}
......
......@@ -107,9 +107,9 @@ class Classify extends Component {
toCourseDetail = (id) => {
const { dispatch, history } = this.props;
dispatch(getCourses(id, () => {
// dispatch(getCourses(id, () => {
history.push(`/detail?id=${id}`)
}));
// }));
}
toClassify=()=>{
......
......@@ -54,10 +54,10 @@ class Classify extends Component {
toCourseDetail = (id) => {
const { dispatch, history } = this.props;
dispatch(getCourses(id, () => {
// dispatch(getCourses(id, () => {
history.push(`/detail?id=${id}`);
return false;
}));
// }));
}
render() {
......
......@@ -149,10 +149,10 @@ class UseCoupon extends PureComponent {
if (coupon['ctype'] === 1) {
history.push(`/classify`)
} else {
dispatch(getCourses(coupon['limit_course'], () => {
// dispatch(getCourses(coupon['limit_course'], () => {
history.push(`/detail?id=${coupon['limit_course']}`);
return false;
}));
// }));
}
} else {
......
......@@ -21,7 +21,8 @@ export const fetchCoursesListIfNeeded = () => (dispatch, getState) => {
}
export const getCourses = (id, cb) => dispatch => {
const courseId = id? id : getParam('id');
return http.get(`${API.home}/m/course/detail/${courseId}`,).then((res) => {
const url = getParam('dist_code')? `${API.home}/m/course/detail/${courseId}/${getParam('dist_code')}` : `${API.home}/m/course/detail/${courseId}`;
return http.get(url).then((res) => {
if (res.data.code === 200) {
dispatch(receiveCourseDetail({
...res.data.data
......
......@@ -23,7 +23,8 @@ class Bargain extends Component {
limitPeople: '',
status: '',
bargainCode: '',
time: ''
time: '',
barInfo: {}
}
}
......@@ -58,9 +59,10 @@ class Bargain extends Component {
http.post(`${API.home}/m/bargain/courseDetail`, data).then((res) => {
if (res.data.code === 200) {
this.setState({
info: res.data.data,
limitPeople: res.data.data.limit_people,
bargainCode: res.data.data.bargain_code
barInfo: res.data.data,
// info: res.data.data,
// limitPeople: res.data.data.limit_people,
// bargainCode: res.data.data.bargain_code
})
if (res.data.data.bargain_status === 0) {
this.getBargainRankList(getParam('id'), 0)
......@@ -120,7 +122,8 @@ class Bargain extends Component {
}
// 继续砍价
continueBargain = () => {
const code = this.state.bargainCode
const { barInfo = {} } = this.state;
const code = barInfo.bargain_code;
this.props.history.push(`/bargain-middle-page?id=${getParam('id')}&bargaincode=${code}&is_originator=1`)
}
......@@ -177,6 +180,7 @@ class Bargain extends Component {
}
render() {
const { list, outList, barInfo } = this.state;
const {user} = this.props
const uid = user && user.data && user.data.uid
return (
......@@ -184,14 +188,14 @@ class Bargain extends Component {
{/*bargain_status 砍价状态 0-砍价中,1砍价结束,待支付,2砍价过期(没有砍价记录没有砍价信息),3已购买*/}
{
(this.state.info.bargain_status === 2 || !uid) &&
<BargainIntro limitPeople={this.state.limitPeople} iWantBargain={this.iWantBargain}/>
(barInfo.bargain_status === 2 || !uid) &&
<BargainIntro limitPeople={barInfo.limitPeople} iWantBargain={this.iWantBargain}/>
}
{
(this.state.info.bargain_status === 0 || this.state.info.bargain_status === 1) &&
(barInfo.bargain_status === 0 || barInfo.bargain_status === 1) &&
<BargainStatus
info={this.state.info}
outList={this.state.outList}
info={barInfo}
outList={outList}
getMore={this.getMore}
toArtifact={this.toArtifact}
useArtifact={this.useArtifact}
......@@ -232,8 +236,13 @@ class Bargain extends Component {
{/*更多好友砍价*/}
<Ranking list={this.state.list} icon={this.state.kanjiaIcon} limitPeople={this.state.limitPeople}
isShowMore={this.state.isShowMore} boxHide={this.boxHide}></Ranking>
<Ranking
list={list}
icon={this.state.kanjiaIcon}
limitPeople={barInfo.limitPeople}
isShowMore={this.state.isShowMore}
boxHide={this.boxHide}
/>
</div>
)
......
......@@ -6,7 +6,6 @@ import { getCourses } from "@/components/detail/actions"
import { connect } from "react-redux"
import './index.scss'
import Overlay from '../overlay'
import axios from "axios";
class BtnStatus extends Component {
......@@ -18,7 +17,7 @@ class BtnStatus extends Component {
group_status: 3,
in_cart: false,
countdown: 0,
// barInfo: ''
barInfo: {}
}
}
......@@ -40,38 +39,44 @@ class BtnStatus extends Component {
// }
componentWillReceiveProps(nextProps) {
const { data = {}} = nextProps;
if(data.is_bargain) {
this.getBargainInfo();
}
// if(nextProps.data && nextProps.data.is_bargain) {
// this.getBargainInfo()
// }
this.setState({
...nextProps.data.course_info,
courseInfo: data,
countdown: nextProps.countdown,
});
}
// 加入购物车 type:1 加入购物车,2加入购物车并跳转到购物车页面去支付
toCart = (type) => {
const { history, addCourseToCart } = this.props;
let data = {
course_id: getParam('id')
};
http.post(`${API.home}/m/cart/add`, data).then((res) => {
if (res.data.code === 200) {
if (type === 1) {
Toast.info('已加入购物车', 2)
// this.props.getCourses()
// document.location.reload()
addCourseToCart();
} else {
history.replace('/shopcart');ß
}
} else if (res.data.code === 15001) {
history.replace('/shopcart');
} else {
Toast.info(res.data.msg, 2);
}
})
};
// // 加入购物车 type:1 加入购物车,2加入购物车并跳转到购物车页面去支付
// toCart = (type) => {
// const { history, addCourseToCart } = this.props;
// let data = {
// course_id: getParam('id')
// };
// http.post(`${API.home}/m/cart/add`, data).then((res) => {
// if (res.data.code === 200) {
// if (type === 1) {
// Toast.info('已加入购物车', 2)
// // this.props.getCourses()
// // document.location.reload()
// addCourseToCart();
// } else {
// history.replace('/shopcart');ß
// }
// } else if (res.data.code === 15001) {
// history.replace('/shopcart');
// } else if (res.data.code === 4030) {
// history.replace('/passport');
// } else {
// Toast.info(res.data.msg, 2);
// }
// })
// };
// 返现课程的立即购买
signUpNow = () => {
if(this.props.user.hasError) {
......@@ -110,7 +115,8 @@ class BtnStatus extends Component {
};
// 直接购买
tobuy = () => {
const {user, barInfo} = this.props
const {user} = this.props;
const {barInfo} = this.state;
const uid = user && user.data && user.data.uid
if (!uid) {
this.props.history.push('/passport/login')
......@@ -198,7 +204,7 @@ class BtnStatus extends Component {
parent_uid: 0 // 被助力人id 【自己本人操作传0】
}
http.post(`${API.home}/m/bargain/toBargain`, data).then((res) => {
const {data: {data, code, msg}} = res;
const {data, code, msg} = res.data;
if (code === 200) {
history.push(`/bargain-middle-page?id=${course_id}&bargaincode=${data.bargain_code}&is_originator=1`)
} else {
......@@ -228,10 +234,12 @@ class BtnStatus extends Component {
}
render() {
console.log(this.state);
// data 课程信息;barInfo 砍价信息
const { data: info = {}, barInfo = {}, user = {} } = this.props;
const { countdown } = this.state;
const { user = {}, toCart } = this.props;
const { countdown ,barInfo, courseInfo: info = {}} = this.state;
const uid = user.data && user.data.uid;
console.log(info.in_cart);
return (
<div>
{/*正常购买*/}
......@@ -248,7 +256,7 @@ class BtnStatus extends Component {
}
{
!info.in_cart &&
<button className='btn btn-s bg-FCCD05' onClick={e => this.toCart(1)}>加入购物车</button>
<button className='btn btn-s bg-FCCD05' onClick={e => toCart(1)}>加入购物车</button>
}
<span className='btn btn-s bg-FD7700' onClick={e => this.simpleCourse()}>立即报名</span>
......
......@@ -37,10 +37,9 @@ class Group extends Component {
}
toPay = (pdd_order_id) => {
const courseInfo = this.props.courseInfo.courseInfo.course_info;
const {courseInfo, history} = this.props;
if (courseInfo.group_status === 3) {
this.props.history.push(`/order?id=${getParam('id')}`, {group: 1})
history.push(`/order?id=${getParam('id')}`, {group: 1});
} else {
this.setState({
isShowMore: false,
......@@ -76,8 +75,9 @@ class Group extends Component {
}
componentDidMount() {
if (this.props.courseInfo && this.props.courseInfo.courseInfo && this.props.courseInfo.courseInfo.course_info && this.props.courseInfo.courseInfo.course_info.pdd_group_info) {
let now_groupon_list = this.props.courseInfo.courseInfo.course_info.pdd_group_info.now_groupon_list;
const { courseInfo={} } = this.props;
if (courseInfo.pdd_group_info) {
let now_groupon_list = courseInfo.pdd_group_info.now_groupon_list;
if (now_groupon_list && now_groupon_list.length > 0) {
// setInterval(() => {
now_groupon_list.map(item => {
......@@ -111,12 +111,16 @@ class Group extends Component {
}
render() {
const { courseInfo } = this.props;
const { alreadyIn, countdown, now_groupon_list } = this.state;
let groupInfo = '', groupon_member = '', group_status = -1, groupSuccessMbc = null;
if (this.props.courseInfo && this.props.courseInfo.courseInfo && this.props.courseInfo.courseInfo.course_info) {
groupInfo = this.props.courseInfo.courseInfo.course_info.pdd_group_info;
let groupInfo = '',
groupon_member = '',
group_status = -1,
groupSuccessMbc = null;
if (courseInfo) {
groupInfo = courseInfo.pdd_group_info;
groupon_member = groupInfo.groupon_member;
group_status = this.props.courseInfo.courseInfo.course_info.group_status;
group_status = courseInfo.group_status;
}
if (group_status === 4) {
if (groupon_member.member) {
......@@ -249,7 +253,9 @@ class Group extends Component {
}
}
export default connect(
state => ({ courseInfo: state }),
null
)(Group)
// export default connect(
// state => ({ courseInfo: state }),
// null
// )(Group)
export default Group;
......@@ -159,6 +159,7 @@
.group-status {
line-height: 60px;
font-size: 12px;
color: $color_666;
position: absolute;
right: 66px;
......
......@@ -35,7 +35,7 @@ class ToGroup extends Component {
title: `【仅剩${number}个名额】我${pdd_price}元拼了《${data.course_title}》`,
desc: data.course_title, // 分享描述
// 直接进入课程详情页,isIn: 1
link: location.origin + `/detail?id=${data.course_id}&isIn=1`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
link: location.origin + `/detail?id=${data.course_id}`, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: data.image_name, // 分享图标
};
http.post(`${API['base-api']}/m/sale/signature`).then(res => {
......@@ -124,10 +124,10 @@ class ToGroup extends Component {
toCourseDetail = (id) => {
const { dispatch, history } = this.props;
dispatch(getCourses(id, () => {
// dispatch(getCourses(id, () => {
history.push(`/detail?id=${id}`, {href: '/classify'});
return false;
}));
// }));
}
render() {
......
......@@ -45,8 +45,8 @@ class OutLine extends Component {
{title: '大纲'}
];
let introduce = ''
if (this.props.data.course_info) {
introduce = this.props.data.course_info
if (this.props.data) {
introduce = this.props.data
}
return (
<div className='course-detail'>
......
......@@ -18,7 +18,6 @@ class ShareRank extends Component {
}
componentDidMount() {
console.log(this.props);
this.getRankList()
this.getCode()
}
......@@ -87,10 +86,11 @@ class ShareRank extends Component {
}
render() {
let info = ''
if (this.props.courseInfo && this.props.courseInfo.courseInfo && this.props.courseInfo.courseInfo.course_info) {
info = this.props.courseInfo.courseInfo.course_info
}
const { courseInfo: info = '' } = this.props;
// let info = ''
// if (this.props.courseInfo && this.props.courseInfo.courseInfo && this.props.courseInfo.courseInfo.course_info) {
// info = this.props.courseInfo.courseInfo.course_info
// }
return (
<div className='share-ranking'>
<Flex className='share-container' justify='between'>
......@@ -157,7 +157,7 @@ class ShareRank extends Component {
export default compose(
connect(
state => ({
courseInfo: state,
// courseInfo: state,
user: state.user
}),
null
......
......@@ -30,10 +30,10 @@ class My extends PureComponent {
toCourseDetail = (id) => {
const { dispatch, history } = this.props;
dispatch(getCourses(id, () => {
// dispatch(getCourses(id, () => {
history.push(`/detail?id=${id}`);
return false;
}));
// }));
}
render() {
......
......@@ -75,10 +75,10 @@ class MyOrders extends Component {
toCourseDetail = (id) => {
const { dispatch, history } = this.props;
dispatch(getCourses(id, () => {
// dispatch(getCourses(id, () => {
history.push(`/detail?id=${id}`);
return false;
}));
// }));
}
......
......@@ -373,9 +373,9 @@ class Order extends Component {
toCourseDetail = (id) => {
const { dispatch, history } = this.props;
dispatch(getCourses(id, () => {
// dispatch(getCourses(id, () => {
history.push(`/detail?id=${id}`)
}));
// }));
}
render() {
......
......@@ -80,9 +80,9 @@ class Preferential extends Component {
toCourseDetail = (id) => {
const { dispatch, history } = this.props;
dispatch(getCourses(id, () => {
// dispatch(getCourses(id, () => {
history.push(`/detail?id=${id}`)
}));
// }));
}
render() {
......
......@@ -37,9 +37,9 @@ class Purchased extends Component {
toCourseDetail = (id) => {
const { dispatch, history } = this.props;
dispatch(getCourses(id, () => {
// dispatch(getCourses(id, () => {
history.push(`/detail?id=${id}`)
}));
// }));
}
......
......@@ -188,9 +188,9 @@ class _Scholarship extends Component {
toCourseDetail = (id) => {
const { dispatch, history } = this.props;
dispatch(getCourses(id, () => {
// dispatch(getCourses(id, () => {
history.push(`/detail?id=${id}`)
}));
// }));
}
render() {
......
......@@ -35,9 +35,9 @@ class Recommendation extends Component {
toCourseDetail = (id) => {
const { dispatch, history } = this.props;
dispatch(getCourses(id, () => {
// dispatch(getCourses(id, () => {
history.push(`/detail?id=${id}`)
}));
// }));
}
render() {
......
......@@ -57,9 +57,9 @@ class SearchResult extends PureComponent {
toCourseDetail = (id) => {
const { dispatch, history } = this.props;
dispatch(getCourses(id, () => {
// dispatch(getCourses(id, () => {
history.push(`/detail?id=${id}`)
}));
// }));
}
render() {
......
......@@ -56,7 +56,7 @@ class SharePoster extends Component {
let qrCodeWidth = (imgList[index].qr_code_width * $width) // 二维码宽度
let qrCodeHeight = (imgList[index].qr_code_height * $height) - avatarHeight / 2 // 二维码高度
let qrCodeLink = `/detail/${getParam('courseId')}/${getParam('dist_code')}`
let qrCodeLink = `https://m.julyedu.com/detail?id=${getParam('courseId')}&dist_code${getParam('dist_code')}`
var canvas = document.getElementById("canvas"),
context = canvas.getContext("2d");
......@@ -156,7 +156,7 @@ class SharePoster extends Component {
// 获取二维码
getCodeWe() {
let _this = this
let qrCodeLink = `http://m.julyedu.com/detail/${getParam('courseId')}/${getParam('dist_code')}`
let qrCodeLink = `https://m.julyedu.com/detail?id=${getParam('courseId')}&dist_code=${getParam('dist_code')}`
return new Promise(resolve => {
QRCode.toDataURL(qrCodeLink, {}, function (err, url) {
_this.setState({
......
......@@ -168,9 +168,9 @@ class Cart extends Component {
toCourseDetail = (id) => {
console.log(id);
const { dispatch, history } = this.props;
dispatch(getCourses(id, () => {
// dispatch(getCourses(id, () => {
history.push(`/detail?id=${id}`)
}));
// }));
}
......
......@@ -46,9 +46,9 @@ class Recommendation extends PureComponent {
toCourseDetail = (id) => {
const { dispatch, history } = this.props;
dispatch(getCourses(id, () => {
// dispatch(getCourses(id, () => {
history.push(`/detail?id=${id}`)
}));
// }));
}
render() {
......
......@@ -42,6 +42,7 @@
background: #F5FBFF;
margin-bottom: 15px;
line-height: 35px;
font-size: $font_12;
color: #000;
border-top: 1px solid transparent;
......
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