Commit e43c1313 by wangshuo

打开APP 拼团到订单页价格显示

parent dc17dab5
...@@ -60,6 +60,20 @@ class BtnStatus extends Component { ...@@ -60,6 +60,20 @@ class BtnStatus extends Component {
}) })
} }
} }
// 直接购买 TODO 等弄清楚了逻辑 再和加入购物车合并
toBuy = () => {
let data = {
course_id: getParam('id')
};
http.post(`${api.home}/m/cart/add`, data).then((res) => {
if(res.data.code !== 200) {
Toast.info(res.data.msg, 2);
return;
}
this.props.history.replace('/shopcart');
})
}
// 取消砍价 // 取消砍价
cancel = () => { cancel = () => {
......
...@@ -16,13 +16,16 @@ function OrderList(props) { ...@@ -16,13 +16,16 @@ function OrderList(props) {
<div> <div>
{ {
listData.map((item, index) => { listData.map((item, index) => {
console.log(item);
const { is_coupon, course_id, image_name, price1, price0, simpledescription, course_title, coupon_num, coupon_desc } = item; const { is_coupon, course_id, image_name, price1, price0, simpledescription, course_title, coupon_num, coupon_desc } = item;
const Info = ( const Info = (
<div className="order-info"> <div className="order-info">
<Link to={`/detail?id=${course_id}`}><p className='order-title' style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{course_title}</p></Link> <Link to={`/detail?id=${course_id}`}><p className='order-title' style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{course_title}</p></Link>
<p className='order-content' style={{ WebkitBoxOrient: 'vertical', WebkitLineClamp: '2', wordBreak: 'break-all', overflow: 'hidden', textOverflow: 'ellipsis', display: '-webkit-box' }}>{simpledescription}</p> <p className='order-content' style={{ WebkitBoxOrient: 'vertical', WebkitLineClamp: '2', wordBreak: 'break-all', overflow: 'hidden', textOverflow: 'ellipsis', display: '-webkit-box' }}>{simpledescription}</p>
<p className='order-des'> <p className='order-des'>
<span className='order-newprice'>¥{price1}</span> {
props.courseId === undefined ? (<span className='order-newprice'>¥{price1}</span>) : (<span className='order-newprice'>¥{item.pdd_group_info.price}</span>)
}
<span className='order-price'>¥{price0}</span> <span className='order-price'>¥{price0}</span>
</p> </p>
</div> </div>
...@@ -168,10 +171,10 @@ class Order extends Component { ...@@ -168,10 +171,10 @@ class Order extends Component {
componentDidMount() { componentDidMount() {
let _this = this; let _this = this;
if(getParam('id') !== undefined) { if(getParam('id') !== undefined) {
Promise.all([http.get(`${api.home}/m/order/preorder`), http.get(`${api.home}/m/course/detail/${getParam('id')}`)]).then(res => { Promise.all([http.get(`${api.home}/m/del_cart_order/${getParam('id')}`), http.get(`${api.home}/m/order/preorder`), http.get(`${api.home}/m/course/detail/${getParam('id')}`)]).then(res => {
let preorder = res[0], let preorder = res[1],
detail = res[1], detail = res[2],
orderList = []; orderList = [];
console.log(detail); console.log(detail);
if(preorder.data.code !== 200) { if(preorder.data.code !== 200) {
...@@ -287,7 +290,7 @@ class Order extends Component { ...@@ -287,7 +290,7 @@ class Order extends Component {
</div> </div>
} }
<div className="order-list"> <div className="order-list">
<OrderList list={orderList} compute={this.computedMoney} /> <OrderList list={orderList} compute={this.computedMoney} courseId={getParam('id')} />
</div> </div>
<div className="order-balance"> <div className="order-balance">
<List> <List>
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Flex, WhiteSpace, WingBlank } from 'antd-mobile'; import { Flex, WhiteSpace, WingBlank } from 'antd-mobile';
import './DrawDocument.scss' import './DrawDocument.scss';
import OpenApp from '@/common/CallApp';
export default class DrawDocument extends Component { export default class DrawDocument extends Component {
constructor(props) { constructor(props) {
...@@ -35,7 +36,8 @@ export default class DrawDocument extends Component { ...@@ -35,7 +36,8 @@ export default class DrawDocument extends Component {
<WingBlank> <WingBlank>
<Flex justify='between' align='center' style={{height: '44px'}}> <Flex justify='between' align='center' style={{height: '44px'}}>
<p className={'tip'}>收支明细及待确认金额请前往App查看</p> <p className={'tip'}>收支明细及待确认金额请前往App查看</p>
<div className={'app'}>APP打开</div> {/* <div className={'app'}>在APP打开</div> */}
<OpenApp />
</Flex> </Flex>
</WingBlank> </WingBlank>
</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