import React, { Component } from 'react'; import { Checkbox, Stepper, SwipeAction, Toast, Modal } from 'antd-mobile'; class CardItem extends Component { // 构造函数 constructor(props) { super(props) this.state = { val: props.item.value } } // 改变选择 onChange(e, id) { let checked = e.target.checked; // console.log(checked,id) this.props.checkChange(id, checked) } // 修改购物车 editCart(it, val) { } // 删除购物车 delete(id) { var that = this; } //跳转 goto(id) { } //render render() { let item = this.props.item return ( <div className="cart-c-item" > <div className="cart-c-check"> <Checkbox checked={item.check} onChange={(e) => { this.onChange(e, item.id) }} /> </div> {/* 商品图片 */} <div className="cart-ci-left" onClick={() => { this.goto(item.productId) }}> <img src={imgUrl + item.productThumbnail} alt={item.productName} /> </div> {/* 商品信息 */} <div className="cart-ci-right"> </div> </div> ) } } export default CardItem;