Quellcode durchsuchen

Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner into dev

lifanagju_citu vor 9 Monaten
Ursprung
Commit
cb3dbdb5d1

+ 24 - 9
src/components/Upload/img.vue

@@ -1,6 +1,7 @@
 <template>
-  <div v-if="!src" class="upload d-flex align-center justify-center" @click="openFileInput">
-    <v-icon color="#ccc" size="50">mdi-plus</v-icon>
+  <div v-if="!src" class="upload d-flex align-center justify-center flex-column" @click="openFileInput">
+    <v-icon color="#ccc" :size="tips ? 30 : 50">mdi-plus</v-icon>
+    <div class="font-size-12 color-999">{{ tips }}</div>
     <input
       type="file"
       ref="fileInput"
@@ -9,9 +10,10 @@
       @change="handleUploadFile"
     />
   </div>
-  <div v-else style="position: relative;">
-    <v-img :src="src" width="120" height="120" rounded></v-img>
-    <v-icon color="primary" class="close" @click="handleClose">mdi-close-circle</v-icon>
+  <div v-else class="" style="position: relative;">
+    <v-icon color="error" class="close" @click="handleClose">mdi-close-circle</v-icon>
+    <v-img :src="src" width="100" height="100" rounded class="imgBox" :class="{'cursor-pointer': showCursor}" @click="handleClickImage"></v-img>
+    <div @click="handleClickImage" class="color-primary cursor-pointer text-center text-decoration-underline">点击预览</div>
   </div>
 </template>
 
@@ -23,9 +25,11 @@ import { uploadFile } from '@/api/common'
 import { useI18n } from '@/hooks/web/useI18n'
 import Snackbar from '@/plugins/snackbar'
 
-const emit = defineEmits(['success', 'delete'])
+const emit = defineEmits(['success', 'delete', 'imgClick'])
 const props = defineProps({
-  value: String
+  value: String,
+  tips: String,
+  showCursor: Boolean
 })
 
 const { t } = useI18n()
@@ -63,20 +67,31 @@ const handleClose = () => {
   src.value = ''
   emit('delete')
 }
+
+const handleClickImage = () => {
+  emit('imgClick')
+}
 </script>
 
 <style scoped lang="scss">
 .upload {
-  width: 120px;
-  height: 120px;
+  width: 100px;
+  height: 100px;
   border: 1px solid #ccc;
   border-radius: 4px;
   cursor: pointer;
 }
+.imgBox {
+  position: relative;
+  border: 1px solid #ccc;
+  border-radius: 4px;
+  padding: 5px;
+}
 .close {
   position: absolute;
   top: -10px;
   right: -10px;
   cursor: pointer;
+  z-index: 9;
 }
 </style>

+ 4 - 1
src/views/recruit/enterprise/register/inReview.vue

@@ -17,7 +17,10 @@
 
         <!-- 等待审核 -->
         <div v-else-if="applyInfo.status === '0'">
-          <span>您的申请正在审核中,审核时间在1~3个工作日内,申请结果会以短信方式通知到您的手机上,请注意查收</span>
+          <div class="d-flex flex-column align-center">
+            <svg-icon name="submit" size="300"></svg-icon>
+          </div>
+          <div>您的申请正在审核中,审核时间在1~3个工作日内,申请结果会以短信方式通知到您的手机上,请注意查收</div>
           <!-- <span>您的申请正在审核中,审核时间在1~3个工作日内,申请结果会通过邮件的方式通知到您,请注意查看邮箱</span> -->
           <div class="mt-5">
             <span>提交时间:{{ applyInfo.createTime }}</span>

+ 6 - 43
src/views/recruit/enterprise/register/register.vue

@@ -16,26 +16,10 @@
           <span class="mr-1" style="color: var(--v-error-base);">*</span>
           <span>上传营业执照</span>
           <!-- <span class="mx-3 defaultLink">查看示例</span> -->
-          <span>支持jpg、jpeg、png格式,片大小不得超过10M</span>
+          <span>支持jpg、jpeg、png格式,片大小不得超过10M</span>
         </div>
         <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 class="note mt-15">
@@ -69,7 +53,6 @@
 <script setup>
 import CtForm from '@/components/CtForm'
 import Snackbar from '@/plugins/snackbar'
-import { uploadFile } from '@/api/common'
 import { useI18n } from '@/hooks/web/useI18n'
 import { useRouter } from 'vue-router'; const router = useRouter()
 import { enterpriseRegisterApply } from '@/api/personal/user'
@@ -78,7 +61,6 @@ defineOptions({name: 'enterprise-enterpriseRegister-register'})
 const { t } = useI18n()
 const CtFormRef = ref()
 
-const fileVerify = 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('')
-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 { 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 = {}
   formItems.value.options.forEach(e => { baseInfo[e.key] = e.value })
   await enterpriseRegisterApply({ ...baseInfo, businessLicenseUrl })