import React, {Component} from 'react' import {withRouter} from 'react-router-dom' import {NavBar, Icon, List, Picker} from 'antd-mobile' import classNames from 'classnames' import './index.css' const Item = List.Item const Brief = Item.Brief const delivery = [ { label: "快递配送", value: "快递配送", }, { label: "门店自提", value: "门店自提", } ] class CartOrders extends Component { constructor(props) { super(props) // console.log('shopping',JSON.parse(window.localStorage.getItem("shopping"))) this.state = { cartList: [], unfoldList: [], totalPrice: JSON.parse(window.localStorage.getItem('totalPrice')), delivery: ["快递配送"], height: '100%', unfoldStatus: true, foldStatus: false, } } componentWillMount() { let cartList = JSON.parse(window.localStorage.getItem("shopping")) if (cartList.length > 3) { let cartList1 = cartList.slice(0, 3) let unfoldList = cartList.slice(3) this.setState({ cartList: cartList1, unfoldList }) } else { this.setState({ cartList }) } } onChangeDelivery = (val) => { this.setState({ delivery: val, }) } onChangeHeight = (height, unfoldStatus, foldStatus) => { this.setState({ height, unfoldStatus, foldStatus }) } render() { let {cartList, unfoldList, height, unfoldStatus, foldStatus, totalPrice} = this.state return (
} onLeftClick={() => { this.props.history.goBack() }} >订单确认
{ this.props.history.push({ pathname:'/my/tools', state: {page: 'address'}}) }}>
承叶子   18726202125
安徽省合肥市蜀山区青阳路彩虹家园1栋1601
{ cartList.map((ele, index) => { return (
{ele.product_id.name}
颜色尺码等
¥ {ele.product_id.price}
x {ele.count}
) }) }
{ unfoldStatus ?
{ this.onChangeHeight(96 * unfoldList.length + 42, false, true) }}>
展开全部商品
: '' } { foldStatus ?
{ this.onChangeHeight('100%', true, false) }}> { unfoldList.map((ele, index) => { return (
{ele.product_id.name}
颜色尺码等
¥ {ele.product_id.price}
x {ele.count}
) }) }
收起
: '' }
配送方式
买家留言
商品金额 ¥ {totalPrice}
运费 ¥ 0.00
合计: ¥ {totalPrice}
) } } export default withRouter(CartOrders)