需求发布页面完成
This commit is contained in:
parent
ecab2bd5a8
commit
6847b89697
@ -33,7 +33,7 @@ class recommondShop extends Component {
|
||||
}
|
||||
goToShop(value) {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/shop/shop?id=' + value.shop_id + '&name=' + value.shop_name
|
||||
url: '/pages/shop/shop?id=' + value.shop_id
|
||||
})
|
||||
}
|
||||
// api 优惠卷请求
|
||||
|
@ -0,0 +1,311 @@
|
||||
|
||||
|
||||
import Taro, { Component } from '@tarojs/taro'
|
||||
import { View, Text } from '@tarojs/components'
|
||||
|
||||
import { AtTabBar, Picker, AtButton } from 'taro-ui'
|
||||
|
||||
import './goodsTypeInteractionComp.scss'
|
||||
|
||||
class GoodsTypeInteractionComp extends Component {
|
||||
|
||||
config = {
|
||||
navigationBarTitleText: 'goodsTypeInteractionComp'
|
||||
}
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
|
||||
this.state = {
|
||||
///---行业分类 开始
|
||||
objectMultiArray: [[{name:'选择商品分类',id:''}],[],[]],
|
||||
multiIndex: [0, 0, 0],
|
||||
formatInWindow: [],
|
||||
///---行业分类 结束
|
||||
}
|
||||
|
||||
}
|
||||
//商品目录请求api GetShopCategoryList
|
||||
getProductCateList(url) {
|
||||
Taro.request({
|
||||
url: url,
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'),
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
if (res.data.err_msg === 'success') {
|
||||
console.log('商品分类目录', res)
|
||||
this.formatIndustryType(res.data.data)
|
||||
this.formatIndustTypeInit(res.data.data)
|
||||
} else {
|
||||
console.log('商品分类请求没有成功', res)
|
||||
}
|
||||
}
|
||||
)
|
||||
.catch(error => {
|
||||
console.log('商品分类请求错误', error)
|
||||
})
|
||||
}
|
||||
// 第一种formate 用于底部弹层滚动时的数据
|
||||
formatIndustryType(data) {
|
||||
const newIndustryType = []
|
||||
if (data) {
|
||||
for (let outter of data) {
|
||||
let outterObject = { name: outter.class_name, id: outter.class_id, children: [] }
|
||||
if (outter.children) {
|
||||
for (let middler of outter.children) {
|
||||
const middleObject = { name: middler.class_name, id: middler.class_id, children: [] }
|
||||
outterObject.children.push(middleObject)
|
||||
if (middler.children) {
|
||||
for (let inner of middler.children) {
|
||||
middleObject.children.push({ name: inner.class_name, id: inner.class_id })
|
||||
}
|
||||
} else {
|
||||
middleObject.children.push({ name: '', id: '' })
|
||||
}
|
||||
}
|
||||
} else {
|
||||
outterObject.children.push({ name: '', id: '', children: [] })
|
||||
}
|
||||
newIndustryType.push(outterObject)
|
||||
}
|
||||
} else {
|
||||
console.log('店铺分类数据问题')
|
||||
}
|
||||
|
||||
this.setState({ formatInWindow: newIndustryType }, () => {
|
||||
console.log('滚动时的数据', this.state.formatInWindow)
|
||||
})
|
||||
}
|
||||
//第二种format 用于底部弹层的初始化数据
|
||||
formatIndustTypeInit(data) {
|
||||
const firstArray = []
|
||||
const secondArray = []
|
||||
const thirdArray = []
|
||||
for (let outter of data) {
|
||||
firstArray.push({ name: outter.class_name, id: outter.class_id })
|
||||
if (outter.children) {
|
||||
for (let middler of outter.children) {
|
||||
secondArray.push({ name: middler.class_name, id: middler.class_id })
|
||||
if (middler.children) {
|
||||
for (let inner of middler.children) {
|
||||
thirdArray.push({ name: inner.class_name, id: inner.class_id })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 这里不能加入secondArray,和thirdArray 会有bug
|
||||
this.setState({ objectMultiArray: [firstArray, [{ name: '', id: '' }], [{ name: '', id: '' }]] }, () => {
|
||||
console.log('初始化数据', this.state.objectMultiArray)
|
||||
})
|
||||
|
||||
}
|
||||
//--- 三级联动--------------
|
||||
bindMultiPickerChange(e) {
|
||||
console.log('picker发送选择改变,携带值为', e.detail.value)
|
||||
this.setState({
|
||||
multiIndex: e.detail.value
|
||||
}, () => {
|
||||
this.returnResultToParent()
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
returnResultToParent() {
|
||||
let result = ''
|
||||
let outter = this.state.formatInWindow[this.state.multiIndex[0]]
|
||||
let middler = outter.children[this.state.multiIndex[1]]
|
||||
let inner = middler.children[this.state.multiIndex[2]]
|
||||
|
||||
if (outter.id) {
|
||||
result = outter
|
||||
if (middler.id) {
|
||||
result = middler
|
||||
if (inner.id) {
|
||||
result = inner
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.passDataToParent(result)
|
||||
}
|
||||
bindMultiPickerCol(e) {
|
||||
console.log('修改的列为', e.detail.column, ',值为', e.detail.value)
|
||||
const data = {
|
||||
multiArray: this.state.objectMultiArray,
|
||||
multiIndex: this.state.multiIndex
|
||||
}
|
||||
data.multiIndex[e.detail.column] = e.detail.value
|
||||
switch (e.detail.column) {
|
||||
case 0:
|
||||
switch (data.multiIndex[0]) {
|
||||
case 0:
|
||||
data.multiArray[1] = this.state.formatInWindow[0].children
|
||||
data.multiArray[2] = this.state.formatInWindow[0].children
|
||||
break
|
||||
case 1:
|
||||
data.multiArray[1] = this.state.formatInWindow[1].children
|
||||
break
|
||||
case 2:
|
||||
data.multiArray[1] = this.state.formatInWindow[2].children
|
||||
break
|
||||
case 3:
|
||||
data.multiArray[1] = this.state.formatInWindow[3].children
|
||||
break
|
||||
case 4:
|
||||
data.multiArray[1] = this.state.formatInWindow[4].children
|
||||
break
|
||||
}
|
||||
data.multiIndex[1] = 0
|
||||
data.multiIndex[2] = 0
|
||||
break
|
||||
case 1:
|
||||
switch (data.multiIndex[0]) {
|
||||
case 0:
|
||||
|
||||
break
|
||||
case 1:
|
||||
switch (data.multiIndex[1]) {
|
||||
case 0:
|
||||
data.multiArray[2] = this.state.formatInWindow[1].children[0].children
|
||||
break
|
||||
case 1:
|
||||
data.multiArray[2] = this.state.formatInWindow[1].children[1].children
|
||||
break
|
||||
case 2:
|
||||
data.multiArray[2] = this.state.formatInWindow[1].children[2].children
|
||||
break
|
||||
case 3:
|
||||
data.multiArray[2] = this.state.formatInWindow[1].children[3].children ? this.state.formatInWindow[1].children[3].children : [{ class_name: '' }]
|
||||
break
|
||||
}
|
||||
break
|
||||
case 2:
|
||||
switch (data.multiIndex[1]) {
|
||||
case 0:
|
||||
data.multiArray[2] = this.state.formatInWindow[2].children[0].children
|
||||
break
|
||||
case 1:
|
||||
data.multiArray[2] = this.state.formatInWindow[2].children[1].children
|
||||
break
|
||||
case 2:
|
||||
data.multiArray[2] = this.state.formatInWindow[2].children[2].children
|
||||
break
|
||||
case 3:
|
||||
data.multiArray[2] = this.state.formatInWindow[2].children[3].children
|
||||
break
|
||||
case 4:
|
||||
data.multiArray[2] = this.state.formatInWindow[2].children[4].children
|
||||
break
|
||||
case 5:
|
||||
data.multiArray[2] = this.state.formatInWindow[2].children[5].children
|
||||
break
|
||||
}
|
||||
break
|
||||
case 3:
|
||||
switch (data.multiIndex[1]) {
|
||||
case 0:
|
||||
data.multiArray[2] = this.state.formatInWindow[3].children[0].children
|
||||
break
|
||||
case 1:
|
||||
data.multiArray[2] = this.state.formatInWindow[3].children[1].children
|
||||
break
|
||||
case 2:
|
||||
data.multiArray[2] = this.state.formatInWindow[3].children[2].children
|
||||
break
|
||||
case 3:
|
||||
data.multiArray[2] = this.state.formatInWindow[3].children[3].children
|
||||
break
|
||||
case 3:
|
||||
data.multiArray[2] = this.state.formatInWindow[3].children[3].children
|
||||
break
|
||||
}
|
||||
break
|
||||
case 4:
|
||||
switch (data.multiIndex[1]) {
|
||||
case 0:
|
||||
data.multiArray[2] = this.state.formatInWindow[4].children[0].children
|
||||
break
|
||||
case 1:
|
||||
data.multiArray[2] = this.state.formatInWindow[4].children[1].children
|
||||
break
|
||||
case 2:
|
||||
data.multiArray[2] = this.state.formatInWindow[4].children[2].children
|
||||
break
|
||||
|
||||
}
|
||||
break
|
||||
|
||||
}
|
||||
data.multiIndex[2] = 0
|
||||
break
|
||||
}
|
||||
this.setState({ multiIndex: data.multiIndex })
|
||||
}
|
||||
|
||||
//--------------------结束-行业分类picker
|
||||
passDataToParent(industryTypeSelected) {
|
||||
this.props.onPassDataToChild(industryTypeSelected)
|
||||
}
|
||||
|
||||
goodTypeOnClick(){
|
||||
console.log('clicked')
|
||||
this.getProductCateList(this.props.url)
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
|
||||
}
|
||||
// 当然父组件有新的props的 会从新渲染组件
|
||||
componentWillReceiveProps(nextProps) {
|
||||
|
||||
}
|
||||
componentWillUnmount() { }
|
||||
|
||||
componentDidShow() { }
|
||||
|
||||
componentDidHide() { }
|
||||
|
||||
render() {
|
||||
console.log('this.state.objectMultiArray[0]',this.state.objectMultiArray[0][this.state.multiIndex[0]].name)
|
||||
return (
|
||||
<View class='page-section'>
|
||||
<Picker
|
||||
rangeKey='name'
|
||||
mode='multiSelector'
|
||||
onChange={this.bindMultiPickerChange.bind(this)}
|
||||
onColumnchange={this.bindMultiPickerCol.bind(this)}
|
||||
value={this.state.multiIndex}
|
||||
range={this.state.objectMultiArray}
|
||||
onClick={this.goodTypeOnClick.bind(this)}
|
||||
>
|
||||
<View class='picker type'>
|
||||
<View className='title-box'>
|
||||
<Text className='require'>*</Text>
|
||||
<Text className='title'>商品分类:</Text>
|
||||
|
||||
{this.state.objectMultiArray[0].length?<Text className='first-col'> {this.state.objectMultiArray[0][this.state.multiIndex[0]].name}</Text>:null}
|
||||
{this.state.objectMultiArray[1].length?<Text className='second-col'>{this.state.objectMultiArray[1][this.state.multiIndex[1]].name}</Text>:null}
|
||||
{this.state.objectMultiArray[2].length?<Text className='third-col'>{this.state.objectMultiArray[2][this.state.multiIndex[2]].name}</Text>:null}
|
||||
|
||||
</View>
|
||||
</View>
|
||||
</Picker>
|
||||
</View>
|
||||
|
||||
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default GoodsTypeInteractionComp
|
||||
|
||||
|
@ -0,0 +1,42 @@
|
||||
.page-section{
|
||||
border-bottom: 1Px solid #d6e4ef;
|
||||
font-size:32rpx;
|
||||
|
||||
.picker{
|
||||
|
||||
|
||||
.title-box{
|
||||
line-height:100rpx;
|
||||
font-weight: bold;
|
||||
.require{
|
||||
color:red,
|
||||
}
|
||||
.title{
|
||||
//color: #333;
|
||||
line-height:100rpx;
|
||||
margin-right:16rpx;
|
||||
width:172rpx;
|
||||
font-size:32rpx;
|
||||
vertical-align:middle;
|
||||
text-align:left;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.first-col{
|
||||
font-weight: normal;
|
||||
margin-left: 2%
|
||||
}
|
||||
.second-col{
|
||||
font-weight: normal;
|
||||
display: inline-block;
|
||||
margin-left: 2%
|
||||
}
|
||||
.third-col{
|
||||
font-weight: normal;
|
||||
display: inline-block;
|
||||
margin-left: 2%
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -1,22 +1,22 @@
|
||||
|
||||
import Taro, { Component } from '@tarojs/taro'
|
||||
import { View, Text } from '@tarojs/components'
|
||||
|
||||
import { AtTabBar, Picker, AtButton } from 'taro-ui'
|
||||
import URL from '../../serviceAPI.config'
|
||||
import { Picker } from 'taro-ui'
|
||||
|
||||
import './interaction.scss'
|
||||
import './interactionComponent.scss'
|
||||
|
||||
class Interaction extends Component {
|
||||
|
||||
config = {
|
||||
navigationBarTitleText: 'bottomNav'
|
||||
navigationBarTitleText: 'interactionComponent'
|
||||
}
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
|
||||
this.state = {
|
||||
///---行业分类 开始
|
||||
objectMultiArray: [],
|
||||
objectMultiArray: '',
|
||||
multiIndex: [0, 0],
|
||||
formatInWindow: [],
|
||||
///---行业分类 结束
|
||||
@ -24,11 +24,29 @@ class Interaction extends Component {
|
||||
}
|
||||
|
||||
}
|
||||
// 行业分类筛选列表GetIndustryTypeList
|
||||
getIndustryTypeList(url) {
|
||||
Taro.request({
|
||||
url: url,
|
||||
method: 'GET',
|
||||
dataType: 'json',
|
||||
header: {
|
||||
'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'),
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
}).then(res => {
|
||||
console.log('行业分类列表', res)
|
||||
this.formatIndustryType(res.data.data)
|
||||
this.formatIndustTypeInit(res.data.data)
|
||||
|
||||
|
||||
}).catch(err => {
|
||||
console.log('行业分类列表获取失败', err)
|
||||
})
|
||||
}
|
||||
// 第一种formate 用于底部弹层滚动时的数据
|
||||
formatIndustryType(data) {
|
||||
const newIndustryType = []
|
||||
const newIndustryType = [{ name: '全部', id: '-1', child: [{ name: '', id: '' }] }]
|
||||
for (let outter of data) {
|
||||
let outterObject = { name: outter.class_name, id: outter.class_id, child: [] }
|
||||
if (outter.child.length) {
|
||||
@ -41,13 +59,11 @@ class Interaction extends Component {
|
||||
newIndustryType.push(outterObject)
|
||||
}
|
||||
this.setState({ formatInWindow: newIndustryType })
|
||||
// console.log('newIndustryType1', newIndustryType)
|
||||
|
||||
}
|
||||
//第二种format 用于底部弹层的初始化数据
|
||||
formatIndustryTypei(data) {
|
||||
const firstArray = []
|
||||
const secondArray = []
|
||||
formatIndustTypeInit(data) {
|
||||
const firstArray = [{ name: '全部', id: '1' }]
|
||||
const secondArray = [{ name: '', id: '' }]
|
||||
for (let outter of data) {
|
||||
firstArray.push({ name: outter.class_name, id: outter.class_id })
|
||||
if (outter.child.length) {
|
||||
@ -57,13 +73,14 @@ class Interaction extends Component {
|
||||
}
|
||||
}
|
||||
this.setState({ objectMultiArray: [firstArray, secondArray] }, () => {
|
||||
// console.log('newIndustryType2', this.state.objectMultiArray)
|
||||
})
|
||||
|
||||
}
|
||||
//--------------------开始-行业分类picker
|
||||
bindMultiPickerChange(e) {
|
||||
//判断如果formatInWindow 的子类为空 那就取父类, 反之取子类
|
||||
console.log('index', this.state.multiIndex)
|
||||
console.log('formatInWindow', this.state.formatInWindow)
|
||||
let industryTypeSelected
|
||||
if (this.state.formatInWindow[e.detail.value[0]].child[e.detail.value[1]].id === '') {
|
||||
industryTypeSelected = this.state.formatInWindow[e.detail.value[0]]
|
||||
@ -72,10 +89,10 @@ class Interaction extends Component {
|
||||
}
|
||||
|
||||
console.log('picker发送选择改变,携带值为', e.detail.value)
|
||||
|
||||
|
||||
this.setState({
|
||||
multiIndex: e.detail.value,
|
||||
},()=>{
|
||||
}, () => {
|
||||
this.passDataToParent(industryTypeSelected)
|
||||
})
|
||||
|
||||
@ -86,6 +103,7 @@ class Interaction extends Component {
|
||||
objectMultiArray: this.state.objectMultiArray,
|
||||
multiIndex: this.state.multiIndex
|
||||
}
|
||||
console.log(' this.state.formatInWindow', this.state.formatInWindow)
|
||||
data.multiIndex[e.detail.column] = e.detail.value
|
||||
switch (e.detail.column) {
|
||||
case 0:
|
||||
@ -106,10 +124,10 @@ class Interaction extends Component {
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[4].child
|
||||
break
|
||||
case 5:
|
||||
data.objectMultiArray[1] = [{ name: '' }]
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[6].child
|
||||
break
|
||||
case 6:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[6].child
|
||||
data.objectMultiArray[1] = [{ name: '' }]
|
||||
break
|
||||
case 7:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[7].child
|
||||
@ -135,41 +153,42 @@ class Interaction extends Component {
|
||||
case 14:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[14].child
|
||||
break
|
||||
case 15:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[15].child
|
||||
break
|
||||
case 15:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[16].child
|
||||
break
|
||||
|
||||
}
|
||||
data.multiIndex[1] = 0
|
||||
data.multiIndex[2] = 0
|
||||
break
|
||||
|
||||
}
|
||||
console.log(data.multiIndex)
|
||||
console.log('objectMultiArray', data.objectMultiArray)
|
||||
this.setState({
|
||||
multiIndex: data.multiIndex,
|
||||
objectMultiArray: data.objectMultiArray
|
||||
}, () => {
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
//--------------------结束-行业分类picker
|
||||
|
||||
|
||||
passDataToParent(industryTypeSelected){
|
||||
passDataToParent(industryTypeSelected) {
|
||||
this.props.onPassDataToChild(industryTypeSelected)
|
||||
}
|
||||
componentWillMount() {
|
||||
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
}
|
||||
// 当然父组件有新的props的 会从新渲染组件
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.data.length) {
|
||||
this.formatIndustryType(nextProps.data)
|
||||
this.formatIndustryTypei(nextProps.data)
|
||||
}
|
||||
}
|
||||
clickHandler() {
|
||||
this.props.onFunction(33)
|
||||
}
|
||||
|
||||
this.getIndustryTypeList(this.props.url)
|
||||
}
|
||||
// 当然父组件有新的props的 会从新渲染组件
|
||||
componentWillReceiveProps(nextProps) {
|
||||
|
||||
}
|
||||
componentWillUnmount() { }
|
||||
|
||||
componentDidShow() { }
|
||||
@ -177,12 +196,8 @@ class Interaction extends Component {
|
||||
componentDidHide() { }
|
||||
|
||||
render() {
|
||||
console.log('我拿到props', this.props)
|
||||
console.log('objectMultiArray', this.state.objectMultiArray)
|
||||
console.log('objectMultiwindow', this.state.formatInWindow)
|
||||
return (
|
||||
<View class='page-section'>
|
||||
|
||||
<Picker
|
||||
rangeKey='name'
|
||||
mode='multiSelector'
|
||||
@ -194,8 +209,8 @@ class Interaction extends Component {
|
||||
<View class='picker type'>
|
||||
<View className='title-box'>
|
||||
<Text className='title'>行业分类:</Text>
|
||||
{this.state.objectMultiArray.length ? <Text> <Text className='first-col'> {this.state.objectMultiArray[0][this.state.multiIndex[0]].name}</Text>
|
||||
<Text className='second-col'> {this.state.objectMultiArray[1][this.state.multiIndex[1]].name}</Text></Text> : null}
|
||||
{this.state.objectMultiArray[0] ? <Text className='first-col'> {this.state.objectMultiArray[0][this.state.multiIndex[0]].name}</Text> : null}
|
||||
{this.state.objectMultiArray[1] ? <Text className='second-col'> {this.state.objectMultiArray[1][this.state.multiIndex[1]].name}</Text> : null}
|
||||
</View>
|
||||
</View>
|
||||
</Picker>
|
@ -1,6 +1,7 @@
|
||||
.page-section{
|
||||
border-bottom: 1Px solid #d6e4ef;
|
||||
|
||||
font-size:32rpx;
|
||||
|
||||
.picker{
|
||||
// padding: 24rpx 0;
|
||||
.selected{
|
||||
@ -28,7 +29,7 @@
|
||||
|
||||
.first-col{
|
||||
font-weight: normal;
|
||||
margin-left: 10%
|
||||
margin-left: 17%
|
||||
}
|
||||
.second-col{
|
||||
font-weight: normal;
|
248
src/component/shopTypeInteractionComp/shopTypeInteractionComp.js
Normal file
248
src/component/shopTypeInteractionComp/shopTypeInteractionComp.js
Normal file
@ -0,0 +1,248 @@
|
||||
|
||||
|
||||
import Taro, { Component } from '@tarojs/taro'
|
||||
import { View, Text } from '@tarojs/components'
|
||||
|
||||
import { AtTabBar, Picker, AtButton } from 'taro-ui'
|
||||
|
||||
import './shopTypeInteractionComp.scss'
|
||||
|
||||
class ShopTypeInteractionComp extends Component {
|
||||
|
||||
config = {
|
||||
navigationBarTitleText: 'shopTypeInteractionComp'
|
||||
}
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
|
||||
this.state = {
|
||||
///---行业分类 开始
|
||||
objectMultiArray: [[{}],[{name:'选择店铺分类',id:''}]],
|
||||
multiIndex: [0, 0],
|
||||
formatInWindow: [],
|
||||
///---行业分类 结束
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// 店铺分类筛选列表GetShopTypeList
|
||||
getShopTypeList(url) {
|
||||
Taro.request({
|
||||
url: url,
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
id: Taro.getStorageSync('shopInfo').shop_id
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'),
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
console.log('店铺分类目录', res)
|
||||
this.formatIndustryType(res.data.data)
|
||||
this.formatIndustTypeInit(res.data.data)
|
||||
|
||||
}
|
||||
)
|
||||
.catch(error => {
|
||||
console.log('店铺分类请求错误', error)
|
||||
})
|
||||
}
|
||||
// 第一种formate 用于底部弹层滚动时的数据
|
||||
formatIndustryType(data) {
|
||||
const newIndustryType = []
|
||||
if (Object.keys(data).length) {
|
||||
for (let key in data) {
|
||||
let outterObject = { name: data[key].n, id: '', child: [] }
|
||||
if (data[key].c.length) {
|
||||
for (let child of data[key].c) {
|
||||
outterObject.child.push({ name: child.n, id: child.id })
|
||||
}
|
||||
} else {
|
||||
outterObject.child.push({ name: '', id: '' })
|
||||
}
|
||||
newIndustryType.push(outterObject)
|
||||
}
|
||||
} else {
|
||||
console.log('店铺分类数据问题')
|
||||
}
|
||||
|
||||
this.setState({ formatInWindow: newIndustryType },()=>{
|
||||
console.log('滚动时的数据',this.state.formatInWindow)
|
||||
})
|
||||
}
|
||||
//第二种format 用于底部弹层的初始化数据
|
||||
formatIndustTypeInit(data) {
|
||||
const firstArray = []
|
||||
const secondArray = []
|
||||
if (Object.keys(data).length) {
|
||||
|
||||
for (let key in data) {
|
||||
firstArray.push({ name: data[key].n, id: '' })
|
||||
if (data[key].c.length) {
|
||||
for (let child of data[key].c) {
|
||||
secondArray.push({ name: child.n, id: child.id })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
console.log('店铺分类数据问题')
|
||||
}
|
||||
|
||||
this.setState({ objectMultiArray: [firstArray, secondArray] }, () => {
|
||||
// console.log('初始化数据', this.state.objectMultiArray)
|
||||
})
|
||||
|
||||
}
|
||||
//--------------------开始-行业分类picker
|
||||
bindMultiPickerChange(e) {
|
||||
|
||||
|
||||
// console.log('picker发送选择改变,携带值为', e.detail.value)
|
||||
|
||||
this.setState({
|
||||
multiIndex: e.detail.value,
|
||||
}, () => {
|
||||
//判断如果formatInWindow 的子类为空 那就取父类, 反之取子类
|
||||
let industryTypeSelected
|
||||
if (this.state.formatInWindow[e.detail.value[0]].child[e.detail.value[1]].id === '') {
|
||||
industryTypeSelected = this.state.formatInWindow[e.detail.value[0]]
|
||||
} else {
|
||||
industryTypeSelected = this.state.formatInWindow[e.detail.value[0]].child[e.detail.value[1]]
|
||||
}
|
||||
this.passDataToParent(industryTypeSelected)
|
||||
})
|
||||
|
||||
}
|
||||
bindMulPickerColChge(e) {
|
||||
//console.log('修改的列为', e.detail.column, ',值为', e.detail.value)
|
||||
const data = {
|
||||
objectMultiArray: this.state.objectMultiArray,
|
||||
multiIndex: this.state.multiIndex
|
||||
}
|
||||
// console.log(' this.state.formatInWindow', this.state.formatInWindow)
|
||||
data.multiIndex[e.detail.column] = e.detail.value
|
||||
|
||||
switch (e.detail.column) {
|
||||
case 0:
|
||||
switch (data.multiIndex[0]) {
|
||||
case 0:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[0].child
|
||||
break
|
||||
case 1:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[1].child
|
||||
break
|
||||
case 2:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[2].child
|
||||
break
|
||||
case 3:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[3].child
|
||||
break
|
||||
case 4:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[4].child
|
||||
break
|
||||
case 5:
|
||||
data.objectMultiArray[1] = [{ name: '' }]
|
||||
break
|
||||
case 6:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[6].child
|
||||
break
|
||||
case 7:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[7].child
|
||||
break
|
||||
case 8:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[8].child
|
||||
break
|
||||
case 9:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[9].child
|
||||
break
|
||||
case 10:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[10].child
|
||||
break
|
||||
case 11:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[11].child
|
||||
break
|
||||
case 12:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[12].child
|
||||
break
|
||||
case 13:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[13].child
|
||||
break
|
||||
case 14:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[14].child
|
||||
break
|
||||
}
|
||||
data.multiIndex[1] = 0
|
||||
break
|
||||
|
||||
}
|
||||
// console.log(data.multiIndex)
|
||||
// console.log('objectMultiArray', data.objectMultiArray)
|
||||
this.setState({
|
||||
multiIndex: data.multiIndex,
|
||||
objectMultiArray: data.objectMultiArray
|
||||
}, () => {
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
//--------------------结束-行业分类picker
|
||||
passDataToParent(industryTypeSelected) {
|
||||
this.props.onPassDataToChild(industryTypeSelected)
|
||||
}
|
||||
shopTypeOnClick(){
|
||||
this.getShopTypeList(this.props.url)
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
|
||||
}
|
||||
// 当然父组件有新的props的 会从新渲染组件
|
||||
componentWillReceiveProps(nextProps) {
|
||||
|
||||
}
|
||||
componentWillUnmount() { }
|
||||
|
||||
componentDidShow() { }
|
||||
|
||||
componentDidHide() { }
|
||||
|
||||
render() {
|
||||
console.log('tesst',this.state.objectMultiArray)
|
||||
return (
|
||||
<View class='page-section'>
|
||||
<Picker
|
||||
rangeKey='name'
|
||||
mode='multiSelector'
|
||||
onChange={this.bindMultiPickerChange.bind(this)}
|
||||
onColumnchange={this.bindMulPickerColChge.bind(this)}
|
||||
value={this.state.multiIndex}
|
||||
range={this.state.objectMultiArray}
|
||||
onClick={this.shopTypeOnClick.bind(this)}
|
||||
>
|
||||
<View class='picker type'>
|
||||
<View className='title-box'>
|
||||
<Text className='require'>*</Text>
|
||||
<Text className='title'>店铺分类:</Text>
|
||||
{ this.props.initialType?this.props.initialType.name: this.state.objectMultiArray.length ? <Text>
|
||||
<Text className='second-col'> {this.state.objectMultiArray[1][this.state.multiIndex[1]].name}</Text></Text> : null}
|
||||
|
||||
|
||||
</View>
|
||||
</View>
|
||||
</Picker>
|
||||
</View>
|
||||
|
||||
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default ShopTypeInteractionComp
|
||||
|
||||
|
@ -0,0 +1,45 @@
|
||||
.page-section{
|
||||
border-bottom: 1Px solid #d6e4ef;
|
||||
font-size:32rpx;
|
||||
|
||||
.picker{
|
||||
// padding: 24rpx 0;
|
||||
.selected{
|
||||
font-weight: normal;
|
||||
display: inline-block;
|
||||
margin-left: 20%;
|
||||
font-size: 32rpx
|
||||
}
|
||||
.date{
|
||||
margin-left: 0%
|
||||
}
|
||||
.title-box{
|
||||
line-height:100rpx;
|
||||
font-weight: bold;
|
||||
.require{
|
||||
color:red
|
||||
}
|
||||
.title{
|
||||
//color: #333;
|
||||
line-height:100rpx;
|
||||
margin-right:16rpx;
|
||||
width:172rpx;
|
||||
font-size:32rpx;
|
||||
vertical-align:middle;
|
||||
text-align:left;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.first-col{
|
||||
font-weight: normal;
|
||||
margin-left: 10%
|
||||
}
|
||||
.second-col{
|
||||
font-weight: normal;
|
||||
display: inline-block;
|
||||
margin-left: 10%
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -1,169 +0,0 @@
|
||||
import Taro, { Component } from '@tarojs/taro'
|
||||
import { View } from '@tarojs/components'
|
||||
|
||||
import { AtTabBar, Picker } from 'taro-ui'
|
||||
|
||||
import './test3.scss'
|
||||
|
||||
class Test3 extends Component {
|
||||
|
||||
config = {
|
||||
navigationBarTitleText: 'test3'
|
||||
}
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
|
||||
this.state = {
|
||||
multiArray: [['无脊柱动物', '脊柱动物'], ['扁性动物', '线形动物', '环节动物', '软体动物', '节肢动物'], ['猪肉绦虫', '吸血虫']],
|
||||
objectMultiArray: [
|
||||
[
|
||||
{
|
||||
id: 0,
|
||||
name: '无脊柱动物'
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
name: '脊柱动物'
|
||||
}
|
||||
], [
|
||||
{
|
||||
id: 0,
|
||||
name: '扁性动物'
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
name: '线形动物'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '环节动物'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '软体动物'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '节肢动物'
|
||||
}
|
||||
], [
|
||||
{
|
||||
id: 0,
|
||||
name: '猪肉绦虫'
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
name: '吸血虫'
|
||||
}
|
||||
]
|
||||
],
|
||||
multiIndex: [0, 0, 0],
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
//console.log(this.props, nextProps)
|
||||
}
|
||||
|
||||
componentWillUnmount() { }
|
||||
|
||||
componentDidShow() { }
|
||||
|
||||
componentDidHide() { }
|
||||
|
||||
bindMultiPickerChange(e) {
|
||||
console.log('picker发送选择改变,携带值为', e.detail.value)
|
||||
this.setState({
|
||||
multiIndex: e.detail.value
|
||||
})
|
||||
}
|
||||
bindMultiPickerCol(e) {
|
||||
console.log('修改的列为', e.detail.column, ',值为', e.detail.value);
|
||||
var data = {
|
||||
multiArray: this.state.multiArray,
|
||||
multiIndex: this.state.multiIndex
|
||||
};
|
||||
data.multiIndex[e.detail.column] = e.detail.value;
|
||||
switch (e.detail.column) {
|
||||
case 0:
|
||||
switch (data.multiIndex[0]) {
|
||||
case 0:
|
||||
data.multiArray[1] = ['扁性动物', '线形动物', '环节动物', '软体动物', '节肢动物'];
|
||||
data.multiArray[2] = ['猪肉绦虫', '吸血虫'];
|
||||
break;
|
||||
case 1:
|
||||
data.multiArray[1] = ['鱼', '两栖动物', '爬行动物'];
|
||||
data.multiArray[2] = ['鲫鱼', '带鱼'];
|
||||
break;
|
||||
}
|
||||
data.multiIndex[1] = 0;
|
||||
data.multiIndex[2] = 0;
|
||||
break;
|
||||
case 1:
|
||||
switch (data.multiIndex[0]) {
|
||||
case 0:
|
||||
switch (data.multiIndex[1]) {
|
||||
case 0:
|
||||
data.multiArray[2] = ['猪肉绦虫', '吸血虫'];
|
||||
break;
|
||||
case 1:
|
||||
data.multiArray[2] = ['蛔虫'];
|
||||
break;
|
||||
case 2:
|
||||
data.multiArray[2] = ['蚂蚁', '蚂蟥'];
|
||||
break;
|
||||
case 3:
|
||||
data.multiArray[2] = ['河蚌', '蜗牛', '蛞蝓'];
|
||||
break;
|
||||
case 4:
|
||||
data.multiArray[2] = ['昆虫', '甲壳动物', '蛛形动物', '多足动物'];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
switch (data.multiIndex[1]) {
|
||||
case 0:
|
||||
data.multiArray[2] = ['鲫鱼', '带鱼'];
|
||||
break;
|
||||
case 1:
|
||||
data.multiArray[2] = ['青蛙', '娃娃鱼'];
|
||||
break;
|
||||
case 2:
|
||||
data.multiArray[2] = ['蜥蜴', '龟', '壁虎'];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
data.multiIndex[2] = 0;
|
||||
console.log(data.multiIndex);
|
||||
break;
|
||||
}
|
||||
console.log(data)
|
||||
this.setState({ multiIndex: data.multiIndex })
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
return (
|
||||
<View >
|
||||
hello
|
||||
|
||||
<View class='section'>
|
||||
<View class='section__title'>多列选择器</View>
|
||||
<Picker mode='multiSelector' onChange={this.bindMultiPickerChange.bind(this)} onColumnchange={this.bindMultiPickerCol.bind(this)} value={this.state.multiIndex} range={this.state.multiArray}>
|
||||
<View class='picker'>
|
||||
当前选择:{this.state.multiArray[0][this.state.multiIndex[0]]}{this.state.multiArray[1][this.state.multiIndex[1]]}{this.state.multiArray[2][this.state.multiIndex[2]]}
|
||||
</View>
|
||||
</Picker>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default Test3
|
||||
|
@ -1,5 +1,5 @@
|
||||
import Taro, { Component } from '@tarojs/taro'
|
||||
import { View, Text, Image , Swiper, SwiperItem} from '@tarojs/components'
|
||||
import { View, Text, Image, Swiper, SwiperItem } from '@tarojs/components'
|
||||
|
||||
import { AtTabs, AtTabsPane, AtSegmentedControl, AtIcon, Picker } from 'taro-ui'
|
||||
import copyrightComponent from '../../component/copyrightComponent/copyrightComponent'
|
||||
@ -31,9 +31,10 @@ class Goods extends Component {
|
||||
monthSold: '',//月销量
|
||||
totalSold: '',//总销量
|
||||
browsingCount: '',// 浏览数
|
||||
shopId: ''
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 商品详情api
|
||||
getGoodDescription() {
|
||||
Taro.request({
|
||||
@ -50,7 +51,7 @@ class Goods extends Component {
|
||||
})
|
||||
.then(res => {
|
||||
console.log('商品详情:', res)
|
||||
if(res.data.err_msg==="success"){
|
||||
if (res.data.err_msg === "success") {
|
||||
this.setState({
|
||||
productImagesUrl: res.data.goods.goods_pic,
|
||||
productName: res.data.goods.goods_name,
|
||||
@ -62,16 +63,16 @@ class Goods extends Component {
|
||||
monthSold: res.data.goods.month_sales,
|
||||
totalSold: res.data.goods.sales_volume,
|
||||
browsingCount: res.data.goods.browse_times,
|
||||
shopId: res.data.goods.shop_id
|
||||
})
|
||||
|
||||
}else{
|
||||
Taro.showToast({
|
||||
title:res.data.err_msg,
|
||||
icon:'none',
|
||||
duration:1000
|
||||
})
|
||||
} else {
|
||||
Taro.showToast({
|
||||
title: res.data.err_msg,
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
@ -91,23 +92,23 @@ class Goods extends Component {
|
||||
// 去其他页面
|
||||
goShopPage() {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/shop/shop'
|
||||
url: '/pages/shop/shop?id=' + this.state.shopId
|
||||
})
|
||||
}
|
||||
// 收藏商品
|
||||
saveItem() {
|
||||
Taro.showToast({
|
||||
title:'收藏成功',
|
||||
icon:'success',
|
||||
duration:1500
|
||||
title: '收藏成功',
|
||||
icon: 'success',
|
||||
duration: 1500
|
||||
})
|
||||
}
|
||||
//添加到购物车
|
||||
addToCart(){
|
||||
addToCart() {
|
||||
Taro.showToast({
|
||||
title:'添加成功',
|
||||
icon:'success',
|
||||
duration:1500
|
||||
title: '添加成功',
|
||||
icon: 'success',
|
||||
duration: 1500
|
||||
})
|
||||
|
||||
}
|
||||
@ -118,7 +119,7 @@ class Goods extends Component {
|
||||
})
|
||||
}
|
||||
componentDidMount() {
|
||||
//this.$router.params.id
|
||||
|
||||
this.getGoodDescription()
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
@ -134,37 +135,37 @@ class Goods extends Component {
|
||||
render() {
|
||||
const mainTabList = [{ title: '宝贝详情' }, { title: '全部评价' }, { title: '猜你喜欢' }]
|
||||
// const subTabList = [{ title: '全部' }, { title: '好评' }, { title: '差评' }, { title: '公开' }, { title: '匿名' }]
|
||||
const itemPicsBannerElementArray=this.state.productImagesUrl.map((item,index)=>{
|
||||
const itemPicsBannerElementArray = this.state.productImagesUrl.map((item, index) => {
|
||||
return < SwiperItem key={index} >
|
||||
|
||||
<Image mode='aspectFit' src={URL.Base + item.file_path} style='max-width: 100%; height:100%;' />
|
||||
|
||||
</SwiperItem >
|
||||
|
||||
<Image mode='aspectFit' src={URL.Base + item.file_path} style='max-width: 100%; height:100%;' />
|
||||
|
||||
</SwiperItem >
|
||||
})
|
||||
|
||||
|
||||
const itemDescriptionPicsElementArray = this.state.productImagesUrl.map((item, index) => {
|
||||
return <View className='description-img' key={index}>
|
||||
<Image mode='widthFix' src={URL.Base + item.file_path} style='width: 100%; max-height:100%;' />
|
||||
|
||||
return <View className='description-img' key={index}>
|
||||
<Image mode='widthFix' src={URL.Base + item.file_path} style='width: 100%; max-height:100%;' />
|
||||
|
||||
</View>
|
||||
|
||||
|
||||
})
|
||||
return (
|
||||
<View className='gooods=container'>
|
||||
<View className='img-box'>
|
||||
<View className='img-box'>
|
||||
{/* <Image className='img' src={URL.Base + this.state.productImagesUrl}></Image> */}
|
||||
<Swiper
|
||||
className='swipper'
|
||||
style='height:100%;'
|
||||
indicatorColor='#999'
|
||||
indicatorActiveColor='#333'
|
||||
hotizontal
|
||||
circular
|
||||
indicatorDots
|
||||
className='swipper'
|
||||
style='height:100%;'
|
||||
indicatorColor='#999'
|
||||
indicatorActiveColor='#333'
|
||||
hotizontal
|
||||
circular
|
||||
indicatorDots
|
||||
>
|
||||
{itemPicsBannerElementArray}
|
||||
{itemPicsBannerElementArray}
|
||||
|
||||
</Swiper>
|
||||
</Swiper>
|
||||
|
||||
</View>
|
||||
<View className='title-box'>
|
||||
@ -228,12 +229,12 @@ class Goods extends Component {
|
||||
{/* 详情和评论区 */}
|
||||
<View className='details-box'>
|
||||
{/* 大类 */}
|
||||
<AtTabs className='alltabs' animated={false} current={this.state.current} tabList={mainTabList} onClick={this.handleClick.bind(this)}>
|
||||
<AtTabs className='alltabs' animated={false} current={this.state.current} tabList={mainTabList} onClick={this.handleClick.bind(this)}>
|
||||
<AtTabsPane current={this.state.current} index={0} >
|
||||
<View style='background-color: #FAFBFC;' >
|
||||
|
||||
<View className='description-title'>商品细节:</View>
|
||||
<View className='description-img'>
|
||||
|
||||
<View className='description-title'>商品细节:</View>
|
||||
<View className='description-img'>
|
||||
{itemDescriptionPicsElementArray}
|
||||
|
||||
</View>
|
||||
@ -244,9 +245,9 @@ class Goods extends Component {
|
||||
<View style='padding: 1px 0px 100px;background-color: #FAFBFC;text-align: center;'>
|
||||
{ /*子标签类*/}
|
||||
<AtSegmentedControl selectedColor='#FF9500'
|
||||
values={['全部', '好评', '中评', '差评', '公开', '匿名']}
|
||||
onClick={this.onClick.bind(this)}
|
||||
current={this.state.subCurrent}
|
||||
values={['全部', '好评', '中评', '差评', '公开', '匿名']}
|
||||
onClick={this.onClick.bind(this)}
|
||||
current={this.state.subCurrent}
|
||||
/>
|
||||
{
|
||||
this.state.subCurrent === 0
|
||||
@ -300,16 +301,16 @@ class Goods extends Component {
|
||||
</View>
|
||||
<View className='collection' onClick={this.saveItem.bind(this)}>
|
||||
<AtIcon className='icon' value='heart' size='12' color='white'></AtIcon>
|
||||
|
||||
|
||||
<Text className='title'>收藏商品</Text>
|
||||
</View>
|
||||
<View className='add-cart' onClick={this.addToCart.bind(this)}>
|
||||
|
||||
<View className='add-cart' onClick={this.addToCart.bind(this)}>
|
||||
|
||||
<AtIcon className='icon' value='shopping-cart' size='12' color='white'></AtIcon>
|
||||
|
||||
|
||||
|
||||
<Text className='title'> 加入购物车</Text>
|
||||
|
||||
<Text className='title'> 加入购物车</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
|
@ -1,6 +1,10 @@
|
||||
import Taro, { Component } from '@tarojs/taro'
|
||||
import { View, Text,Input } from '@tarojs/components'
|
||||
import { AtInput, AtImagePicker, AtTextarea, AtButton, Picker, } from 'taro-ui'
|
||||
import { View, Text } from '@tarojs/components'
|
||||
import { AtInput, AtImagePicker, AtTextarea, AtButton, } from 'taro-ui'
|
||||
|
||||
|
||||
import ShopTypeInteractionComp from '../../component/shopTypeInteractionComp/shopTypeInteractionComp'
|
||||
import GoodsTypeInteractionComp from '../../component/goodsTypeInteractionComp/goodsTypeInteractionComp'
|
||||
|
||||
import URL from '../../serviceAPI.config'
|
||||
|
||||
@ -15,26 +19,19 @@ class GoodsPublish extends Component {
|
||||
constructor() {
|
||||
super(...arguments)
|
||||
this.state = {
|
||||
|
||||
objectMultiArray: [
|
||||
|
||||
],
|
||||
multiIndex: [0, 0, 0],
|
||||
shopCategoryPicker: [], // 店铺分类选项
|
||||
shopCategoryCheckedPicker: { name: '选择店铺类型' },
|
||||
shopTypeSelected: { name: '选择店铺类型', id: '' },//已选的店铺分类
|
||||
goodsTypeSelected: { name: '选择商品分类', id: '' },// 已选的商品分类
|
||||
productName: '',
|
||||
productPrice: '',
|
||||
productUnit: '',
|
||||
productDescript: '',
|
||||
pickerImageUrl: [], // 上传的图片
|
||||
ImagesInfo: [],// 后台传回来的图片信息
|
||||
isUploadImageSuccess: false,
|
||||
uploadImageTextTip: '',
|
||||
isUploadProductSuccess: false,
|
||||
uploadProductTextTip: '',
|
||||
shopCategoryList: [],
|
||||
productCategoryList: [],
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,7 +54,6 @@ class GoodsPublish extends Component {
|
||||
console.log('商品分类目录', res)
|
||||
this.sortShopCateToState(res.data.data)
|
||||
}
|
||||
|
||||
}
|
||||
)
|
||||
.catch(error => {
|
||||
@ -66,49 +62,14 @@ class GoodsPublish extends Component {
|
||||
}
|
||||
|
||||
|
||||
// 店铺分类目录请求 api
|
||||
getShopCateList() {
|
||||
Taro.request({
|
||||
url: URL.GetShopCategoryList,
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
id: Taro.getStorageSync('shopInfo').shop_id
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'),
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
if (res.data.err_msg === 'success') {
|
||||
this.setState({ shopCategoryList: res.data.data })
|
||||
const shopCategoryInfo = res.data.data
|
||||
const shopCategory = []
|
||||
// 处理后台返回的店铺分类信息
|
||||
for (let item in shopCategoryInfo) {
|
||||
const children = shopCategoryInfo[item].c
|
||||
for (let child in children) {
|
||||
shopCategory.push({ id: children[child].id, name: children[child].n })
|
||||
}
|
||||
}
|
||||
this.setState({ shopCategoryPicker: shopCategory })
|
||||
console.log('店铺分类目录', res)
|
||||
}
|
||||
}
|
||||
)
|
||||
.catch(error => {
|
||||
console.log('店铺分类请求错误', error)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 发布商品api
|
||||
uploadGoods({ goods_name = "test2",
|
||||
goods_price = "1.00",
|
||||
goods_unit = "1", goods_profiles = "test2",
|
||||
class_id = "10103",
|
||||
shop_class_id = "1930" }) {
|
||||
uploadGoods({ goods_name = "test2",
|
||||
goods_price = "1.00",
|
||||
goods_unit = "1", goods_profiles = "test2",
|
||||
class_id = "10103",
|
||||
shop_class_id = "1930" }) {
|
||||
|
||||
// 上传图片的参数
|
||||
const uploadProductGoodFileParams = []
|
||||
@ -126,15 +87,15 @@ class GoodsPublish extends Component {
|
||||
file_id: this.state.ImagesInfo[i].file_id,
|
||||
file_type: 1,
|
||||
if_cover: 0,
|
||||
file_sort: i+1
|
||||
file_sort: i + 1
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
alert('图片为空')
|
||||
}
|
||||
console.log('页面图片列表',this.state.pickerImageUrl)
|
||||
console.log('图片参数列表',uploadProductGoodFileParams)
|
||||
console.log('页面图片列表', this.state.pickerImageUrl)
|
||||
console.log('图片参数列表', uploadProductGoodFileParams)
|
||||
Taro.request({
|
||||
url: URL.UploadProduct,
|
||||
method: 'POST',
|
||||
@ -160,22 +121,22 @@ class GoodsPublish extends Component {
|
||||
})
|
||||
.then(res => {
|
||||
Taro.hideLoading()
|
||||
if(res.data.err_msg==='success'){
|
||||
|
||||
if (res.data.err_msg === 'success') {
|
||||
|
||||
Taro.showToast({
|
||||
title: '发布成功',
|
||||
icon: 'success',
|
||||
duration: 1000
|
||||
})
|
||||
setTimeout(() => {
|
||||
|
||||
Taro.navigateTo({
|
||||
url: '/pages/goods/goods?id='+res.data.goods_id
|
||||
})
|
||||
|
||||
Taro.navigateTo({
|
||||
url: '/pages/goods/goods?id=' + res.data.goods_id
|
||||
})
|
||||
}, 1000);
|
||||
|
||||
}
|
||||
else{
|
||||
else {
|
||||
Taro.showToast({
|
||||
title: res.data.err_msg,
|
||||
icon: 'none',
|
||||
@ -183,8 +144,8 @@ class GoodsPublish extends Component {
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
console.log('上传商品', res)
|
||||
}
|
||||
)
|
||||
@ -223,6 +184,7 @@ class GoodsPublish extends Component {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 改变商品分类状态
|
||||
onChangeProductType(e) {
|
||||
this.setState({
|
||||
@ -238,9 +200,6 @@ class GoodsPublish extends Component {
|
||||
this.setState({
|
||||
productPrice: event
|
||||
})
|
||||
|
||||
|
||||
|
||||
}
|
||||
productUnitChange(event) {
|
||||
this.setState({
|
||||
@ -273,7 +232,7 @@ class GoodsPublish extends Component {
|
||||
const imagePath = URL.Base + data.file_path
|
||||
const newPickerImageUrl = that.state.pickerImageUrl.concat({ url: imagePath })
|
||||
const newImageInfo = that.state.ImagesInfo.concat(data)
|
||||
console.log('第一',newImageInfo)
|
||||
console.log('第一', newImageInfo)
|
||||
that.setState({ pickerImageUrl: newPickerImageUrl, ImagesInfo: newImageInfo }, () => {
|
||||
Taro.showToast({
|
||||
title: '上传成功',
|
||||
@ -287,7 +246,7 @@ class GoodsPublish extends Component {
|
||||
if (operationType === 'remove') {
|
||||
this.state.pickerImageUrl.splice(index, 1);
|
||||
this.state.ImagesInfo.splice(index, 1);
|
||||
this.setState({ pickerImageUrl: this.state.pickerImageUrl,ImagesInfo:this.state.ImagesInfo });
|
||||
this.setState({ pickerImageUrl: this.state.pickerImageUrl, ImagesInfo: this.state.ImagesInfo });
|
||||
Taro.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'success',
|
||||
@ -303,7 +262,12 @@ class GoodsPublish extends Component {
|
||||
onImageClick(index) {
|
||||
}
|
||||
onClickUploadGoods() {
|
||||
if (this.state.productName && this.state.productPrice && this.state.productUnit && this.state.ImagesInfo.length && this.state.shopCategoryCheckedPicker.id) {
|
||||
if (this.state.productName &&
|
||||
this.state.productPrice &&
|
||||
this.state.productUnit &&
|
||||
this.state.ImagesInfo.length &&
|
||||
this.state.goodsTypeSelected.id &&
|
||||
this.state.shopTypeSelected.id) {
|
||||
Taro.showLoading({ title: '发布中' }).then(() => {
|
||||
setTimeout(() => {
|
||||
this.uploadGoods({
|
||||
@ -311,35 +275,34 @@ class GoodsPublish extends Component {
|
||||
goods_price: this.state.productPrice,
|
||||
goods_unit: this.state.productUnit,
|
||||
goods_profiles: this.state.productDescript,
|
||||
class_id: "10103",// to be continue //商品分类的选项
|
||||
shop_class_id: this.state.shopCategoryCheckedPicker.id,
|
||||
class_id: this.state.goodsTypeSelected.id,
|
||||
shop_class_id: this.state.shopTypeSelected.id,
|
||||
})
|
||||
},1000)})
|
||||
|
||||
}, 1000)
|
||||
})
|
||||
|
||||
} else {
|
||||
|
||||
Taro.showToast({title:'请填写完表格',icon:'none'})
|
||||
Taro.showToast({ title: '请填写完表格', icon: 'none' })
|
||||
}
|
||||
}
|
||||
shopCategoryChanged(e) {
|
||||
this.setState({
|
||||
shopCategoryCheckedPicker: this.state.shopCategoryPicker[e.detail.value]
|
||||
}, () => {
|
||||
console.log(this.state.shopCategoryCheckedPicker)
|
||||
|
||||
goToMyGoodListPage() {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/myGoodList/myGoodList'
|
||||
})
|
||||
}
|
||||
goToMyGoodListPage(){
|
||||
Taro.navigateTo({
|
||||
|
||||
url: '/pages/myGoodList/myGoodList'
|
||||
|
||||
})
|
||||
|
||||
getDataFromShopChild(value) {
|
||||
console.log('从子组件店铺分类传回来的值', value)
|
||||
this.setState({ shopTypeSelected: value })
|
||||
}
|
||||
getDataFromGoodsChild(value) {
|
||||
console.log('从子组件商品分类传回来的值', value)
|
||||
this.setState({ goodsTypeSelected: value })
|
||||
}
|
||||
|
||||
|
||||
componentDidMount() {
|
||||
this.getProductCateList()
|
||||
this.getShopCateList()
|
||||
// this.getProductCateList()
|
||||
// this.getShopCateList()
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
@ -352,190 +315,49 @@ class GoodsPublish extends Component {
|
||||
|
||||
componentDidHide() { }
|
||||
|
||||
//--- 三级联动--------------
|
||||
bindMultiPickerChange(e) {
|
||||
console.log('picker发送选择改变,携带值为', e.detail.value)
|
||||
this.setState({
|
||||
multiIndex: e.detail.value
|
||||
})
|
||||
}
|
||||
bindMultiPickerCol(e) {
|
||||
console.log('修改的列为', e.detail.column, ',值为', e.detail.value)
|
||||
const data = {
|
||||
multiArray: this.state.objectMultiArray,
|
||||
multiIndex: this.state.multiIndex
|
||||
}
|
||||
data.multiIndex[e.detail.column] = e.detail.value
|
||||
switch (e.detail.column) {
|
||||
case 0:
|
||||
switch (data.multiIndex[0]) {
|
||||
case 0:
|
||||
data.multiArray[1] = this.state.productCategoryList[0].children ? this.state.productCategoryList[0].children : [{ class_name: '' }]
|
||||
data.multiArray[2] = this.state.productCategoryList[0].children ? this.state.productCategoryList[0].children : [{ class_name: '' }]
|
||||
|
||||
break
|
||||
case 1:
|
||||
data.multiArray[1] = this.state.productCategoryList[1].children
|
||||
break
|
||||
case 2:
|
||||
data.multiArray[1] = this.state.productCategoryList[2].children
|
||||
break
|
||||
case 3:
|
||||
data.multiArray[1] = this.state.productCategoryList[3].children
|
||||
break
|
||||
case 4:
|
||||
data.multiArray[1] = this.state.productCategoryList[4].children
|
||||
break
|
||||
}
|
||||
data.multiIndex[1] = 0
|
||||
data.multiIndex[2] = 0
|
||||
break
|
||||
case 1:
|
||||
switch (data.multiIndex[0]) {
|
||||
case 0:
|
||||
|
||||
break
|
||||
case 1:
|
||||
switch (data.multiIndex[1]) {
|
||||
case 0:
|
||||
data.multiArray[2] = this.state.productCategoryList[1].children[0].children
|
||||
break
|
||||
case 1:
|
||||
data.multiArray[2] = this.state.productCategoryList[1].children[1].children
|
||||
break
|
||||
case 2:
|
||||
data.multiArray[2] = this.state.productCategoryList[1].children[2].children
|
||||
break
|
||||
case 3:
|
||||
data.multiArray[2] = this.state.productCategoryList[1].children[3].children ? this.state.productCategoryList[1].children[3].children : [{ class_name: '' }]
|
||||
break
|
||||
}
|
||||
break
|
||||
case 2:
|
||||
switch (data.multiIndex[1]) {
|
||||
case 0:
|
||||
data.multiArray[2] = this.state.productCategoryList[2].children[0].children
|
||||
break
|
||||
case 1:
|
||||
data.multiArray[2] = this.state.productCategoryList[2].children[1].children
|
||||
break
|
||||
case 2:
|
||||
data.multiArray[2] = this.state.productCategoryList[2].children[2].children
|
||||
break
|
||||
case 3:
|
||||
data.multiArray[2] = this.state.productCategoryList[2].children[3].children
|
||||
break
|
||||
case 4:
|
||||
data.multiArray[2] = this.state.productCategoryList[2].children[4].children
|
||||
break
|
||||
case 5:
|
||||
data.multiArray[2] = this.state.productCategoryList[2].children[5].children
|
||||
break
|
||||
}
|
||||
break
|
||||
case 3:
|
||||
switch (data.multiIndex[1]) {
|
||||
case 0:
|
||||
data.multiArray[2] = this.state.productCategoryList[3].children[0].children
|
||||
break
|
||||
case 1:
|
||||
data.multiArray[2] = this.state.productCategoryList[3].children[1].children
|
||||
break
|
||||
case 2:
|
||||
data.multiArray[2] = this.state.productCategoryList[3].children[2].children
|
||||
break
|
||||
case 3:
|
||||
data.multiArray[2] = this.state.productCategoryList[3].children[3].children ? this.state.productCategoryList[3].children[3].children : [{ class_name: '' }]
|
||||
break
|
||||
case 3:
|
||||
data.multiArray[2] = this.state.productCategoryList[3].children[3].children ? this.state.productCategoryList[3].children[3].children : [{ class_name: '' }]
|
||||
break
|
||||
}
|
||||
break
|
||||
case 4:
|
||||
switch (data.multiIndex[1]) {
|
||||
case 0:
|
||||
data.multiArray[2] = this.state.productCategoryList[4].children[0].children
|
||||
break
|
||||
case 1:
|
||||
data.multiArray[2] = this.state.productCategoryList[4].children[1].children
|
||||
break
|
||||
case 2:
|
||||
data.multiArray[2] = this.state.productCategoryList[4].children[2].children
|
||||
break
|
||||
|
||||
}
|
||||
break
|
||||
|
||||
}
|
||||
data.multiIndex[2] = 0
|
||||
break
|
||||
}
|
||||
this.setState({ multiIndex: data.multiIndex })
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
|
||||
|
||||
console.log("this.state.productCategoryList", this.state.productCategoryList)
|
||||
return (
|
||||
<View className='goods-publish'>
|
||||
|
||||
|
||||
|
||||
|
||||
<View className='goods-category'>
|
||||
<View className='page-section'>
|
||||
<View>
|
||||
<Picker
|
||||
range={this.state.objectMultiArray}
|
||||
onChange={this.bindMultiPickerChange.bind(this)}
|
||||
rangeKey='class_name'
|
||||
mode='multiSelector'
|
||||
onColumnchange={this.bindMultiPickerCol.bind(this)}
|
||||
value={this.state.multiIndex}
|
||||
>
|
||||
<View className='picker'>
|
||||
<View className='title-box'>
|
||||
<Text className='title'><Text className='require'>*</Text>商品分类:</Text> <Text className='selected'>
|
||||
{this.state.objectMultiArray[0]?this.state.objectMultiArray[0][this.state.multiIndex[0]].class_name:''}
|
||||
&{this.state.objectMultiArray[1]?this.state.objectMultiArray[1][this.state.multiIndex[1]].class_name:''}
|
||||
&{this.state.objectMultiArray[2]?this.state.objectMultiArray[2][this.state.multiIndex[2]].class_name:''}
|
||||
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
</Picker>
|
||||
</View>
|
||||
</View>
|
||||
{/* 商品分类开始 */}
|
||||
<GoodsTypeInteractionComp url={URL.GetProductCategoryList} onPassDataToChild={this.getDataFromGoodsChild.bind(this)}></GoodsTypeInteractionComp>
|
||||
{/* 商品分类结束 */}
|
||||
|
||||
<View className='input-box'>
|
||||
<Text className='require'>*</Text>
|
||||
<AtInput
|
||||
name='productName'
|
||||
title='商品名称:'
|
||||
type='text'
|
||||
value={this.state.productName}
|
||||
onChange={this.productNameChange.bind(this)}
|
||||
name='productName'
|
||||
title='商品名称:'
|
||||
type='text'
|
||||
value={this.state.productName}
|
||||
onChange={this.productNameChange.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
<View className='input-box'>
|
||||
<Text className='require'>*</Text>
|
||||
<AtInput
|
||||
name='productPrice'
|
||||
title='商品价格:'
|
||||
type='number'
|
||||
placeholder='¥'
|
||||
value={this.state.productPrice}
|
||||
onChange={this.productPriceChange.bind(this)}
|
||||
name='productPrice'
|
||||
title='商品价格:'
|
||||
type='number'
|
||||
placeholder='¥'
|
||||
value={this.state.productPrice}
|
||||
onChange={this.productPriceChange.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
<View className='input-box'>
|
||||
<Text className='require'>*</Text>
|
||||
<AtInput
|
||||
name='productUnit'
|
||||
title='商品单位:'
|
||||
type='text'
|
||||
value={this.state.productUnit}
|
||||
onChange={this.productUnitChange.bind(this)}
|
||||
name='productUnit'
|
||||
title='商品单位:'
|
||||
type='text'
|
||||
value={this.state.productUnit}
|
||||
onChange={this.productUnitChange.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
{/* 图片上传 */}
|
||||
@ -546,29 +368,21 @@ class GoodsPublish extends Component {
|
||||
</View>
|
||||
<View className='img-container'>
|
||||
<AtImagePicker
|
||||
multiple
|
||||
files={this.state.pickerImageUrl}
|
||||
onChange={this.onChangeImg.bind(this)}
|
||||
onFail={this.onFail.bind(this)}
|
||||
onImageClick={this.onImageClick.bind(this)}
|
||||
multiple
|
||||
files={this.state.pickerImageUrl}
|
||||
onChange={this.onChangeImg.bind(this)}
|
||||
onFail={this.onFail.bind(this)}
|
||||
onImageClick={this.onImageClick.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
<View className='shoptype-box'>
|
||||
{/* 店铺分类 */}
|
||||
<View className='title-box page-section'>
|
||||
<Picker mode='selector' rangeKey='name' range={this.state.shopCategoryPicker} onChange={this.shopCategoryChanged.bind(this)}>
|
||||
<View className='picker'>
|
||||
<Text className='require'>*</Text>
|
||||
<Text className='title'> 店铺分类:</Text>
|
||||
<Text className='selected'>{this.state.shopCategoryCheckedPicker.name}</Text>
|
||||
{/* 店铺分类 */}
|
||||
<ShopTypeInteractionComp url={URL.GetShopCategoryList}
|
||||
initialShopType={this.state.shopTypeSelected}
|
||||
onPassDataToChild={this.getDataFromShopChild.bind(this)}
|
||||
></ShopTypeInteractionComp>
|
||||
{/* 店铺分类结束 */}
|
||||
|
||||
</View>
|
||||
</Picker>
|
||||
</View>
|
||||
|
||||
|
||||
</View>
|
||||
|
||||
<View className='description-box'>
|
||||
<View className='title-box'>
|
||||
@ -577,10 +391,10 @@ class GoodsPublish extends Component {
|
||||
</View>
|
||||
|
||||
<AtTextarea
|
||||
value={this.state.productDescript}
|
||||
onChange={this.productDescriptChange.bind(this)}
|
||||
maxlength='200'
|
||||
placeholder='你的产品简介'
|
||||
value={this.state.productDescript}
|
||||
onChange={this.productDescriptChange.bind(this)}
|
||||
maxlength='200'
|
||||
placeholder='你的产品简介'
|
||||
/>
|
||||
|
||||
</View>
|
||||
|
@ -10,49 +10,51 @@ import './index.scss'
|
||||
@connect(({ counter }) => ({
|
||||
counter
|
||||
}), (dispatch) => ({
|
||||
add () {
|
||||
add() {
|
||||
dispatch(add())
|
||||
},
|
||||
dec () {
|
||||
dec() {
|
||||
dispatch(minus())
|
||||
},
|
||||
asyncAdd () {
|
||||
asyncAdd() {
|
||||
dispatch(asyncAdd())
|
||||
}
|
||||
}))
|
||||
|
||||
class Index extends Component {
|
||||
config = {
|
||||
config = {
|
||||
navigationBarTitleText: '首页'
|
||||
}
|
||||
|
||||
//http://ihome6.com/Shop-supplyShops
|
||||
componentDidMount(){
|
||||
//http://ihome6.com/Shop-supplyShops
|
||||
componentDidMount() {
|
||||
Taro.navigateTo({
|
||||
// url: '/pages/goodsPublish/goodsPublish'
|
||||
//url: '/pages/goodsPublish/goodsPublish'
|
||||
// url: '/pages/myGoodList/myGoodList'
|
||||
// url: '/pages/myDemandSupplyEdit/myDemandSupplyEdit'
|
||||
// url: '/pages/mySupplyDemand/mySupplyDemand'
|
||||
// url:'/pages/grabOrderPage/grabOrderPage'
|
||||
url:'/pages/home/home'
|
||||
// url:'/pages/myNeeds/myNeeds'
|
||||
|
||||
// url: '/pages/mySupplyDemand/mySupplyDemand'
|
||||
// url:'/pages/grabOrderPage/grabOrderPage'
|
||||
// url:'/pages/home/home'
|
||||
// url:'/pages/myNeeds/myNeeds',
|
||||
url:'/pages/myNeedsPublish/myNeedsPublish'
|
||||
// url:'/pages/goodsPublish/goodsPublish'
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
componentWillReceiveProps (nextProps) {
|
||||
componentWillReceiveProps(nextProps) {
|
||||
console.log(this.props, nextProps)
|
||||
}
|
||||
|
||||
componentWillUnmount () { }
|
||||
componentWillUnmount() { }
|
||||
|
||||
componentDidShow () { }
|
||||
componentDidShow() { }
|
||||
|
||||
componentDidHide () { }
|
||||
componentDidHide() { }
|
||||
|
||||
render () {
|
||||
render() {
|
||||
return (
|
||||
<View className='index'>
|
||||
|
||||
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ import Taro, { Component, UpdateManager } from '@tarojs/taro'
|
||||
import { View, Text, Radio, RadioGroup, Label } from '@tarojs/components'
|
||||
import { AtInput, AtImagePicker, AtTextarea, AtButton, Picker, AtToast } from 'taro-ui'
|
||||
|
||||
import ShopTypeInteractionComp from '../../component/shopTypeInteractionComp/shopTypeInteractionComp'
|
||||
|
||||
import URL from '../../serviceAPI.config'
|
||||
|
||||
|
||||
@ -14,8 +16,8 @@ class MyGoodsEdit extends Component {
|
||||
constructor() {
|
||||
super(...arguments)
|
||||
this.state = {
|
||||
shopCategoryList: [], // 店铺分类选项
|
||||
shopCategoryCheckedPicker: { name: '选择店铺类型', id: '' },
|
||||
shopTypeSelected:'',
|
||||
shopTypeList: {},//店铺分类列表
|
||||
productName: '',
|
||||
productPrice: '',
|
||||
productUnit: '',
|
||||
@ -33,7 +35,6 @@ class MyGoodsEdit extends Component {
|
||||
method: 'GET',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
// goodsID: 'c610femn1j8fHUOM5gvh6VxW03O5mBDgNcAJGGFmvFX3Zw'
|
||||
goodsID: this.$router.params.id,
|
||||
},
|
||||
header: {
|
||||
@ -43,38 +44,46 @@ class MyGoodsEdit extends Component {
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
console.log('商品详情获取成功', res)
|
||||
const imageFile = res.data.goodsFiles.map((item) => {
|
||||
return { url: URL.Base + item.files.file_path }
|
||||
})
|
||||
const shopTypeId = res.data.goods.shop_class_id
|
||||
const shopTypeName = this.state.shopCategoryList.filter(item => {
|
||||
return item.id === shopTypeId
|
||||
})
|
||||
if (res.data.err_msg === 'success') {
|
||||
console.log('商品详情获取成功', res)
|
||||
|
||||
const imageFile = res.data.goodsFiles.map((item) => {
|
||||
return { url: URL.Base + item.files.file_path }
|
||||
})
|
||||
let shopTypeSelected
|
||||
|
||||
const shopTypeId = res.data.goods.shop_class_id
|
||||
for (let key in this.state.shopTypeList) {
|
||||
for (let item of this.state.shopTypeList[key].c) {
|
||||
if (item.id === shopTypeId) {
|
||||
shopTypeSelected = {name:item.n,id:item.id}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.setState({
|
||||
productName: res.data.goods.goods_name,
|
||||
productPrice: res.data.goods.goods_price,
|
||||
productUnit: res.data.goods.goods_unit,
|
||||
productDescript: res.data.goods.goods_profiles,
|
||||
pickerImageUrl: imageFile,
|
||||
ImagesInfo: res.data.goodsFiles,
|
||||
shopTypeSelected: shopTypeSelected,
|
||||
goodsTypeParam: res.data.goods.class_id,
|
||||
goodId: res.data.goods.goods_id,
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
this.setState({
|
||||
productName: res.data.goods.goods_name,
|
||||
productPrice: res.data.goods.goods_price,
|
||||
productUnit: res.data.goods.goods_unit,
|
||||
productDescript: res.data.goods.goods_profiles,
|
||||
pickerImageUrl: imageFile,
|
||||
ImagesInfo: res.data.goodsFiles,
|
||||
shopCategoryCheckedPicker: shopTypeName[0],
|
||||
goodsTypeParam: res.data.goods.class_id,
|
||||
goodId: res.data.goods.goods_id,
|
||||
})
|
||||
}
|
||||
)
|
||||
.catch(error => {
|
||||
console.log('商品详情获取失败', error)
|
||||
})
|
||||
}
|
||||
|
||||
// 店铺分类目录请求 api
|
||||
getShopCateList() {
|
||||
//获取店铺分类筛选列表api
|
||||
getShopTypeList(url) {
|
||||
Taro.request({
|
||||
url: URL.GetShopCategoryList,
|
||||
url: url,
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
@ -87,30 +96,17 @@ class MyGoodsEdit extends Component {
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
if (res.data.err_msg === 'success') {
|
||||
this.setState({ shopTypeList: res.data.data }, () => {
|
||||
this.getGoodsInfo()
|
||||
})
|
||||
|
||||
const shopCategoryInfo = res.data.data
|
||||
const shopCategory = []
|
||||
// 处理后台返回的店铺分类信息
|
||||
for (let item in shopCategoryInfo) {
|
||||
const children = shopCategoryInfo[item].c
|
||||
for (let child in children) {
|
||||
shopCategory.push({ id: children[child].id, name: children[child].n })
|
||||
}
|
||||
}
|
||||
this.setState({ shopCategoryList: shopCategory }, () => {
|
||||
this.getGoodsInfo()
|
||||
})
|
||||
console.log('店铺分类目录', res)
|
||||
return
|
||||
}
|
||||
}
|
||||
)
|
||||
.catch(error => {
|
||||
console.log('店铺分类请求错误', error)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 发布商品api
|
||||
uploadGoods({ goods_name = "test2",
|
||||
goods_price = "1.00",
|
||||
@ -136,7 +132,7 @@ class MyGoodsEdit extends Component {
|
||||
file_id: this.state.ImagesInfo[i].file_id,
|
||||
file_type: 1,
|
||||
if_cover: 0,
|
||||
file_sort: i+1
|
||||
file_sort: i + 1
|
||||
|
||||
})
|
||||
}
|
||||
@ -178,7 +174,7 @@ class MyGoodsEdit extends Component {
|
||||
})
|
||||
setTimeout(() => {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/goods/goods?id='+this.$router.params.id
|
||||
url: '/pages/goods/goods?id=' + this.$router.params.id
|
||||
})
|
||||
}, 1000);
|
||||
console.log('上传商品', res)
|
||||
@ -234,13 +230,13 @@ class MyGoodsEdit extends Component {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
},
|
||||
success(response) {
|
||||
|
||||
|
||||
const data = JSON.parse(response.data)
|
||||
console.log('imagedata',data)
|
||||
console.log('imagedata', data)
|
||||
const imagePath = URL.Base + data.file_path
|
||||
const newPickerImageUrl = that.state.pickerImageUrl.concat({ url: imagePath })
|
||||
const newImageInfo = that.state.ImagesInfo.concat(data)
|
||||
console.log('新添加后的图片列表',newImageInfo)
|
||||
console.log('新添加后的图片列表', newImageInfo)
|
||||
|
||||
that.setState({
|
||||
pickerImageUrl: newPickerImageUrl,
|
||||
@ -272,7 +268,7 @@ class MyGoodsEdit extends Component {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
onClickUploadGoods() {
|
||||
if (this.state.productName && this.state.productPrice && this.state.productUnit && this.state.ImagesInfo.length && this.state.shopCategoryCheckedPicker.id) {
|
||||
@ -283,7 +279,7 @@ class MyGoodsEdit extends Component {
|
||||
goods_price: this.state.productPrice,
|
||||
goods_unit: this.state.productUnit,
|
||||
goods_profiles: this.state.productDescript,
|
||||
shop_class_id: this.state.shopCategoryCheckedPicker.id,
|
||||
shop_class_id: this.state.shopTypeSelected.id,
|
||||
class_id: this.state.goodsTypeParam,
|
||||
goods_id: this.state.goodId,
|
||||
})
|
||||
@ -311,11 +307,13 @@ class MyGoodsEdit extends Component {
|
||||
})
|
||||
}
|
||||
|
||||
getDataFromShopChild(value) {
|
||||
console.log('从子组件店铺分类传回来的值', value)
|
||||
this.setState({ shopTypeSelected: value })
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
this.getShopCateList()
|
||||
|
||||
this.getShopTypeList(URL.GetShopCategoryList)
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
@ -337,32 +335,32 @@ class MyGoodsEdit extends Component {
|
||||
<View className='input-box'>
|
||||
<Text className='require'>*</Text>
|
||||
<AtInput
|
||||
name='productName'
|
||||
title='商品名称:'
|
||||
type='text'
|
||||
value={this.state.productName}
|
||||
onChange={this.productNameChange.bind(this)}
|
||||
name='productName'
|
||||
title='商品名称:'
|
||||
type='text'
|
||||
value={this.state.productName}
|
||||
onChange={this.productNameChange.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
<View className='input-box'>
|
||||
<Text className='require'>*</Text>
|
||||
<AtInput
|
||||
name='productPrice'
|
||||
title='商品价格:'
|
||||
type='number'
|
||||
placeholder='¥'
|
||||
value={this.state.productPrice}
|
||||
onChange={this.productPriceChange.bind(this)}
|
||||
name='productPrice'
|
||||
title='商品价格:'
|
||||
type='number'
|
||||
placeholder='¥'
|
||||
value={this.state.productPrice}
|
||||
onChange={this.productPriceChange.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
<View className='input-box'>
|
||||
<Text className='require'>*</Text>
|
||||
<AtInput
|
||||
name='productUnit'
|
||||
title='商品单位:'
|
||||
type='text'
|
||||
value={this.state.productUnit}
|
||||
onChange={this.productUnitChange.bind(this)}
|
||||
name='productUnit'
|
||||
title='商品单位:'
|
||||
type='text'
|
||||
value={this.state.productUnit}
|
||||
onChange={this.productUnitChange.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
{/* 图片上传 */}
|
||||
@ -373,29 +371,17 @@ class MyGoodsEdit extends Component {
|
||||
</View>
|
||||
<View className='img-container'>
|
||||
<AtImagePicker
|
||||
multiple
|
||||
files={this.state.pickerImageUrl}
|
||||
onChange={this.onChangeImg.bind(this)}
|
||||
onFail={this.onFail.bind(this)}
|
||||
onImageClick={this.onImageClick.bind(this)}
|
||||
multiple
|
||||
files={this.state.pickerImageUrl}
|
||||
onChange={this.onChangeImg.bind(this)}
|
||||
onFail={this.onFail.bind(this)}
|
||||
onImageClick={this.onImageClick.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
<View className='shoptype-box'>
|
||||
{/* 店铺分类 */}
|
||||
<View className='title-box page-section'>
|
||||
<Picker mode='selector' rangeKey='name' range={this.state.shopCategoryList} onChange={this.shopCategoryChanged.bind(this)}>
|
||||
<View className='picker'>
|
||||
<Text className='require'>*</Text>
|
||||
<Text className='title'> 店铺分类:</Text>
|
||||
<Text className='selected'>{this.state.shopCategoryCheckedPicker.name}</Text>
|
||||
|
||||
</View>
|
||||
</Picker>
|
||||
</View>
|
||||
|
||||
|
||||
</View>
|
||||
{/* 店铺分类 */}
|
||||
<ShopTypeInteractionComp url={URL.GetShopCategoryList} initialType={this.state.shopTypeSelected} onPassDataToChild={this.getDataFromShopChild.bind(this)}></ShopTypeInteractionComp>
|
||||
{/* 店铺分类结束 */}
|
||||
|
||||
<View className='description-box'>
|
||||
<View className='title-box'>
|
||||
@ -404,10 +390,10 @@ class MyGoodsEdit extends Component {
|
||||
</View>
|
||||
|
||||
<AtTextarea
|
||||
value={this.state.productDescript}
|
||||
onChange={this.productDescriptChange.bind(this)}
|
||||
maxlength='200'
|
||||
placeholder='你的产品简介'
|
||||
value={this.state.productDescript}
|
||||
onChange={this.productDescriptChange.bind(this)}
|
||||
maxlength='200'
|
||||
placeholder='你的产品简介'
|
||||
/>
|
||||
|
||||
</View>
|
||||
|
@ -4,7 +4,7 @@ import { View, Text, Button } from '@tarojs/components'
|
||||
import { AtInput, AtButton, Picker, AtIcon, AtModal, AtModalHeader, AtModalContent, AtModalAction, AtPagination } from 'taro-ui'
|
||||
import URL from '../../serviceAPI.config'
|
||||
|
||||
import Interaction from '../../component/interaction/interaction'
|
||||
import InteractionComponent from '../../component/interactionComponent/interactionComponent'
|
||||
import CopyrightComponent from '../../component/copyrightComponent/copyrightComponent'
|
||||
|
||||
|
||||
@ -36,11 +36,6 @@ class MyNeeds extends Component {
|
||||
allNeedsList: [],// 我的需求列表
|
||||
totalNeeds: 0,// 我的需求数量
|
||||
currentPage: 1,
|
||||
///---行业分类 开始
|
||||
objectMultiArray: [],
|
||||
multiIndex: [0, 0],
|
||||
formatInWindow: [],
|
||||
///---行业分类 结束
|
||||
needsItem: '',// 确认框提示时 使用的供求名
|
||||
isDeleteModal:false,
|
||||
IndustryTypeList:[]
|
||||
@ -132,66 +127,9 @@ class MyNeeds extends Component {
|
||||
})
|
||||
|
||||
}
|
||||
// 行业分类筛选列表GetIndustryTypeList
|
||||
getIndustryTypeList() {
|
||||
Taro.request({
|
||||
url: URL.GetIndustryTypeList,
|
||||
method: 'GET',
|
||||
dataType: 'json',
|
||||
header: {
|
||||
'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'),
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
}).then(res => {
|
||||
console.log('行业分类列表', res)
|
||||
this.setState({IndustryTypeList:res.data.data})
|
||||
|
||||
|
||||
|
||||
this.formatIndustryType(res.data.data)
|
||||
this.formatIndustryTypei(res.data.data)
|
||||
|
||||
}).catch(err => {
|
||||
console.log('行业分类列表获取失败', err)
|
||||
})
|
||||
}
|
||||
|
||||
// 第一种formate 用于底部弹层滚动时的数据
|
||||
formatIndustryType(data) {
|
||||
const newIndustryType = []
|
||||
for (let outter of data) {
|
||||
let outterObject = { name: outter.class_name, id: outter.class_id, child: [] }
|
||||
if (outter.child.length) {
|
||||
for (let inner of outter.child) {
|
||||
outterObject.child.push({ name: inner.class_name, id: inner.class_id })
|
||||
}
|
||||
} else {
|
||||
outterObject.child.push({ name: '', id: '' })
|
||||
}
|
||||
newIndustryType.push(outterObject)
|
||||
}
|
||||
this.setState({ formatInWindow: newIndustryType })
|
||||
console.log('newIndustryType1', newIndustryType)
|
||||
|
||||
}
|
||||
//第二种format 用于底部弹层的初始化数据
|
||||
formatIndustryTypei(data) {
|
||||
const firstArray = []
|
||||
const secondArray = []
|
||||
for (let outter of data) {
|
||||
firstArray.push({ name: outter.class_name, id: outter.class_id })
|
||||
if (outter.child.length) {
|
||||
for (let inner of outter.child) {
|
||||
secondArray.push({ name: inner.class_name, id: inner.class_id })
|
||||
}
|
||||
}
|
||||
}
|
||||
this.setState({ objectMultiArray: [firstArray, secondArray] }, () => {
|
||||
console.log('newIndustryType2', this.state.objectMultiArray)
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 搜索按钮
|
||||
onSearchButtonHandler() {
|
||||
@ -283,98 +221,12 @@ class MyNeeds extends Component {
|
||||
state: this.state.needsStateSelected.id
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
//--------------------开始-行业分类picker
|
||||
bindMultiPickerChange(e) {
|
||||
//判断如果formatInWindow 的子类为空 那就取父类, 反之取子类
|
||||
let industryTypeSelected
|
||||
if( this.state.formatInWindow[e.detail.value[0]].child[e.detail.value[1]].id===''){
|
||||
industryTypeSelected = this.state.formatInWindow[e.detail.value[0]]
|
||||
}else{
|
||||
industryTypeSelected = this.state.formatInWindow[e.detail.value[0]].child[e.detail.value[1]]
|
||||
}
|
||||
|
||||
console.log('picker发送选择改变,携带值为', e.detail.value)
|
||||
this.setState({
|
||||
multiIndex: e.detail.value, industryTypeSelected: industryTypeSelected
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
bindMulPickerColChge(e) {
|
||||
console.log('修改的列为', e.detail.column, ',值为', e.detail.value)
|
||||
const data = {
|
||||
objectMultiArray: this.state.objectMultiArray,
|
||||
multiIndex: this.state.multiIndex
|
||||
}
|
||||
data.multiIndex[e.detail.column] = e.detail.value
|
||||
switch (e.detail.column) {
|
||||
case 0:
|
||||
switch (data.multiIndex[0]) {
|
||||
case 0:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[0].child
|
||||
break
|
||||
case 1:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[1].child
|
||||
break
|
||||
case 2:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[2].child
|
||||
break
|
||||
case 3:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[3].child
|
||||
break
|
||||
case 4:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[4].child
|
||||
break
|
||||
case 5:
|
||||
data.objectMultiArray[1] = [{ name: '' }]
|
||||
break
|
||||
case 6:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[6].child
|
||||
break
|
||||
case 7:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[7].child
|
||||
break
|
||||
case 8:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[8].child
|
||||
break
|
||||
case 9:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[9].child
|
||||
break
|
||||
case 10:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[10].child
|
||||
break
|
||||
case 11:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[11].child
|
||||
break
|
||||
case 12:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[12].child
|
||||
break
|
||||
case 13:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[13].child
|
||||
break
|
||||
case 14:
|
||||
data.objectMultiArray[1] = this.state.formatInWindow[14].child
|
||||
break
|
||||
}
|
||||
data.multiIndex[1] = 0
|
||||
data.multiIndex[2] = 0
|
||||
break
|
||||
|
||||
}
|
||||
console.log(data.multiIndex)
|
||||
this.setState({
|
||||
multiIndex: data.multiIndex,
|
||||
objectMultiArray: data.objectMultiArray
|
||||
})
|
||||
}
|
||||
|
||||
//--------------------结束-行业分类picker
|
||||
|
||||
componentDidMount() {
|
||||
this.getMyNeedsList({})
|
||||
this.getIndustryTypeList()
|
||||
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
console.log(this.props, nextProps)
|
||||
@ -389,6 +241,7 @@ class MyNeeds extends Component {
|
||||
|
||||
getDataFromChild(value){
|
||||
console.log('从子组件传回来的值',value)
|
||||
this.setState({industryTypeSelected:value})
|
||||
}
|
||||
render() {
|
||||
const myNeedsListArrayElement = this.state.allNeedsList.map((item, index) => {
|
||||
@ -475,26 +328,7 @@ class MyNeeds extends Component {
|
||||
</View>
|
||||
{/* 行业分类 */}
|
||||
{/* 行业分类开始 */}
|
||||
<Interaction data={this.state.IndustryTypeList} onPassDataToChild={this.getDataFromChild.bind(this)}></Interaction>
|
||||
{/* <View class='page-section'>
|
||||
<Picker
|
||||
rangeKey='name'
|
||||
mode='multiSelector'
|
||||
onChange={this.bindMultiPickerChange.bind(this)}
|
||||
onColumnchange={this.bindMulPickerColChge.bind(this)}
|
||||
value={this.state.multiIndex}
|
||||
range={this.state.objectMultiArray}
|
||||
>
|
||||
<View class='picker type'>
|
||||
<View className='title-box'>
|
||||
<Text className='title'>行业分类:</Text>
|
||||
{this.state.objectMultiArray.length? <Text> <Text className='first-col'> {this.state.objectMultiArray[0][this.state.multiIndex[0]].name}</Text>
|
||||
<Text className='second-col'> {this.state.objectMultiArray[1][this.state.multiIndex[1]].name}</Text></Text>:null}
|
||||
|
||||
</View>
|
||||
</View>
|
||||
</Picker>
|
||||
</View> */}
|
||||
<InteractionComponent url={URL.GetIndustryTypeList} onPassDataToChild={this.getDataFromChild.bind(this)}></InteractionComponent>
|
||||
{/* 行业分类结束 */}
|
||||
{/* 需求类型 */}
|
||||
<View className='page-section'>
|
||||
|
@ -3,6 +3,7 @@ import Taro, { Component } from '@tarojs/taro'
|
||||
import { View, Text } from '@tarojs/components'
|
||||
import { AtInput, AtImagePicker, AtTextarea, AtButton, Picker, AtToast } from 'taro-ui'
|
||||
|
||||
import InteractionComponent from '../../component/interactionComponent/interactionComponent'
|
||||
import CopyrightComponent from '../../component/copyrightComponent/copyrightComponent'
|
||||
import URL from '../../serviceAPI.config'
|
||||
|
||||
@ -13,397 +14,404 @@ import './myNeedsEdit.scss'
|
||||
|
||||
class MyNeedsEdit extends Component {
|
||||
|
||||
config = {
|
||||
navigationBarTitleText: '需求编辑'
|
||||
config = {
|
||||
navigationBarTitleText: '需求编辑'
|
||||
}
|
||||
constructor() {
|
||||
super(...arguments)
|
||||
this.state = {
|
||||
needsType: [{ name: '业主需求', id: '4' }, { name: '效果图', id: '5' }],// 需要从后台api 获取
|
||||
needsTypeSelected: { name: '业主需求', id: '4' },
|
||||
needsState: [
|
||||
{ name: '全部', id: '' },
|
||||
{ name: '作废', id: '0' }
|
||||
, { name: '在用', id: '1' },
|
||||
{ name: '设计中', id: '2' },
|
||||
{ name: '已设计', id: '3' }],// 需要从后台api 获取
|
||||
title: '',
|
||||
industryTypeSelected:'',
|
||||
contactName: '',
|
||||
contactNumber: '',
|
||||
contactAddress: '',
|
||||
content: '',
|
||||
pickerImageUrl: [], // 上传的图片
|
||||
ImagesInfo: [],// 后台传回来的图片信息
|
||||
isFormCompleted: false,
|
||||
}
|
||||
constructor() {
|
||||
super(...arguments)
|
||||
this.state = {
|
||||
demandingSupplyCate: [{ name: '需求', id: '1' }, { name: '供求', id: '2' }, { name: '人才', id: '3' }], //供求类型选择,
|
||||
demandingSupplyCateSelected: { name: '需求', id: '1' },// 当前供求类型
|
||||
needsState: [{ name: '在用', id: '1' }, { name: '作废', id: '0' }], // 状态选择
|
||||
needsStateSelected: { name: '在用', id: '1' },// 当前状态
|
||||
needsType:[{name:'全部',id:'4'},{name:'效果图',id:'5'}],
|
||||
needsTypeSelected:{name:'全部',id:'4'},
|
||||
title: '',
|
||||
contactName: '',
|
||||
contactNumber: '',
|
||||
contactAddress: '',
|
||||
content: '',
|
||||
pickerImageUrl: [], // 上传的图片
|
||||
ImagesInfo: [],// 后台传回来的图片信息
|
||||
isFormCompleted: false,
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
//获取商品信息api GetProductInfo
|
||||
getSupplyDemandInfo() {
|
||||
Taro.request({
|
||||
url: URL.GetSupplyDemandInfo,
|
||||
method: 'GET',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
sdID: this.$router.params.sdId,
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'),
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
}
|
||||
//获取商品信息api GetProductInfo
|
||||
getSupplyDemandInfo() {
|
||||
Taro.request({
|
||||
url: URL.GetSupplyDemandInfo,
|
||||
method: 'GET',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
sdID: this.$router.params.sdId,
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'),
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
console.log('供求详情获取成功', res)
|
||||
const selectedType = this.state.demandingSupplyCate.filter(item => item.id == res.data.sdInfo.sd_type)[0]
|
||||
const selectedState = this.state.needsState.filter(item => item.id == res.data.sdInfo.state)[0]
|
||||
const imageFile = res.data.sdInfo.file_path.map(item => { return { url: URL.Base + item.file_path } })
|
||||
this.setState({
|
||||
demandingSupplyCateSelected: selectedType,
|
||||
title: res.data.sdInfo.sd_title,
|
||||
contactName: res.data.sdInfo.user_name,
|
||||
contactNumber: res.data.sdInfo.user_phone,
|
||||
contactAddress: res.data.sdInfo.user_address,
|
||||
content: res.data.sdInfo.sd_desc,
|
||||
needsStateSelected: selectedState,
|
||||
pickerImageUrl: imageFile,
|
||||
ImagesInfo: res.data.sdInfo.file_path,
|
||||
})
|
||||
.then(res => {
|
||||
console.log('供求详情获取成功', res)
|
||||
const selectedType = this.state.demandingSupplyCate.filter(item => item.id == res.data.sdInfo.sd_type)[0]
|
||||
const selectedState = this.state.needsState.filter(item => item.id == res.data.sdInfo.state)[0]
|
||||
const imageFile = res.data.sdInfo.file_path.map(item => { return { url: URL.Base + item.file_path } })
|
||||
this.setState({
|
||||
demandingSupplyCateSelected: selectedType,
|
||||
title: res.data.sdInfo.sd_title,
|
||||
contactName: res.data.sdInfo.user_name,
|
||||
contactNumber: res.data.sdInfo.user_phone,
|
||||
contactAddress: res.data.sdInfo.user_address,
|
||||
content: res.data.sdInfo.sd_desc,
|
||||
needsStateSelected: selectedState,
|
||||
pickerImageUrl: imageFile,
|
||||
ImagesInfo:res.data.sdInfo.file_path,
|
||||
})
|
||||
Taro.hideLoading()
|
||||
}
|
||||
Taro.hideLoading()
|
||||
}
|
||||
|
||||
)
|
||||
.catch(error => {
|
||||
console.log('供求详情获取失败', error)
|
||||
})
|
||||
)
|
||||
.catch(error => {
|
||||
console.log('供求详情获取失败', error)
|
||||
})
|
||||
}
|
||||
|
||||
// 上传供求api
|
||||
uploadSupplyDemand() {
|
||||
if (this.state.demandingSupplyCateSelected && this.state.title && this.state.contactName && this.state.contactNumber && this.state.content && this.state.needsStateSelected) {
|
||||
this.uploadDemSup({})
|
||||
} else {
|
||||
this.setState({ uploadDemSupTextTip: '请填写完表格', isUploadDemSupSuccess: true }, () => {
|
||||
setTimeout(() => {
|
||||
this.setState({ isUploadDemSupSuccess: false })
|
||||
}, 2000)
|
||||
})
|
||||
}
|
||||
|
||||
// 上传供求api
|
||||
uploadSupplyDemand() {
|
||||
if (this.state.demandingSupplyCateSelected && this.state.title && this.state.contactName && this.state.contactNumber && this.state.content && this.state.needsStateSelected) {
|
||||
this.uploadDemSup({})
|
||||
} else {
|
||||
this.setState({ uploadDemSupTextTip: '请填写完表格', isUploadDemSupSuccess: true }, () => {
|
||||
setTimeout(() => {
|
||||
this.setState({ isUploadDemSupSuccess: false })
|
||||
}, 2000)
|
||||
})
|
||||
}
|
||||
// Taro.request({
|
||||
// url: URL.UploadSupplyDemand,
|
||||
// method: 'POST',
|
||||
// dataType: 'json',
|
||||
// data: {
|
||||
// action: 1,
|
||||
// sdInfo: JSON.stringify({ "sd_type": "2", "sd_title": "534523", "user_name": "杨夕兵", "user_phone": "18950295811", "user_address": "2342", "sd_desc": "42342", "state": "1", "file_path": [{ "file_name": "bg3.jpg", "file_size": "212678", "file_path": "Uploads/supply/user_27/201812/38bf91f30d215bbefb2686f2401217a6.jpg", "thumb_path": "Uploads/supply/user_27/201812/thumb/38bf91f30d215bbefb2686f2401217a6_200X200.jpg" }] })
|
||||
// },
|
||||
// header: {
|
||||
// 'content-type': 'application/x-www-form-urlencoded',
|
||||
// }
|
||||
// })
|
||||
// .then(res => {
|
||||
// console.log('上传供求', res)
|
||||
// }
|
||||
// )
|
||||
}
|
||||
|
||||
// Taro.request({
|
||||
// url: URL.UploadSupplyDemand,
|
||||
// method: 'POST',
|
||||
// dataType: 'json',
|
||||
// data: {
|
||||
// action: 1,
|
||||
// sdInfo: JSON.stringify({ "sd_type": "2", "sd_title": "534523", "user_name": "杨夕兵", "user_phone": "18950295811", "user_address": "2342", "sd_desc": "42342", "state": "1", "file_path": [{ "file_name": "bg3.jpg", "file_size": "212678", "file_path": "Uploads/supply/user_27/201812/38bf91f30d215bbefb2686f2401217a6.jpg", "thumb_path": "Uploads/supply/user_27/201812/thumb/38bf91f30d215bbefb2686f2401217a6_200X200.jpg" }] })
|
||||
// },
|
||||
// header: {
|
||||
// 'content-type': 'application/x-www-form-urlencoded',
|
||||
// }
|
||||
// })
|
||||
// .then(res => {
|
||||
// console.log('上传供求', res)
|
||||
// }
|
||||
// )
|
||||
}
|
||||
// uploadDemSup 上传供求 的api
|
||||
uploadDemSup({ sd_type = this.state.demandingSupplyCateSelected.id,
|
||||
sd_title = this.state.title,
|
||||
user_name = this.state.contactName,
|
||||
user_phone = this.state.contactNumber,
|
||||
user_address = this.state.contactAddress,
|
||||
sd_desc = this.state.content,
|
||||
state = this.state.needsStateSelected.id }) {
|
||||
|
||||
// uploadDemSup 上传供求 的api
|
||||
uploadDemSup({ sd_type = this.state.demandingSupplyCateSelected.id,
|
||||
sd_title = this.state.title,
|
||||
user_name = this.state.contactName,
|
||||
user_phone = this.state.contactNumber,
|
||||
user_address = this.state.contactAddress,
|
||||
sd_desc = this.state.content,
|
||||
state = this.state.needsStateSelected.id }) {
|
||||
|
||||
const file_path = [];
|
||||
this.state.ImagesInfo.forEach((item) => {
|
||||
file_path.push({
|
||||
file_name: item.file_name,
|
||||
file_size: item.file_size,
|
||||
file_path: item.file_path,
|
||||
thumb_path: item.thumb_path
|
||||
})
|
||||
const file_path = [];
|
||||
this.state.ImagesInfo.forEach((item) => {
|
||||
file_path.push({
|
||||
file_name: item.file_name,
|
||||
file_size: item.file_size,
|
||||
file_path: item.file_path,
|
||||
thumb_path: item.thumb_path
|
||||
})
|
||||
})
|
||||
Taro.request({
|
||||
url: URL.UploadSupplyDemand,
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
action: 2,
|
||||
sdInfo: JSON.stringify({
|
||||
sd_id: this.$router.params.sdId,
|
||||
sd_type: sd_type,
|
||||
sd_title: sd_title,
|
||||
user_name: user_name,
|
||||
user_phone: user_phone,
|
||||
user_address: user_address,
|
||||
sd_desc: sd_desc,
|
||||
state: state,
|
||||
file_path: file_path
|
||||
})
|
||||
Taro.request({
|
||||
url: URL.UploadSupplyDemand,
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
action: 2,
|
||||
sdInfo: JSON.stringify({
|
||||
sd_id:this.$router.params.sdId,
|
||||
sd_type: sd_type,
|
||||
sd_title: sd_title,
|
||||
user_name: user_name,
|
||||
user_phone: user_phone,
|
||||
user_address: user_address,
|
||||
sd_desc: sd_desc,
|
||||
state: state,
|
||||
file_path: file_path
|
||||
})
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'),
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
console.log('上传供求', res)
|
||||
if (res.data.err_msg === 'success') {
|
||||
Taro.showToast({
|
||||
title: '上传成功',
|
||||
icon: 'success',
|
||||
duration: 1500
|
||||
}).then(()=>{
|
||||
setTimeout(() => {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/mySupplyDemand/mySupplyDemand'
|
||||
})
|
||||
}, 1500);
|
||||
})
|
||||
|
||||
} else {
|
||||
Taro.showToast({
|
||||
title: res.data.err_msg,
|
||||
icon: 'none',
|
||||
duration: 1500
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
// 上传图片
|
||||
onChangeImg(files, operationType, index) {
|
||||
const that = this
|
||||
if (operationType === 'add') {
|
||||
Taro.uploadFile({
|
||||
url: URL.UploadDSPorductImage,
|
||||
filePath: files[files.length - 1].url,
|
||||
name: 'file',
|
||||
header: {
|
||||
'content-type': 'multipart/form-data',
|
||||
'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'),
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
},
|
||||
success(response) {
|
||||
const data = JSON.parse(response.data)
|
||||
const imagePath = URL.Base + data.file_path
|
||||
const newPickerImageUrl = that.state.pickerImageUrl.concat({ url: imagePath })
|
||||
const newImageInfo = that.state.ImagesInfo.concat(data)
|
||||
that.setState({
|
||||
pickerImageUrl: newPickerImageUrl,
|
||||
ImagesInfo: newImageInfo
|
||||
})
|
||||
Taro.showToast({
|
||||
title: '上传成功',
|
||||
icon: 'success',
|
||||
duration: 1500
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
if (operationType === 'remove') {
|
||||
this.state.ImagesInfo.splice(index, 1) // 删除显示的图片
|
||||
this.state.pickerImageUrl.splice(index, 1)// 删除图片param
|
||||
that.setState({
|
||||
pockerImageUrl:this.state.pickerImageUrl,
|
||||
ImagesInfo:this.state.ImagesInfo,
|
||||
})
|
||||
Taro.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'success',
|
||||
duration: 1500
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'),
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
console.log('上传供求', res)
|
||||
if (res.data.err_msg === 'success') {
|
||||
Taro.showToast({
|
||||
title: '上传成功',
|
||||
icon: 'success',
|
||||
duration: 1500
|
||||
}).then(() => {
|
||||
setTimeout(() => {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/mySupplyDemand/mySupplyDemand'
|
||||
})
|
||||
}, 1500);
|
||||
})
|
||||
|
||||
} else {
|
||||
Taro.showToast({
|
||||
title: res.data.err_msg,
|
||||
icon: 'none',
|
||||
duration: 1500
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
// 上传图片
|
||||
onChangeImg(files, operationType, index) {
|
||||
const that = this
|
||||
if (operationType === 'add') {
|
||||
Taro.uploadFile({
|
||||
url: URL.UploadDSPorductImage,
|
||||
filePath: files[files.length - 1].url,
|
||||
name: 'file',
|
||||
header: {
|
||||
'content-type': 'multipart/form-data',
|
||||
'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'),
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
},
|
||||
success(response) {
|
||||
const data = JSON.parse(response.data)
|
||||
const imagePath = URL.Base + data.file_path
|
||||
const newPickerImageUrl = that.state.pickerImageUrl.concat({ url: imagePath })
|
||||
const newImageInfo = that.state.ImagesInfo.concat(data)
|
||||
that.setState({
|
||||
pickerImageUrl: newPickerImageUrl,
|
||||
ImagesInfo: newImageInfo
|
||||
})
|
||||
Taro.showToast({
|
||||
title: '上传成功',
|
||||
icon: 'success',
|
||||
duration: 1500
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
// 修改供求类型
|
||||
demandingSupplyCate = e => {
|
||||
this.setState({
|
||||
demandingSupplyCateSelected: this.state.demandingSupplyCate[e.detail.value]
|
||||
})
|
||||
}
|
||||
// 修改供求状态
|
||||
demSupplyStateChange = e => {
|
||||
this.setState({
|
||||
needsStateSelected: this.state.needsState[e.detail.value]
|
||||
})
|
||||
}
|
||||
//改标题
|
||||
titleChange(event) {
|
||||
this.setState({ title: event })
|
||||
}
|
||||
contactNameChange(event) {
|
||||
this.setState({ contactName: event })
|
||||
}
|
||||
contactNumberChange(event) {
|
||||
this.setState({ contactNumber: event })
|
||||
}
|
||||
contactAddressChange(event) {
|
||||
this.setState({ contactAddress: event.target.value })
|
||||
}
|
||||
contentChange(event) {
|
||||
this.setState({ content: event.target.value })
|
||||
}
|
||||
goToMyDemSupPage() {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/mySupplyDemand/mySupplyDemand'
|
||||
})
|
||||
if (operationType === 'remove') {
|
||||
this.state.ImagesInfo.splice(index, 1) // 删除显示的图片
|
||||
this.state.pickerImageUrl.splice(index, 1)// 删除图片param
|
||||
that.setState({
|
||||
pockerImageUrl: this.state.pickerImageUrl,
|
||||
ImagesInfo: this.state.ImagesInfo,
|
||||
})
|
||||
Taro.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'success',
|
||||
duration: 1500
|
||||
})
|
||||
}
|
||||
}
|
||||
// 修改供求类型
|
||||
demandingSupplyCate = e => {
|
||||
this.setState({
|
||||
demandingSupplyCateSelected: this.state.demandingSupplyCate[e.detail.value]
|
||||
})
|
||||
}
|
||||
// 修改供求状态
|
||||
demSupplyStateChange = e => {
|
||||
this.setState({
|
||||
needsStateSelected: this.state.needsState[e.detail.value]
|
||||
})
|
||||
}
|
||||
//改标题
|
||||
titleChange(event) {
|
||||
this.setState({ title: event })
|
||||
}
|
||||
contactNameChange(event) {
|
||||
this.setState({ contactName: event })
|
||||
}
|
||||
contactNumberChange(event) {
|
||||
this.setState({ contactNumber: event })
|
||||
}
|
||||
contactAddressChange(event) {
|
||||
this.setState({ contactAddress: event.target.value })
|
||||
}
|
||||
contentChange(event) {
|
||||
this.setState({ content: event.target.value })
|
||||
}
|
||||
goToMyDemSupPage() {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/mySupplyDemand/mySupplyDemand'
|
||||
})
|
||||
}
|
||||
|
||||
getDataFromChild(value){
|
||||
console.log('从子组件传回来的值',value)
|
||||
this.setState({industryTypeSelected:value})
|
||||
}
|
||||
|
||||
|
||||
componentDidMount() {
|
||||
// console.log('this.$router.params.sdId',this.$router.params.sdId)
|
||||
// Taro.showLoading({title:'加载中'})
|
||||
// this.getSupplyDemandInfo()
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
console.log(this.props, nextProps)
|
||||
}
|
||||
componentDidMount() {
|
||||
// console.log('this.$router.params.sdId',this.$router.params.sdId)
|
||||
// Taro.showLoading({title:'加载中'})
|
||||
// this.getSupplyDemandInfo()
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
console.log(this.props, nextProps)
|
||||
}
|
||||
|
||||
componentWillUnmount() { }
|
||||
componentWillUnmount() { }
|
||||
|
||||
componentDidShow() { }
|
||||
componentDidShow() { }
|
||||
|
||||
componentDidHide() { }
|
||||
componentDidHide() { }
|
||||
|
||||
render() {
|
||||
|
||||
return (
|
||||
<View className='supply-demand'>
|
||||
|
||||
{/* 供求类型 */}
|
||||
<View className='page-section'>
|
||||
<View>
|
||||
<Picker mode='selector' rangeKey='name' range={this.state.demandingSupplyCate} onChange={this.demandingSupplyCate.bind(this)}>
|
||||
<View className='picker'>
|
||||
<View className='title-box'>
|
||||
<Text className='title'><Text className='require'>*</Text>行业分类:</Text> <Text className='selected'>{this.state.demandingSupplyCateSelected.name}</Text>
|
||||
</View>
|
||||
render() {
|
||||
|
||||
</View>
|
||||
</Picker>
|
||||
</View>
|
||||
</View>
|
||||
{/* 需求类型 */}
|
||||
<View className='page-section'>
|
||||
<View>
|
||||
<Picker mode='selector' rangeKey='name' range={this.state.needsType} onChange={this.demandingSupplyCate.bind(this)}>
|
||||
<View className='picker'>
|
||||
<View className='title-box'>
|
||||
<Text className='title'><Text className='require'>*</Text>需求类型:</Text> <Text className='selected'>{this.state.needsTypeSelected.name}</Text>
|
||||
</View>
|
||||
return (
|
||||
<View className='supply-demand'>
|
||||
|
||||
</View>
|
||||
</Picker>
|
||||
</View>
|
||||
</View>
|
||||
<View className='border-box'>
|
||||
<Text className='require'>*</Text><AtInput
|
||||
name='value'
|
||||
title='需求标题:'
|
||||
type='text'
|
||||
value={this.state.title}
|
||||
onChange={this.titleChange.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
<View className='input-box'>
|
||||
<Text className='require'>*</Text>
|
||||
<AtInput
|
||||
name='value'
|
||||
title='联系人:'
|
||||
type='text'
|
||||
value={this.state.contactName}
|
||||
onChange={this.contactNameChange.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
<View className='input-box'>
|
||||
<Text className='require'>*</Text>
|
||||
<AtInput
|
||||
name='value'
|
||||
title='联系电话:'
|
||||
type='number'
|
||||
value={this.state.contactNumber}
|
||||
onChange={this.contactNumberChange.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
<View className='demanding-box'>
|
||||
<View className='title-box'>
|
||||
<Text className='title'>联系地址:</Text>
|
||||
</View>
|
||||
|
||||
<AtTextarea
|
||||
value={this.state.contactAddress}
|
||||
onChange={this.contactAddressChange.bind(this)}
|
||||
maxlength='200'
|
||||
placeholder='联系地址'
|
||||
/>
|
||||
</View>
|
||||
<View className='demanding-box'>
|
||||
<View className='title-box'>
|
||||
<Text className='title'><Text className='require'>*</Text>需求内容:</Text>
|
||||
</View>
|
||||
<AtTextarea
|
||||
value={this.state.content}
|
||||
onChange={this.contentChange.bind(this)}
|
||||
maxlength='200'
|
||||
placeholder=''
|
||||
/>
|
||||
</View>
|
||||
<View className='img-box'>
|
||||
<View className='title-box'>
|
||||
<Text className='title'>需求图片:</Text>
|
||||
<View className='warn'>(最多4张)</View>
|
||||
</View>
|
||||
|
||||
<View className='img-container'>
|
||||
<AtImagePicker
|
||||
multiple
|
||||
showAddBtn={this.state.pickerImageUrl.length < 4}
|
||||
files={this.state.pickerImageUrl}
|
||||
onChange={this.onChangeImg.bind(this)}
|
||||
onFail={this.onFail.bind(this)}
|
||||
onImageClick={this.onImageClick.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
<View className='page-section'>
|
||||
|
||||
<View>
|
||||
<Picker mode='selector' rangeKey='name' range={this.state.needsState} onChange={this.demSupplyStateChange}>
|
||||
<View className='picker'>
|
||||
<View className='title-box'>
|
||||
<Text className='title'> <Text className='require'>*</Text>状态:</Text> <Text className='selected'>{this.state.needsStateSelected.name}</Text>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
</Picker>
|
||||
</View>
|
||||
{/* 行业分类 */}
|
||||
<InteractionComponent url={URL.GetIndustryTypeList} onPassDataToChild={this.getDataFromChild.bind(this)}></InteractionComponent>
|
||||
{/* <View className='page-section'>
|
||||
<View>
|
||||
<Picker mode='selector' rangeKey='name' range={this.state.demandingSupplyCate} onChange={this.demandingSupplyCate.bind(this)}>
|
||||
<View className='picker'>
|
||||
<View className='title-box'>
|
||||
<Text className='title'><Text className='require'>*</Text>行业分类:</Text> <Text className='selected'>{this.state.demandingSupplyCateSelected.name}</Text>
|
||||
</View>
|
||||
|
||||
<View className='button-box'>
|
||||
<View className='button' onClick={this.uploadSupplyDemand.bind(this)}>
|
||||
<AtButton type='primary' size='small'>保存</AtButton>
|
||||
</View>
|
||||
{/* <View className='button'>
|
||||
</View>
|
||||
</Picker>
|
||||
</View>
|
||||
</View> */}
|
||||
{/* 需求类型 */}
|
||||
<View className='page-section'>
|
||||
<View>
|
||||
<Picker mode='selector' rangeKey='name' range={this.state.needsType} onChange={this.demandingSupplyCate.bind(this)}>
|
||||
<View className='picker'>
|
||||
<View className='title-box'>
|
||||
<Text className='title'><Text className='require'>*</Text>需求类型:</Text> <Text className='selected'>{this.state.needsTypeSelected.name}</Text>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
</Picker>
|
||||
</View>
|
||||
</View>
|
||||
<View className='border-box'>
|
||||
<Text className='require'>*</Text><AtInput
|
||||
name='value'
|
||||
title='需求标题:'
|
||||
type='text'
|
||||
value={this.state.title}
|
||||
onChange={this.titleChange.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
<View className='input-box'>
|
||||
<Text className='require'>*</Text>
|
||||
<AtInput
|
||||
name='value'
|
||||
title='联系人:'
|
||||
type='text'
|
||||
value={this.state.contactName}
|
||||
onChange={this.contactNameChange.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
<View className='input-box'>
|
||||
<Text className='require'>*</Text>
|
||||
<AtInput
|
||||
name='value'
|
||||
title='联系电话:'
|
||||
type='number'
|
||||
value={this.state.contactNumber}
|
||||
onChange={this.contactNumberChange.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
<View className='demanding-box'>
|
||||
<View className='title-box'>
|
||||
<Text className='title'>联系地址:</Text>
|
||||
</View>
|
||||
|
||||
<AtTextarea
|
||||
value={this.state.contactAddress}
|
||||
onChange={this.contactAddressChange.bind(this)}
|
||||
maxlength='200'
|
||||
placeholder='联系地址'
|
||||
/>
|
||||
</View>
|
||||
<View className='demanding-box'>
|
||||
<View className='title-box'>
|
||||
<Text className='title'><Text className='require'>*</Text>需求内容:</Text>
|
||||
</View>
|
||||
<AtTextarea
|
||||
value={this.state.content}
|
||||
onChange={this.contentChange.bind(this)}
|
||||
maxlength='200'
|
||||
placeholder=''
|
||||
/>
|
||||
</View>
|
||||
<View className='img-box'>
|
||||
<View className='title-box'>
|
||||
<Text className='title'>需求图片:</Text>
|
||||
<View className='warn'>(最多4张)</View>
|
||||
</View>
|
||||
|
||||
<View className='img-container'>
|
||||
<AtImagePicker
|
||||
multiple
|
||||
showAddBtn={this.state.pickerImageUrl.length < 4}
|
||||
files={this.state.pickerImageUrl}
|
||||
onChange={this.onChangeImg.bind(this)}
|
||||
onFail={this.onFail.bind(this)}
|
||||
onImageClick={this.onImageClick.bind(this)}
|
||||
/>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
<View className='page-section'>
|
||||
|
||||
<View>
|
||||
<Picker mode='selector' rangeKey='name' range={this.state.needsState} onChange={this.demSupplyStateChange}>
|
||||
<View className='picker'>
|
||||
<View className='title-box'>
|
||||
<Text className='title'> <Text className='require'>*</Text>状态:</Text> <Text className='selected'>{this.state.needsStateSelected.name}</Text>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
</Picker>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<View className='button-box'>
|
||||
<View className='button' onClick={this.uploadSupplyDemand.bind(this)}>
|
||||
<AtButton type='primary' size='small'>保存</AtButton>
|
||||
</View>
|
||||
{/* <View className='button'>
|
||||
|
||||
<AtButton type='primary' className='button-a' size='small'>保存并新增</AtButton>
|
||||
</View> */}
|
||||
<View className='button' onClick={this.goToMyDemSupPage.bind(this)}>
|
||||
<AtButton type='primary' className='button-a' size='small'>我的需求</AtButton>
|
||||
</View>
|
||||
</View>
|
||||
<CopyrightComponent></CopyrightComponent>
|
||||
<View className='button' onClick={this.goToMyDemSupPage.bind(this)}>
|
||||
<AtButton type='primary' className='button-a' size='small'>我的需求</AtButton>
|
||||
</View>
|
||||
</View>
|
||||
<CopyrightComponent></CopyrightComponent>
|
||||
|
||||
|
||||
</View>
|
||||
)
|
||||
}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default MyNeedsEdit
|
||||
|
@ -5,6 +5,7 @@ import { AtInput, AtImagePicker, AtTextarea, AtButton, Picker, AtToast } from 't
|
||||
|
||||
import CopyrightComponent from '../../component/copyrightComponent/copyrightComponent'
|
||||
import URL from '../../serviceAPI.config'
|
||||
import InteractionComponent from '../../component/interactionComponent/interactionComponent'
|
||||
|
||||
|
||||
import './myNeedsPublish.scss'
|
||||
@ -19,102 +20,47 @@ class MyNeedsPublish extends Component {
|
||||
constructor() {
|
||||
super(...arguments)
|
||||
this.state = {
|
||||
demandingSupplyCate: [{ name: '需求', id: '1' }, { name: '供求', id: '2' }, { name: '人才', id: '3' }], //供求类型选择,
|
||||
demandingSupplyCateSelected: { name: '需求', id: '1' },// 当前供求类型
|
||||
industryTypeSelected: { name: '全部', id: '-1' },// 当前行业分类
|
||||
needsState: [{ name: '在用', id: '1' }, { name: '作废', id: '0' }], // 状态选择
|
||||
needsStateSelected: { name: '在用', id: '1' },// 当前状态
|
||||
needsType:[{name:'全部',id:'4'},{name:'效果图',id:'5'}],
|
||||
needsTypeSelected:{name:'全部',id:'4'},
|
||||
needsType: [{ name: '业主需求', id: '4' }, { name: '效果图', id: '5' }],
|
||||
needsTypeSelected: { name: '业主需求', id: '4' },
|
||||
title: '',
|
||||
contactName: '',
|
||||
contactNumber: '',
|
||||
contactName: Taro.getStorageSync('userInfo').login_name,
|
||||
contactNumber: Taro.getStorageSync('userInfo').user_phone,
|
||||
contactAddress: '',
|
||||
content: '',
|
||||
pickerImageUrl: [], // 上传的图片
|
||||
ImagesInfo: [],// 后台传回来的图片信息
|
||||
isFormCompleted: false,
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
//获取商品信息api GetProductInfo
|
||||
getSupplyDemandInfo() {
|
||||
Taro.request({
|
||||
url: URL.GetSupplyDemandInfo,
|
||||
method: 'GET',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
sdID: this.$router.params.sdId,
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded',
|
||||
'Cookie': 'PFWSSS=' + Taro.getStorageSync('session_id'),
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
console.log('供求详情获取成功', res)
|
||||
const selectedType = this.state.demandingSupplyCate.filter(item => item.id == res.data.sdInfo.sd_type)[0]
|
||||
const selectedState = this.state.needsState.filter(item => item.id == res.data.sdInfo.state)[0]
|
||||
const imageFile = res.data.sdInfo.file_path.map(item => { return { url: URL.Base + item.file_path } })
|
||||
this.setState({
|
||||
demandingSupplyCateSelected: selectedType,
|
||||
title: res.data.sdInfo.sd_title,
|
||||
contactName: res.data.sdInfo.user_name,
|
||||
contactNumber: res.data.sdInfo.user_phone,
|
||||
contactAddress: res.data.sdInfo.user_address,
|
||||
content: res.data.sdInfo.sd_desc,
|
||||
needsStateSelected: selectedState,
|
||||
pickerImageUrl: imageFile,
|
||||
ImagesInfo:res.data.sdInfo.file_path,
|
||||
})
|
||||
Taro.hideLoading()
|
||||
}
|
||||
|
||||
)
|
||||
.catch(error => {
|
||||
console.log('供求详情获取失败', error)
|
||||
})
|
||||
}
|
||||
|
||||
// 上传供求api
|
||||
uploadSupplyDemand() {
|
||||
if (this.state.demandingSupplyCateSelected && this.state.title && this.state.contactName && this.state.contactNumber && this.state.content && this.state.needsStateSelected) {
|
||||
this.uploadDemSup({})
|
||||
uploadMyNeeds() {
|
||||
if (this.state.title &&
|
||||
this.state.contactName
|
||||
&& this.state.contactNumber
|
||||
&& this.state.content && this.state.needsStateSelected) {
|
||||
this.uploadMyNeeds({})
|
||||
} else {
|
||||
this.setState({ uploadDemSupTextTip: '请填写完表格', isUploadDemSupSuccess: true }, () => {
|
||||
setTimeout(() => {
|
||||
this.setState({ isUploadDemSupSuccess: false })
|
||||
}, 2000)
|
||||
Taro.showToast({
|
||||
title: '请填写完表格',
|
||||
icon: 'none',
|
||||
duration: 1500
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// Taro.request({
|
||||
// url: URL.UploadSupplyDemand,
|
||||
// method: 'POST',
|
||||
// dataType: 'json',
|
||||
// data: {
|
||||
// action: 1,
|
||||
// sdInfo: JSON.stringify({ "sd_type": "2", "sd_title": "534523", "user_name": "杨夕兵", "user_phone": "18950295811", "user_address": "2342", "sd_desc": "42342", "state": "1", "file_path": [{ "file_name": "bg3.jpg", "file_size": "212678", "file_path": "Uploads/supply/user_27/201812/38bf91f30d215bbefb2686f2401217a6.jpg", "thumb_path": "Uploads/supply/user_27/201812/thumb/38bf91f30d215bbefb2686f2401217a6_200X200.jpg" }] })
|
||||
// },
|
||||
// header: {
|
||||
// 'content-type': 'application/x-www-form-urlencoded',
|
||||
// }
|
||||
// })
|
||||
// .then(res => {
|
||||
// console.log('上传供求', res)
|
||||
// }
|
||||
// )
|
||||
|
||||
}
|
||||
|
||||
// uploadDemSup 上传供求 的api
|
||||
uploadDemSup({ sd_type = this.state.demandingSupplyCateSelected.id,
|
||||
sd_title = this.state.title,
|
||||
user_name = this.state.contactName,
|
||||
user_phone = this.state.contactNumber,
|
||||
user_address = this.state.contactAddress,
|
||||
sd_desc = this.state.content,
|
||||
state = this.state.needsStateSelected.id }) {
|
||||
|
||||
// uploadMyNeeds 上传供求 的api
|
||||
uploadMyNeeds() {
|
||||
|
||||
const file_path = [];
|
||||
this.state.ImagesInfo.forEach((item) => {
|
||||
@ -126,21 +72,23 @@ class MyNeedsPublish extends Component {
|
||||
})
|
||||
})
|
||||
Taro.request({
|
||||
url: URL.UploadSupplyDemand,
|
||||
url: URL.PublishMyNeed,
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
action: 2,
|
||||
action: 1,
|
||||
sdInfo: JSON.stringify({
|
||||
sd_id:this.$router.params.sdId,
|
||||
sd_type: sd_type,
|
||||
sd_title: sd_title,
|
||||
user_name: user_name,
|
||||
user_phone: user_phone,
|
||||
user_address: user_address,
|
||||
sd_desc: sd_desc,
|
||||
state: state,
|
||||
file_path: file_path
|
||||
class_id: this.state.industryTypeSelected.id,
|
||||
|
||||
sd_type: this.state.needsTypeSelected.id,
|
||||
sd_title: this.state.title,
|
||||
user_name: this.state.contactName,
|
||||
user_phone: this.state.contactNumber,
|
||||
user_address: this.state.contactAddress,
|
||||
sd_desc: this.state.content,
|
||||
state: this.state.needsStateSelected.id,
|
||||
file_path: file_path,
|
||||
|
||||
})
|
||||
},
|
||||
header: {
|
||||
@ -150,26 +98,26 @@ class MyNeedsPublish extends Component {
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
console.log('上传供求', res)
|
||||
console.log('上传需求', res)
|
||||
if (res.data.err_msg === 'success') {
|
||||
Taro.showToast({
|
||||
title: '上传成功',
|
||||
icon: 'success',
|
||||
duration: 1500
|
||||
}).then(()=>{
|
||||
setTimeout(() => {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/mySupplyDemand/mySupplyDemand'
|
||||
})
|
||||
}, 1500);
|
||||
})
|
||||
|
||||
}).then(() => {
|
||||
// setTimeout(() => {
|
||||
// Taro.navigateTo({
|
||||
// // url: '/pages/mySupplyDemand/mySupplyDemand'
|
||||
// })
|
||||
// }, 1500);
|
||||
})
|
||||
|
||||
} else {
|
||||
Taro.showToast({
|
||||
title: res.data.err_msg,
|
||||
icon: 'none',
|
||||
duration: 1500
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@ -182,7 +130,7 @@ class MyNeedsPublish extends Component {
|
||||
const that = this
|
||||
if (operationType === 'add') {
|
||||
Taro.uploadFile({
|
||||
url: URL.UploadDSPorductImage,
|
||||
url: URL.MyNeedUploadImage,
|
||||
filePath: files[files.length - 1].url,
|
||||
name: 'file',
|
||||
header: {
|
||||
@ -203,34 +151,38 @@ class MyNeedsPublish extends Component {
|
||||
title: '上传成功',
|
||||
icon: 'success',
|
||||
duration: 1500
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
if (operationType === 'remove') {
|
||||
this.state.ImagesInfo.splice(index, 1) // 删除显示的图片
|
||||
this.state.pickerImageUrl.splice(index, 1)// 删除图片param
|
||||
that.setState({
|
||||
pockerImageUrl:this.state.pickerImageUrl,
|
||||
ImagesInfo:this.state.ImagesInfo,
|
||||
})
|
||||
Taro.showToast({
|
||||
this.state.ImagesInfo.splice(index, 1) // 删除显示的图片
|
||||
this.state.pickerImageUrl.splice(index, 1)// 删除图片param
|
||||
that.setState({
|
||||
pockerImageUrl: this.state.pickerImageUrl,
|
||||
ImagesInfo: this.state.ImagesInfo,
|
||||
})
|
||||
Taro.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'success',
|
||||
duration: 1500
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
// 修改供求类型
|
||||
demandingSupplyCate = e => {
|
||||
// 修改需求类型
|
||||
needsTypeHandler = e => {
|
||||
this.setState({
|
||||
demandingSupplyCateSelected: this.state.demandingSupplyCate[e.detail.value]
|
||||
needsTypeSelected: this.state.needsType[e.detail.value]
|
||||
}, () => {
|
||||
console.log(this.state.needsTypeSelected)
|
||||
})
|
||||
}
|
||||
// 修改供求状态
|
||||
demSupplyStateChange = e => {
|
||||
needsStateHandler = e => {
|
||||
this.setState({
|
||||
needsStateSelected: this.state.needsState[e.detail.value]
|
||||
}, () => {
|
||||
console.log(this.state.needsStateSelected)
|
||||
})
|
||||
}
|
||||
//改标题
|
||||
@ -249,11 +201,15 @@ class MyNeedsPublish extends Component {
|
||||
contentChange(event) {
|
||||
this.setState({ content: event.target.value })
|
||||
}
|
||||
goToMyDemSupPage() {
|
||||
goToMyNeedsPage() {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/mySupplyDemand/mySupplyDemand'
|
||||
url: '/pages/myNeeds/myNeeds'
|
||||
})
|
||||
}
|
||||
getDataFromChild(value) {
|
||||
console.log('从子组件传回来的值', value)
|
||||
this.setState({ industryTypeSelected: value })
|
||||
}
|
||||
|
||||
|
||||
componentDidMount() {
|
||||
@ -272,30 +228,21 @@ class MyNeedsPublish extends Component {
|
||||
componentDidHide() { }
|
||||
|
||||
render() {
|
||||
|
||||
|
||||
return (
|
||||
<View className='supply-demand'>
|
||||
|
||||
{/* 供求类型 */}
|
||||
<View className='page-section'>
|
||||
<View>
|
||||
<Picker mode='selector' rangeKey='name' range={this.state.demandingSupplyCate} onChange={this.demandingSupplyCate.bind(this)}>
|
||||
<View className='picker'>
|
||||
<View className='title-box'>
|
||||
<Text className='title'><Text className='require'>*</Text>行业分类:</Text> <Text className='selected'>{this.state.demandingSupplyCateSelected.name}</Text>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
</Picker>
|
||||
</View>
|
||||
</View>
|
||||
{/* 行业分类 */}
|
||||
<InteractionComponent url={URL.GetIndustryTypeList}
|
||||
onPassDataToChild={this.getDataFromChild.bind(this)}
|
||||
></InteractionComponent>
|
||||
{/* 需求类型 */}
|
||||
<View className='page-section'>
|
||||
<View>
|
||||
<Picker mode='selector' rangeKey='name' range={this.state.needsType} onChange={this.demandingSupplyCate.bind(this)}>
|
||||
<Picker mode='selector' rangeKey='name' range={this.state.needsType} onChange={this.needsTypeHandler.bind(this)}>
|
||||
<View className='picker'>
|
||||
<View className='title-box'>
|
||||
<Text className='title'><Text className='require'>*</Text>需求类型:</Text> <Text className='selected'>{this.state.needsTypeSelected.name}</Text>
|
||||
<Text className='title'>需求类型:</Text> <Text className='selected'>{this.state.needsTypeSelected.name}</Text>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
@ -303,7 +250,8 @@ class MyNeedsPublish extends Component {
|
||||
</View>
|
||||
</View>
|
||||
<View className='border-box'>
|
||||
<Text className='require'>*</Text><AtInput
|
||||
<Text className='require'>*</Text>
|
||||
<AtInput
|
||||
name='value'
|
||||
title='需求标题:'
|
||||
type='text'
|
||||
@ -375,7 +323,7 @@ class MyNeedsPublish extends Component {
|
||||
<View className='page-section'>
|
||||
|
||||
<View>
|
||||
<Picker mode='selector' rangeKey='name' range={this.state.needsState} onChange={this.demSupplyStateChange}>
|
||||
<Picker mode='selector' rangeKey='name' range={this.state.needsState} onChange={this.needsStateHandler}>
|
||||
<View className='picker'>
|
||||
<View className='title-box'>
|
||||
<Text className='title'> <Text className='require'>*</Text>状态:</Text> <Text className='selected'>{this.state.needsStateSelected.name}</Text>
|
||||
@ -387,14 +335,14 @@ class MyNeedsPublish extends Component {
|
||||
</View>
|
||||
|
||||
<View className='button-box'>
|
||||
<View className='button' onClick={this.uploadSupplyDemand.bind(this)}>
|
||||
<AtButton type='primary' size='small'>保存</AtButton>
|
||||
<View className='button' onClick={this.uploadMyNeeds.bind(this)}>
|
||||
<AtButton type='primary' size='small'>发布</AtButton>
|
||||
</View>
|
||||
{/* <View className='button'>
|
||||
|
||||
<AtButton type='primary' className='button-a' size='small'>保存并新增</AtButton>
|
||||
</View> */}
|
||||
<View className='button' onClick={this.goToMyDemSupPage.bind(this)}>
|
||||
<View className='button' onClick={this.goToMyNeedsPage.bind(this)}>
|
||||
<AtButton type='primary' className='button-a' size='small'>我的需求</AtButton>
|
||||
</View>
|
||||
</View>
|
||||
|
@ -49,7 +49,7 @@ $themeColor:#FF7142;
|
||||
margin-right:16rpx;
|
||||
width:172rpx;
|
||||
font-size:32rpx;
|
||||
line-height:1.5;
|
||||
line-height:100rpx;
|
||||
vertical-align:middle;
|
||||
text-align:left;
|
||||
font-weight: bold;
|
||||
|
@ -59,7 +59,7 @@ class Shop extends Component {
|
||||
curr_page: 1,
|
||||
page_count: 10,
|
||||
shop_name: false,
|
||||
shop_id: 1305,
|
||||
shop_id: Taro.getStorageSync('shopInfo').shop_id,
|
||||
config_id: 4,
|
||||
shop_class_id: '',
|
||||
order: '',
|
||||
@ -525,7 +525,7 @@ class Shop extends Component {
|
||||
componentDidMount() {
|
||||
|
||||
Taro.showLoading({ title: '加载中' })
|
||||
|
||||
console.log('this.$router.params.id',this.$router.params.id)
|
||||
//页面加载之后 得到指定店铺的商品 和 筛选标签
|
||||
this.goodsSearch({ shop_id: this.$router.params.id }) // 加载店铺商品
|
||||
this.getSearchParams({})// 加载筛选项
|
||||
|
@ -49,7 +49,7 @@ $themeColor:#FF7142;
|
||||
margin-right:16rpx;
|
||||
width:172rpx;
|
||||
font-size:32rpx;
|
||||
line-height:1.5;
|
||||
line-height:100rpx;
|
||||
vertical-align:middle;
|
||||
text-align:left;
|
||||
font-weight: bold;
|
||||
|
@ -3,13 +3,13 @@ const LOCALURL = "http://192.168.1.230/"
|
||||
const URL = {
|
||||
Base: LOCALURL,
|
||||
Login: LOCALURL + 'Applet-login', //登入接口
|
||||
ShopWxStore: LOCALURL + 'Shop-wxStore', //商城首页信息
|
||||
ShopWxStore: LOCALURL + 'Shop-ajaxStore', //商城首页信息
|
||||
ShopSupplyShops: LOCALURL + 'Shop-supplyShops',// 商城店铺信息
|
||||
GrabDemand: LOCALURL + 'Supply-grabDemand',// 抢单接口
|
||||
GetVoucherInfo: LOCALURL + 'Shop-couponsTips',// 优惠卷信息
|
||||
GetConsultInfo: LOCALURL + 'Shop-consultTips',// 咨询信息
|
||||
BuyConsult: LOCALURL + 'Shop-consult',// 购买咨询
|
||||
GetShopItemDetail: LOCALURL + 'GoodsQuery-wxGoodsDetail',// 商品详情
|
||||
GetShopItemDetail: LOCALURL + 'GoodsQuery-ajaxGoodsDetail',// 商品详情
|
||||
UploadDSPorductImage: LOCALURL + 'Supply-fileUpload',// 上传供求图片
|
||||
|
||||
|
||||
@ -17,14 +17,14 @@ const URL = {
|
||||
//所有业主供求
|
||||
GetAllDemanding: LOCALURL + 'supply-allDemandList',// 获取所有业主需求
|
||||
MySupplyDemand: LOCALURL + 'Supply-myList',// 我的供求
|
||||
supplyDemandDetails: LOCALURL + 'supply-wxDemandDetail',// 单个供求详情
|
||||
supplyDemandDetails: LOCALURL + 'supply-ajaxDemandDetail',// 单个供求详情
|
||||
|
||||
|
||||
|
||||
|
||||
// 店铺信息
|
||||
GoodsSearch: LOCALURL + 'GoodsSearch-search',// 店铺页面的信息
|
||||
ShopDescription: LOCALURL + 'shop-wxShopInfo',// 获取店铺详情
|
||||
ShopDescription: LOCALURL + 'shop-ajaxShopInfo',// 获取店铺详情
|
||||
GetSearchParam: LOCALURL + 'GoodsSearch-getSearchParam',// sidebar筛选的字段
|
||||
GetShopCategoryList: LOCALURL + 'Shop-ajaxShopCartgory',// 店铺内分类目录
|
||||
GetProductCategoryList: LOCALURL + 'applet-getGoodsClass',// 商品分类目录
|
||||
@ -38,21 +38,25 @@ const URL = {
|
||||
// 商品列表的api 接口 GoodsList-goodsDelete
|
||||
DeleteGood: LOCALURL + 'GoodsList-goodsDelete',// 删除商品列表接口
|
||||
ChangeGoodState: LOCALURL + 'GoodsList-setGoodsState',// 改变商品列表状态 (下架)
|
||||
BaoBeiCateList: LOCALURL + 'GoodsList-wxSales',// 获取宝贝类目列表
|
||||
BaoBeiCateList: LOCALURL + 'GoodsList-ajaxSales',// 获取宝贝类目列表
|
||||
|
||||
|
||||
|
||||
// 我的供求页面接口Supply-myList
|
||||
SearchDemandSupply: LOCALURL + 'Supply-myList',// 搜索我的供求接口
|
||||
DeleteDemandSupply: LOCALURL + 'Supply-delete',// 删除我的供求接口
|
||||
GetSupplyDemandInfo: LOCALURL + 'Supply-wxEditDeploy',// 获取单个供求信息
|
||||
GetSupplyDemandInfo: LOCALURL + 'Supply-ajaxEditDeploy',// 获取单个供求信息
|
||||
|
||||
// 商品编辑页面 Goods-wxEditPhoneDeploy
|
||||
GetProductInfo: LOCALURL + 'Goods-wxEditPhoneDeploy',// 获取单个商品信息
|
||||
//我的需求列表
|
||||
GetMyNeedsList:LOCALURL+'Supply-userDemandList',// 获取我的需求列表
|
||||
GetIndustryTypeList:LOCALURL+'shop-getIndustryClass',// 获取行业分类筛选列表
|
||||
DeleteMyNeeds:LOCALURL+'Supply-deleteUserDemand'// 删除我的需求
|
||||
// 商品编辑页面 Goods-ajaxEditPhoneDeploy
|
||||
GetProductInfo: LOCALURL + 'Goods-ajaxEditPhoneDeploy',// 获取单个商品信息
|
||||
//我的需求
|
||||
|
||||
PublishMyNeed: LOCALURL + 'Supply-userPost',// 发布我的需求
|
||||
MyNeedUploadImage: LOCALURL + 'Supply-fileUpload?type=user',// 我的需求图片上传
|
||||
GetMyNeedsList: LOCALURL + 'Supply-userDemandList',// 获取我的需求列表
|
||||
GetIndustryTypeList: LOCALURL + 'shop-getIndustryClass',// 获取行业分类筛选列表
|
||||
DeleteMyNeeds: LOCALURL + 'Supply-deleteUserDemand',// 删除我的需求
|
||||
EditMyNeeds: LOCALURL + 'Supply-ajaxUserDemand'// 需求编辑
|
||||
|
||||
}
|
||||
|
||||
|
@ -31,4 +31,7 @@ bug: 商品编辑 增加图片后 图片顺序乱了
|
||||
|
||||
|
||||
|
||||
等待后台--- 单个我的商品页面的图片顺序,单个我的需求页面的接口, 当个我哦的需求编辑页面的接口
|
||||
等待后台--- 单个我的商品页面的图片顺序,单个我的需求页面的接口, 当个我哦的需求编辑页面的接口
|
||||
|
||||
|
||||
// switch ---- shopTypeInteractionComp
|
Loading…
Reference in New Issue
Block a user