import Taro, { Component } from '@tarojs/taro' import { View, Text, Radio, RadioGroup, Label } from '@tarojs/components' import { AtInput, AtImagePicker, AtTextarea, AtButton, Picker } from 'taro-ui' import SearchBarComponent from '../../component/searchBarComponent/searchBarComponent' import copyrightComponent from '../../component/copyrightComponent/copyrightComponent' import './goodsPublish.scss' class GoodsPublish extends Component { config = { navigationBarTitleText: '商品发布' } constructor() { super(...arguments) this.state = { selector: ['需求', '供应', '人才'], // 应该是树型结构,需要修改 selectorChecked: '需求', productName:'', productPrice:'', productUnit:'', productDescript:'', files: [{ url: 'https://jimczj.gitee.io/lazyrepay/aragaki1.jpeg', }, { url: 'https://jimczj.gitee.io/lazyrepay/aragaki2.jpeg', }, { url: 'https://jimczj.gitee.io/lazyrepay/aragaki3.png', }], // 上传的图片 list: [ { value: '美国', text: '美国', checked: false }, { value: '中国', text: '中国', checked: true }, { value: '巴西', text: '巴西', checked: false }, { value: '日本', text: '日本', checked: false } ] // 店铺分类选项 } } // 改变商品分类状态 onChange(e){ this.setState({ selectorChecked: this.state.selector[e.detail.value] }) } productNameChange(event){ this.setState({ productName: event }) } productPriceChange(event){ this.setState({ productPrice: event }) } productUnitChange(event){ this.setState({ productUnit: event }) } productDescriptChange(event){ this.setState({ productDescript: event.target.value }) } // 上传图片 onChangeImg(files,operationType) { if (operationType === 'add') { this.setState({ files }) } if (operationType === 'remove') { this.state.files.splice(index, 1); this.setState({ files: this.state.files }); } } // 图片上传失败 onFail(mes) { console.log(mes) } // 删除图片 onImageClick(index) { } componentWillReceiveProps(nextProps) { console.log(this.props, nextProps) } componentWillUnmount() { } componentDidShow() { } componentDidHide() { } render() { return ( *商品分类: {this.state.selectorChecked} * * * {/* 图片上传 */} * 上传图片: {/* 店铺分类 */} * 店铺分类: 国家: {this.state.list.map((item, i) => { return ( ) })} 国家: {this.state.list.map((item, i) => { return ( ) })} 国家: {this.state.list.map((item, i) => { return ( ) })} 商品简介: 发布 发布并新增 商品列表 ) } } export default GoodsPublish