Commit 85f0e2c0 by xuzhenghua

合并

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