|
@@ -16,26 +16,10 @@
|
|
<span class="mr-1" style="color: var(--v-error-base);">*</span>
|
|
<span class="mr-1" style="color: var(--v-error-base);">*</span>
|
|
<span>上传营业执照</span>
|
|
<span>上传营业执照</span>
|
|
<!-- <span class="mx-3 defaultLink">查看示例</span> -->
|
|
<!-- <span class="mx-3 defaultLink">查看示例</span> -->
|
|
- <span>支持jpg、jpeg、png格式,照片大小不得超过10M</span>
|
|
|
|
|
|
+ <span>支持jpg、jpeg、png格式,图片大小不得超过10M</span>
|
|
</div>
|
|
</div>
|
|
<div class="file-box">
|
|
<div class="file-box">
|
|
- <div class="file-item cursor-pointer" v-if="licenseUrl" >
|
|
|
|
- <v-img width="100%" height="100%" :src="licenseUrl"></v-img>
|
|
|
|
- <div @click="showPreview = !showPreview" class="color-primary cursor-pointer text-center my-3 text-decoration-underline">点击预览</div>
|
|
|
|
- </div>
|
|
|
|
- <div class="file-item file-input-box" :class="{'verifyAct': fileVerify}" @click="openFileInput">
|
|
|
|
- <div class="icon text-center">
|
|
|
|
- <span class="mdi mdi-plus" style="font-size: 20px;"></span>
|
|
|
|
- <div style="font-size: 12px; ">上传照片</div>
|
|
|
|
- </div>
|
|
|
|
- <input
|
|
|
|
- type="file"
|
|
|
|
- ref="fileInput"
|
|
|
|
- accept="image/png, image/jpg, image/jpeg"
|
|
|
|
- style="display: none;"
|
|
|
|
- @change="handleUploadFile"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
|
|
+ <Img class="mt-3" :value="licenseUrl" tips="上传图片" @imgClick="showPreview = !showPreview" :showCursor="true" @success="val => licenseUrl = val" @delete="licenseUrl = ''"></Img>
|
|
</div>
|
|
</div>
|
|
<!-- 注意事项 -->
|
|
<!-- 注意事项 -->
|
|
<div class="note mt-15">
|
|
<div class="note mt-15">
|
|
@@ -69,7 +53,6 @@
|
|
<script setup>
|
|
<script setup>
|
|
import CtForm from '@/components/CtForm'
|
|
import CtForm from '@/components/CtForm'
|
|
import Snackbar from '@/plugins/snackbar'
|
|
import Snackbar from '@/plugins/snackbar'
|
|
-import { uploadFile } from '@/api/common'
|
|
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
import { useRouter } from 'vue-router'; const router = useRouter()
|
|
import { useRouter } from 'vue-router'; const router = useRouter()
|
|
import { enterpriseRegisterApply } from '@/api/personal/user'
|
|
import { enterpriseRegisterApply } from '@/api/personal/user'
|
|
@@ -78,7 +61,6 @@ defineOptions({name: 'enterprise-enterpriseRegister-register'})
|
|
const { t } = useI18n()
|
|
const { t } = useI18n()
|
|
const CtFormRef = ref()
|
|
const CtFormRef = ref()
|
|
|
|
|
|
-const fileVerify = ref(false)
|
|
|
|
const loginLoading = ref(false)
|
|
const loginLoading = ref(false)
|
|
|
|
|
|
// 图片预览
|
|
// 图片预览
|
|
@@ -127,34 +109,15 @@ const formItems = ref({
|
|
]
|
|
]
|
|
})
|
|
})
|
|
|
|
|
|
-// 选择文件
|
|
|
|
-const fileInput = ref()
|
|
|
|
-const clicked = ref(false)
|
|
|
|
-const openFileInput = () => {
|
|
|
|
- if (clicked.value) return
|
|
|
|
- clicked.value = true
|
|
|
|
- fileInput.value.click()
|
|
|
|
- clicked.value = false
|
|
|
|
-}
|
|
|
|
// 上传
|
|
// 上传
|
|
let licenseUrl = ref('')
|
|
let licenseUrl = ref('')
|
|
-const handleUploadFile = async (e) => {
|
|
|
|
- const file = e.target.files[0]
|
|
|
|
- const formData = new FormData()
|
|
|
|
- formData.append('file', file)
|
|
|
|
- const { data } = await uploadFile(formData)
|
|
|
|
- if (!data) return
|
|
|
|
- licenseUrl.value = data
|
|
|
|
- fileVerify.value = false
|
|
|
|
- // console.log('uploadFile->data', data)
|
|
|
|
- Snackbar.success(t('common.uploadSucMsg'))
|
|
|
|
-}
|
|
|
|
|
|
+
|
|
// 提交 企业注册
|
|
// 提交 企业注册
|
|
const handleCommit = async () => {
|
|
const handleCommit = async () => {
|
|
- // 广州辞图科技有限公司
|
|
|
|
const { valid } = await CtFormRef.value.formRef.validate()
|
|
const { valid } = await CtFormRef.value.formRef.validate()
|
|
- const businessLicenseUrl = licenseUrl.value; if (!businessLicenseUrl) fileVerify.value = true
|
|
|
|
- if (!valid || !businessLicenseUrl) return
|
|
|
|
|
|
+ if (!valid) return
|
|
|
|
+ const businessLicenseUrl = licenseUrl.value;
|
|
|
|
+ if (!businessLicenseUrl) return Snackbar.warning('请上传营业执照图片')
|
|
const baseInfo = {}
|
|
const baseInfo = {}
|
|
formItems.value.options.forEach(e => { baseInfo[e.key] = e.value })
|
|
formItems.value.options.forEach(e => { baseInfo[e.key] = e.value })
|
|
await enterpriseRegisterApply({ ...baseInfo, businessLicenseUrl })
|
|
await enterpriseRegisterApply({ ...baseInfo, businessLicenseUrl })
|