|
|
|
@ -4,17 +4,17 @@
|
|
|
|
|
<view class="form-box"> |
|
|
|
|
<form @submit="submit"> |
|
|
|
|
<view class="form-item chose-box acea-row row-between"> |
|
|
|
|
<view class="label">我是供应/需求</view> |
|
|
|
|
<view> {{form.resourceType == 1 ? '供应' : '需求'}} </view> |
|
|
|
|
<view class="label">我是{{title}}方</view> |
|
|
|
|
<view> {{title}} </view> |
|
|
|
|
</view> |
|
|
|
|
<view class="form-item"> |
|
|
|
|
<view class="label">{{form.resourceType == 1 ? '供应' : '需求'}}标题<text class="red">*</text></view> |
|
|
|
|
<view class="label">{{title}}标题<text class="red">*</text></view> |
|
|
|
|
<view class="inp-box"> |
|
|
|
|
<input type="text" :placeholder="'我' + (form.resourceType == 1 ? '供应' : '需求') + '...'" :value="form.title" name="title"> |
|
|
|
|
<input type="text" :placeholder="'我' + (title) + '...'" :value="form.title" name="title"> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="form-item"> |
|
|
|
|
<view class="label">{{form.resourceType == 1 ? '供应' : '需求'}}类型<text class="red">*</text></view> |
|
|
|
|
<view class="label">{{title}}类型<text class="red">*</text></view> |
|
|
|
|
<!-- <view class="inp-box"><input type="text" placeholder="我供应/需求..." value="{{form.resourceCagetoryId}}" name="resourceCagetoryId" /></view> --> |
|
|
|
|
<view class="inp-box acea-row-nowrap row-between row-middle"> |
|
|
|
|
<picker class="pick-box" @change="resourcesChange" :value="idx" :range="resourcesList" :range-key="'cagetoryName'" mode="selector"> |
|
|
|
@ -25,11 +25,11 @@
|
|
|
|
|
</view> |
|
|
|
|
<view class="form-item"> |
|
|
|
|
<view class="label acea-row row-between"> |
|
|
|
|
<view>{{form.resourceType == 1 ? '供应' : '需求'}}内容<text class="red">*</text></view> |
|
|
|
|
<view>{{title}}内容<text class="red">*</text></view> |
|
|
|
|
<!-- <view class="colO">看看别人怎么写></view> --> |
|
|
|
|
</view> |
|
|
|
|
<view class="area-box"> |
|
|
|
|
<textarea :placeholder="'请详细描述您的' + (form.resourceType == 1 ? '供应' : '需求')" :value="form.detailedDescription" name="detailedDescription"></textarea> |
|
|
|
|
<textarea :placeholder="'请详细描述您的' + (title)" :value="form.detailedDescription" name="detailedDescription"></textarea> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="form-item"> |
|
|
|
@ -41,7 +41,7 @@
|
|
|
|
|
</view> |
|
|
|
|
<view class="form-item"> |
|
|
|
|
<view class="label acea-row row-between"> |
|
|
|
|
<view>{{form.resourceType == 1 ? '供应' : '需求'}}预算<text class="red">*</text></view> |
|
|
|
|
<view>{{title}}预算<text class="red">*</text></view> |
|
|
|
|
<view class="tab-box acea-row "> |
|
|
|
|
<view :class="'tab-item ' + (active == 1 ? 'tab-a' : '')" data-i="1" @tap="tabClick">明确预算</view> |
|
|
|
|
<view :class="'tab-item ' + (active == 2 ? 'tab-a' : '')" data-i="2" @tap="tabClick">价格可议</view> |
|
|
|
@ -91,6 +91,7 @@ import WxValidate from '../../../utils/WxValidate.js';
|
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
title: '', |
|
|
|
|
form: { |
|
|
|
|
resourceType: 0, |
|
|
|
|
title: '', |
|
|
|
@ -120,10 +121,10 @@ export default {
|
|
|
|
|
this.getDetail(options.id); |
|
|
|
|
} |
|
|
|
|
if (options.type) { |
|
|
|
|
this.setData({//['form.resourceType']: Number(options.type) |
|
|
|
|
}); |
|
|
|
|
//try fix |
|
|
|
|
this.form.resourceType = Number(options.type); |
|
|
|
|
console.log(this.form.resourceType) |
|
|
|
|
this.title = this.form.resourceType == 1? '供应' : '需求' |
|
|
|
|
uni.setNavigationBarTitle({ title: this.title+ '发布' }) |
|
|
|
|
} |
|
|
|
|
this.initValidate(); //验证规则函数 |
|
|
|
|
|
|
|
|
@ -134,9 +135,6 @@ export default {
|
|
|
|
|
let i = e.currentTarget.dataset.i; |
|
|
|
|
|
|
|
|
|
if (i == 2) { |
|
|
|
|
this.setData({//['form.capital']: '价格可议' |
|
|
|
|
}); |
|
|
|
|
//try fix |
|
|
|
|
this.form.capital = '价格可议'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -146,9 +144,6 @@ export default {
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
capitalChange(e) { |
|
|
|
|
this.setData({//['form.capital']: e.detail.value |
|
|
|
|
}); |
|
|
|
|
//try fix |
|
|
|
|
this.form.capital = e.detail.value; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -156,26 +151,15 @@ export default {
|
|
|
|
|
console.log(e.detail.value); |
|
|
|
|
let timeArr = e.detail.value.split('-'); |
|
|
|
|
let year = Number(timeArr[0]) + 1; |
|
|
|
|
this.setData({//['form.resourceStartTime']: e.detail.value |
|
|
|
|
//['form.resourceEndTime']: year + '-' + timeArr[1] + '-' + timeArr[2] |
|
|
|
|
}); |
|
|
|
|
//try fix |
|
|
|
|
this.form.resourceEndTime = year + '-' + timeArr[1] + '-' + timeArr[2]; |
|
|
|
|
//try fix |
|
|
|
|
this.form.resourceStartTime = e.detail.value; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
endTimeChange(e) { |
|
|
|
|
this.setData({//['form.resourceEndTime']: e.detail.value |
|
|
|
|
}); |
|
|
|
|
//try fix |
|
|
|
|
this.form.resourceEndTime = e.detail.value; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
bindPickerChange(e) { |
|
|
|
|
this.setData({//['form.resourceType']: this.data.typeArr[e.detail.value] |
|
|
|
|
}); |
|
|
|
|
//try fix |
|
|
|
|
this.form.resourceType = this.typeArr[e.detail.value]; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -194,9 +178,6 @@ export default {
|
|
|
|
|
resourcesChange(e) { |
|
|
|
|
// console.log(e) |
|
|
|
|
let idx = Number(e.detail.value); |
|
|
|
|
// this.setData({//['form.resourceCagetoryId']: this.data.resourcesList[idx].id |
|
|
|
|
// resourcesIdx: idx, |
|
|
|
|
// }); |
|
|
|
|
this.resourcesIdx = idx; |
|
|
|
|
//try fix |
|
|
|
|
this.form.resourceCagetoryId = this.resourcesList[idx].id; |
|
|
|
@ -209,27 +190,12 @@ export default {
|
|
|
|
|
}).then(res => { |
|
|
|
|
if (res.data.success) { |
|
|
|
|
let data = res.data.data; |
|
|
|
|
this.setData({//['form.resourceType']: data.resourceType |
|
|
|
|
//['form.title']: data.title |
|
|
|
|
//['form.detailedDescription']: data.detailedDescription |
|
|
|
|
//['form.resourceImgs']: data.resourceImgs |
|
|
|
|
//['form.capital']: data.capital |
|
|
|
|
//['form.resourceStartTime']: data.resourceStartTime |
|
|
|
|
//['form.resourceEndTime']: data.resourceEndTime |
|
|
|
|
}); |
|
|
|
|
//try fix |
|
|
|
|
this.form.resourceEndTime = data.resourceEndTime; |
|
|
|
|
//try fix |
|
|
|
|
this.form.resourceStartTime = data.resourceStartTime; |
|
|
|
|
//try fix |
|
|
|
|
this.form.capital = data.capital; |
|
|
|
|
//try fix |
|
|
|
|
this.form.resourceImgs = data.resourceImgs; |
|
|
|
|
//try fix |
|
|
|
|
this.form.detailedDescription = data.detailedDescription; |
|
|
|
|
//try fix |
|
|
|
|
this.form.title = data.title; |
|
|
|
|
//try fix |
|
|
|
|
this.form.resourceType = data.resourceType; |
|
|
|
|
|
|
|
|
|
if (isNaN(Number(data.capital))) { |
|
|
|
@ -283,9 +249,6 @@ export default {
|
|
|
|
|
util.chooseImages2(img => { |
|
|
|
|
let imgs = this.form.resourceImgs; |
|
|
|
|
imgs.push(img); |
|
|
|
|
this.setData({//['form.resourceImgs']: imgs |
|
|
|
|
}); |
|
|
|
|
//try fix |
|
|
|
|
this.form.resourceImgs = imgs; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|