Commit 85f0e2c0 by xuzhenghua

合并

parent 904554c4
...@@ -70,7 +70,7 @@ class BtnStatus extends Component { ...@@ -70,7 +70,7 @@ class BtnStatus extends Component {
<i className='iconfont iconerji'></i> <i className='iconfont iconerji'></i>
<span>课程咨询</span> <span>课程咨询</span>
</a> </a>
<button className='btn btn-m bg-09f'>开始学习</button> <Link to={`/play?id=${getParam('id')}`} className='btn btn-m bg-09f'>开始学习</Link>
</div> </div>
} }
{/*拼团 未开团*/} {/*拼团 未开团*/}
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
background-color: $bg_fff; background-color: $bg_fff;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
border-top: 1px solid $sp_e7eaf1;
.consult { .consult {
display: inline-block; display: inline-block;
......
import React, {Component} from 'react' import React, {Component} from 'react'
import {Tabs, WhiteSpace} from 'antd-mobile' import {Tabs, WhiteSpace} from 'antd-mobile'
import './index.scss' import './index.scss'
import {api, getParam, http} from "@/utils"; import {api, getParam, http} from "@/utils"
import {Toast} from 'antd-mobile'
class OutLine extends Component { class OutLine extends Component {
...@@ -25,6 +26,8 @@ class OutLine extends Component { ...@@ -25,6 +26,8 @@ class OutLine extends Component {
this.setState({ this.setState({
stageInfo: res.data.data stageInfo: res.data.data
}) })
} else {
Toast.info(res.data.msg, 2)
} }
}) })
} }
......
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 {withRouter} from "react-router-dom"
import {Toast} from 'antd-mobile'
class ShareRank extends Component { class ShareRank extends Component {
...@@ -23,6 +24,8 @@ class ShareRank extends Component { ...@@ -23,6 +24,8 @@ class ShareRank extends Component {
rankingslice: res.data.data.slice(0, 2), rankingslice: res.data.data.slice(0, 2),
courseInfo: this.props.data.course_info courseInfo: this.props.data.course_info
}) })
} else {
Toast.info(res.data.msg, 2)
} }
}) })
// 获取分销码 // 获取分销码
...@@ -34,6 +37,8 @@ class ShareRank extends Component { ...@@ -34,6 +37,8 @@ class ShareRank extends Component {
this.setState({ this.setState({
code: res.data.data.code code: res.data.data.code
}) })
} else {
Toast.info(res.data.msg, 2)
} }
}) })
} }
......
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, is_weixin} from "@/utils";
import {Toast, WhiteSpace, WingBlank, Button} from 'antd-mobile'; import {Toast} from 'antd-mobile';
class Single extends Component { class Single extends Component {
...@@ -41,7 +41,7 @@ class Single extends Component { ...@@ -41,7 +41,7 @@ class Single extends Component {
}) })
this.state.payType === '1' ? this.alipayPay(this.state.orderId) : this.weixinPay(this.state.orderId) this.state.payType === '1' ? this.alipayPay(this.state.orderId) : this.weixinPay(this.state.orderId)
} else { } else {
alert(res.data.msg) Toast.info(res.data.msg, 2)
} }
}) })
} }
...@@ -56,7 +56,7 @@ class Single extends Component { ...@@ -56,7 +56,7 @@ class Single extends Component {
if (res.data.errno === 0) { if (res.data.errno === 0) {
window.location.href = res.data.data.url + "&redirect_url=" + encodeURIComponent(window.location.href + "&weixinpay=1").toLowerCase(); window.location.href = res.data.data.url + "&redirect_url=" + encodeURIComponent(window.location.href + "&weixinpay=1").toLowerCase();
} else { } else {
alert(res.data.msg); Toast.info(res.data.msg, 2)
} }
}) })
} }
...@@ -67,7 +67,7 @@ class Single extends Component { ...@@ -67,7 +67,7 @@ class Single extends Component {
if (res.data.errno === 0) { if (res.data.errno === 0) {
window.location = res.data.data.url; window.location = res.data.data.url;
} else { } else {
alert(res.data.msg); Toast.info(res.data.msg, 2)
} }
}) })
} }
...@@ -112,7 +112,7 @@ class Single extends Component { ...@@ -112,7 +112,7 @@ class Single extends Component {
this.onBridgeReady() this.onBridgeReady()
} }
} else { } else {
alert(res.data.msg) Toast.info(res.data.msg, 2)
} }
}) })
} }
...@@ -145,7 +145,7 @@ class Single extends Component { ...@@ -145,7 +145,7 @@ class Single extends Component {
status: 2 status: 2
}) })
} else { } else {
alert(res.data.data.msg) Toast.info(res.data.data.msg, 2)
} }
}) })
} }
......
...@@ -5,8 +5,7 @@ import Avatar from './image/avatar.png'; ...@@ -5,8 +5,7 @@ import Avatar from './image/avatar.png';
import Vip from './image/vip.png'; import Vip from './image/vip.png';
import {WithTab} from '@/HOCs' import {WithTab} from '@/HOCs'
import {Link} from "react-router-dom"; import {Link} from "react-router-dom";
import {connect} from "react-redux";
// import UnVip from './image/unVIP.png';
const Item = List.Item; const Item = List.Item;
const Brief = Item.Brief; const Brief = Item.Brief;
...@@ -18,70 +17,81 @@ class My extends PureComponent { ...@@ -18,70 +17,81 @@ class My extends PureComponent {
data: [] data: []
} }
} }
// 去登录
toLogin = () => {
this.props.history.push('/passport')
}
render() { render() {
let { history } = this.props; const {user} = this.props
const uid = user && user.data && user.data.uid
const username = user && user.data && user.data.username
const avatar = user && user.data && user.data.avatar
const isVIP = user && user.data && user.data.isVIP
let list
if (!uid) {
list = <List className="my-list">
<Item
className="avatar-wrap"
arrow="horizontal"
multipleLine
thumb={Avatar}
onClick={this.toLogin}>
<Brief>点击登录</Brief>
</Item>
</List>
} else {
list = <List className="my-list">
<Item
className="avatar-wrap"
arrow="horizontal"
multipleLine
thumb={avatar}
onClick={() => {
}}>
<Brief>
{username}
{
isVIP === 1 &&
<img src={Vip} className='vip' alt=""/>
}
</Brief>
<Brief style={{fontSize: "12px"}}>学号: {uid}</Brief>
</Item>
{
isVIP === 0 &&
<div className="my-isvip"></div>
}
</List>
}
return ( return (
<div className="flex-container"> <div className="flex-container">
<Flex> <Flex>
<Flex.Item> <Flex.Item>
<NavBar <NavBar className="my-tab" mode="light">
className="my-tab"
mode="light"
>
我的 我的
</NavBar> </NavBar>
{/* <List className="my-list"> {list}
<Item
className="avatar-wrap" <div className="am-list-header"></div>
arrow="horizontal"
multipleLine <List className="my-list-content">
thumb={Avatar} <Link to='/purchased'>
onClick={() => { }}> <Item arrow="horizontal">
<Brief>点击登录</Brief> <i className="iconfont iconiconfront-27"></i>
</Item> 已购课程
</List> */} </Item>
<List className="my-list"> </Link>
<Item
className="avatar-wrap"
arrow="horizontal"
multipleLine
thumb={Avatar}
onClick={() => {
}}>
<Brief style={{fontSize: "18px"}}>
xuan先生
<img src={Vip} alt=""/>
</Brief>
<Brief style={{fontSize: "12px"}}>学号: 410026</Brief>
</Item>
<div className="my-isvip"></div>
{/* <div className="my-shadow"></div> */}
</List>
<List>
<Item
arrow="horizontal"
onClick={() => {
}}
>
<i className="iconfont iconiconfront-27"></i>
已购课程
</Item>
<Link to='/shopcart'> <Link to='/shopcart'>
<Item <Item arrow="horizontal">
arrow="horizontal" <i className="iconfont icongouwuche-xianxing"></i>
onClick={() => {
}}
>
<i className="iconfont icongouwuche"></i>
购物车 购物车
</Item> </Item>
</Link> </Link>
<Link to='/myorders'> <Link to='/myorders'>
<Item <Item arrow="horizontal">
arrow="horizontal"
onClick={() => {
}}
>
<i className="iconfont iconiconfront-24"></i> <i className="iconfont iconiconfront-24"></i>
课程订单 课程订单
</Item> </Item>
...@@ -92,27 +102,20 @@ class My extends PureComponent { ...@@ -92,27 +102,20 @@ class My extends PureComponent {
from: this.props.location.pathname from: this.props.location.pathname
} }
}}> }}>
<Item <Item arrow="horizontal" className="no-border">
arrow="horizontal"
>
<i className="iconfont iconiconfront-52"></i> <i className="iconfont iconiconfront-52"></i>
优惠券 优惠券
</Item> </Item>
</Link> </Link>
<div className="am-list-header"></div>
</List> <Link to='/scholarship'>
<Link to='/scholarship'> <Item arrow="horizontal" className='btm-scholarship'>
<List renderHeader={() => ''}>
<Item
arrow="horizontal"
onClick={() => {
}}
>
<i className="iconfont iconiconfront-51"></i> <i className="iconfont iconiconfront-51"></i>
赚奖学金 赚奖学金
</Item> </Item>
</List> </Link>
</Link> </List>
</Flex.Item> </Flex.Item>
</Flex> </Flex>
...@@ -123,4 +126,7 @@ class My extends PureComponent { ...@@ -123,4 +126,7 @@ class My extends PureComponent {
} }
export default WithTab(My); export default connect(
\ No newline at end of file state => ({user: state.user}),
null
)(WithTab(My))
.flex-container { .flex-container {
.my-tab { .my-tab {
width: 100%; width: 100%;
height: 44px; height: 44px;
font-size: $font_16; font-size: $font_16;
background: $bg_f7f9fc; background: $bg_f7f9fc;
} }
.my-list-content {
.am-list-item-middle {
height: 50px;
.my-list { .am-list-line {
.avatar-wrap { border-bottom: 1px solid $border_e7eaf1;
padding: 15px 20px; padding: 0;
} }
} }
.my-isvip { .no-border {
width: 100%; .am-list-line {
height: 43px; border-bottom: none;
background-image: url("./image/vip_bg.png");
background-size: cover; }
background-repeat: no-repeat;
border-radius: 3px;
} }
}
.my-stu { .my-list {
font-size: 12px; .avatar-wrap {
padding: 15px 20px;
height: 95px;
} }
}
.my-isvip {
width: 100%;
height: 43px;
background-image: url("./image/vip_bg.png");
background-size: cover;
background-repeat: no-repeat;
border-radius: 3px;
}
// 修改List组件默认样式 .my-stu {
.am-list-item { font-size: 12px;
padding-left: 22px; }
padding-right: 8px;
}
.am-list-item .am-list-line-multiple {
padding-right: 0px !important;
}
.am-list-thumb { // 修改List组件默认样式
img { .am-list-item {
width: 64px; padding: 0 20px;
height: 64px;
}
}
.am-list-brief { .vip {
color: $color_333 !important; width: 18px;
height: 17px;
margin-left: 6px;
} }
}
.am-list-header { .am-list-item .am-list-line-multiple {
padding: 2.5px 0; padding-right: 0px !important;
background: $bg_f5f5f5; }
}
.am-list-content { .am-list-thumb {
i { img {
vertical-align: middle; width: 64px;
margin-top: -1px; height: 64px;
display: inline-block; border-radius: 50%;
margin-right: 12px;
margin: 10px 12px 10px 0;
font-size: 30px !important;
}
} }
}
.am-list-line-multiple::after { .am-list-brief {
background-color: transparent !important; color: $color_333 !important;
}
.am-list-header {
padding: 2.5px 0;
background: $bg_f5f5f5;
}
.am-list-content {
font-size: 14px !important;
color: $color_333 !important;
i {
vertical-align: middle;
display: inline-block;
margin: 10px 12px 10px 0;
font-size: 18px !important;
} }
}
.my-list { .my-list {
.am-list-body::after { .am-list-arrow {
background-color: transparent !important; width: 8px !important;
} height: 15px !important;
} }
}
.am-list-content i { .am-list-body {
margin: 0; .am-list-arrow {
margin-top: -4px; width: 7px;
margin-right: 10px; height: 12px;
} }
}
.am-list-line-multiple::after {
background-color: transparent !important;
}
.am-list-body::before { .my-list {
background-color: transparent !important; .am-list-body::after {
height: 0 !important; background-color: transparent !important;
} }
}
.am-list-body::after {
background-color: $bg_fff !important;
}
.am-list-content i {
margin: 0;
margin-top: -4px;
margin-right: 10px;
}
.am-list-body::before {
background-color: transparent !important;
height: 0 !important;
}
} }
\ No newline at end of file
...@@ -63,36 +63,42 @@ class MyOrders extends Component { ...@@ -63,36 +63,42 @@ class MyOrders extends Component {
<div className='myorders-box'> <div className='myorders-box'>
<HeaderBar title={'我的订单'}></HeaderBar> <HeaderBar title={'我的订单'}></HeaderBar>
{ {
this.state.data && this.state.data.length > 0 && this.state.data.map((item, index) => { this.state.data && this.state.data.length > 0 ?
return ( this.state.data.map((item, index) => {
<div className="order-body" key={index}> return (
<OrderInfo item={item}/> <div className="order-body" key={index}>
{ <OrderInfo item={item}/>
item.course && item.course.length > 0 && item.course.map((item, index) => { {
const Info = ( item.course && item.course.length > 0 && item.course.map((item, index) => {
<div className="order-info"> const Info = (
<p className='order-title text-overflow-one'> <div className="order-info">
<Link to={`/detail?id=${item.course_id}`}>{item.course_title}</Link> <p className='order-title text-overflow-one'>
</p> <Link
<p className='order-content text-overflow-2'>{item.description}</p> to={`/detail?id=${item.course_id}`}>{item.course_title}</Link>
<p className='order-des'> </p>
<span className='order-newprice'>¥{item.pay_amount}</span> <p className='order-content text-overflow-2'>{item.description}</p>
<span className='order-price'>¥{item.price0}</span> <p className='order-des'>
</p> <span className='order-newprice'>¥{item.pay_amount}</span>
</div> <span className='order-price'>¥{item.price0}</span>
) </p>
return ( </div>
<div className="order-wrap" key={index}> )
<OrderList info={Info} src={item.image_name} id={item.course_id}></OrderList> return (
</div> <div className="order-wrap" key={index}>
) <OrderList info={Info} src={item.image_name}
}) id={item.course_id}></OrderList>
} </div>
)
<PayInfo item={item} cancel={this.cancel}/> })
</div> }
)
}) <PayInfo item={item} cancel={this.cancel}/>
</div>
)
}) : <div className="cart-tip">
<p className='cart-mess'>您还没有订单哦,快去逛逛吧~</p>
<Link to='/classify'>去逛逛</Link>
</div>
} }
</div> </div>
...@@ -136,7 +142,7 @@ function PayInfo(props) { ...@@ -136,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='/'>去支付</Link> <Link to='/order'>去支付</Link>
</div> </div>
} }
......
.myorders-box { .myorders-box {
width: 100%; width: 100%;
height: 100%;
background-color: $bg_f5f5f5; background-color: $bg_f5f5f5;
.order-body { .order-body {
...@@ -100,4 +101,31 @@ ...@@ -100,4 +101,31 @@
} }
} }
.cart-tip {
color: #555;
margin-top: 140px;
text-align: center;
.iconfridge {
font-size: 21px;
}
.cart-mess {
font-size: 12px;
color: $color_666;
}
a {
display: inline-block;
width: 130px;
height: 30px;
border: 1px solid $bg_active;
border-radius: 15px;
font-size: 16px;
margin-top: 30px;
color: $active;
text-align: center;
line-height: 28px;
}
}
} }
\ No newline at end of file
...@@ -5,7 +5,7 @@ import {VList} from '../../common' ...@@ -5,7 +5,7 @@ import {VList} from '../../common'
import {http, api} from "@/utils"; import {http, api} from "@/utils";
import {Link} from 'react-router-dom' import {Link} from 'react-router-dom'
import {Toast} from 'antd-mobile' import {Toast} from 'antd-mobile'
import {connect} from "react-redux"; import {connect} from "react-redux"
class Purchased extends Component { class Purchased extends Component {
constructor(props) { constructor(props) {
...@@ -19,12 +19,6 @@ class Purchased extends Component { ...@@ -19,12 +19,6 @@ class Purchased extends Component {
this.getList() this.getList()
} }
componentDidUpdate(prevProps, prevState) {
const {user} = this.props
console.log(user && user.data && user.data.uid);
}
// 获取订单 // 获取订单
getList = () => { getList = () => {
http.get(`${api.home}/m/my/courses`,).then((res) => { http.get(`${api.home}/m/my/courses`,).then((res) => {
...@@ -73,7 +67,6 @@ class Purchased extends Component { ...@@ -73,7 +67,6 @@ class Purchased extends Component {
} }
</div> </div>
: <div className="cart-tip"> : <div className="cart-tip">
<p><i className='iconfont iconfridge'></i></p>
<p className='cart-mess'>您还没有课程哦,快去逛逛吧~</p> <p className='cart-mess'>您还没有课程哦,快去逛逛吧~</p>
<Link to='/classify'>去逛逛</Link> <Link to='/classify'>去逛逛</Link>
</div> </div>
......
...@@ -2,7 +2,9 @@ import React, {Component} from 'react' ...@@ -2,7 +2,9 @@ import React, {Component} from 'react'
import './index.scss' import './index.scss'
import {HeaderBar} from '../../common' import {HeaderBar} from '../../common'
import {http, api, getParam} from '@/utils' import {http, api, getParam} from '@/utils'
import QRCode from 'qrcode'; import QRCode from 'qrcode'
import { Toast} from 'antd-mobile'
class SharePoster extends Component { class SharePoster extends Component {
...@@ -32,6 +34,8 @@ class SharePoster extends Component { ...@@ -32,6 +34,8 @@ class SharePoster extends Component {
name: res.data.data.username name: res.data.data.username
}) })
this.initCanvas(this.state.bgImage, 0) this.initCanvas(this.state.bgImage, 0)
} else {
Toast.info(res.data.msg, 2)
} }
}) })
} }
......
...@@ -25,7 +25,6 @@ class cartList extends Component { ...@@ -25,7 +25,6 @@ class cartList extends Component {
) )
}) })
: <div className="cart-tip"> : <div className="cart-tip">
<p><i className='iconfont iconfridge'></i></p>
<p className='cart-mess'>这里是空的,快去逛逛吧~</p> <p className='cart-mess'>这里是空的,快去逛逛吧~</p>
<Link to='/classify'>去逛逛</Link> <Link to='/classify'>去逛逛</Link>
</div> </div>
......
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