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 { ...@@ -30,7 +30,7 @@ class HeaderBar extends Component {
} }
{ {
toHref && typeof toHref === 'function' && 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' && toHref && typeof toHref === 'string' &&
......
...@@ -12,15 +12,25 @@ class HeaderBar extends Component { ...@@ -12,15 +12,25 @@ class HeaderBar extends Component {
} }
goShop = () => { goShop = () => {
location.replace('/shopcart'); location.replace('/shopcart')
} }
render() { render() {
{
console.log(this.props.toHref);
}
return ( return (
<div className='preferential'> <div className='preferential'>
<div className="search-nav"> <div className="search-nav">
<i className={'iconfont iconiconfront-68 return'} onClick={this.return.bind(this)}></i> {
!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 <SearchBar
placeholder="搜索课程" placeholder="搜索课程"
cancelText={" "} cancelText={" "}
......
...@@ -10,6 +10,11 @@ ...@@ -10,6 +10,11 @@
position: relative; position: relative;
width: 125px; width: 125px;
height: 90px; height: 90px;
img {
width: 100%;
height: 100%;
border-radius: 3px;
}
a { a {
position: relative; position: relative;
...@@ -42,8 +47,6 @@ ...@@ -42,8 +47,6 @@
.order-title { .order-title {
font-size: 16px; font-size: 16px;
color: $color_333; color: $color_333;
height: 18px;
line-height: 18px;
} }
.order-content { .order-content {
......
...@@ -66,7 +66,7 @@ class BargainMiddlePage extends Component { ...@@ -66,7 +66,7 @@ class BargainMiddlePage extends Component {
limitPeople: res.data.data.course.limit_people, limitPeople: res.data.data.course.limit_people,
bargainData: res.data.data.bargain, bargainData: res.data.data.bargain,
width: (res.data.data.bargain.bargain_price / res.data.data.bargain.total_price).toFixed(2) * 100 + '%' width: (res.data.data.bargain.bargain_price / res.data.data.bargain.total_price).toFixed(2) * 100 + '%'
}, },
() => { () => {
if (this.state.bargainData.expire_time) { if (this.state.bargainData.expire_time) {
let date = this.state.bargainData.expire_time * 1000 let date = this.state.bargainData.expire_time * 1000
...@@ -147,6 +147,19 @@ class BargainMiddlePage extends Component { ...@@ -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 = () => { getMore = () => {
...@@ -425,7 +438,7 @@ class BargainMiddlePage extends Component { ...@@ -425,7 +438,7 @@ class BargainMiddlePage extends Component {
bottom={ bottom={
<CourseBottom <CourseBottom
item={item} item={item}
toCart={this.toCart} toCartBottom={this.toCartBottom.bind(this,item.course_id)}
toDetail={this.toCourseDetail} toDetail={this.toCourseDetail}
/> />
} }
...@@ -533,7 +546,7 @@ function CourseBottom(props) { ...@@ -533,7 +546,7 @@ function CourseBottom(props) {
// Buttons = <Link to={`/detail?id=${props.item.course_id}`} className={'bargain'}>我要砍价</Link> // 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> Buttons = <a href="javascript:;" onClick={() => props.toDetail(props.item.course_id)} className={'bargain'}>我要砍价</a>
} else if (props.item.bargain_status === 3) { } 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 { } else {
Buttons = ( Buttons = (
<div className="btns"> <div className="btns">
...@@ -551,7 +564,7 @@ function CourseBottom(props) { ...@@ -551,7 +564,7 @@ function CourseBottom(props) {
} }
<button onClick={props.toCart} <button onClick={props.toCartBottom}
className={'purchase-btn'}>¥{props.item.pay_price}去支付 className={'purchase-btn'}>¥{props.item.pay_price}去支付
</button> </button>
</div> </div>
......
...@@ -112,6 +112,10 @@ class Classify extends Component { ...@@ -112,6 +112,10 @@ class Classify extends Component {
})); }));
} }
toClassify=()=>{
location.replace('/classify');
}
render() { render() {
const bottom = ( const bottom = (
<i className={'iconfont iconiconfront-69 pull-down'}></i> <i className={'iconfont iconiconfront-69 pull-down'}></i>
...@@ -124,7 +128,7 @@ class Classify extends Component { ...@@ -124,7 +128,7 @@ class Classify extends Component {
return ( return (
<div className='class-child'> <div className='class-child'>
<HeaderSearch></HeaderSearch> <HeaderSearch toHref={this.toClassify}></HeaderSearch>
<Loading isLoading={this.state.isLoading}> <Loading isLoading={this.state.isLoading}>
<div className='class-content'> <div className='class-content'>
<WhiteSpace/> <WhiteSpace/>
......
...@@ -8,6 +8,7 @@ import { api, getParam, http } from "@/utils" ...@@ -8,6 +8,7 @@ import { api, getParam, http } from "@/utils"
import Ranking from "@/components/bargainMiddlePage/ranking" import Ranking from "@/components/bargainMiddlePage/ranking"
import { compose } from "redux" import { compose } from "redux"
import { withRouter } from 'react-router-dom' import { withRouter } from 'react-router-dom'
import {connect} from "react-redux";
class Bargain extends Component { class Bargain extends Component {
...@@ -125,7 +126,13 @@ class Bargain extends Component { ...@@ -125,7 +126,13 @@ class Bargain extends Component {
// 我要砍价 // 我要砍价
iWantBargain = () => { iWantBargain = () => {
this.toKanjia(getParam('id'), 1, 0) 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)
}
} }
// 砍价接口 // 砍价接口
...@@ -170,11 +177,14 @@ class Bargain extends Component { ...@@ -170,11 +177,14 @@ class Bargain extends Component {
} }
render() { render() {
const {user} = this.props
const uid = user && user.data && user.data.uid
return ( return (
<div className={'bargain-func'}> <div className={'bargain-func'}>
{/*bargain_status 砍价状态 0-砍价中,1砍价结束,待支付,2砍价过期(没有砍价记录没有砍价信息),3已购买*/} {/*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}/> <BargainIntro limitPeople={this.state.limitPeople} iWantBargain={this.iWantBargain}/>
} }
{ {
...@@ -394,5 +404,11 @@ function UseArtifact(props) { ...@@ -394,5 +404,11 @@ function UseArtifact(props) {
export default compose( export default compose(
connect(
state => ({
user: state.user
}),
null
),
withRouter withRouter
)(Bargain) )(Bargain)
...@@ -110,13 +110,13 @@ class OutLine extends Component { ...@@ -110,13 +110,13 @@ class OutLine extends Component {
{ {
// 已购买直播结束已上传视频:正常播放按钮,点击播放课程 // 已购买直播结束已上传视频:正常播放按钮,点击播放课程
!introduce.is_aist && item.class_status === 2 && !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 && 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>
} }
......
...@@ -28,10 +28,10 @@ function OrderList(props) { ...@@ -28,10 +28,10 @@ function OrderList(props) {
<div className="order-info"> <div className="order-info">
{/* <Link to={`/detail?id=${course_id}`}> */} {/* <Link to={`/detail?id=${course_id}`}> */}
<p <p
className='order-title' className='order-title'
style={{ style={{
overflow: 'hidden', overflow: 'hidden',
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
whiteSpace: 'nowrap' whiteSpace: 'nowrap'
}} }}
onClick={() => props.toDetail(course_id)} onClick={() => props.toDetail(course_id)}
...@@ -52,12 +52,12 @@ function OrderList(props) { ...@@ -52,12 +52,12 @@ function OrderList(props) {
); );
return ( return (
<OrderItem <OrderItem
{...item} {...item}
src={image_name} src={image_name}
id={course_id} id={course_id}
key={index} key={index}
info={Info} info={Info}
isaist={props.isaist} isaist={props.isaist}
toDetail={props.toDetail} toDetail={props.toDetail}
> >
...@@ -286,7 +286,6 @@ class Order extends Component { ...@@ -286,7 +286,6 @@ class Order extends Component {
} }
}); });
} else if (this.props.location.state && this.props.location.state.group === 1){ } 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 => { 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], let courseInfo = resList[0],
......
...@@ -108,8 +108,6 @@ ...@@ -108,8 +108,6 @@
justify-content: space-around; justify-content: space-around;
.order-title { .order-title {
height: 18px;
line-height: 18x;
color: $color_333; color: $color_333;
font-size: $font_16; font-size: $font_16;
} }
......
.pay-order { .pay-order {
width: 100%; width: 100%;
background-color: #f5f5f5; background-color: #f5f5f5;
margin-bottom: 50px; margin-bottom: 50px;
.order-number {
background-color: #fff;
span {
font-size: 15px;
color: #333333;
}
.number { .order-number {
font-size: 12px; background-color: #fff;
color: #666666;
}
.money { span {
color: #ff3131; font-size: 15px;
} color: #333333;
}
.number {
font-size: 12px;
color: #666666;
} }
.pay-type-list { .money {
.am-list-body { color: #ff3131;
&::after { }
display: none; }
}
}
.am-list-header {
color: #333333;
font-size: 15px;
background-color: #fff;
}
.iconalipay {
font-size: 22px;
color: #01aaef;
}
.iconweixinzhifu {
font-size: 22px;
color: #3baf34;
}
.iconhuabei { .pay-type-list {
font-size: 22px; .am-list-header {
color: #01aaef; color: #333333;
} font-size: 15px;
background-color: #fff;
}
.am-radio-inner { .iconzhifubaox- {
width: 20px; font-size: 22px;
height: 20px; color: #01aaef;
border-radius: 50%; }
background-color: #c1c1c1;
}
.am-radio-inner:after { .iconweixinzhifu {
display: block; font-size: 22px;
border-color: #fff; color: #3baf34;
top: 0; }
right: 6px;
}
.am-radio.am-radio-checked .am-radio-inner { .iconhuabei {
background-color: #009aff; font-size: 22px;
border-radius: 50%; color: #01aaef;
width: 20px; }
height: 20px;
}
.am-radio.am-radio-checked .am-radio-inner:after { .am-radio-inner {
display: block; width: 20px;
} height: 20px;
border-radius: 50%;
background-color: #c1c1c1;
}
.am-radio-inner:after {
display: block;
border-color: #fff;
top: 0;
right: 6px;
} }
.pay-tip { .am-radio.am-radio-checked .am-radio-inner {
width: 100%; background-color: #009aff;
height: 30px; border-radius: 50%;
line-height: 30px; width: 20px;
text-align: center; height: 20px;
font-size: 12px; }
color: #ff3131; .am-radio.am-radio-checked .am-radio-inner:after {
background-color: #fff4ce; display: block;
} }
}
.pay-button { .pay-tip {
position: fixed; width: 100%;
bottom: 0; height: 30px;
line-height: 30px;
text-align: center;
font-size: 12px;
color: #ff3131;
background-color: #fff4ce;
}
.pay-button {
position: fixed;
bottom: 0;
width: 100%;
height: 44px;
line-height: 44px;
text-align: center;
color: #fff;
font-size: 18px;
background-color: #18b4ed;
z-index: 9;
}
.check-staging {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, $alpha: 0.6);
z-index: 19;
.container {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 300px;
border-radius: 6px;
background-color: #FFF;
padding-bottom: 10px;
.check-title{
color: #333333;
font-size: 16px;
text-align: center;
width: 100%; width: 100%;
height: 44px; height: 44px;
line-height: 44px; line-height: 44px;
text-align: center; border-bottom: 1px solid #DDDDDD;
color: #fff; border-top-left-radius: 6px;
font-size: 18px; border-top-right-radius: 6px;
background-color: #18b4ed; }
z-index: 9;
} }
.check-staging { .am-list-item .am-list-line .am-list-extra {
position: fixed; flex-basis: 16%;
width: 100%; }
height: 100%; .am-radio-inner {
top: 0; width: 20px;
left: 0; height: 20px;
background-color: rgba(0, 0, 0, $alpha: 0.6); border-radius: 50%;
z-index: 19; border: 1px solid #BFBFBF;
background-color: #fff;
.container { }
position: absolute; .am-radio-inner:after {
top: 50%; display: block;
left: 50%; border-color: #fff;
transform: translate(-50%, -50%); top: 0;
width: 300px; right: 6px;
border-radius: 6px; }
background-color: #FFF; .am-radio.am-radio-checked .am-radio-inner {
padding-bottom: 10px; background-color: #009aff;
border: 1px solid #FFF;
.check-title { border-radius: 50%;
color: #333333; width: 20px;
font-size: 16px; height: 20px;
text-align: center; }
width: 100%; .am-radio.am-radio-checked .am-radio-inner:after {
height: 44px; display: block;
line-height: 44px; }
border-bottom: 1px solid #DDDDDD; }
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}
}
.am-list-item .am-list-line .am-list-extra { .order-info {
flex-basis: 16%; position: relative;
} flex: 1;
.am-radio-inner { .order-title {
width: 20px; font-size: 16px;
height: 20px; color: $color_333;
border-radius: 50%; }
border: 1px solid #BFBFBF;
background-color: #fff;
}
.am-radio-inner:after { .order-content {
display: block; font-size: 14px;
border-color: #fff; color: $color_666;
top: 0; margin-top: 14px;
right: 6px; line-height: 18px;
} }
.am-radio.am-radio-checked .am-radio-inner { .order-des {
background-color: #009aff; height: 24px;
border: 1px solid #FFF; line-height: 33px;
border-radius: 50%; position: absolute;
width: 20px; bottom: 0;
height: 20px;
}
.am-radio.am-radio-checked .am-radio-inner:after { .order-newprice {
display: block; font-size: 16px;
} color: $redprice;
}
.order-price {
font-size: 12px;
color: $color_999;
margin-left: 15px;
text-decoration: line-through;
}
} }
}
.order-info { .v-list-item {
position: relative; padding: 10px 15px;
flex: 1; background-color: #fff;
border-bottom: 1px solid #e7eaf1;
.order-title { .content {
font-size: 16px; border: none;
color: $color_333; padding-bottom: 0;
}
.cover {
flex: inherit;
width: 42.2%;
.order-content { img {
font-size: 14px; width: 100%;
color: $color_666; height: 100%;
margin-top: 14px;
line-height: 18px;
} }
.order-des { .course-status {
height: 24px; background-color: rgba(224, 46, 36, 0.6);
line-height: 33px;
.order-newprice {
font-size: 16px;
color: $redprice;
}
.order-price {
font-size: 12px;
color: $color_999;
margin-left: 15px;
text-decoration: line-through;
}
} }
}
} }
.v-list-item { .info {
padding: 10px 15px; width: 52.3%;
background-color: #fff; position: relative;
display: block;
.content {
border: none; .title {
font-size: 16px;
color: $color_333;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 16px;
line-height: 16px;
}
.contact {
font-size: 14px;
color: $color_666;
margin-top: 14px;
}
.des {
position: absolute;
bottom: 0;
.cover { .course-price {
flex: inherit; .price {
width: 42.2%; color: $red;
font-size: 12px;
}
img { .new {
width: 100%; color: $red;
} font-size: 16px;
}
.course-status { .old {
background-color: rgba(224, 46, 36, 0.6); color: $color_999;
} font-size: 12px;
} display: inline-block;
margin-left: 15px;
text-decoration: line-through;
}
} }
.info { .isbuy {
width: 52.3%; display: inline-block;
position: relative; width: 61px;
display: block; height: 18px;
background-color: $bg_active;
.title { border-radius: 9px;
font-size: 16px; color: $white;
color: $color_333; font-size: 12px;
overflow: hidden; text-align: center;
text-overflow: ellipsis; line-height: 18px;
white-space: nowrap;
height: 16px;
line-height: 16px;
}
.contact {
font-size: 14px;
color: $color_666;
margin-top: 14px;
}
.des {
position: absolute;
bottom: 0;
.course-price {
.price {
color: $red;
font-size: 12px;
}
.new {
color: $red;
font-size: 16px;
}
.old {
color: $color_999;
font-size: 12px;
display: inline-block;
margin-left: 15px;
text-decoration: line-through;
}
}
.isbuy {
display: inline-block;
width: 61px;
height: 18px;
background-color: $bg_active;
border-radius: 9px;
color: $white;
font-size: 12px;
text-align: center;
line-height: 18px;
}
}
} }
}
} }
}
} }
...@@ -364,13 +364,6 @@ class Video extends Component { ...@@ -364,13 +364,6 @@ class Video extends Component {
if (this.lessonAvailable()) { if (this.lessonAvailable()) {
if (this.hasAuth()) { if (this.hasAuth()) {
Promise.resolve().then(() => { 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.initializePlayer()
this.playWithAuth() this.playWithAuth()
}) })
...@@ -425,8 +418,12 @@ class Video extends Component { ...@@ -425,8 +418,12 @@ class Video extends Component {
} }
lessonAvailable = () => { lessonAvailable = () => {
const {videoList, activeIndex} = this.state let {videoList, course} = this.state
return videoList[activeIndex]['video_size'] !== 0 let videoIndex = videoList.findIndex(item => item.id == course.last_video_id)
this.setState({
activeIndex: videoIndex
})
return videoList[videoIndex]['video_size'] !== 0
} }
getCoursePrice = () => { getCoursePrice = () => {
...@@ -450,8 +447,13 @@ class Video extends Component { ...@@ -450,8 +447,13 @@ class Video extends Component {
} }
hasAuth = () => { hasAuth = () => {
const {course, videoList, activeIndex} = this.state const {course, videoList} = this.state
let lesson = videoList[activeIndex]
let videoIndex = videoList.findIndex(item => item.id == course.last_video_id)
this.setState({
activeIndex: videoIndex
})
let lesson = videoList[videoIndex]
if (lesson['video_auth']) { if (lesson['video_auth']) {
this.setState({ 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