caiyunyi/pages/highwayHeadlines/investmentApplication.vue
ylj20011123 18959b7500 update
2025-11-07 18:33:55 +08:00

688 lines
18 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="application-page">
<!-- 页面标题 -->
<div class="page-header">
<div class="header-title">报名申请</div>
<div class="header-subtitle">请填写以下信息进行报名</div>
</div>
<!-- 申请表单 -->
<div class="form-section">
<!-- 商户名称 -->
<div class="form-item">
<div class="item-label">
<span class="required">*</span>
商户名称
</div>
<input class="item-input" v-model="formData.merchantName" placeholder="请输入商户名称" />
</div>
<!-- 统一社会信用代码 -->
<div class="form-item">
<div class="item-label">
<span class="required">*</span>
统一社会信用代码
</div>
<input class="item-input" v-model="formData.creditCode" placeholder="请输入18位统一社会信用代码" maxlength="18" />
</div>
<!-- 联系电话 -->
<div class="form-item">
<div class="item-label">
<span class="required">*</span>
联系电话
</div>
<input class="item-input" v-model="formData.phone" type="number" placeholder="请输入联系电话" />
</div>
<!-- 联系人 -->
<div class="form-item">
<div class="item-label">
<span class="required">*</span>
联系人姓名
</div>
<input class="item-input" v-model="formData.contactPerson" placeholder="请输入联系人姓名" />
</div>
<!-- 经营业态 -->
<div class="form-item">
<div class="item-label">
<span class="required">*</span>
经营业态
</div>
<div class="radio-group">
<div class="radio-item" v-for="(item, index) in businessTypes" :key="index"
:class="{ 'active': formData.businessType === item.value }"
@click="handleRadioChange('businessType', item.value)">
<div class="radio-icon" :class="{ 'checked': formData.businessType === item.value }"></div>
<span class="radio-text">{{ item.label }}</span>
</div>
</div>
</div>
<!-- 商家简介 -->
<div class="form-item">
<div class="item-label">商家简介</div>
<textarea class="item-textarea" v-model="formData.remarks" placeholder="请输入商家简介" :maxlength="200" />
</div>
<!-- 证照上传 -->
<div class="form-item">
<div class="item-label">
<span class="required">*</span>
证照材料上传
</div>
<div class="upload-section">
<div class="upload-grid">
<div class="upload-item" v-for="(file, index) in imgsList" :key="index">
<image class="upload-image" :src="file" @click="previewImage(index)" />
<div class="delete-btn" @click="deleteFile(index)">×</div>
</div>
<div class="upload-btn" v-if="imgsList.length < 5" @click="chooseImage">
<div class="upload-icon">+</div>
<div class="upload-text">上传证照</div>
</div>
</div>
<div class="upload-tip">支持上传营业执照法人身份证等证照材料最多5张</div>
</div>
</div>
</div>
<!-- 提交按钮 -->
<div class="action-section">
<div class="action-btn primary-btn" @click="handleSubmit">
<span class="btn-text">提交申请</span>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
formData: {
merchantName: "", // 商户名称
creditCode: "", // 统一社会信用代码
phone: "", // 联系电话
contactPerson: "", // 联系人
businessType: "", // 经营业态
remarks: "", // 备注
},
NOTICEINFO_ID: "",// 招商的id
businessTypes: [],
imgsList: [],// 附件图片
saveMsg: [],// 附件图片
};
},
onLoad(query) {
console.log('dadas', query);
if (query.NOTICEINFO_ID) {
this.NOTICEINFO_ID = query.NOTICEINFO_ID
}
this.getBusinessTypes();
},
methods: {
// 获取经营业态数据
async getBusinessTypes() {
try {
const res = await this.$api.getCoop({
action_type: 'GetEnumLable',
fieldexplainField: 'BUSINESS_TARGET',
fieldenumIndex: 4000
});
if (res && res.Data && res.Data.List) {
// 找到FIELDENUM_VALUE为'4600'的项
const targetItem = res.Data.List.find(item => item.FIELDENUM_VALUE === '4600');
if (targetItem && targetItem.fieldenumList) {
// 将fieldenumList转换为需要的格式
this.businessTypes = targetItem.fieldenumList.map(item => ({
label: item.FIELDENUM_NAME,
value: item.FIELDENUM_VALUE
}));
}
}
} catch (error) {
console.error('获取经营业态数据失败:', error);
}
},
// 选择单选项
handleRadioChange(field, value) {
this.formData[field] = value;
},
// 选择图片
chooseImage() {
const _this = this;
uni.chooseImage({
count: 5 - this.imgsList.length,
sizeType: ["compressed"],
sourceType: ["album", "camera"],
success(rs) {
let tempFilePath = rs.tempFiles
if (tempFilePath && tempFilePath.length > 0) {
for (let i = 0; i < tempFilePath.length; i++) {
uni.getImageInfo({
src: tempFilePath[i].path,
success(imgInfo) {
let quality = 100
if (imgInfo.size > 1024 * 200) {
quality = 1024 * 200 / imgInfo.size * 100
}
if (quality < 100 && tempFilePath.indexOf('.jpg') > -1) {
uni.compressImage({
// src: tempFilePath,
src: imgInfo.path,
quality: quality,
success(res) {
uni.showLoading({
title: '图片上传中...',
mask: true
})
uni.uploadFile({
url: 'https://eshangtech.com:18998/Coop.Merchant/Handler/handler_ajax.ashx?action_type=UploadFile&folder=suggestion',
// filePath: res.tempFilePath,
filePath: imgInfo.path,
name: 'data',
success(res) {
let _data = JSON.parse(res.data)
_this.imgsList.push(_data.Data.IMAGE_URL)
uni.hideLoading()
_this.noPost = true
},
fail(res) {
console.log(res)
_this.noPost = true
}
})
},
fail(error) {
console.log(error)
_this.noPost = true
}
})
} else {
uni.showLoading({
title: '图片上传中...',
mask: true
})
uni.uploadFile({
url: 'https://eshangtech.com:18998/Coop.Merchant/Handler/handler_ajax.ashx?action_type=UploadFile&folder=suggestion',
// filePath: tempFilePath,
filePath: imgInfo.path,
name: 'data',
success(res) {
let _data = JSON.parse(res.data)
_this.imgsList.push(_data.Data.IMAGE_URL)
uni.hideLoading()
_this.noPost = true
},
fail(res) {
console.log(res)
_this.noPost = true
}
})
}
},
fail(error) {
}
})
}
}
},
});
},
// 上传文件
uploadFiles(filePaths) {
// 这里可以添加实际的上传逻辑
filePaths.forEach((path) => {
this.imgsList.push({
url: path,
name: "证照材料",
});
});
},
// 删除文件
deleteFile(index) {
this.imgsList.splice(index, 1);
},
// 预览图片
previewImage(index) {
const urls = this.imgsList.map(file => file);
uni.previewImage({
current: index,
urls: urls,
});
},
// 验证表单
validateForm() {
if (!this.formData.merchantName.trim()) {
uni.showToast({
title: "请输入商户名称",
icon: "none",
});
return false;
}
if (!this.formData.creditCode.trim()) {
uni.showToast({
title: "请输入统一社会信用代码",
icon: "none",
});
return false;
}
if (this.formData.creditCode.length !== 18) {
uni.showToast({
title: "统一社会信用代码应为18位",
icon: "none",
});
return false;
}
if (!this.formData.phone.trim()) {
uni.showToast({
title: "请输入联系电话",
icon: "none",
});
return false;
}
if (!/^1[3-9]\d{9}$/.test(this.formData.phone)) {
uni.showToast({
title: "请输入正确的手机号码",
icon: "none",
});
return false;
}
if (!this.formData.contactPerson.trim()) {
uni.showToast({
title: "请输入联系人姓名",
icon: "none",
});
return false;
}
if (!this.formData.businessType) {
uni.showToast({
title: "请选择经营业态",
icon: "none",
});
return false;
}
if (this.imgsList.length === 0) {
uni.showToast({
title: "请上传证照材料",
icon: "none",
});
return false;
}
return true;
},
// 提交申请
async handleSubmit() {
if (!this.validateForm()) {
return;
}
console.log('this.formDatathis.formDatathis.formData', this.formData);
console.log('this.imgsList', this.imgsList);
if (!this.NOTICEINFO_ID) {
return
}
const req = {
NOTICEINFO_ID: this.NOTICEINFO_ID,// 招商的内码
BUSINESSMAN_NAME: this.formData.merchantName,
TAXPAYER_IDENTIFYCODE: this.formData.creditCode,
LINK_PERSON: this.formData.contactPerson,
LINK_MOBILEPHONE: this.formData.phone,
BUSINESS_PROFILE: this.formData.remarks,
MEMBERSHIP_TYPE: this.formData.businessType,// 传经营业态
RTNOTICEINFO_STATE: 1,
RTNOTICEINFO_URL: this.imgsList && this.imgsList.length > 0 ? this.imgsList.toString() : "",// 图片地址变成string
OPERATE_DATE: this.$moment.now().format("YYYY-MM-DD HH:mm:ss"),
type: 'encryption'
}
uni.showLoading({
title: '加载中...',
mask: true
});
const data = await this.$api.$posMemberPost("/MemberMessage/SynchroRTNOTICEINFO", req)
uni.hideLoading();
console.log('datadasdasdasda', data);
if (data.Result_Code === 100) {
uni.showModal({
title: "提交成功",
content: "您的报名申请已提交,我们会尽快与您联系!",
showCancel: false,
success: (res) => {
if (res.confirm) {
uni.navigateBack();
}
},
});
} else {
uni.showToast({
title: data.Result_Desc,
icon: 'none'
})
}
// uni.showLoading({
// title: "提交中...",
// mask: true,
// });
// // 模拟提交过程
// setTimeout(() => {
// uni.hideLoading();
// uni.showModal({
// title: "提交成功",
// content: "您的投资报名申请已提交,我们会尽快与您联系!",
// showCancel: false,
// success: (res) => {
// if (res.confirm) {
// uni.navigateBack();
// }
// },
// });
// }, 2000);
},
},
};
</script>
<style scoped lang="less">
.application-page {
width: 100vw;
min-height: 100vh;
background: #f8fafc;
overflow-y: scroll;
.page-header {
background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
padding: 60rpx 40rpx 40rpx;
text-align: center;
.header-title {
font-size: 30rpx;
font-weight: 600;
color: white;
margin-bottom: 12rpx;
}
.header-subtitle {
font-size: 24rpx;
color: rgba(255, 255, 255, 0.9);
}
}
.form-section {
padding: 40rpx 32rpx 24rpx;
background: white;
margin: -20rpx 32rpx 0;
border-radius: 24rpx;
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
border-bottom: 1rpx solid #f5f5f5;
margin-bottom: calc(24rpx + env(safe-area-inset-bottom) + 120rpx);
.form-item {
margin-bottom: 40rpx;
&:last-child {
margin-bottom: 0;
}
.item-label {
font-size: 24rpx;
color: #374151;
font-weight: 500;
margin-bottom: 16rpx;
display: flex;
align-items: center;
.required {
color: #ef4444;
margin-right: 4rpx;
}
}
.item-input {
width: 100%;
height: 66rpx;
padding: 0 24rpx;
border: 2rpx solid #e5e7eb;
border-radius: 16rpx;
font-size: 24rpx;
color: #374151;
background: #f9fafb;
box-sizing: border-box;
&:focus {
border-color: #22c55e;
background: white;
}
&::placeholder {
color: #9ca3af;
}
}
.item-textarea {
width: 100%;
min-height: 160rpx;
padding: 20rpx 24rpx;
border: 2rpx solid #e5e7eb;
border-radius: 16rpx;
font-size: 24rpx;
color: #374151;
background: #f9fafb;
box-sizing: border-box;
resize: none;
&:focus {
border-color: #22c55e;
background: white;
}
&::placeholder {
color: #9ca3af;
}
}
.radio-group {
display: flex;
flex-wrap: wrap;
gap: 20rpx;
.radio-item {
display: flex;
align-items: center;
padding: 16rpx 24rpx;
background: #f9fafb;
border: 2rpx solid #e5e7eb;
border-radius: 40rpx;
transition: all 0.3s ease;
.radio-icon {
width: 32rpx;
height: 32rpx;
border: 2rpx solid #d1d5db;
border-radius: 50%;
margin-right: 12rpx;
position: relative;
transition: all 0.3s ease;
&.checked {
border-color: #22c55e;
background: #22c55e;
&::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 12rpx;
height: 12rpx;
background: white;
border-radius: 50%;
}
}
}
.radio-text {
font-size: 24rpx;
color: #374151;
}
&.active {
background: #dcfce7;
border-color: #22c55e;
.radio-text {
color: #15803d;
}
}
}
}
.upload-section {
.upload-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20rpx;
margin-bottom: 16rpx;
.upload-item {
position: relative;
width: 100%;
height: 200rpx;
border-radius: 16rpx;
overflow: hidden;
.upload-image {
width: 100%;
height: 100%;
object-fit: cover;
}
.delete-btn {
position: absolute;
top: 8rpx;
right: 8rpx;
width: 40rpx;
height: 40rpx;
background: rgba(0, 0, 0, 0.6);
color: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
line-height: 1;
}
}
.upload-btn {
width: 100%;
height: 200rpx;
border: 2rpx dashed #d1d5db;
border-radius: 16rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: #f9fafb;
.upload-icon {
font-size: 48rpx;
color: #9ca3af;
margin-bottom: 8rpx;
}
.upload-text {
font-size: 24rpx;
color: #6b7280;
}
}
}
.upload-tip {
font-size: 24rpx;
color: #9ca3af;
line-height: 1.5;
}
}
}
}
.action-section {
position: fixed;
left: 0;
right: 0;
bottom: 0;
background: white;
border-top: 1rpx solid #f0f0f0;
padding: 24rpx 32rpx calc(24rpx + env(safe-area-inset-bottom));
z-index: 100;
.action-btn {
display: flex;
align-items: center;
justify-content: center;
padding: 18rpx 28rpx;
border-radius: 40rpx;
font-size: 32rpx;
font-weight: 600;
transition: all 0.3s ease;
border: 2rpx solid #e5e7eb;
&.primary-btn {
background: linear-gradient(135deg, #22c55e, #16a34a);
color: white;
border-color: #22c55e;
&:active {
opacity: 0.9;
}
.btn-text {
margin-right: 12rpx;
font-size: 26rpx;
}
.btn-icon {
font-size: 24rpx;
}
}
}
}
}
.application-page::-webkit-scrollbar {
display: none;
}
</style>