Browse Source

新增提示组件,修改样式

gcz 2 years ago
parent
commit
1ea59ff9ec

+ 95 - 0
src/components/TipPopup/index.vue

@@ -0,0 +1,95 @@
+<!--
+ * @Description: 
+ * @Author: gcz
+ * @Date: 2022-08-24 10:02:16
+ * @LastEditors: gcz
+ * @LastEditTime: 2022-08-24 10:31:12
+ * @FilePath: \veterans_client_web\src\components\TipPopup\index.vue
+ * @Copyright: Copyright (c) 2016~2022 by gcz, All Rights Reserved. 
+-->
+<template>
+    <div class='tipPopup u-flex u-row-center'>
+        <div class="tip-content">
+            <img class="icon" v-if="type=='success'" src="@/assets/images/success-icon.png" alt="">
+            <div class="text">{{text}}</div>
+            <span class="btn" @click="confirm">确定</span>
+        </div>
+    </div>
+</template>
+
+<script>
+    export default {
+        name: 'TipPopup',
+        components: {},
+        props:{
+            text: {
+                type: String,
+                default: "",
+            },
+            type: {
+                type: String,
+                default: "success",
+            },
+            urlPath: {
+                type: String,
+                default: null,
+            },
+        },
+        data () {
+            return {
+                
+            };
+        },
+        created(){},
+        methods: {
+            confirm(){
+                if(this.urlPath){
+                    this.$router.push({path:this.urlPath});
+                }else{
+                    this.$router.go(-1)
+                }
+            }
+        },
+    }
+</script>
+
+<style lang='scss' scoped>
+.tipPopup{
+    position: fixed;
+    left: 0;
+    right: 0;
+    top: 0;
+    bottom: 0;
+    z-index: 99999999;
+    background: rgba(0,0,0,.5);
+    .tip-content{
+        width: 400px;
+        background: #fff;
+        padding: 24px;
+        border-radius: 8px;
+        text-align: center;
+        .icon{
+            margin-top: 24px;
+            width: 134px;
+            margin-bottom: 24px;
+        }
+        .text{
+            font-size: 20px;
+            margin-bottom: 100px;
+        }
+        .btn{
+            display: inline-block;
+            text-align: center;
+            width: 281px;
+            height: 48px;
+            line-height: 48px;
+            background: #709078;
+            border-radius: 7px;
+            letter-spacing: 1px;
+            color: #fff;
+            font-size: 20px;
+            cursor: pointer;
+        }
+    }
+}
+</style>

+ 58 - 16
src/views/CooperativeEnterprise/EnterprisePosition/EnterprisePositionIndex.vue

@@ -3,7 +3,7 @@
  * @Author: gcz
  * @Date: 2022-08-23 15:06:48
  * @LastEditors: gcz
- * @LastEditTime: 2022-08-23 17:44:18
+ * @LastEditTime: 2022-08-24 10:38:44
  * @FilePath: \veterans_client_web\src\views\CooperativeEnterprise\EnterprisePosition\EnterprisePositionIndex.vue
  * @Copyright: Copyright (c) 2016~2022 by gcz, All Rights Reserved. 
 -->
@@ -56,10 +56,13 @@
         <section class="job-details">
             <div class="title">职位描述</div>
             <div class="description ql-editor" v-html="jobDetails.description"></div>
-            <div class="submit" @click="submit">提交简历</div>
+            <div class="content-bottom">
+              <div class="submit" @click="submit">提交简历</div>
+            </div>
         </section>
       </div>
     </div>
+    <TipPopup v-if="showTipPopup" text="提交成功,等待审核" />
   </div>
 </template>
 
@@ -67,11 +70,16 @@
 import { getCompanyDetails,getJobDetails,applyJob } from "@/api/CooperativeEnterprise";
 import { parseTime } from "@/utils/utils";
 import { getDictData } from "@/api/Dict";
+import { mapState } from "vuex";
+import TipPopup from "@/components/TipPopup";
 export default {
   name: "EnterprisePositionIndex",
-  components: {},
+  components: {
+    TipPopup
+  },
   data() {
     return {
+      showTipPopup:false,
       positionId:'',
       loading: false,
       details: [], //公司详情
@@ -98,6 +106,11 @@ export default {
       return label;
     },
   },
+  computed: {
+    ...mapState({
+      userInfo: (state) => state.user.userInfo,
+    }),
+  },
   methods: {
     /**
      * 获取教育字典
@@ -167,9 +180,30 @@ export default {
       return true;
     },
     submit(){
-        applyJob({postId:this.positionId}).then(res=>{
-            this.$message.success(res.msg);
-            this.$router.go(-1);
+      let auditStatus = this.userInfo?.auditStatus;
+      switch (Number(auditStatus)){
+        case 0:
+          this.$message.warning('您的认证正在审核中,该功能需要认证后才能使用!')
+          break;
+        case 1:
+          this.$message.warning('您的认证未通过,,该功能需要认证后才能使用!')
+          break;
+        case 2:
+          this.applyJob()
+          break;
+        case 3:
+          this.$message.warning('您的认证已被撤销,该功能需要认证后才能使用!')
+          break;
+        case 9:
+          this.$message.warning('您还未进行认证,该功能需要认证后才能使用!')
+          break;
+      }   
+    },
+    applyJob(){
+      applyJob({postId:this.positionId}).then(res=>{
+          if(res.code==200){
+            this.showTipPopup = true
+          }
         })
     }
   },
@@ -183,6 +217,7 @@ export default {
 // import "quill/dist/quill.bubble.css";
 .app-main-box-content{
   min-height: calc( 100vh - 73px - 180px - 100px - 40px - 23px );
+  position: relative;
 }
 .enterprise-details{
     &-header {
@@ -252,18 +287,25 @@ export default {
     letter-spacing: 1.34px;
     margin-bottom: 15px;
   }
-  .submit{
-    margin: 30px auto 38px;
-    width: 200px;
+  .content-bottom{
+    position: static;
     height: 50px;
     line-height: 50px;
-    background: #709078;
-    font-weight: 400;
-    font-size: 20px;
-    color: #FFFFFF;
-    letter-spacing: 1.08px;
-    text-align: center;
-    cursor: pointer;;
+    margin: 30px auto 38px;
+    .submit{
+      position: absolute;
+      left: 50%;
+      margin-left: -100px;
+      bottom: 38px;
+      width: 200px;
+      background: #709078;
+      font-weight: 400;
+      font-size: 20px;
+      color: #FFFFFF;
+      letter-spacing: 1.08px;
+      text-align: center;
+      cursor: pointer;;
+    }
   }
 }