Commit 82d57e50 by zhanghaozhe

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

parents 88658ae7 4a8bbd37
...@@ -9,6 +9,7 @@ $redprice: #ff3131; ...@@ -9,6 +9,7 @@ $redprice: #ff3131;
$color_333: #333; $color_333: #333;
$color_555: #555; $color_555: #555;
$color_666: #666; $color_666: #666;
$color_888: #888;
$color_999: #999; $color_999: #999;
$color_606: #606060; $color_606: #606060;
$color_bbb: #BBB; $color_bbb: #BBB;
...@@ -19,7 +20,6 @@ $color_FF4000: #FF4000; ...@@ -19,7 +20,6 @@ $color_FF4000: #FF4000;
$color_FF0000: #FF0000; $color_FF0000: #FF0000;
/* /*
* @ 文字大小 * @ 文字大小
*/ */
...@@ -73,6 +73,7 @@ $bg_E02E24: #E02E24; ...@@ -73,6 +73,7 @@ $bg_E02E24: #E02E24;
$bg_007FD0: #007FD0; $bg_007FD0: #007FD0;
$bg_FF0000: #FF0000; $bg_FF0000: #FF0000;
$bg_FFF4CE: #FFF4CE; $bg_FFF4CE: #FFF4CE;
$bg_FAFAFA: #FAFAFA;
/* /*
...@@ -91,8 +92,6 @@ $border_f31: #f31; ...@@ -91,8 +92,6 @@ $border_f31: #f31;
$border_ccc: #ccc; $border_ccc: #ccc;
/* /*
* @ 标签颜色 * @ 标签颜色
*/ */
......
...@@ -4,7 +4,7 @@ import {Link} from 'react-router-dom' ...@@ -4,7 +4,7 @@ import {Link} from 'react-router-dom'
const VList = (props) => { const VList = (props) => {
return ( return (
<li className='v-list-item' onClick={e => props.handleClick(props.id)}> <li className='v-list-item'>
<div className="content"> <div className="content">
<div className="cover"> <div className="cover">
{props.status} {props.status}
......
...@@ -7,7 +7,7 @@ import createStyle from './createStyle' ...@@ -7,7 +7,7 @@ import createStyle from './createStyle'
import LazyLoad from 'react-lazy-load' import LazyLoad from 'react-lazy-load'
import {http, api} from '@/utils' import {http, api} from '@/utils'
import LiveRoom from './liveRoom' import LiveRoom from './liveRoom'
import {Link} from "react-router-dom"; import {Link} from "react-router-dom"
import {Toast} from 'antd-mobile' import {Toast} from 'antd-mobile'
...@@ -22,7 +22,7 @@ class Index extends Component { ...@@ -22,7 +22,7 @@ class Index extends Component {
modules: [], modules: [],
isShow: false, isShow: false,
islive: false, islive: false,
roomId: '', roomMess: '',
tabdata: [ tabdata: [
{ {
'src': require('./image/freeclass_icon.png'), 'src': require('./image/freeclass_icon.png'),
...@@ -71,12 +71,17 @@ class Index extends Component { ...@@ -71,12 +71,17 @@ class Index extends Component {
// 点击近期直播课程弹出预约提示框 // 点击近期直播课程弹出预约提示框
liveCourse = (roomId) => { liveCourse = (item) => {
this.setState(status => ({ if (item.live_status === 0) {
this.setState({
isShow: true, isShow: true,
islive: true, islive: true,
roomId roomMess: item
})) })
} else {
window.location.href = `http://www-test.julyedu.com/live/m_room/${item.room_id}`
}
} }
// 自组件传给父组件的isshow // 自组件传给父组件的isshow
colseBox = (val) => { colseBox = (val) => {
...@@ -148,7 +153,7 @@ class Index extends Component { ...@@ -148,7 +153,7 @@ class Index extends Component {
{/* 直播间预约 */} {/* 直播间预约 */}
{ {
this.state.islive && this.state.islive &&
<LiveRoom isShow={this.state.isShow} colseBox={this.colseBox} roomId={this.state.roomId}></LiveRoom> <LiveRoom isShow={this.state.isShow} colseBox={this.colseBox} roomMess={this.state.roomMess}></LiveRoom>
} }
</div> </div>
...@@ -238,13 +243,26 @@ function ScrollBox(props) { ...@@ -238,13 +243,26 @@ function ScrollBox(props) {
{ {
props.livesList && props.livesList.length > 0 && props.livesList.map((item, index) => { props.livesList && props.livesList.length > 0 && props.livesList.map((item, index) => {
return ( return (
<li key={index} className='scroll-item' onClick={e => props.liveCourse(item.room_id)}> <li key={index} className='scroll-item'
onClick={e => props.liveCourse(item)}>
<div className='item-box'> <div className='item-box'>
{
item.live_status === 0 &&
<span className='no-start'>即将开始</span>
}
{
item.live_status === 1 &&
<span className='start'>正在直播</span>
}
<img className="item-img" src={item.live_img} alt=""/> <img className="item-img" src={item.live_img} alt=""/>
<div className="item-content"> <div className="item-content">
<h2 className="item-title">{item.live_title}</h2> <h2 className="item-title">{item.live_title}</h2>
<p className="item-teacher">讲师:{item.live_teacher_name}</p> <p className="item-teacher">讲师:{item.live_teacher_name}</p>
<p className="item-time">时间:{item.live_start_time}</p> <p className="item-time">时间:{item.live_start_time}</p>
{
item.live_status === 1 &&
<span>已预约</span>
}
</div> </div>
</div> </div>
</li> </li>
......
...@@ -131,6 +131,7 @@ ...@@ -131,6 +131,7 @@
} }
} }
} }
/* /*
近期直播 近期直播
*/ */
...@@ -172,6 +173,24 @@ ...@@ -172,6 +173,24 @@
height: 100%; height: 100%;
padding: 10px; padding: 10px;
display: flex; display: flex;
position: relative;
.no-start, .start {
display: inline-block;
position: absolute;
top: 15px;
padding: 3px 8px;
color: $white;
font-size: 12px;
text-align: center;
border-radius: 0 20px 20px 0;
}
.no-start{
background-color: $red;
}
.start{
background-color: $bg_active;
}
.item-img { .item-img {
width: 100px; width: 100px;
...@@ -536,11 +555,11 @@ ...@@ -536,11 +555,11 @@
} }
.follow { .follow {
margin-top: 15px; margin-top: 20px;
} }
.nofollow { .nofollow {
margin-top: 20px; margin-top: 15px;
} }
.tips { .tips {
...@@ -668,6 +687,7 @@ ...@@ -668,6 +687,7 @@
// // background-image: none; // // background-image: none;
// //} // //}
} }
.borderTop { .borderTop {
width: 100%; width: 100%;
height: 8px; height: 8px;
......
...@@ -70,10 +70,6 @@ class Classify extends Component { ...@@ -70,10 +70,6 @@ class Classify extends Component {
}) })
} }
// 点击课程
handleClick = (courseId) => {
console.log(courseId)
}
// 点击横向滚动tab查询 // 点击横向滚动tab查询
ontabclick = (tab) => { ontabclick = (tab) => {
...@@ -161,7 +157,7 @@ class Classify extends Component { ...@@ -161,7 +157,7 @@ class Classify extends Component {
</div> </div>
) )
return ( return (
<VList handleClick={this.handleClick} key={index} status={status} <VList key={index} status={status}
img={item.image_name} id={item.course_id} img={item.image_name} id={item.course_id}
info={Info}></VList> info={Info}></VList>
) )
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
width: 30.5%; width: 30.5%;
height: 76px; height: 76px;
margin-top: 10px; margin-top: 10px;
margin-right: 13px;
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
......
...@@ -35,7 +35,7 @@ class BtnStatus extends Component { ...@@ -35,7 +35,7 @@ class BtnStatus extends Component {
render() { render() {
let info = '' let info = ''
if (this.props.data.course_info) { if (this.props.data && this.props.data.course_info) {
info = this.props.data.course_info info = this.props.data.course_info
} }
return ( return (
...@@ -43,7 +43,7 @@ class BtnStatus extends Component { ...@@ -43,7 +43,7 @@ class BtnStatus extends Component {
<div> <div>
{/*正常购买*/} {/*正常购买*/}
{ {
info.is_baoming === 0 && info.is_baoming === 0 && info.group_status !== 3 &&
<div className='btns-box'> <div className='btns-box'>
<a className='consult consult-s' href="https://q.url.cn/AB8aue?_type=wpa&qidian=true"> <a className='consult consult-s' href="https://q.url.cn/AB8aue?_type=wpa&qidian=true">
<i className='iconfont iconerji'></i> <i className='iconfont iconerji'></i>
...@@ -75,7 +75,7 @@ class BtnStatus extends Component { ...@@ -75,7 +75,7 @@ class BtnStatus extends Component {
} }
{/*拼团 未开团*/} {/*拼团 未开团*/}
{ {
this.props.status === 2 && this.state.isbuy === 0 && info.is_baoming === 0 && info.group_status === 4&&
<div className='btns-box'> <div className='btns-box'>
<a className='consult consult-s' href="https://q.url.cn/AB8aue?_type=wpa&qidian=true"> <a className='consult consult-s' href="https://q.url.cn/AB8aue?_type=wpa&qidian=true">
<i className='iconfont iconerji'></i> <i className='iconfont iconerji'></i>
...@@ -93,15 +93,15 @@ class BtnStatus extends Component { ...@@ -93,15 +93,15 @@ class BtnStatus extends Component {
} }
{/*拼团 已开团*/} {/*拼团 已开团*/}
{ {
this.props.status === 2 && this.state.isbuy === 1 && info.is_baoming === 0 && info.group_status === 3 &&
<div className='btns-box'> <div className='btns-box'>
<a className='consult consult-s' href="https://q.url.cn/AB8aue?_type=wpa&qidian=true"> <a className='consult consult-s' href="https://q.url.cn/AB8aue?_type=wpa&qidian=true">
<i className='iconfont iconerji'></i> <i className='iconfont iconerji'></i>
<span>课程咨询</span> <span>课程咨询</span>
</a> </a>
<button className='btn btn-l bg-E02E24'> <Link to={`/togroup`} className='btn btn-l bg-E02E24'>
邀请好友参团 23:32:23 后结束 邀请好友参团 23:32:23 后结束
</button> </Link>
</div> </div>
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
border-top: 1px solid $sp_e7eaf1; border-top: 1px solid $sp_e7eaf1;
z-index: 3;
.consult { .consult {
display: inline-block; display: inline-block;
......
import React, {Component} from 'react'
import './index.scss'
import {getParam} from "@/utils"
import {connect} from "react-redux"
import {Link} from "react-router-dom"
class Group extends Component {
constructor(props) {
super(props)
this.state = {
isShowMore: false
}
}
// 查看更多
getMore = () => {
this.setState({
isShowMore: true
})
}
// 关闭更多窗口
closeMore = () => {
this.setState({
isShowMore: false
})
}
render() {
let groupInfo = ''
if (this.props.courseInfo && this.props.courseInfo.courseInfo && this.props.courseInfo.courseInfo.course_info) {
groupInfo = this.props.courseInfo.courseInfo.course_info.pdd_group_info
}
return (
<div className='group-box'>
<div className="group-title">
<span>{groupInfo.now_groupon_total}人正在开团,可直接参与</span>
<span className='more' onClick={this.getMore}>
查看更多
<i className='iconfont iconiconfront-70'></i>
</span>
</div>
<ul className="group-list">
{
groupInfo.now_groupon_list && groupInfo.now_groupon_list.length > 0 && groupInfo.now_groupon_list.map((item, index) => {
return (
<li key={index} className='group-item'>
<img className='avatar' src={item.avatar} alt=""/>
<div className='user-name text-overflow-one'>
{item.user_name}
</div>
<div className='group-status'>
<p>还差<span className='red'>{item.number}</span>拼成</p>
<p>剩余 {item.end_time}</p>
</div>
<Link to={`/order?id=${getParam('id')}&&groupon_code=${item.pdd_order_id}`}
className='topay'>去参团</Link>
</li>
)
})
}
</ul>
<div className="group-dec">
<span>
<i className='iconfont iconiconfront-1'></i>
·好友参团 ·人满成交 ·人不满退款
</span>
<span className='allNum'>累计856人成团</span>
</div>
{/*更多*/}
{
this.state.isShowMore &&
<div className="moreMbc">
<div className="content">
<div className="title-box">
正在拼团
</div>
<ul className='more-group-list'>
{
groupInfo.now_groupon_list && groupInfo.now_groupon_list.length > 0 && groupInfo.now_groupon_list.map((item, index) => {
return (
<li key={index} className='group-item'>
<img className='avatar' src={item.avatar} alt=""/>
<div className='user-name'>
<p className='name text-overflow-one'>{item.user_name}</p>
<p className='time'>剩余 {item.end_time}</p>
</div>
<p className='group-status'>还差{item.number}</p>
<Link
to={`/order?id=${getParam('id')}&&groupon_code=${item.pdd_order_id}`}
className='topay'>去参团</Link>
</li>
)
})
}
</ul>
<div className='more-group-dec'>
仅显示10个正在开团的人
</div>
</div>
<i onClick={this.closeMore} className={'iconfont iconiconfront-2 close'}></i>
</div>
}
</div>
)
}
}
export default connect(
state => ({courseInfo: state}),
null
)(Group)
.group-box {
border-top: 8px solid $bg_f5f5f5;
.group-title {
height: 40px;
line-height: 40px;
font-size: 14px;
padding: 0 12px;
display: flex;
justify-content: space-between;
color: $color_333;
.more {
color: $color_888;
i {
width: 12px;
height: 7px;
}
}
}
.group-list {
width: 100%;
border-top: 1px solid $sp_e7eaf1;
padding: 0 12px;
.group-item {
border-bottom: 1px solid $sp_e7eaf1;
height: 60px;
display: flex;
position: relative;
.avatar {
width: 44px;
height: 44px;
border-radius: 50%;
margin-top: 8px;
margin-right: 6px;
}
.user-name {
font-size: 16px;
color: $color_333;
max-width: 104px;
line-height: 60px;
}
.group-status {
line-height: 15px;
font-size: 12px;
position: absolute;
right: 72px;
p:nth-child(1) {
margin-top: 17px;
.red {
color: $red;
}
}
}
.topay {
width: 62px;
height: 28px;
border-radius: 5px;
background-color: $bg_E02E24;
color: $white;
font-size: 14px;
line-height: 28px;
text-align: center;
margin-top: 16px;
position: absolute;
right: 0;
}
}
}
.group-dec {
background-color: $bg_FAFAFA;
width: 100%;
padding: 0 12px;
height: 30px;
line-height: 30px;
font-size: 12px;
display: flex;
justify-content: space-between;
color: $color_999;
.allNum {
color: $color_333;
}
}
.moreMbc {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, .6);
z-index: 2;
.content {
width: 300px;
height: 388px;
background-color: $white;
border-radius: 3px;
margin: 139px auto 20px auto;
position: relative;
.title-box {
width: 100%;
height: 44px;
text-align: center;
color: $color_333;
font-size: 16px;
line-height: 44px;
}
.more-group-list {
width: 100%;
height: 302px;
overflow: auto;
border-top: 1px solid $sp_e7eaf1;
padding: 0 15px;
background-color: $bg_f5f5f5;
.group-item {
border-bottom: 1px solid $sp_e7eaf1;
height: 60px;
display: flex;
position: relative;
.avatar {
width: 44px;
height: 44px;
border-radius: 50%;
margin-top: 8px;
margin-right: 10px;
}
.user-name {
font-size: 12px;
color: $color_333;
max-width: 90px;
line-height: 15px;
.name {
margin-top: 16px;
}
.time{
color: $color_999;
}
}
.group-status {
line-height: 60px;
color: $color_666;
position: absolute;
right: 66px;
}
.topay {
width: 56px;
height: 26px;
border-radius: 5px;
background-color: $bg_E02E24;
color: $white;
font-size: 14px;
line-height: 26px;
text-align: center;
margin-top: 17px;
position: absolute;
right: 0;
}
}
}
}
.more-group-dec {
width: 100%;
position: absolute;
bottom: 0;
height: 42px;
font-size: 12px;
color: $color_999;
text-align: center;
line-height: 42px;
}
.close {
color: #fff;
font-size: 22px;
position: relative;
left: 50%;
margin-left: -11px;
}
}
}
\ No newline at end of file
import React, {Component} from 'react'
import './togroup.scss'
import {HeaderBar} from '../../../common'
import {VList} from '../../../common'
import {getParam} from "@/utils"
import {connect} from "react-redux"
import {Link} from "react-router-dom"
class ToGroup extends Component {
constructor(props) {
super(props)
this.state = {
data: {
'course_id': '140',
'course_title': '课程标题课程标题课程标题课程标题课程标题课程标题课程标题课程标题',
'simpledescription': '课程标题课程标题课程标题课程标题课程标题课程标题课程标题课程标题课程标题课程标题课程标题课程标题课程标题课程标题课程标题课程标题',
'image_name': 'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/6479fe123a.jpg',
'price0': '140',
'price1': '140',
'success': false, // 拼团成功
'my': 0, // 0 自己发起的邀请好友 1 别人发起的,参别人的团
}
}
}
render() {
const Info = (
<div className="info">
<p className='title'>
<Link to={`/detail?id=${this.state.data.course_id}`}>
{this.state.data.course_title}
</Link>
</p>
<p className='contact text-overflow-2'>{this.state.data.simpledescription}</p>
<div className='des'>
<p className="course-price">
<span className="new">¥{this.state.data.price1}</span>
<span className="old">¥{this.state.data.price0}</span>
</p>
</div>
</div>
)
return (
<div className='to-group-box'>
<HeaderBar title='拼团' arrow={true} cart={false}></HeaderBar>
<VList img={this.state.data.image_name} id={this.state.data.course_id} info={Info}></VList>
<GorupContent data={this.state.data}/>
<div className="group-course">
<div className="top-title">
<span>本周特惠</span>
<Link to={`/preferential`} className='more'>更多<i className='iconfont iconiconfront-70'></i></Link>
</div>
<VList img={this.state.data.image_name} id={this.state.data.course_id} info={Info}></VList>
</div>
</div>
)
}
}
function GorupContent(props) {
console.log(props)
let tip, btn, dec
if (props.data.my === 0) {
tip = <p className='tip'>拼团省500</p>
btn = <Link to={`/`} className='group-btn'>邀请好友参团 232323 后结束</Link>
dec = <p className='dec'>分享到3个群后,成团率高达98%</p>
} else {
tip = <p className='tip'>拼团省500</p>
btn = <Link to={`/`} className='group-btn'>一键参团</Link>
}
if (props.data.success) {
tip = <p className='success'>拼团成功</p>
btn = <Link to={`/play`} className='tostudy'>去学习</Link>
}
return (
<div className='gorup-content'>
{tip}
<img className='imgname' src={props.data.image_name} alt=""/>
<img className='imgname' src={props.data.image_name} alt=""/>
<img className='imgname' src={props.data.image_name} alt=""/>
{btn}
{dec}
{
!props.data.success &&
<div className="group-dec">
<span>
<i className='iconfont iconiconfront-1'></i>
·好友参团 ·人满成交 ·人不满退款
</span>
<span className='allNum'>累计856人成团</span>
</div>
}
</div>
)
}
export default ToGroup
.to-group-box {
.v-list-item {
margin-top: 5px;
.content {
border-bottom: 1px solid #e7eaf1;
.cover {
flex: inherit;
width: 42.2%;
img {
width: 100%;
}
}
}
.info {
width: 52.3%;
position: relative;
display: block;
.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;
.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;
}
}
}
}
}
.gorup-content {
padding: 20px;
text-align: center;
.imgname {
width: 44px;
height: 44px;
border-radius: 50%;
margin: 20px 20px 0 20px;
}
:nth-child(1) {
margin-left: 0;
}
.tip {
color: $bg_E02E24;
font-size: 16px;
}
.success {
color: $active;
font-size: 16px;
}
.group-btn, .tostudy {
display: inline-block;
width: 335px;
height: 44px;
border-radius: 5px;
background-color: $bg_E02E24;
font-size: 16px;
color: $white;
text-align: center;
line-height: 44px;
margin-top: 20px;
}
.tostudy {
background-color: $bg_active;
margin-top: 30px;
}
.dec {
font-size: 12px;
margin-top: 10px;
color: $color_666;
}
.group-dec {
background-color: $bg_FAFAFA;
width: 100%;
padding: 0 12px;
height: 30px;
line-height: 30px;
font-size: 12px;
display: flex;
justify-content: space-between;
color: $color_999;
margin-top: 15px;
.allNum {
color: $color_333;
}
}
}
.group-course {
.top-title {
height: 40px;
line-height: 40px;
font-size: 14px;
padding: 0 12px;
display: flex;
justify-content: space-between;
color: $color_333;
.more {
color: $active;
i {
width: 12px;
height: 7px;
}
}
}
}
}
\ No newline at end of file
import React, {Component} from 'react' import React, {Component} from 'react'
import './index.scss' import './index.scss'
import Bargain from './bargain' import Bargain from './bargain'
import Group from './group'
import OutLine from './outline' import OutLine from './outline'
import {HeaderBar, ToApp} from '../../common' import {HeaderBar, ToApp} from '../../common'
import ShareRank from "./shareRank" import ShareRank from "./shareRank"
...@@ -51,17 +52,12 @@ class Detail extends Component { ...@@ -51,17 +52,12 @@ class Detail extends Component {
})); }));
} }
// 打开分销排行榜弹窗
openRanking = () => {
this.setState(status => ({
shareRank: true
}));
}
// 自组件传给父组件的boxHide // 自组件传给父组件的boxHide
boxHide = (val) => { boxHide = (val) => {
this.setState({auditionBox: val, singleBox: val, shareRank: val}) this.setState({auditionBox: val, singleBox: val})
} }
render() { render() {
...@@ -138,10 +134,16 @@ class Detail extends Component { ...@@ -138,10 +134,16 @@ class Detail extends Component {
{/*分享赚钱*/} {/*分享赚钱*/}
{ {
courseInfo.is_dist && courseInfo.is_dist &&
<ShareRank data={this.props.courseInfo} shareRank={this.state.shareRank} <ShareRank/>
openRanking={this.openRanking} boxHide={this.boxHide}/>
} }
{/*拼团*/}
{
courseInfo.group_status === 3 &&
<Group/>
}
{/*砍价*/} {/*砍价*/}
<Bargain/> <Bargain/>
......
import React, {Component} from 'react' import React, {Component} from 'react'
import './index.scss' import './index.scss'
import {api, getParam, http} from "@/utils" import {api, getParam, http} from "@/utils"
import {withRouter} from "react-router-dom"
import {Toast} from 'antd-mobile' import {Toast} from 'antd-mobile'
import {connect} from "react-redux"
import {withRouter} from 'react-router-dom'
import {compose} from "redux"
class ShareRank extends Component { class ShareRank extends Component {
...@@ -11,7 +13,8 @@ class ShareRank extends Component { ...@@ -11,7 +13,8 @@ class ShareRank extends Component {
this.state = { this.state = {
list: '', list: '',
rankingslice: '', rankingslice: '',
code: '' code: '',
shareRank: false
} }
} }
...@@ -21,8 +24,7 @@ class ShareRank extends Component { ...@@ -21,8 +24,7 @@ class ShareRank extends Component {
if (res.data.code === 200) { if (res.data.code === 200) {
this.setState({ this.setState({
list: res.data.data, list: res.data.data,
rankingslice: res.data.data.slice(0, 2), rankingslice: res.data.data.slice(0, 2)
courseInfo: this.props.data.course_info
}) })
} else { } else {
Toast.info(res.data.msg, 2) Toast.info(res.data.msg, 2)
...@@ -43,28 +45,38 @@ class ShareRank extends Component { ...@@ -43,28 +45,38 @@ class ShareRank extends Component {
}) })
} }
share = () => { share = (info) => {
const courseId = getParam('id') const courseId = getParam('id')
const dist_first = this.state.courseInfo.dist_first_level_ti const dist_first = info.dist_first_level_ti
const uid = this.state.courseInfo.uid const uid = info.uid
const dist_code = this.state.code const dist_code = this.state.code
this.props.history.push(`/shareposter?courseId=${courseId}&dist_first=${dist_first}&uid=${uid}&dist_code=${dist_code}`) this.props.history.push(`/shareposter?courseId=${courseId}&dist_first=${dist_first}&uid=${uid}&dist_code=${dist_code}`)
} }
// 打开分销排行榜弹窗
openRanking = () => {
this.setState({
shareRank: true
})
}
// 关闭弹窗 // 关闭弹窗
colse = () => { colse = () => {
this.props.boxHide(false) this.setState({
shareRank: false
})
} }
render() { render() {
let info = '' let info = ''
if (this.props.data.course_info) { if (this.props.courseInfo && this.props.courseInfo.courseInfo && this.props.courseInfo.courseInfo.course_info) {
info = this.props.data.course_info info = this.props.courseInfo.courseInfo.course_info
} }
return ( return (
<div className='share-ranking'> <div className='share-ranking'>
<span className="title">排行榜:</span> <span className="title">排行榜:</span>
<div className='ranking-box' onClick={this.props.openRanking}> <div className='ranking-box' onClick={this.openRanking}>
{ {
this.state.rankingslice && this.state.rankingslice.length > 0 && this.state.rankingslice.map((item, index) => { this.state.rankingslice && this.state.rankingslice.length > 0 && this.state.rankingslice.map((item, index) => {
return ( return (
...@@ -79,10 +91,10 @@ class ShareRank extends Component { ...@@ -79,10 +91,10 @@ class ShareRank extends Component {
<img className="ranking-ellipsis" <img className="ranking-ellipsis"
src="https://julyedu-img.oss-cn-beijing.aliyuncs.com/Image/train/ellipsis.png" alt=""/> src="https://julyedu-img.oss-cn-beijing.aliyuncs.com/Image/train/ellipsis.png" alt=""/>
</div> </div>
<button className="share" onClick={this.share}>分享赚{info.dist_first_level_ti}</button> <button className="share" onClick={this.share.bind(this,info)}>分享赚{info.dist_first_level_ti}</button>
{ {
this.props.shareRank && this.state.shareRank &&
<div className="shareMbc"> <div className="shareMbc">
<div className="content"> <div className="content">
<div className="title-box"> <div className="title-box">
...@@ -103,7 +115,7 @@ class ShareRank extends Component { ...@@ -103,7 +115,7 @@ class ShareRank extends Component {
} }
</ul> </ul>
<div className='shareBtn'> <div className='shareBtn'>
<button onClick={this.share}>分享赚{info.dist_first_level_ti}</button> <button onClick={this.share.bind(this,info)}>分享赚{info.dist_first_level_ti}</button>
</div> </div>
</div> </div>
<i onClick={this.colse} className={'iconfont iconiconfront-2 close'}></i> <i onClick={this.colse} className={'iconfont iconiconfront-2 close'}></i>
...@@ -114,4 +126,10 @@ class ShareRank extends Component { ...@@ -114,4 +126,10 @@ class ShareRank extends Component {
} }
} }
export default withRouter(ShareRank); export default compose(
connect(
state => ({courseInfo: state}),
null
),
withRouter
)(ShareRank)
import React, {Component} from 'react' import React, {Component} from 'react'
import './index.scss' import './index.scss'
import {api, getParam, http, is_weixin} from "@/utils"; import {api, getParam, http, browser} from "@/utils";
import {Toast} from 'antd-mobile'; import {Toast} from 'antd-mobile';
import {Link} from "react-router-dom";
class Single extends Component { class Single extends Component {
...@@ -20,7 +21,7 @@ class Single extends Component { ...@@ -20,7 +21,7 @@ class Single extends Component {
if (getParam('is_class') === 1 || getParam('weixinpay')) { if (getParam('is_class') === 1 || getParam('weixinpay')) {
this.payCallback() this.payCallback()
} }
if (is_weixin) { if (browser.isWeixin) {
this.isweixinPay() this.isweixinPay()
} }
} }
...@@ -48,7 +49,7 @@ class Single extends Component { ...@@ -48,7 +49,7 @@ class Single extends Component {
// 微信支付 // 微信支付
weixinPay = (orderId) => { weixinPay = (orderId) => {
// 微信内部-支付 // 微信内部-支付
if (is_weixin) { if (browser.isWeixin) {
window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx23dac6775ac82877&redirect_uri=" + encodeURIComponent(window.location.href + "&aa=bb").toLowerCase() + "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"; window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx23dac6775ac82877&redirect_uri=" + encodeURIComponent(window.location.href + "&aa=bb").toLowerCase() + "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
} else { } else {
// 微信外部-支付 // 微信外部-支付
...@@ -199,7 +200,7 @@ class Single extends Component { ...@@ -199,7 +200,7 @@ class Single extends Component {
<div className='payment-type'> <div className='payment-type'>
<label>支付方式:</label> <label>支付方式:</label>
{ {
!is_weixin() && !browser.isWeixin &&
<p onClick={this.check.bind(this, '1')}> <p onClick={this.check.bind(this, '1')}>
<i className='iconfont iconzhifubaox-'></i> <i className='iconfont iconzhifubaox-'></i>
<span>支付宝</span> <span>支付宝</span>
...@@ -259,7 +260,7 @@ class Single extends Component { ...@@ -259,7 +260,7 @@ class Single extends Component {
<i className='iconfont icondanseshixintubiao-5'></i> <i className='iconfont icondanseshixintubiao-5'></i>
<span>购买成功</span> <span>购买成功</span>
</div> </div>
<div className='btn btn-18B4ED'>去学习</div> <Link to={`/play?id=${getParam('id')}`} className='btn btn-18B4ED'>去学习</Link>
</div> </div>
} }
{ {
......
...@@ -4,8 +4,7 @@ import {connect} from "react-redux" ...@@ -4,8 +4,7 @@ import {connect} from "react-redux"
import {Toast} from 'antd-mobile' import {Toast} from 'antd-mobile'
import {api, http} from "@/utils" import {api, http} from "@/utils"
import {HeaderBar} from "@/common" import {HeaderBar} from "@/common"
// import {logout} from '@/store/userAction' import {logout, updateUser} from '@/store/userAction'
class MyEdut extends PureComponent { class MyEdut extends PureComponent {
...@@ -39,12 +38,13 @@ class MyEdut extends PureComponent { ...@@ -39,12 +38,13 @@ class MyEdut extends PureComponent {
} }
// 退出登录 // 退出登录
outLogin = () => { outLogin = () => {
// this.props.logout() this.props.logout()
Toast.info('已退出', 2)
this.props.history.push('/my')
} }
// 确定修改 // 确定修改
submit = () => { submit = () => {
console.log(this.state.value)
if (this.state.value.length > 12) { if (this.state.value.length > 12) {
Toast.info('不超过12个字符', 2) Toast.info('不超过12个字符', 2)
} else if (this.state.value.length === 0) { } else if (this.state.value.length === 0) {
...@@ -58,6 +58,7 @@ class MyEdut extends PureComponent { ...@@ -58,6 +58,7 @@ class MyEdut extends PureComponent {
this.setState({ this.setState({
isShow: false isShow: false
}) })
this.props.updateUser({data: {username: this.state.value}})
Toast.info('修改成功', 2) Toast.info('修改成功', 2)
} else { } else {
Toast.info(res.data.msg, 2) Toast.info(res.data.msg, 2)
...@@ -108,5 +109,5 @@ class MyEdut extends PureComponent { ...@@ -108,5 +109,5 @@ class MyEdut extends PureComponent {
export default connect( export default connect(
state => ({user: state.user}), state => ({user: state.user}),
// {logout} {logout, updateUser}
)(MyEdut) )(MyEdut)
...@@ -142,7 +142,7 @@ function PayInfo(props) { ...@@ -142,7 +142,7 @@ function PayInfo(props) {
props.item.pay_time === '0' && props.item.member_num === 0 && props.item.pay_time === '0' && props.item.member_num === 0 &&
<div className='btm-right'> <div className='btm-right'>
<button className='cancel' onClick={event => props.cancel(props.item.oid)}>取消订单</button> <button className='cancel' onClick={event => props.cancel(props.item.oid)}>取消订单</button>
<Link to='/order'>去支付</Link> <Link to={`/payorder?oid=${props.item.oid}`}>去支付</Link>
</div> </div>
} }
......
...@@ -135,7 +135,6 @@ class Cart extends Component { ...@@ -135,7 +135,6 @@ class Cart extends Component {
Toast.info(res.data.msg, 2); Toast.info(res.data.msg, 2);
} }
}) })
} }
......
...@@ -26,6 +26,7 @@ const Video = loadable(() => import(/* webpackChunkName: 'video'*/'@/components/ ...@@ -26,6 +26,7 @@ const Video = loadable(() => import(/* webpackChunkName: 'video'*/'@/components/
const sharePoster = loadable(() => import(/* webpackChunkName: 'shareposter'*/'@/components/sharePoster')) const sharePoster = loadable(() => import(/* webpackChunkName: 'shareposter'*/'@/components/sharePoster'))
const myOrders = loadable(() => import(/* webpackChunkName: 'myorders'*/'@/components/myOrders')) const myOrders = loadable(() => import(/* webpackChunkName: 'myorders'*/'@/components/myOrders'))
const Purchased = loadable(() => import(/* webpackChunkName: 'purchased'*/'@/components/purchased')) const Purchased = loadable(() => import(/* webpackChunkName: 'purchased'*/'@/components/purchased'))
const ToGroup = loadable(() => import(/* webpackChunkName: 'togroup'*/'@/components/detail/group/togroup'))
export default [ export default [
{ {
path: '/', path: '/',
...@@ -46,7 +47,8 @@ export default [ ...@@ -46,7 +47,8 @@ export default [
}, },
{ {
path: '/myedit', path: '/myedit',
component: MyEdit component: MyEdit,
isPrivate: true
}, },
{ {
path: '/courselist', path: '/courselist',
...@@ -113,7 +115,8 @@ export default [ ...@@ -113,7 +115,8 @@ export default [
}, },
{ {
path: '/shareposter', path: '/shareposter',
component: sharePoster component: sharePoster,
isPrivate: true
}, },
{ {
path: '/myorders', path: '/myorders',
...@@ -129,4 +132,10 @@ export default [ ...@@ -129,4 +132,10 @@ export default [
path: '/payOrder', path: '/payOrder',
component: PayOrder component: PayOrder
}, },
{
path: '/togroup',
component: ToGroup,
isPrivate: true
},
] ]
\ No newline at end of file
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