|
@@ -2,10 +2,10 @@
|
|
|
<view class="content">
|
|
|
<view class="content1">
|
|
|
<view class="top">
|
|
|
- <textarea v-model="dataObj.publishingContent" placeholder="请发布粮食类商品交易信息,建议包含联系方" maxlength='200'
|
|
|
+ <textarea v-model="dataObj.publishingContent" placeholder="请发布粮食类商品交易信息,建议包含联系方" maxlength='2000'
|
|
|
placeholder-class='placeholder-class' class="textarea" />
|
|
|
<view class="number">
|
|
|
- {{dataObj.publishingContent.length}}/200个字
|
|
|
+ {{dataObj.publishingContent.length}}/2000个字
|
|
|
</view>
|
|
|
</view>
|
|
|
<view style="padding-left: 10rpx;">
|
|
@@ -25,8 +25,8 @@
|
|
|
</u-radio>
|
|
|
</u-radio-group>
|
|
|
</u-cell-item>
|
|
|
- <u-cell-item title="交易地" :title-style="titleStyle">
|
|
|
- <selectAddress @selectAddress='selectAddress' series='3' :textStyle='textStyle'></selectAddress>
|
|
|
+ <u-cell-item :title="dataObj.tranType=='采购'?'交易地':'货源地'" :title-style="titleStyle">
|
|
|
+ <selectAddress forbid='false' :placeHolder='dataObj.tranType=="采购"?"选择交货地区":"选择货源地区"' @selectAddress='selectAddress' series='3' :textStyle='textStyle'></selectAddress>
|
|
|
</u-cell-item>
|
|
|
<u-cell-item title="发布者昵称" :title-style="titleStyle" :border-bottom='false' @click="editNicknamee">
|
|
|
<view :style='textStyle'>
|
|
@@ -106,6 +106,11 @@
|
|
|
this.dataObj.userId = this.userInfo.id
|
|
|
this.dataObj.publisher = this.userInfo.wechatNo
|
|
|
},
|
|
|
+ onShow() {
|
|
|
+ if(uni.getStorageSync('placeDelivery')){
|
|
|
+ this.dataObj.placeDelivery=uni.getStorageSync('placeDelivery')
|
|
|
+ }
|
|
|
+ },
|
|
|
onNavigationBarButtonTap(e) {
|
|
|
console.log(e)
|
|
|
uni.navigateTo({
|
|
@@ -183,6 +188,46 @@
|
|
|
this.showNickname = true
|
|
|
},
|
|
|
submit() {
|
|
|
+ if(!this.dataObj.publishingContent&&this.imgList.length==0){
|
|
|
+ uni.showToast({
|
|
|
+ title: "发布内容不能为空!",
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(this.dataObj.publishingContent.length>2000){
|
|
|
+ uni.showToast({
|
|
|
+ title: "交易信息字数不超过2000字!",
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.dataObj.publisher){
|
|
|
+ uni.showToast({
|
|
|
+ title: "昵称不能为空!",
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.dataObj.placeDelivery&&this.dataObj.tranType=='采购'){
|
|
|
+ uni.showToast({
|
|
|
+ title: "交易地不能为空!",
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.dataObj.placeDelivery&&this.dataObj.tranType=='销售'){
|
|
|
+ uni.showToast({
|
|
|
+ title: "货源地不能为空!",
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
uni.showLoading({
|
|
|
title: '数据加载中',
|
|
|
mask: true
|
|
@@ -193,6 +238,7 @@
|
|
|
this.$api.doRequest('post', '/transactionExchangeInfo/addInfo', this.dataObj).then(res => {
|
|
|
console.log(res)
|
|
|
if (res.data.code == 200) {
|
|
|
+ uni.setStorageSync('placeDelivery',this.dataObj.placeDelivery)
|
|
|
uni.navigateBack({
|
|
|
delta: 1
|
|
|
})
|