|
|
|
@ -35,13 +35,13 @@
|
|
|
|
</u-radio-group>
|
|
|
|
</u-radio-group>
|
|
|
|
</u-form-item>
|
|
|
|
</u-form-item>
|
|
|
|
<u-form-item label="金额" label-width="150" prop="amount" :border-bottom="false">
|
|
|
|
<u-form-item label="金额" label-width="150" prop="amount" :border-bottom="false">
|
|
|
|
<u-input v-model="form.amount" type="number" placeholder="请输入金额(元)" :custom-style="inputStyle('amount')" @focus="activeInput='amount'" @blur="activeInput=null" />
|
|
|
|
<u-input v-model="form.amount" type="number" placeholder="请输入金额(万元)" :custom-style="inputStyle('amount')" @focus="activeInput='amount'" @blur="activeInput=null" />
|
|
|
|
</u-form-item>
|
|
|
|
</u-form-item>
|
|
|
|
<u-form-item label="融资阶段" label-width="150" prop="fund_stage" :border-bottom="false">
|
|
|
|
<u-form-item label="融资阶段" label-width="150" prop="fund_stage" :border-bottom="false">
|
|
|
|
<u-input v-model="form.fund_stage" placeholder="如:天使轮/A轮/B轮..." :custom-style="inputStyle('fund_stage')" @focus="activeInput='fund_stage'" @blur="activeInput=null" />
|
|
|
|
<u-input v-model="form.fund_stage" placeholder="如:天使轮/A轮/B轮..." :custom-style="inputStyle('fund_stage')" @focus="activeInput='fund_stage'" @blur="activeInput=null" />
|
|
|
|
</u-form-item>
|
|
|
|
</u-form-item>
|
|
|
|
<u-form-item label="期望资金属性" label-width="150" prop="expect_fund_attr" :border-bottom="false">
|
|
|
|
<u-form-item label="公司名称" label-width="150" prop="fund_company" :border-bottom="false">
|
|
|
|
<u-input v-model="form.expect_fund_attr" placeholder="如:国资、基金、民营等..." :custom-style="inputStyle('expect_fund_attr')" @focus="activeInput='expect_fund_attr'" @blur="activeInput=null" />
|
|
|
|
<u-input v-model="form.fund_company" placeholder="请输入公司名称" :custom-style="inputStyle('fund_company')" @focus="activeInput='fund_company'" @blur="activeInput=null" />
|
|
|
|
</u-form-item>
|
|
|
|
</u-form-item>
|
|
|
|
<u-form-item label="行业类型" label-width="150" prop="industry_type" :border-bottom="false">
|
|
|
|
<u-form-item label="行业类型" label-width="150" prop="industry_type" :border-bottom="false">
|
|
|
|
<u-input v-model="form.industry_type" placeholder="如:智能制造/生物医药..." :custom-style="inputStyle('industry_type')" @focus="activeInput='industry_type'" @blur="activeInput=null" />
|
|
|
|
<u-input v-model="form.industry_type" placeholder="如:智能制造/生物医药..." :custom-style="inputStyle('industry_type')" @focus="activeInput='industry_type'" @blur="activeInput=null" />
|
|
|
|
@ -156,7 +156,7 @@
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
<view class="footer-button">
|
|
|
|
<view class="footer-button">
|
|
|
|
<u-button type="primary" shape="circle" @click="submit">{{ form.type === 'supply' ? '发布供应' : '发布需求' }}</u-button>
|
|
|
|
<u-button type="primary" shape="circle" @click="submit">更新并发布</u-button>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 日期选择器 -->
|
|
|
|
<!-- 日期选择器 -->
|
|
|
|
@ -176,6 +176,7 @@
|
|
|
|
activeInput: null,
|
|
|
|
activeInput: null,
|
|
|
|
tagInput: '',
|
|
|
|
tagInput: '',
|
|
|
|
header: {}, // 添加header对象
|
|
|
|
header: {}, // 添加header对象
|
|
|
|
|
|
|
|
id:'',
|
|
|
|
form: {
|
|
|
|
form: {
|
|
|
|
type: 'supply', // supply or demand or finance or industry
|
|
|
|
type: 'supply', // supply or demand or finance or industry
|
|
|
|
title: '',
|
|
|
|
title: '',
|
|
|
|
@ -184,7 +185,7 @@
|
|
|
|
fund_type: '投资',
|
|
|
|
fund_type: '投资',
|
|
|
|
amount: '',
|
|
|
|
amount: '',
|
|
|
|
fund_stage: '',
|
|
|
|
fund_stage: '',
|
|
|
|
expect_fund_attr: '',
|
|
|
|
fund_company: '',
|
|
|
|
industry_type: '',
|
|
|
|
industry_type: '',
|
|
|
|
product: '',
|
|
|
|
product: '',
|
|
|
|
finance_desc: '',
|
|
|
|
finance_desc: '',
|
|
|
|
@ -197,6 +198,7 @@
|
|
|
|
expiryDate: '', // 具体日期
|
|
|
|
expiryDate: '', // 具体日期
|
|
|
|
images: [], // 图片列表
|
|
|
|
images: [], // 图片列表
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
existingFiles: [], // 已存在的文件信息(包含id和url)
|
|
|
|
showDatePicker: false,
|
|
|
|
showDatePicker: false,
|
|
|
|
dateParams: {
|
|
|
|
dateParams: {
|
|
|
|
year: true,
|
|
|
|
year: true,
|
|
|
|
@ -218,7 +220,11 @@
|
|
|
|
return placeholders[this.form.contactType]
|
|
|
|
return placeholders[this.form.contactType]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onLoad() {
|
|
|
|
onLoad(options) {
|
|
|
|
|
|
|
|
this.id = options.id;
|
|
|
|
|
|
|
|
if(this.id){
|
|
|
|
|
|
|
|
this.getDetail();
|
|
|
|
|
|
|
|
}
|
|
|
|
// 获取当前用户信息,设置默认联系人
|
|
|
|
// 获取当前用户信息,设置默认联系人
|
|
|
|
const currentUser = this.$store.state.vuex_user;
|
|
|
|
const currentUser = this.$store.state.vuex_user;
|
|
|
|
if (currentUser && currentUser.name) {
|
|
|
|
if (currentUser && currentUser.name) {
|
|
|
|
@ -258,6 +264,7 @@
|
|
|
|
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
|
|
|
|
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
|
|
|
|
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
|
|
|
|
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
|
|
|
|
success: (res) => {
|
|
|
|
success: (res) => {
|
|
|
|
|
|
|
|
// 新选择的图片添加到images数组中
|
|
|
|
this.form.images.push(...res.tempFilePaths);
|
|
|
|
this.form.images.push(...res.tempFilePaths);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
@ -302,6 +309,41 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
// 获取详情
|
|
|
|
|
|
|
|
async getDetail() {
|
|
|
|
|
|
|
|
const res = await this.$u.api.supplyDemandDetail({
|
|
|
|
|
|
|
|
id: this.id
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 映射详情数据到表单字段
|
|
|
|
|
|
|
|
this.form = {
|
|
|
|
|
|
|
|
type: res.type === 1 ? 'supply' : res.type === 2 ? 'demand' : res.type === 3 ? 'finance' : 'industry',
|
|
|
|
|
|
|
|
title: res.title || '',
|
|
|
|
|
|
|
|
description: res.content || '',
|
|
|
|
|
|
|
|
// 投融资字段映射
|
|
|
|
|
|
|
|
fund_type: res.fund_type || '投资',
|
|
|
|
|
|
|
|
amount: res.amount || '',
|
|
|
|
|
|
|
|
fund_stage: res.fund_stage || '',
|
|
|
|
|
|
|
|
fund_company: res.fund_company || '',
|
|
|
|
|
|
|
|
industry_type: res.industry_type || '',
|
|
|
|
|
|
|
|
product: res.product || '',
|
|
|
|
|
|
|
|
finance_desc: res.desc || res.content || '',
|
|
|
|
|
|
|
|
tags: res.tag ? res.tag.split(',').filter(t => t.trim()) : [],
|
|
|
|
|
|
|
|
contactType: res.wechat ? 'wechat' : res.mobile ? 'phone' : res.email ? 'email' : 'wechat',
|
|
|
|
|
|
|
|
contactValue: res.wechat || res.mobile || res.email || '',
|
|
|
|
|
|
|
|
contactName: res.contact_name || '',
|
|
|
|
|
|
|
|
publicWay: res.public_way || 1,
|
|
|
|
|
|
|
|
expiryType: res.expire_time ? 'specific' : 'longterm',
|
|
|
|
|
|
|
|
expiryDate: res.expire_time ? res.expire_time.split(' ')[0] : '',
|
|
|
|
|
|
|
|
images: res.files ? res.files.map(f => f.url) : []
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 保存已存在的文件信息
|
|
|
|
|
|
|
|
this.existingFiles = res.files ? res.files.map(f => ({
|
|
|
|
|
|
|
|
id: f.id,
|
|
|
|
|
|
|
|
url: f.url
|
|
|
|
|
|
|
|
})) : [];
|
|
|
|
|
|
|
|
},
|
|
|
|
async submit() {
|
|
|
|
async submit() {
|
|
|
|
// 表单验证
|
|
|
|
// 表单验证
|
|
|
|
if (!this.form.title.trim()) {
|
|
|
|
if (!this.form.title.trim()) {
|
|
|
|
@ -331,11 +373,19 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
// 先上传图片文件
|
|
|
|
// 处理图片文件:区分已存在的文件和新上传的文件
|
|
|
|
const fileIds = [];
|
|
|
|
const fileIds = [];
|
|
|
|
if (this.form.images.length > 0) {
|
|
|
|
if (this.form.images.length > 0) {
|
|
|
|
for (let i = 0; i < this.form.images.length; i++) {
|
|
|
|
for (let i = 0; i < this.form.images.length; i++) {
|
|
|
|
const imagePath = this.form.images[i];
|
|
|
|
const imagePath = this.form.images[i];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 检查是否是已存在的文件
|
|
|
|
|
|
|
|
const existingFile = this.existingFiles.find(f => f.url === imagePath);
|
|
|
|
|
|
|
|
if (existingFile) {
|
|
|
|
|
|
|
|
// 使用已存在文件的ID
|
|
|
|
|
|
|
|
fileIds.push(existingFile.id);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// 新上传的文件
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const uploadResult = await this.uploadImage(imagePath);
|
|
|
|
const uploadResult = await this.uploadImage(imagePath);
|
|
|
|
// 根据coursePay.vue的实现,直接使用result.id
|
|
|
|
// 根据coursePay.vue的实现,直接使用result.id
|
|
|
|
@ -351,6 +401,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 构建请求参数
|
|
|
|
// 构建请求参数
|
|
|
|
const params = {
|
|
|
|
const params = {
|
|
|
|
@ -371,7 +422,7 @@
|
|
|
|
params.fund_type = this.form.fund_type || ''
|
|
|
|
params.fund_type = this.form.fund_type || ''
|
|
|
|
params.amount = this.form.amount || ''
|
|
|
|
params.amount = this.form.amount || ''
|
|
|
|
params.fund_stage = this.form.fund_stage || ''
|
|
|
|
params.fund_stage = this.form.fund_stage || ''
|
|
|
|
params.expect_fund_attr = this.form.expect_fund_attr || ''
|
|
|
|
params.fund_company = this.form.fund_company || ''
|
|
|
|
params.industry_type = this.form.industry_type || ''
|
|
|
|
params.industry_type = this.form.industry_type || ''
|
|
|
|
params.product = this.form.product || ''
|
|
|
|
params.product = this.form.product || ''
|
|
|
|
params.desc = this.form.finance_desc || ''
|
|
|
|
params.desc = this.form.finance_desc || ''
|
|
|
|
@ -383,11 +434,15 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 调用保存接口
|
|
|
|
// 调用保存接口
|
|
|
|
|
|
|
|
if(this.id){
|
|
|
|
|
|
|
|
params.id = this.id;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
params.status = 1
|
|
|
|
const res = await this.$u.api.supplyDemandSave(params);
|
|
|
|
const res = await this.$u.api.supplyDemandSave(params);
|
|
|
|
|
|
|
|
|
|
|
|
uni.hideLoading();
|
|
|
|
uni.hideLoading();
|
|
|
|
uni.showToast({
|
|
|
|
uni.showToast({
|
|
|
|
title: '发布成功, 请等待审核',
|
|
|
|
title: this.id ? '更新成功' : '发布成功',
|
|
|
|
icon: 'success',
|
|
|
|
icon: 'success',
|
|
|
|
success: () => {
|
|
|
|
success: () => {
|
|
|
|
setTimeout(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
|