修改新用户登入后的就用户的数据还在
This commit is contained in:
parent
55644ac246
commit
04efa389b3
@ -57,7 +57,10 @@ class GoodsTypeInteractionComp extends Component {
|
|||||||
}) // 用递归来整理无限层次的数据
|
}) // 用递归来整理无限层次的数据
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
console.log('商品分类请求没有成功', res)
|
Taro.showToast({
|
||||||
|
title: res.data.err_msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -28,7 +28,7 @@ class ShopTypeInteractionComp extends Component {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
data: {
|
data: {
|
||||||
id: this.props.shopId
|
id: this.props.shopId,
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
'content-type': 'application/x-www-form-urlencoded',
|
'content-type': 'application/x-www-form-urlencoded',
|
||||||
@ -41,16 +41,21 @@ class ShopTypeInteractionComp extends Component {
|
|||||||
// this.formatIndustryType(res.data.data)
|
// this.formatIndustryType(res.data.data)
|
||||||
// this.formatIndustTypeInit(res.data.data)
|
// this.formatIndustTypeInit(res.data.data)
|
||||||
if (res.data.err_msg === 'success') {
|
if (res.data.err_msg === 'success') {
|
||||||
|
if(res.data.data===null){
|
||||||
|
return
|
||||||
|
}
|
||||||
console.log('店铺分类目录', res)
|
console.log('店铺分类目录', res)
|
||||||
this.setState({
|
this.setState({
|
||||||
interactionMultiArray: this.recursionInteraction(res.data.data),
|
interactionMultiArray: this.recursionInteraction(res.data.data),
|
||||||
initailMultiArray: this.recursionInitialized(res.data.data)
|
initailMultiArray: this.recursionInitialized(res.data.data)
|
||||||
}, () => {
|
}, () => {
|
||||||
|
|
||||||
|
// this.passDataToParent(this.state.initailMultiArray)
|
||||||
//返回初始选项在 在商品编辑页面
|
//返回初始选项在 在商品编辑页面
|
||||||
// if(this.props.shopTypeId){
|
if(this.props.shopTypeId){
|
||||||
// const foundData=this.findDataByShopTypeId(this.props.shopTypeId)
|
const foundData=this.findDataByShopTypeId(this.props.shopTypeId)
|
||||||
// this.passDataToParent(foundData)
|
this.passDataToParent(foundData)
|
||||||
// }
|
}
|
||||||
|
|
||||||
// console.log('联动数据', this.state.interactionMultiArray)
|
// console.log('联动数据', this.state.interactionMultiArray)
|
||||||
// console.log('初始化数据', this.state.initailMultiArray)
|
// console.log('初始化数据', this.state.initailMultiArray)
|
||||||
@ -68,19 +73,20 @@ class ShopTypeInteractionComp extends Component {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
findDataByShopTypeId() {
|
findDataByShopTypeId() {
|
||||||
console.log('id', this.props.shopTypeId)
|
console.log('id', this.props.shopTypeId,this.state.initailMultiArray)
|
||||||
|
let result=''
|
||||||
this.state.initailMultiArray.forEach(items => {
|
this.state.initailMultiArray.forEach(items => {
|
||||||
items.forEach(item => {
|
items.forEach(item => {
|
||||||
if (item.id === this.props.shopTypeId) {
|
if (item.id === this.props.shopTypeId) {
|
||||||
return item
|
result =item
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
// 递归整理无限层联动数据
|
// 递归整理无限层联动数据
|
||||||
recursionInteraction(data) {
|
recursionInteraction(data) {
|
||||||
|
|
||||||
let parentArrayHolder = []
|
let parentArrayHolder = []
|
||||||
const keys = Object.keys(data)
|
const keys = Object.keys(data)
|
||||||
for (let key of keys) {
|
for (let key of keys) {
|
||||||
@ -148,16 +154,13 @@ class ShopTypeInteractionComp extends Component {
|
|||||||
|
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
||||||
this.getShopTypeList(this.props.url)
|
this.getShopTypeList(this.props.url)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 当然父组件有新的props的 会从新渲染组件
|
// 当然父组件有新的props的 会从新渲染组件
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
// if (nextProps.shopTypeId) {
|
|
||||||
// const foundData = this.findDataByShopTypeId(nextProps.shopTypeId)
|
|
||||||
// this.passDataToParent(foundData)
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
componentWillUnmount() { }
|
componentWillUnmount() { }
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ class GoodsPublish extends Component {
|
|||||||
})
|
})
|
||||||
} else if (this.state.isPublishAndAdd) {
|
} else if (this.state.isPublishAndAdd) {
|
||||||
// 导航到发布页面
|
// 导航到发布页面
|
||||||
Taro.navigateTo({
|
Taro.reLaunch({
|
||||||
url: '/pages/goodsPublish/goodsPublish'
|
url: '/pages/goodsPublish/goodsPublish'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -180,12 +180,12 @@ class GoodsPublish extends Component {
|
|||||||
'X-Requested-With': 'XMLHttpRequest'
|
'X-Requested-With': 'XMLHttpRequest'
|
||||||
},
|
},
|
||||||
success(response) {
|
success(response) {
|
||||||
const responseMsg = JSON.parse(response.data).err_msg
|
const responseData = JSON.parse(response.data)
|
||||||
if (responseMsg === 'success' || responseMsg === 'duplicate') {
|
console.log('responseData',responseData)
|
||||||
const data = JSON.parse(response.data)
|
if (responseData.err_code===0) {
|
||||||
const imagePath = URL.Base + data.file_path
|
const imagePath = URL.Base + responseData.file_path
|
||||||
const newPickerImageUrl = that.state.pickerImageUrl.concat({ url: imagePath })
|
const newPickerImageUrl = that.state.pickerImageUrl.concat({ url: imagePath })
|
||||||
const newImageInfo = that.state.ImagesInfo.concat(data)
|
const newImageInfo = that.state.ImagesInfo.concat(responseData)
|
||||||
that.setState({ pickerImageUrl: newPickerImageUrl, ImagesInfo: newImageInfo }, () => {
|
that.setState({ pickerImageUrl: newPickerImageUrl, ImagesInfo: newImageInfo }, () => {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: '上传成功',
|
title: '上传成功',
|
||||||
@ -193,15 +193,15 @@ class GoodsPublish extends Component {
|
|||||||
duration: 2000
|
duration: 2000
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: responseMsg,
|
title: responseData.err_msg,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 1500
|
duration: 1500
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,7 @@ class GrabOrderPage extends Component {
|
|||||||
}
|
}
|
||||||
goToMyNeedsPage() {
|
goToMyNeedsPage() {
|
||||||
Taro.switchTab({
|
Taro.switchTab({
|
||||||
url: '/pages/myNeedsPublish/myNeedsPublish'
|
url: '/pages/myNeeds/myNeeds'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
goMyNeedEditPage() {
|
goMyNeedEditPage() {
|
||||||
@ -200,7 +200,7 @@ class GrabOrderPage extends Component {
|
|||||||
duration: 1500
|
duration: 1500
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
Taro.switchTab({
|
Taro.reLaunch({
|
||||||
url: '/pages/myNeeds/myNeeds'
|
url: '/pages/myNeeds/myNeeds'
|
||||||
})
|
})
|
||||||
}, 1500);
|
}, 1500);
|
||||||
|
@ -76,7 +76,7 @@ class Login extends Component {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: res.data.err_msg,
|
title: res.data.msg,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
})
|
})
|
||||||
|
@ -34,7 +34,6 @@ class MyDemandSupplyEdit extends Component {
|
|||||||
isFormCompleted: false,
|
isFormCompleted: false,
|
||||||
isConfirmWindow: false,// 删除提示框
|
isConfirmWindow: false,// 删除提示框
|
||||||
demandSupplyId: '',// 供求id
|
demandSupplyId: '',// 供求id
|
||||||
isSave: false,//是否点击保存按钮
|
|
||||||
isSaveAndNew: false//是否点击保存新增按钮
|
isSaveAndNew: false//是否点击保存新增按钮
|
||||||
|
|
||||||
|
|
||||||
@ -128,24 +127,26 @@ class MyDemandSupplyEdit extends Component {
|
|||||||
.then(res => {
|
.then(res => {
|
||||||
console.log('上传供求', res)
|
console.log('上传供求', res)
|
||||||
Taro.hideLoading()
|
Taro.hideLoading()
|
||||||
if (res.data.err_msg === 'success') {
|
if (res.data.err_code === 0) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: '保存成功',
|
title: res.data.err_msg == 'success' ? '保存成功' : res.data.err_msg,
|
||||||
icon: 'success',
|
icon: res.data.err_msg == 'success' ? 'success' : 'none',
|
||||||
duration: 1000
|
duration: 1000
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.state.isSave) {
|
console.log('this.state.isSaveAndNew', this.state.isSaveAndNew)
|
||||||
Taro.navigateTo({
|
if (this.state.isSaveAndNew) {
|
||||||
url: '/pages/myDemandSupplyEdit/myDemandSupplyEdit?sdId=' + res.data.sd_id
|
Taro.reLaunch({
|
||||||
})
|
|
||||||
} else if (this.state.isSaveAndNew) {
|
|
||||||
Taro.switchTab({
|
|
||||||
url: '/pages/supplyDemandPublish/supplyDemandPublish'
|
url: '/pages/supplyDemandPublish/supplyDemandPublish'
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
// Taro.navigateTo({
|
||||||
|
// url: '/pages/myDemandSupplyEdit/myDemandSupplyEdit?sdId=' + res.data.sd_id
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: res.data.err_msg,
|
title: res.data.err_msg,
|
||||||
@ -153,7 +154,6 @@ class MyDemandSupplyEdit extends Component {
|
|||||||
duration: 1500
|
duration: 1500
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -280,7 +280,7 @@ class MyDemandSupplyEdit extends Component {
|
|||||||
if (this.state.demandingSupplyCateSelected && this.state.title && this.state.contactName && this.state.contactNumber && this.state.content && this.state.demandingSupplyStateSelected) {
|
if (this.state.demandingSupplyCateSelected && this.state.title && this.state.contactName && this.state.contactNumber && this.state.content && this.state.demandingSupplyStateSelected) {
|
||||||
|
|
||||||
Taro.showLoading({ title: '保存中' }).then(() => {
|
Taro.showLoading({ title: '保存中' }).then(() => {
|
||||||
this.setState({ isSave: true }, () => {
|
this.setState({ isSaveAndNew: false }, () => {
|
||||||
this.uploadDemSup({})
|
this.uploadDemSup({})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -395,7 +395,7 @@ class MyDemandSupplyEdit extends Component {
|
|||||||
</View>
|
</View>
|
||||||
<View className='input-box' style='padding:24rpx 0;font-size:32rpx'>
|
<View className='input-box' style='padding:24rpx 0;font-size:32rpx'>
|
||||||
<View className='title' style='font-weight:bold;'>
|
<View className='title' style='font-weight:bold;'>
|
||||||
<Text style='color:red'>*</Text>
|
<Text style='color:red'>*</Text>
|
||||||
<Text>联系电话:</Text>
|
<Text>联系电话:</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style='margin-left:5%;'>
|
<View style='margin-left:5%;'>
|
||||||
|
@ -46,7 +46,6 @@ class MyGoodList extends Component {
|
|||||||
isOpenOffStockModal: false,// 是否显示下架模态框
|
isOpenOffStockModal: false,// 是否显示下架模态框
|
||||||
isAddToList: false,// 是否下拉加载 如果是 就添加商品到我的商品列表
|
isAddToList: false,// 是否下拉加载 如果是 就添加商品到我的商品列表
|
||||||
isShowTopNav: false,// 是否显示返回顶部按钮
|
isShowTopNav: false,// 是否显示返回顶部按钮
|
||||||
loadMorePageIndex: 1,//上拉加载页面数
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,23 +86,21 @@ class MyGoodList extends Component {
|
|||||||
'X-Requested-With': 'XMLHttpRequest'
|
'X-Requested-With': 'XMLHttpRequest'
|
||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log('baobei', res)
|
console.log('宝贝类目',res)
|
||||||
const productCate = [{ name: '全部类目', id: '' }]
|
if (res.data.err_code != 10) {
|
||||||
for (let item of res.data.goodsClass) {
|
const productCate = [{ name: '全部类目', id: '' }]
|
||||||
productCate.push({ name: item.class_name, id: item.class_id })
|
for (let item of res.data.goodsClass) {
|
||||||
|
productCate.push({ name: item.class_name, id: item.class_id })
|
||||||
|
}
|
||||||
|
this.setState({ productCate: productCate })
|
||||||
|
} else {
|
||||||
|
Taro.showToast({
|
||||||
|
title: res.data.err_msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1500,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
this.setState({ productCate: productCate })
|
|
||||||
|
|
||||||
}).catch(err => {
|
|
||||||
Taro.showToast({
|
|
||||||
title: '获取宝贝类目失败',
|
|
||||||
icon: 'none',
|
|
||||||
duration: 1500,
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取我的商品列表接口api
|
// 获取我的商品列表接口api
|
||||||
@ -143,16 +140,15 @@ class MyGoodList extends Component {
|
|||||||
'X-Requested-With': 'XMLHttpRequest'
|
'X-Requested-With': 'XMLHttpRequest'
|
||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.statusCode === 200) {
|
const data = JSON.parse(res.data)
|
||||||
|
if (data.err_code != 10) {
|
||||||
console.log('我的商品列表', JSON.parse(res.data))
|
console.log('我的商品列表', JSON.parse(res.data))
|
||||||
const data = JSON.parse(res.data)
|
|
||||||
Taro.hideLoading()
|
Taro.hideLoading()
|
||||||
|
if (data.goodsCount != '0' && data.goods.length) {
|
||||||
if (data.goods.length) {
|
|
||||||
data.goods.forEach(item => {
|
data.goods.forEach(item => {
|
||||||
item.checked = false
|
item.checked = false
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.state.isAddToList) {
|
if (this.state.isAddToList) {
|
||||||
this.setState({ myGoodList: this.state.myGoodList.concat(data.goods) }, () => {
|
this.setState({ myGoodList: this.state.myGoodList.concat(data.goods) }, () => {
|
||||||
this.setState({ isAddToList: false })
|
this.setState({ isAddToList: false })
|
||||||
@ -162,17 +158,26 @@ class MyGoodList extends Component {
|
|||||||
myGoodList: data.goods,
|
myGoodList: data.goods,
|
||||||
myGoodListTotal: data.goodsCount
|
myGoodListTotal: data.goodsCount
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.setState({ isAddToList: false })
|
if (data.goods === null) {
|
||||||
Taro.showToast({
|
this.setState({
|
||||||
title: '没有更多了',
|
myGoodList: [],
|
||||||
icon: 'none'
|
myGoodListTotal: data.goodsCount
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
this.setState({ isAddToList: false })
|
||||||
|
Taro.showToast({
|
||||||
|
title: '没有更多了',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('我的商品列表获取失败')
|
Taro.showToast({
|
||||||
|
title: data.err_msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -252,21 +257,24 @@ class MyGoodList extends Component {
|
|||||||
'X-Requested-With': 'XMLHttpRequest'
|
'X-Requested-With': 'XMLHttpRequest'
|
||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.statusCode === 200) {
|
let responseData = JSON.parse(res.data)
|
||||||
Taro.showToast({
|
if (responseData.err_code === 0) {
|
||||||
title: '下架成功',
|
|
||||||
icon: 'success',
|
this.setState({
|
||||||
duration: 1500
|
isCheckAll: false,
|
||||||
}).then(() => {
|
currPageParam: 1,
|
||||||
this.setState({ isCheckAll: false })
|
|
||||||
|
}, () => {
|
||||||
this.getMyGoodListApi({})
|
this.getMyGoodListApi({})
|
||||||
|
Taro.showToast({
|
||||||
|
title: '下架成功',
|
||||||
|
icon: 'success',
|
||||||
|
duration: 1500
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: '下架失败',
|
title: responseData.err_msg,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 1500
|
duration: 1500
|
||||||
})
|
})
|
||||||
@ -294,21 +302,19 @@ class MyGoodList extends Component {
|
|||||||
'X-Requested-With': 'XMLHttpRequest'
|
'X-Requested-With': 'XMLHttpRequest'
|
||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.statusCode === 200) {
|
let responseData = JSON.parse(res.data)
|
||||||
console.log('商品删除返回', res)
|
if (responseData.err_code === 0) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: '删除成功',
|
title: '删除成功',
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
duration: 1500
|
duration: 1500
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
this.setState({ isCheckAll: false, currPageParam: 1 })
|
||||||
this.setState({ isCheckAll: false })
|
|
||||||
this.getMyGoodListApi({})
|
this.getMyGoodListApi({})
|
||||||
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: '删除失败',
|
title: responseData.err_msg,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 1500
|
duration: 1500
|
||||||
})
|
})
|
||||||
@ -316,6 +322,7 @@ class MyGoodList extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -328,7 +335,7 @@ class MyGoodList extends Component {
|
|||||||
Taro.showLoading({
|
Taro.showLoading({
|
||||||
title: '加载中',
|
title: '加载中',
|
||||||
})
|
})
|
||||||
this.setState({ currPageParam: 1, isCheckAll: false,order:'' }, () => {
|
this.setState({ currPageParam: 1, isCheckAll: false, order: '' }, () => {
|
||||||
this.getMyGoodListApi({})
|
this.getMyGoodListApi({})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -346,7 +353,7 @@ class MyGoodList extends Component {
|
|||||||
maximumSold: '',
|
maximumSold: '',
|
||||||
productId: '',
|
productId: '',
|
||||||
productCateSelected: { id: '', name: '全部类目' },
|
productCateSelected: { id: '', name: '全部类目' },
|
||||||
order:'',
|
order: '',
|
||||||
}, () => {
|
}, () => {
|
||||||
this.getMyGoodListApi({})
|
this.getMyGoodListApi({})
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
@ -521,7 +528,7 @@ class MyGoodList extends Component {
|
|||||||
// 导航到商品发布页面
|
// 导航到商品发布页面
|
||||||
|
|
||||||
goToGoodsPublishPage() {
|
goToGoodsPublishPage() {
|
||||||
Taro.navigateTo({
|
Taro.switchTab({
|
||||||
url: '/pages/goodsPublish/goodsPublish'
|
url: '/pages/goodsPublish/goodsPublish'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -580,7 +587,9 @@ class MyGoodList extends Component {
|
|||||||
|
|
||||||
componentWillUnmount() { }
|
componentWillUnmount() { }
|
||||||
|
|
||||||
componentDidShow() { }
|
componentDidShow() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
componentDidHide() { }
|
componentDidHide() { }
|
||||||
// 页面位置
|
// 页面位置
|
||||||
@ -776,13 +785,13 @@ class MyGoodList extends Component {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
{this.state.myGoodList.length ? <View className='mygoodlist-container'>
|
||||||
|
|
||||||
<View className='mygoodlist-container'>
|
|
||||||
{goodListElementArray}
|
{goodListElementArray}
|
||||||
</View >
|
</View > : <View className='no-more-title'> 没有更多了</View>}
|
||||||
{this.state.isShowTopNav ? <ScrollToTopComponent ></ScrollToTopComponent> : null}
|
{this.state.isShowTopNav ? <ScrollToTopComponent ></ScrollToTopComponent> : null}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<CopyrightComponent></CopyrightComponent>
|
<CopyrightComponent></CopyrightComponent>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
@ -16,7 +16,7 @@ class MyGoodsEdit extends Component {
|
|||||||
super(...arguments)
|
super(...arguments)
|
||||||
this.state = {
|
this.state = {
|
||||||
shopTypeSelected: { name: '全部', id: '' },
|
shopTypeSelected: { name: '全部', id: '' },
|
||||||
shopTypeId:'',
|
shopTypeId: '',
|
||||||
shopTypeList: {},//店铺分类列表
|
shopTypeList: {},//店铺分类列表
|
||||||
productName: '',
|
productName: '',
|
||||||
productPrice: '',
|
productPrice: '',
|
||||||
@ -90,7 +90,6 @@ class MyGoodsEdit extends Component {
|
|||||||
class_id = "10103",
|
class_id = "10103",
|
||||||
shop_class_id = "1930",
|
shop_class_id = "1930",
|
||||||
goods_id = '123' }) {
|
goods_id = '123' }) {
|
||||||
console.log('上传函数1~~~~')
|
|
||||||
// 上传图片的参数
|
// 上传图片的参数
|
||||||
const uploadProductGoodFileParams = []
|
const uploadProductGoodFileParams = []
|
||||||
if (this.state.ImagesInfo.length) {
|
if (this.state.ImagesInfo.length) {
|
||||||
@ -115,7 +114,6 @@ class MyGoodsEdit extends Component {
|
|||||||
} else {
|
} else {
|
||||||
alert('图片为空')
|
alert('图片为空')
|
||||||
}
|
}
|
||||||
console.log('上传函数~~~~')
|
|
||||||
|
|
||||||
Taro.request({
|
Taro.request({
|
||||||
url: URL.UploadProduct,
|
url: URL.UploadProduct,
|
||||||
@ -143,35 +141,36 @@ class MyGoodsEdit extends Component {
|
|||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
Taro.hideLoading()
|
Taro.hideLoading()
|
||||||
Taro.showToast({
|
|
||||||
title: '保存成功',
|
if (res.data.err_code === 0) {
|
||||||
icon: 'success',
|
Taro.showToast({
|
||||||
duration: 1000
|
title: '保存成功',
|
||||||
}).then(() => {
|
icon: 'success',
|
||||||
setTimeout(() => {
|
duration: 1500
|
||||||
if (this.state.isSaveButton) {
|
}).then(() => {
|
||||||
Taro.navigateTo({
|
setTimeout(() => {
|
||||||
url: '/pages/myGoodsEdit/myGoodsEdit?id=' + this.$router.params.id
|
if (this.state.isSaveButton) {
|
||||||
})
|
// Taro.redirectTo({
|
||||||
} else if (this.state.isSaveAndNewBUtton) {
|
// url: '/pages/myGoodsEdit/myGoodsEdit?id=' + this.$router.params.id
|
||||||
Taro.navigateTo({
|
// })
|
||||||
url: '/pages/goodsPublish/goodsPublish'
|
} else if (this.state.isSaveAndNewBUtton) {
|
||||||
})
|
Taro.switchTab({
|
||||||
}
|
url: '/pages/goodsPublish/goodsPublish'
|
||||||
}, 1000);
|
})
|
||||||
})
|
}
|
||||||
|
}, 1000);
|
||||||
console.log('上传商品', res)
|
})
|
||||||
|
} else {
|
||||||
|
Taro.hideLoading()
|
||||||
|
Taro.showToast({
|
||||||
|
title: res.data.err_msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1500
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.catch(error => {
|
|
||||||
Taro.hideLoading()
|
|
||||||
Taro.showToast({
|
|
||||||
title: '保存失败',
|
|
||||||
icon: 'none',
|
|
||||||
duration: 1000
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
productNameChange(event) {
|
productNameChange(event) {
|
||||||
this.setState({
|
this.setState({
|
||||||
@ -335,6 +334,7 @@ class MyGoodsEdit extends Component {
|
|||||||
this.setState({ shopTypeSelected: value })
|
this.setState({ shopTypeSelected: value })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.getGoodsInfo()
|
this.getGoodsInfo()
|
||||||
}
|
}
|
||||||
@ -410,7 +410,7 @@ class MyGoodsEdit extends Component {
|
|||||||
{/* 店铺分类 */}
|
{/* 店铺分类 */}
|
||||||
<ShopTypeInteractionComp url={URL.GetShopCategoryList}
|
<ShopTypeInteractionComp url={URL.GetShopCategoryList}
|
||||||
shopId={Taro.getStorageSync('shopInfo').shop_id}
|
shopId={Taro.getStorageSync('shopInfo').shop_id}
|
||||||
// selectedValue={this.state.shopTypeSelected}
|
selectedValue={this.state.shopTypeSelected}
|
||||||
onPassDataToChild={this.getDataFromShopChild.bind(this)}
|
onPassDataToChild={this.getDataFromShopChild.bind(this)}
|
||||||
shopTypeId={this.state.shopTypeId}
|
shopTypeId={this.state.shopTypeId}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
import Taro, { Component } from '@tarojs/taro'
|
import Taro, { Component } from '@tarojs/taro'
|
||||||
import { View, Text, Button,Input } from '@tarojs/components'
|
import { View, Text, Button, Input } from '@tarojs/components'
|
||||||
import { AtInput, AtImagePicker, AtTextarea, Picker, AtModal, AtModalHeader, AtModalContent, AtModalAction } from 'taro-ui'
|
import { AtInput, AtImagePicker, AtTextarea, Picker, AtModal, AtModalHeader, AtModalContent, AtModalAction } from 'taro-ui'
|
||||||
|
|
||||||
import InteractionComponent from '../../component/interactionComponent/interactionComponent'
|
import InteractionComponent from '../../component/interactionComponent/interactionComponent'
|
||||||
@ -34,7 +34,7 @@ class MyNeedsEdit extends Component {
|
|||||||
pickerImageUrl: [],
|
pickerImageUrl: [],
|
||||||
ImagesInfo: '',
|
ImagesInfo: '',
|
||||||
isDeleteModal: false,// 删除提示框
|
isDeleteModal: false,// 删除提示框
|
||||||
isSave: false,//是否点击保存按钮
|
|
||||||
isSaveAndNew: false,//是否点击保存新增按钮
|
isSaveAndNew: false,//是否点击保存新增按钮
|
||||||
|
|
||||||
|
|
||||||
@ -59,58 +59,58 @@ class MyNeedsEdit extends Component {
|
|||||||
console.log('需求详情获取成功', res)
|
console.log('需求详情获取成功', res)
|
||||||
// const selectedType = this.state.demandingSupplyCate.filter(item => item.id == res.data.sdInfo.sd_type)[0]
|
// 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 selectedState = this.state.needsState.filter(item => item.id == res.data.sdInfo.state)[0]
|
||||||
let industryType = {}
|
if (res.data.err_code === 0) {
|
||||||
const classId = res.data.sdInfo.class_id
|
let industryType = {}
|
||||||
for (let outter of res.data.supplyTree) {
|
const classId = res.data.sdInfo.class_id
|
||||||
if (outter.children) {
|
for (let outter of res.data.supplyTree) {
|
||||||
for (let inner of outter.children) {
|
if (outter.children) {
|
||||||
if (inner.class_id === classId) {
|
for (let inner of outter.children) {
|
||||||
industryType.name = inner.class_name
|
if (inner.class_id === classId) {
|
||||||
industryType.id = inner.class_id
|
industryType.name = inner.class_name
|
||||||
break
|
industryType.id = inner.class_id
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (outter.class_id === classId) {
|
||||||
|
industryType.name = outter.class_name
|
||||||
|
industryType.id = outter.class_id
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (outter.class_id === classId) {
|
if (!Object.keys(industryType).length) {
|
||||||
industryType.name = outter.class_name
|
industryType.name = '全部'
|
||||||
industryType.id = outter.class_id
|
industryType.id = '-1'
|
||||||
break
|
|
||||||
}
|
}
|
||||||
|
const needsType = this.state.needsType.filter(item => {
|
||||||
|
return item.id === res.data.sdInfo.sd_type
|
||||||
|
})[0]
|
||||||
|
const imageFile = res.data.sdInfo.file_path.map(item => { return { url: URL.Base + item.file_path } })
|
||||||
|
const needsState = this.state.needsState.filter(item => {
|
||||||
|
return item.id === res.data.sdInfo.state
|
||||||
|
})[0]
|
||||||
|
this.setState({
|
||||||
|
sd_id: res.data.sdInfo.sd_id,
|
||||||
|
industryTypeSelected: industryType,
|
||||||
|
needsTypeSelected: needsType,
|
||||||
|
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: needsState,
|
||||||
|
pickerImageUrl: imageFile,
|
||||||
|
ImagesInfo: res.data.sdInfo.file_path,
|
||||||
|
})
|
||||||
|
Taro.hideLoading()
|
||||||
|
} else {
|
||||||
|
Taro.showToast({
|
||||||
|
title: res.data.err_msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
if (!Object.keys(industryType).length) {
|
|
||||||
industryType.name = '全部'
|
|
||||||
industryType.id = '-1'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const needsType = this.state.needsType.filter(item => {
|
|
||||||
return item.id === res.data.sdInfo.sd_type
|
|
||||||
})[0]
|
|
||||||
const imageFile = res.data.sdInfo.file_path.map(item => { return { url: URL.Base + item.file_path } })
|
|
||||||
const needsState = this.state.needsState.filter(item => {
|
|
||||||
return item.id === res.data.sdInfo.state
|
|
||||||
})[0]
|
|
||||||
this.setState({
|
|
||||||
sd_id: res.data.sdInfo.sd_id,
|
|
||||||
industryTypeSelected: industryType,
|
|
||||||
needsTypeSelected: needsType,
|
|
||||||
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: needsState,
|
|
||||||
pickerImageUrl: imageFile,
|
|
||||||
ImagesInfo: res.data.sdInfo.file_path,
|
|
||||||
})
|
|
||||||
Taro.hideLoading()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
)
|
)
|
||||||
.catch(error => {
|
|
||||||
console.log('供求详情获取失败', error)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -156,34 +156,33 @@ class MyNeedsEdit extends Component {
|
|||||||
.then(res => {
|
.then(res => {
|
||||||
console.log('上传需求', res)
|
console.log('上传需求', res)
|
||||||
Taro.hideLoading()
|
Taro.hideLoading()
|
||||||
if (res.data.err_msg === 'success') {
|
|
||||||
|
if (res.data.err_code === 0) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: '保存成功',
|
title: res.data.err_msg === 'success' ? '保存成功' : res.data.err_msg,
|
||||||
icon: 'success',
|
icon: res.data.err_msg === 'success' ? 'success' : 'none',
|
||||||
duration: 1500
|
duration: 1500
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.state.isSave) {
|
console.log('this.state.isSaveAndNew', this.state.isSaveAndNew)
|
||||||
|
if (this.state.isSaveAndNew) {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: '/pages/myNeedsEdit/myNeedsEdit?id=' + this.state.sd_id
|
|
||||||
})
|
|
||||||
} else if (this.state.isSaveAndNew) {
|
|
||||||
Taro.switchTab({
|
|
||||||
url: '/pages/myNeedsPublish/myNeedsPublish'
|
url: '/pages/myNeedsPublish/myNeedsPublish'
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
// Taro.navigateTo({
|
||||||
|
// url: '/pages/myNeedsEdit/myNeedsEdit?id=' + this.state.sd_id
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
|
|
||||||
}, 1500);
|
}, 1500);
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: res.data.err_msg,
|
title: '保存失败',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 1500
|
duration: 1500
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -259,9 +258,10 @@ class MyNeedsEdit extends Component {
|
|||||||
duration: 1000
|
duration: 1000
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
Taro.navigateTo({
|
Taro.reLaunch({
|
||||||
url: '/pages/myNeedsPublish/myNeedsPublish'
|
url: '/pages/myNeeds/myNeeds'
|
||||||
})
|
})
|
||||||
|
|
||||||
}, 1000);
|
}, 1000);
|
||||||
} else {
|
} else {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
@ -302,7 +302,7 @@ class MyNeedsEdit extends Component {
|
|||||||
this.setState({ content: event.target.value })
|
this.setState({ content: event.target.value })
|
||||||
}
|
}
|
||||||
goToMyNeedsPage() {
|
goToMyNeedsPage() {
|
||||||
Taro.switchTab({
|
Taro.reLaunch({
|
||||||
url: '/pages/myNeeds/myNeeds'
|
url: '/pages/myNeeds/myNeeds'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -315,10 +315,9 @@ class MyNeedsEdit extends Component {
|
|||||||
Taro.showLoading({
|
Taro.showLoading({
|
||||||
title: '保存中'
|
title: '保存中'
|
||||||
})
|
})
|
||||||
this.setState({ isSave: true }, () => {
|
this.setState({ isSaveAndNew: false }, () => {
|
||||||
this.uploadMyNeedsApi({})
|
this.uploadMyNeedsApi({})
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: '请填写完表格',
|
title: '请填写完表格',
|
||||||
@ -326,7 +325,6 @@ class MyNeedsEdit extends Component {
|
|||||||
duration: 1500
|
duration: 1500
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// 保存新增按钮
|
// 保存新增按钮
|
||||||
saveAndNewButton() {
|
saveAndNewButton() {
|
||||||
@ -447,7 +445,7 @@ class MyNeedsEdit extends Component {
|
|||||||
onInput={this.contactNumberChange.bind(this)}
|
onInput={this.contactNumberChange.bind(this)}
|
||||||
/></View>
|
/></View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View className='demanding-box'>
|
<View className='demanding-box'>
|
||||||
<View className='title-box'>
|
<View className='title-box'>
|
||||||
<Text className='title'>联系地址:</Text>
|
<Text className='title'>联系地址:</Text>
|
||||||
|
@ -32,11 +32,8 @@ class MyNeedsPublish extends Component {
|
|||||||
content: '',
|
content: '',
|
||||||
pickerImageUrl: [], // 上传的图片
|
pickerImageUrl: [], // 上传的图片
|
||||||
ImagesInfo: [],// 后台传回来的图片信息
|
ImagesInfo: [],// 后台传回来的图片信息
|
||||||
isPublish: false,//是否点击发布按钮
|
|
||||||
isPublishAndNew: false,//是否点击发布新增按钮
|
isPublishAndNew: false,//是否点击发布新增按钮
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,7 +61,6 @@ class MyNeedsPublish extends Component {
|
|||||||
action: 1,
|
action: 1,
|
||||||
sdInfo: JSON.stringify({
|
sdInfo: JSON.stringify({
|
||||||
class_id: this.state.industryTypeSelected.id,
|
class_id: this.state.industryTypeSelected.id,
|
||||||
|
|
||||||
sd_type: this.state.needsTypeSelected.id,
|
sd_type: this.state.needsTypeSelected.id,
|
||||||
sd_title: this.state.title,
|
sd_title: this.state.title,
|
||||||
user_name: this.state.contactName,
|
user_name: this.state.contactName,
|
||||||
@ -91,15 +87,16 @@ class MyNeedsPublish extends Component {
|
|||||||
duration: 1500
|
duration: 1500
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.state.isPublish) {
|
if (this.state.isPublishAndNew) {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: '/pages/myNeedsEdit/myNeedsEdit?id=' + res.data.sd_id
|
url: '/pages/myNeedsPublish/myNeedsPublish'
|
||||||
})
|
})
|
||||||
} else if (this.state.isPublishAndNew) {
|
} else {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: '/pages/myNeedsPublish/myNeedsPublish'
|
url: '/pages/myNeedsEdit/myNeedsEdit?id=' + res.data.sd_id
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}, 1500);
|
}, 1500);
|
||||||
})
|
})
|
||||||
@ -184,8 +181,8 @@ class MyNeedsPublish extends Component {
|
|||||||
contactNameChange(event) {
|
contactNameChange(event) {
|
||||||
this.setState({ contactName: event })
|
this.setState({ contactName: event })
|
||||||
}
|
}
|
||||||
contactNumberChange(event) {
|
contactNumberChange(e) {
|
||||||
this.setState({ contactNumber: event })
|
this.setState({ contactNumber: e.detail.value })
|
||||||
}
|
}
|
||||||
contactAddressChange(event) {
|
contactAddressChange(event) {
|
||||||
this.setState({ contactAddress: event.target.value })
|
this.setState({ contactAddress: event.target.value })
|
||||||
@ -203,7 +200,7 @@ class MyNeedsPublish extends Component {
|
|||||||
Taro.showLoading({
|
Taro.showLoading({
|
||||||
title: '发布中'
|
title: '发布中'
|
||||||
})
|
})
|
||||||
this.setState({ isPublish: true }, () => {
|
this.setState({ isPublishAndNew: false }, () => {
|
||||||
this.uploadMyNeedsApi({})
|
this.uploadMyNeedsApi({})
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -241,7 +238,7 @@ class MyNeedsPublish extends Component {
|
|||||||
|
|
||||||
}
|
}
|
||||||
goToMyNeedsPage() {
|
goToMyNeedsPage() {
|
||||||
Taro.switchTab({
|
Taro.reLaunch({
|
||||||
url: '/pages/myNeeds/myNeeds'
|
url: '/pages/myNeeds/myNeeds'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,7 @@ class MySupplyDemand extends Component {
|
|||||||
|
|
||||||
// 新增我的供求
|
// 新增我的供求
|
||||||
addDemandSupply() {
|
addDemandSupply() {
|
||||||
Taro.switchTab({
|
Taro.reLaunch({
|
||||||
url: '/pages/supplyDemandPublish/supplyDemandPublish'
|
url: '/pages/supplyDemandPublish/supplyDemandPublish'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,8 @@ class SupplyDemand extends Component {
|
|||||||
content: '',
|
content: '',
|
||||||
pickerImageUrl: [], // 上传的图片
|
pickerImageUrl: [], // 上传的图片
|
||||||
ImagesInfo: [],// 后台传回来的图片信息
|
ImagesInfo: [],// 后台传回来的图片信息
|
||||||
isPublish: false,//是否点击发布按钮
|
isPublishAndNew: false,//是否点击发布并新增按钮
|
||||||
isPublishAndNew: false,//是否点击发布新增按钮
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,29 +80,28 @@ class SupplyDemand extends Component {
|
|||||||
.then(res => {
|
.then(res => {
|
||||||
console.log('上传供求', res)
|
console.log('上传供求', res)
|
||||||
Taro.hideLoading()
|
Taro.hideLoading()
|
||||||
if (res.data.err_msg === 'success') {
|
if (res.data.err_code === 0) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: '上传成功',
|
title: res.data.err_msg == 'success' ? '上传成功' : res.data.err_msg,
|
||||||
icon: 'success',
|
icon: res.data.err_msg == 'success' ? 'success' : 'none',
|
||||||
duration: 1000
|
duration: 1000
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
console.log('this.state.isPublishAndNew', this.state.isPublishAndNew)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.state.isPublish) {
|
if (this.state.isPublishAndNew) {
|
||||||
|
Taro.reLaunch({
|
||||||
|
url: '/pages/supplyDemandPublish/supplyDemandPublish'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: '/pages/myDemandSupplyEdit/myDemandSupplyEdit?sdId=' + res.data.sd_id
|
url: '/pages/myDemandSupplyEdit/myDemandSupplyEdit?sdId=' + res.data.sd_id
|
||||||
})
|
})
|
||||||
|
|
||||||
} else if (this.state.isPublishAndNew) {
|
|
||||||
Taro.switchTab({
|
|
||||||
url: '/pages/supplyDemandPublish/supplyDemandPublish'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}, 1000);
|
}, 1000);
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: '上传失败',
|
title: res.data.err_msg,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 1500
|
duration: 1500
|
||||||
})
|
})
|
||||||
@ -206,7 +205,7 @@ class SupplyDemand extends Component {
|
|||||||
if (this.state.demandingSupplyCateSelected && this.state.title && this.state.contactName && this.state.contactNumber && this.state.content && this.state.demandingSupplyStateSelected) {
|
if (this.state.demandingSupplyCateSelected && this.state.title && this.state.contactName && this.state.contactNumber && this.state.content && this.state.demandingSupplyStateSelected) {
|
||||||
|
|
||||||
Taro.showLoading({ title: '发布中' }).then(() => {
|
Taro.showLoading({ title: '发布中' }).then(() => {
|
||||||
this.setState({ isPublish: true }, () => {
|
this.setState({ isPublishAndNew: false }, () => {
|
||||||
this.uploadDemSup({})
|
this.uploadDemSup({})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -270,12 +269,8 @@ class SupplyDemand extends Component {
|
|||||||
componentDidHide() { }
|
componentDidHide() { }
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className='supply-demand'>
|
<View className='supply-demand'>
|
||||||
|
|
||||||
|
|
||||||
<View className='page-section'>
|
<View className='page-section'>
|
||||||
<View>
|
<View>
|
||||||
<Picker mode='selector' rangeKey='name' range={this.state.demandingSupplyCate} onChange={this.demandingSupplyCate.bind(this)}>
|
<Picker mode='selector' rangeKey='name' range={this.state.demandingSupplyCate} onChange={this.demandingSupplyCate.bind(this)}>
|
||||||
|
@ -117,7 +117,7 @@ class SupplyDemandView extends Component {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
goToSDPublishPage() {
|
goToSDPublishPage() {
|
||||||
Taro.switchTab({
|
Taro.reLaunch({
|
||||||
url: '/pages/supplyDemandPublish/supplyDemandPublish',// 供求发布页面
|
url: '/pages/supplyDemandPublish/supplyDemandPublish',// 供求发布页面
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -129,10 +129,9 @@ class SupplyDemandView extends Component {
|
|||||||
|
|
||||||
}
|
}
|
||||||
goToMySDPage() {
|
goToMySDPage() {
|
||||||
Taro.switchTab({
|
Taro.reLaunch({
|
||||||
url: '/pages/mySupplyDemand/mySupplyDemand',//我的供求页面
|
url: '/pages/mySupplyDemand/mySupplyDemand',//我的供求页面
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
makeAPhoneCall(){
|
makeAPhoneCall(){
|
||||||
Taro.makePhoneCall({
|
Taro.makePhoneCall({
|
||||||
|
Loading…
Reference in New Issue
Block a user