Commit 2ad44c74 by xuzhenghua

Merge branch '0821bug' of gitlab.julyedu.com:baiguangyao/mr-julyedu

# Conflicts:
#	src/components/order/payOrder/PayOrder.scss
parents 5ca713ee 8c5d1cf5
......@@ -30,7 +30,7 @@ class HeaderBar extends Component {
}
{
toHref && typeof toHref === 'function' &&
<i className='iconfont iconiconfront-68' onClick={toHref}>1</i>
<i className='iconfont iconiconfront-68' onClick={toHref}></i>
}
{
toHref && typeof toHref === 'string' &&
......
......@@ -12,15 +12,25 @@ class HeaderBar extends Component {
}
goShop = () => {
location.replace('/shopcart');
location.replace('/shopcart')
}
render() {
{
console.log(this.props.toHref);
}
return (
<div className='preferential'>
<div className="search-nav">
{
!this.props.toHref &&
<i className={'iconfont iconiconfront-68 return'} onClick={this.return.bind(this)}></i>
}
{
this.props.toHref &&
<i className={'iconfont iconiconfront-68 return'} onClick={this.props.toHref}></i>
}
<SearchBar
placeholder="搜索课程"
cancelText={" "}
......
......@@ -10,6 +10,11 @@
position: relative;
width: 125px;
height: 90px;
img {
width: 100%;
height: 100%;
border-radius: 3px;
}
a {
position: relative;
......@@ -42,8 +47,6 @@
.order-title {
font-size: 16px;
color: $color_333;
height: 18px;
line-height: 18px;
}
.order-content {
......
......@@ -147,6 +147,19 @@ class BargainMiddlePage extends Component {
}
})
}
// 我要砍价列表的去支付
toCartBottom=(id)=>{
let data = {
course_id: id
}
http.post(`${API.home}/m/cart/add`, data).then((res) => {
if (res.data.code === 200 || res.data.code === 15001) {
this.props.history.push('/shopcart')
} else {
Toast.info(res.data.msg, 2);
}
})
}
// 查看更多
getMore = () => {
......@@ -425,7 +438,7 @@ class BargainMiddlePage extends Component {
bottom={
<CourseBottom
item={item}
toCart={this.toCart}
toCartBottom={this.toCartBottom.bind(this,item.course_id)}
toDetail={this.toCourseDetail}
/>
}
......@@ -533,7 +546,7 @@ function CourseBottom(props) {
// Buttons = <Link to={`/detail?id=${props.item.course_id}`} className={'bargain'}>我要砍价</Link>
Buttons = <a href="javascript:;" onClick={() => props.toDetail(props.item.course_id)} className={'bargain'}>我要砍价</a>
} else if (props.item.bargain_status === 3) {
Buttons = <Link to={`/play/video?id=${props.item.course_id}`} className={'bargain'}>去学习</Link>
Buttons = <Link to={`/play/video?id=${props.item.v_course_id}`} className={'bargain'}>去学习</Link>
} else {
Buttons = (
<div className="btns">
......@@ -551,7 +564,7 @@ function CourseBottom(props) {
}
<button onClick={props.toCart}
<button onClick={props.toCartBottom}
className={'purchase-btn'}>¥{props.item.pay_price}去支付
</button>
</div>
......
......@@ -112,6 +112,10 @@ class Classify extends Component {
}));
}
toClassify=()=>{
location.replace('/classify');
}
render() {
const bottom = (
<i className={'iconfont iconiconfront-69 pull-down'}></i>
......@@ -124,7 +128,7 @@ class Classify extends Component {
return (
<div className='class-child'>
<HeaderSearch></HeaderSearch>
<HeaderSearch toHref={this.toClassify}></HeaderSearch>
<Loading isLoading={this.state.isLoading}>
<div className='class-content'>
<WhiteSpace/>
......
......@@ -8,6 +8,7 @@ import { api, getParam, http } from "@/utils"
import Ranking from "@/components/bargainMiddlePage/ranking"
import { compose } from "redux"
import { withRouter } from 'react-router-dom'
import {connect} from "react-redux";
class Bargain extends Component {
......@@ -125,8 +126,14 @@ class Bargain extends Component {
// 我要砍价
iWantBargain = () => {
const {user} = this.props
const uid = user && user.data && user.data.uid
if(!uid){
this.props.history.push('/passport/login')
} else {
this.toKanjia(getParam('id'), 1, 0)
}
}
// 砍价接口
toKanjia = (id, type, uid) => {
......@@ -170,11 +177,14 @@ class Bargain extends Component {
}
render() {
const {user} = this.props
const uid = user && user.data && user.data.uid
return (
<div className={'bargain-func'}>
{/*bargain_status 砍价状态 0-砍价中,1砍价结束,待支付,2砍价过期(没有砍价记录没有砍价信息),3已购买*/}
{
this.state.info.bargain_status === 2 &&
(this.state.info.bargain_status === 2 || !uid) &&
<BargainIntro limitPeople={this.state.limitPeople} iWantBargain={this.iWantBargain}/>
}
{
......@@ -394,5 +404,11 @@ function UseArtifact(props) {
export default compose(
connect(
state => ({
user: state.user
}),
null
),
withRouter
)(Bargain)
......@@ -110,13 +110,13 @@ class OutLine extends Component {
{
// 已购买直播结束已上传视频:正常播放按钮,点击播放课程
!introduce.is_aist && item.class_status === 2 &&
<Link to={`/play/video?id=${introduce.v_course_id}`} className='iconfont icondanseshixintubiao-23 icon-right-22'></Link>
<Link to={`/play/video?id=${introduce.v_course_id + '&video_id=' + item.video_id}`} className='iconfont icondanseshixintubiao-23 icon-right-22'></Link>
}
{
// 返现课程 是返现课程 未开课 已开课 是返现课程 未开课 已开课 已练习
introduce.is_aist && item.is_open && introduce.is_baoming === 1 &&
<Link to={`/play/video?id=${introduce.v_course_id}`} className='aist aist_open'></Link>
<Link to={`/play/video?id=${introduce.v_course_id + '&video_id=' + item.video_id}`} className='aist aist_open'></Link>
}
......
......@@ -286,7 +286,6 @@ class Order extends Component {
}
});
} else if (this.props.location.state && this.props.location.state.group === 1){
console.log(2);
// 获取一键开团的课程
Promise.all([http.get(`${API.home}/m/course/detail/${getParam('id')}`),http.get(`${API['base-api']}/m/order/preorder`)]).then(resList => {
let courseInfo = resList[0],
......
......@@ -108,8 +108,6 @@
justify-content: space-around;
.order-title {
height: 18px;
line-height: 18x;
color: $color_333;
font-size: $font_16;
}
......
......@@ -10,7 +10,6 @@
font-size: 15px;
color: #333333;
}
.number {
font-size: 12px;
color: #666666;
......@@ -22,19 +21,13 @@
}
.pay-type-list {
.am-list-body {
&::after {
display: none;
}
}
.am-list-header {
color: #333333;
font-size: 15px;
background-color: #fff;
}
.iconalipay {
.iconzhifubaox- {
font-size: 22px;
color: #01aaef;
}
......@@ -55,7 +48,6 @@
border-radius: 50%;
background-color: #c1c1c1;
}
.am-radio-inner:after {
display: block;
border-color: #fff;
......@@ -69,7 +61,6 @@
width: 20px;
height: 20px;
}
.am-radio.am-radio-checked .am-radio-inner:after {
display: block;
}
......@@ -117,7 +108,7 @@
background-color: #FFF;
padding-bottom: 10px;
.check-title {
.check-title{
color: #333333;
font-size: 16px;
text-align: center;
......@@ -133,7 +124,6 @@
.am-list-item .am-list-line .am-list-extra {
flex-basis: 16%;
}
.am-radio-inner {
width: 20px;
height: 20px;
......@@ -141,14 +131,12 @@
border: 1px solid #BFBFBF;
background-color: #fff;
}
.am-radio-inner:after {
display: block;
border-color: #fff;
top: 0;
right: 6px;
}
.am-radio.am-radio-checked .am-radio-inner {
background-color: #009aff;
border: 1px solid #FFF;
......@@ -156,7 +144,6 @@
width: 20px;
height: 20px;
}
.am-radio.am-radio-checked .am-radio-inner:after {
display: block;
}
......@@ -181,6 +168,8 @@
.order-des {
height: 24px;
line-height: 33px;
position: absolute;
bottom: 0;
.order-newprice {
font-size: 16px;
......@@ -199,9 +188,11 @@
.v-list-item {
padding: 10px 15px;
background-color: #fff;
border-bottom: 1px solid #e7eaf1;
.content {
border: none;
padding-bottom: 0;
.cover {
flex: inherit;
......@@ -209,6 +200,7 @@
img {
width: 100%;
height: 100%;
}
.course-status {
......
......@@ -364,13 +364,6 @@ class Video extends Component {
if (this.lessonAvailable()) {
if (this.hasAuth()) {
Promise.resolve().then(() => {
let {videoList, course} = this.state
let videoIndex = videoList.findIndex(item => item.id == course.last_video_id)
this.setState({
activeIndex: videoIndex < 0 ? 0 : videoIndex
})
this.initializePlayer()
this.playWithAuth()
})
......@@ -425,8 +418,12 @@ class Video extends Component {
}
lessonAvailable = () => {
const {videoList, activeIndex} = this.state
return videoList[activeIndex]['video_size'] !== 0
let {videoList, course} = this.state
let videoIndex = videoList.findIndex(item => item.id == course.last_video_id)
this.setState({
activeIndex: videoIndex
})
return videoList[videoIndex]['video_size'] !== 0
}
getCoursePrice = () => {
......@@ -450,8 +447,13 @@ class Video extends Component {
}
hasAuth = () => {
const {course, videoList, activeIndex} = this.state
let lesson = videoList[activeIndex]
const {course, videoList} = this.state
let videoIndex = videoList.findIndex(item => item.id == course.last_video_id)
this.setState({
activeIndex: videoIndex
})
let lesson = videoList[videoIndex]
if (lesson['video_auth']) {
this.setState({
......
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