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 (