Browse Source

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

zhengnaiwen_citu 1 year ago
parent
commit
390776a980

+ 1 - 1
src/config/axios/config.js

@@ -2,7 +2,7 @@ const config = {
   /**
    * api请求基础路径
    */
-  base_url: import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL,
+  base_url: import.meta.env.VITE_BASE_URL,
   /**
    * 接口成功返回状态码
    */

+ 43 - 0
src/views/Home/personal/components/jobTypeCard.vue

@@ -0,0 +1,43 @@
+<template>
+  <div>
+    <v-navigation-drawer
+      v-model="value"
+      right absolute floating app
+      @change="drawerChange"
+    >
+      <v-list density="compact" nav>
+        <v-list-item prepend-icon="mdi-view-dashboard" title="Home" value="home"></v-list-item>
+        <v-list-item prepend-icon="mdi-forum" title="About" value="about"></v-list-item>
+      </v-list>
+    </v-navigation-drawer>
+  </div>
+</template>
+
+<script setup>
+defineOptions({ name:'personal-jobTypeCard'})
+const props = defineProps({
+  value: {
+    type: Boolean,
+    default: false
+  },
+  height: {
+    type: [String, Number],
+    default: 400
+  },
+  width: {
+    type: [String, Number],
+    default: 400
+  }
+})
+const value = props.value
+const emit = defineEmits(['update:modelValue'])
+const drawerChange = (val) => {
+  emit('update:modelValue', value)
+  console.log('val', val)
+  console.log('value', value)
+}
+
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 33 - 7
src/views/Home/personal/components/search.vue

@@ -1,34 +1,57 @@
 <template>
   <div class="search d-flex align-center">
-    <div class="jobBox d-flex pl-5">
-      <div>职位类型</div>
-      <span class="mdi mdi-chevron-down px-2" style="font-size: 18px;"></span>
+    <div style="position: relative;">
+      <div class="jobBox d-flex pl-5" :class="{'drawer': drawer}" @click="showJobTypeCard">
+        <span>职位类型</span>
+        <span class="mdi mdi-chevron-down px-2" style="font-size: 18px;"></span>
+      </div>
+      <!-- <jobTypeCard v-if="drawer" style="position: absolute; top: 42px; left: 250px; height: 300px; width: 250px;"></jobTypeCard> -->
+      <!-- <div style="position: absolute; top: 42px; left: 250px; height: 300px; width: 250px;"> -->
+      <div>
+      </div>
     </div>
     <v-text-field
       v-model="value"
       placeholder="搜索职位/公司"
       color="#00897B"
       variant="plain"
-      density="comfortable"
+      density="compact"
       :hide-details="true"
       class="px-2"
       style="height: 100%; line-height: 100%;"
     ></v-text-field>
     <div class="searchBtn">搜索</div>
+    <v-navigation-drawer
+      v-model="drawer"
+      right absolute floating app
+    >
+      <v-list density="compact" nav>
+        <v-list-item prepend-icon="mdi-view-dashboard" title="Home" value="home"></v-list-item>
+        <v-list-item prepend-icon="mdi-forum" title="About" value="about"></v-list-item>
+      </v-list>
+    </v-navigation-drawer>
   </div>
 </template>
 
 <script setup>
+// import jobTypeCard from './jobTypeCard.vue'
+
 import { ref } from 'vue';
 
 defineOptions({ name:'personal-search'})
 
 const value = ref('')
+let drawer = ref(false)
+
+const showJobTypeCard = () => {
+  drawer.value = !drawer.value
+  console.log('drawer.value', drawer.value)
+}
 </script>
 
 <style lang="scss" scoped>
 .search {
-  height: 60px;
+  height: 50px;
   width: 800px;
   margin: 16px auto 8px auto;
   border: 2px solid var(--v-primary-base);
@@ -39,11 +62,14 @@ const value = ref('')
       color: var(--v-primary-base);
     }
   }
+  .drawer {
+    color: var(--v-primary-base);
+  }
   .searchBtn {
     width: 100px;
-    height: 60px; line-height: 60px;
-    font-size: 18px;
+    height: 50px; line-height: 48px;
     text-align: center;
+    font-size: 18px;
     color: #fff;
     background-color: var(--v-primary-base);
   }

+ 4 - 14
src/views/login/index.vue

@@ -44,20 +44,18 @@
         </div>
       </div>
     </div>
-    <v-snackbar v-model="tips.show" :color="tips.color" :timeout="1500" location="top">{{ tips.text }}</v-snackbar>
   </div>
 </template>
 
 <script setup>
-import { ref, reactive } from 'vue'
+import { ref } from 'vue'
 import passwordFrom from './components/passwordPage.vue'
 import phoneFrom from '@/components/VerificationCode'
 import qrCode from './components/qrCode.vue'
 
 import { userLocaleStore } from '@/store/user'
 import { useRouter } from 'vue-router'
-// import Confirm from '@/plugins/confirm'
-// import Snackbar from '@/plugins/snackbar'
+import Snackbar from '@/plugins/snackbar'
 defineOptions({ name: 'login-index' })
 
 const router = useRouter()
@@ -76,11 +74,6 @@ const phoneRef = ref()
 const passRef = ref()
 const loginLoading = ref(false)
 const userStore = userLocaleStore()
-const tips = reactive({
-  show: false,
-  color: '',
-  text: ''
-})
 const handleLogin = async () => {
   const { valid } = tab.value === 1 ? await phoneRef.value.phoneForm.validate() : await passRef.value.passwordForm.validate()
   if (!valid) return
@@ -91,13 +84,10 @@ const handleLogin = async () => {
     } else {
       await userStore.handlePasswordLogin(passRef.value.loginData)
     }
-    tips.color = 'success'
-    tips.text = '登录成功'
-    tips.show = true
+    Snackbar.success('登录成功')
     router.push({ path: '/home' })
   } catch (error) {
-    console.log(error, 'error-login')
-    alert(error.msg)
+    Snackbar.error(error.msg)
   } finally {
     loginLoading.value = false
   }