Browse Source

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

lifanagju_citu 9 months ago
parent
commit
755cf213fd

+ 2 - 2
src/api/common/index.js

@@ -83,8 +83,8 @@ export const updatePassword = async (data) => {
 
 // 重置密码
 export const resetPassword = async (data) => {
-  return await request.post({
-    url: '/admin-api/menduner/system/mde-user/update-password',
+  return await request.put({
+    url: '/app-api/menduner/system/mde-user/reset-password',
     data
   })
 }

+ 9 - 9
src/components/VerificationCode/index.vue

@@ -5,7 +5,7 @@
         <template v-slot:prepend-inner>
           <span class="d-flex">
             <v-icon icon="mdi-cellphone" size="20"></v-icon>
-            <span class="d-flex" id="menu-activator">
+            <!-- <span class="d-flex" id="menu-activator">
               <span class="phone-number">{{ currentArea }}</span>
               <v-icon size="20">mdi-chevron-down</v-icon>
             </span>
@@ -15,7 +15,7 @@
                   <v-list-item-title>{{ item.label }}</v-list-item-title>
                 </v-list-item>
               </v-list>
-            </v-menu>
+            </v-menu> -->
           </span>
         </template>
       </v-text-field>
@@ -72,13 +72,13 @@ const codeValid = ref([
 ])
 
 // 手机号区域
-const currentArea = ref('0086')
-const items = [
-  { label: '中国大陆-0086', value: '0086' }
-]
-const handleChangeCurrentArea = (e) => {
-  currentArea.value = e.value
-}
+// const currentArea = ref('0086')
+// const items = [
+//   { label: '中国大陆-0086', value: '0086' }
+// ]
+// const handleChangeCurrentArea = (e) => {
+//   currentArea.value = e.value
+// }
 
 // 获取验证码
 const showCode = ref(true)

+ 0 - 9
src/components/personalRecharge/index.vue

@@ -3,13 +3,6 @@
     <div class="resume-header" v-if="showTitle">
       <div class="resume-title">
         余额充值
-        <span
-          class="ml-2 text-decoration-underline cursor-pointer"
-          style="font-size: 13px;color: #666;"
-          @click="router.push('/recruit/personal/myWallet/myBalance')"
-        >
-          (充值记录)
-        </span>
       </div>
     </div>
     <div class="d-flex align-center mb-10 mt-5">
@@ -45,7 +38,6 @@
             <span v-if="!item.custom">¥{{ FenYuanTransform(item.payPrice) }}</span>
             <span v-else>{{ item.tip }}</span>
           </div>
-          <v-btn v-if="!item.custom" class="mt-5" size="small" color="error" variant="outlined" rounded >立即充值</v-btn>
           <div class="vip">
             <svg-icon v-if="current === (index+1)" name="diamond-active" size="50"></svg-icon>
             <svg-icon v-else name="diamond" size="50"></svg-icon>
@@ -77,7 +69,6 @@ defineProps({
 })
 
 import { useRoute } from 'vue-router'; const route = useRoute()
-import { useRouter } from 'vue-router'; const router = useRouter()
 const fullShow = ref(route.path === '/personalRecharge' ? true : false)
 
 const current = ref(0)

+ 4 - 4
src/layout/company/navBar.vue

@@ -17,7 +17,7 @@
             <v-img @click="enterpriseClick(2)" rounded width="40" height="40" :src="baseInfo?.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'" ></v-img>
             <span @click="enterpriseClick(1)" class="ml-3 commonHover">{{ baseInfo?.enterpriseAnotherName || baseInfo?.enterpriseName || '--' }}</span>
           </div>
-          <div class="ml-3 cursor-pointer border-left border-right px-3 commonHover" @click="handleLogout">我要求职</div>
+          <div class="ml-3 cursor-pointer border-left border-right px-3 commonHover" @click="router.push('/recruitHome')">我要求职</div>
           <div class="cursor-pointer border-right px-3 commonHover" @click="router.push('/recruit/enterprise/hirePosition')">全员猎聘</div>
           <div class="d-flex align-center px-3 border-right">
             <div>{{ $t('enterprise.account.remainingPoints') }}:{{ enterpriseUserAccount?.balance || 0 }}点</div>
@@ -129,9 +129,9 @@ const handleLogout = async () => {
 const enterpriseList = ref([])
 
 const menuList = ref([
-  { title: t('enterprise.account.myAccount'), icon: 'mdi-account', change: () => router.push({ path: '/recruit/enterprise/memberCenter/myAccount' }) },
-  { title: t('vipPackage.purchasePackage'), icon: 'mdi-gift-outline', change: () => window.open('/recruit/enterprise/purchasePackage') },
-  { title: t('enterprise.personalInformationSettings'), icon: 'mdi-account-cog', change: () => router.push({ path: '/recruit/enterprise/informationSettings' }) },
+  // { title: t('enterprise.account.myAccount'), icon: 'mdi-account', change: () => router.push({ path: '/recruit/enterprise/memberCenter/myAccount' }) },
+  // { title: t('vipPackage.purchasePackage'), icon: 'mdi-gift-outline', change: () => window.open('/recruit/enterprise/purchasePackage') },
+  // { title: t('enterprise.personalInformationSettings'), icon: 'mdi-account-cog', change: () => router.push({ path: '/recruit/enterprise/informationSettings' }) },
   // { title: t('setting.switchToOtherCompany'), icon: 'mdi-home-switch', hidden: enterpriseList.value?.length < 2, change: () => handleSwitchToAnotherEnterprise },
   // { title: t('enterprise.registeringNewEnterprise'), icon: 'mdi-home-plus-outline', change: () => handleRegisteringNewEnterprise },
   // { title: t('setting.switchToJobSeeker'), icon: 'mdi-swap-horizontal', change: handleLogout },

+ 7 - 6
src/layout/personal/navBar.vue

@@ -24,7 +24,7 @@
                 <defineListPage v-bind="$attrs" :title="val.title" :list="val.children" @emitClick="handleClick" :closeOnContentClick="true"></defineListPage>
               </template>
               <template v-else>
-                <span class="cursor-pointer menuList-first-title" @click="handleClick(val, true)">{{ val.title }}</span>
+                <span class="cursor-pointer menuList-first-title" :class="{'active-route' : route.path === val.path}" @click="handleClick(val, true)">{{ val.title }}</span>
               </template>
             </div>
           </div>
@@ -39,9 +39,9 @@
           <div class="d-flex align-center color-333" v-if="getToken()">
             <span class="cursor-pointer mr-5 commonHover" @click="handleSwitch">我要招聘</span>
             <span class="cursor-pointer commonHover" :class="{'active-route': routeActive === 6}" @click="router.push({ path: paths[6] })">
-              {{t('enterprise.account.accountBalances')}}:{{ userAccount?.balance && userAccount?.balance > 0 ? (userAccount?.balance / 100.0).toFixed(2) : 0 }}
+              现金:{{ userAccount?.balance && userAccount?.balance > 0 ? (userAccount?.balance / 100.0).toFixed(2) : 0 }}
             </span>
-            <span class="mr-3 ml-3 cursor-pointer commonHover" :class="{'active-route': routeActive === 7}" @click="router.push({ path: paths[7] })">{{t('resume.goldCoins')}}:{{ userAccount?.point || 0 }}</span>
+            <span class="mr-3 ml-3 cursor-pointer commonHover" :class="{'active-route': routeActive === 7}" @click="router.push({ path: paths[7] })">积分:{{ userAccount?.point || 0 }}</span>
 
             <v-menu open-on-hover>
               <template v-slot:activator="{ props }">
@@ -170,10 +170,10 @@ const navList = [
   },
   { title: '甄选', path: '/mall' },
   { title: '猎寻', path: '/headhunting' },
-  { title: '数据' },
   { title: '火苗儿' },
   { title: '联合会' },
-  { title: '了解门墩儿' },
+  { title: '数据' },
+  { title: '了解门墩儿' }
 ]
 
 const handleClick = (e, status) => {
@@ -243,7 +243,8 @@ const handleToPersonalCenter = () => {
 // 退出登录
 const handleLogout = async () => {
   await userStore.userLogout(1)
-  router.push({ path: '/recruitHome' })
+  if (route.path === '/recruitHome') location.reload()
+  else router.push({ path: '/recruitHome' })
 }
 
 const items = ref([

+ 0 - 12
src/router/modules/common.js

@@ -18,18 +18,6 @@ const common = [
       }
     ]
   },
-  {
-    path: '/mall',
-    children: [
-      {
-        path: '/mall',
-        component: () => import('@/views/mall/index'),
-        meta: {
-          title: '臻选商城'
-        }
-      }
-    ]
-  },
   {
     path: '/shareJob',
     name: 'shareJob',

+ 14 - 0
src/router/modules/recruit.js

@@ -31,6 +31,20 @@ const recruit = [
       }
     ]
   },
+  {
+    path: '/mall',
+    component: Layout,
+    children: [
+      {
+        path: '/mall',
+        component: () => import('@/views/mall/index'),
+        name: 'mall',
+        meta: {
+          title: '甄选商城'
+        }
+      }
+    ]
+  },
   {
     path: '/recruit/personal/position',
     component: Layout,

+ 4 - 1
src/views/integral/pointsManagement/components/integralShow.vue

@@ -5,7 +5,10 @@
       <div v-for="(val, i) in list" :key="i" :style="{'margin-left': val.showRules ? '0' : '200px'}">
         <div>
           <span class="ml-10 item-title">{{ val.title }}</span>
-          <span v-if="val.showRules" class="ml-2 rules cursor-pointer" @click="integralRulesClick">{{ $t('points.integralRules') }}</span>
+          <span v-if="val.showRules" class="ml-5 rules cursor-pointer" @click="integralRulesClick">
+            <v-icon>mdi-help-circle-outline</v-icon>
+            {{ $t('points.integralRules') }}
+          </span>
         </div>
         <div>
           <span v-if="val.value === 'balance'" class="ml-10 item-value">{{ accountData[val.value] && accountData[val.value] > 0 ? (accountData[val.value]) : 0 }}</span>

+ 114 - 0
src/views/login/components/editPassword.vue

@@ -0,0 +1,114 @@
+<template>
+  <div>
+    <PhonePage ref="phoneRef" style="width: 370px;" :phone="phone" :phoneDisabled="phone ? true : false"></PhonePage>
+    <v-form ref="passwordRef" style="width: 370px;">
+      <v-text-field
+        v-model="query.password"
+        placeholder="请输入新密码" 
+        variant="outlined" 
+        density="compact"
+        color="primary"
+        prepend-inner-icon="mdi-lock-outline" 
+        :append-inner-icon="passwordType ? 'mdi-eye-outline' : 'mdi-eye-off-outline'"
+        :type="passwordType ? 'text' : 'password'"
+        :rules="[v=> !!v || '请填写新密码', validPassword]"
+        @click:append-inner="passwordType = !passwordType"
+      ></v-text-field>
+      <v-text-field
+        v-model="query.checkPassword"
+        placeholder="请再次输入新密码" 
+        variant="outlined" 
+        density="compact"
+        color="primary"
+        prepend-inner-icon="mdi-lock-outline" 
+        :append-inner-icon="show ? 'mdi-eye-outline' : 'mdi-eye-off-outline'"
+        :type="show ? 'text' : 'password'"
+        :rules="[v=> !!v || '请再次输入新密码', passwordCheck]"
+        @click:append-inner="show = !show"
+      ></v-text-field>
+    </v-form>
+    <div class="text-center mt-5">
+      <v-btn v-if="showCancelBtn" class="mr-5" color="primary" variant="outlined" @click="handleClose">取 消</v-btn>
+      <v-btn color="primary" :max-width="showCancelBtn ? 370 : 95" :min-width="showCancelBtn ? 95 : 370" @click="handleSubmit" :loading="loading">确认修改</v-btn>
+    </div>
+  </div>
+</template>
+
+<script setup>
+defineOptions({ name: 'editPasswordCommonPage'})
+import { ref, reactive, computed } from 'vue'
+import PhonePage from '@/components/VerificationCode'
+import { updatePassword, resetPassword } from '@/api/common/index'
+import Snackbar from '@/plugins/snackbar'
+
+const emit = defineEmits(['cancel'])
+const props = defineProps({
+  phone: {
+    type: String,
+    default: ''
+  },
+  showCancelBtn: {
+    type: Boolean,
+    default: true
+  },
+  isReset: {
+    type: Boolean,
+    default: false
+  }
+})
+
+let query = reactive({
+  password: '',
+  checkPassword: ''
+})
+const passwordRef = ref(false)
+const show = ref(false)
+const loading = ref(false)
+const passwordType = ref(false)
+const phoneRef = ref()
+
+// 密码效验
+const regex = /^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,16}$/
+const validPassword = computed(() => {
+  return regex.test(query.password) || '请输入8-16位数由数字、大小写字母组成的密码'
+})
+const passwordCheck = computed(() => {
+  return (query.checkPassword === query.password && regex.test(query.checkPassword)) || '两次密码输入不一致'
+})
+
+
+const handleClose = () => {
+  query = {
+    password: '',
+    checkPassword: ''
+  }
+  passwordType.value = false
+  loading.value = false
+  emit('cancel')
+}
+
+// 修改
+const handleSubmit = async () => {
+  const passwordValid = await passwordRef.value.validate()
+  const phoneValid = await phoneRef.value.phoneForm.validate()
+  if (!passwordValid.valid || !phoneValid.valid) return
+  const data = {
+    password: query.password,
+    code: phoneRef.value.loginData.code
+  }
+  // 重置密码需要手机号
+  if (props.isReset) data.phone = phoneRef.value.loginData.phone
+  loading.value = true
+  const api = props.isReset ? resetPassword : updatePassword
+  try {
+    await api(data)
+    Snackbar.success('修改成功')
+  } finally {
+    loading.value = false
+    handleClose()
+  }
+}
+</script>
+
+<style scoped lang="scss">
+</style>

+ 1 - 1
src/views/login/components/passwordPage.vue

@@ -73,7 +73,7 @@ const loginData = reactive({
 // 设置默认账号密码便于开发快捷登录
 if (window.location.hostname === 'localhost' || window.location.hostname === '192.168.3.152') {
   loginData.phone = '13229740092'
-  loginData.password = 'Citu123'
+  loginData.password = 'Citu123456'
 }
 
 const passwordForm = ref()

+ 8 - 7
src/views/login/forgotPassword.vue

@@ -1,19 +1,20 @@
 <template>
   <div class="box">
     <div class="content pa-10">
-      找回密码
+      <div class="resume-header">
+        <div class="resume-title">修改密码</div>
+      </div>
+      <editPasswordPage class="mt-5" :showCancelBtn="false" :isReset="true" @cancel="router.push('/login')"></editPasswordPage>
     </div>
   </div>
 </template>
 
 <script setup>
 defineOptions({ name: 'forgotPassword'})
-// import { ref } from 'vue'
-// import { useRouter } from 'vue-router'
-// import Snackbar from '@/plugins/snackbar'
+import { useRouter } from 'vue-router'
+import editPasswordPage from '@/views/login/components/editPassword.vue'
 
-// const router = useRouter()
-// const loading = ref(false)
+const router = useRouter()
 </script>
 
 <style scoped lang="scss">
@@ -30,7 +31,7 @@ defineOptions({ name: 'forgotPassword'})
   left: 50%;
   translate: -50% -50%;
   width: 450px;
-  height: 400px;
+  height: 450px;
   background-color: #fff;
   border-radius: 10px;
 }

+ 10 - 110
src/views/recruit/personal/accountSettings/dynamic/editPassword.vue

@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div style="position: relative; width: 100%; height: 100%;">
     <h3>{{ $t('setting.editPassword') }}</h3>
     <v-divider class="mb-4"></v-divider>
     <div v-if="!showEdit" class="login-user mb-4">
@@ -7,124 +7,18 @@
       <span>{{ userInfo.phone }}</span>
       <span class="color-primary ml-5 text-decoration-underline cursor-pointer" @click="showEdit = true">修改密码</span>
     </div>
-    <v-stepper v-if="showEdit" v-model="stepper" color="primary">
-      <v-stepper-header>
-        <v-stepper-item title="手机验证" value="1"></v-stepper-item>
-        <v-divider></v-divider>
-        <v-stepper-item title="修改密码" value="2"></v-stepper-item>
-      </v-stepper-header>
-      <v-stepper-window>
-        <v-stepper-window-item value="1">
-          <div class="d-flex justify-center">
-            <PhonePage ref="phoneRef" style="width: 300px;" :phone="userInfo.phone" :phoneDisabled="true"></PhonePage>
-          </div>
-          <div class="text-center mt-5">
-            <v-btn class="buttons" color="primary" @click="handleValidate">立即验证</v-btn>
-          </div>
-          <div class="text-end">
-            <v-btn color="primary" variant="outlined" @click="handleClose">取 消</v-btn>
-          </div>
-        </v-stepper-window-item>
-        <v-stepper-window-item value="2">
-          <div class="d-flex justify-center">
-            <v-form ref="passwordRef" style="width: 300px;">
-              <v-text-field
-                v-model="query.password"
-                placeholder="请输入新密码" 
-                variant="outlined" 
-                density="compact"
-                color="primary"
-                prepend-inner-icon="mdi-lock-outline" 
-                :append-inner-icon="passwordType ? 'mdi-eye-outline' : 'mdi-eye-off-outline'"
-                :type="passwordType ? 'text' : 'password'"
-                :rules="[v=> !!v || '请填写新密码', validPassword]"
-                @click:append-inner="passwordType = !passwordType"
-              ></v-text-field>
-              <v-text-field
-                v-model="query.checkPassword"
-                placeholder="请再次输入新密码" 
-                variant="outlined" 
-                density="compact"
-                color="primary"
-                prepend-inner-icon="mdi-lock-outline" 
-                :append-inner-icon="show ? 'mdi-eye-outline' : 'mdi-eye-off-outline'"
-                :type="show ? 'text' : 'password'"
-                :rules="[v=> !!v || '请再次输入新密码', passwordCheck]"
-                @click:append-inner="show = !show"
-              ></v-text-field>
-            </v-form>
-          </div>
-          <div class="text-center mt-5">
-            <v-btn class="buttons" color="primary" @click="handleSubmit" :loading="loading">确认修改</v-btn>
-          </div>
-          <div class="text-end">
-            <v-btn color="primary" variant="outlined" @click="handleClose">取 消</v-btn>
-          </div>
-        </v-stepper-window-item>
-      </v-stepper-window>
-    </v-stepper>
+    <editPasswordPage v-if="showEdit" :phone="userInfo.phone" @cancel="showEdit = false" class="editPage"></editPasswordPage>
   </div>
 </template>
 
 <script setup name="editPassword">
-import PhonePage from '@/components/VerificationCode'
-import { updatePassword } from '@/api/common/index'
-import { ref, reactive, computed } from 'vue'
-import Snackbar from '@/plugins/snackbar'
+import { ref } from 'vue'
+import editPasswordPage from '@/views/login/components/editPassword.vue'
 
-const phoneRef = ref()
-const passwordRef = ref()
-const passwordType = ref(false)
-const show = ref(false)
-const loading = ref(false)
-const stepper = ref('1')
 const showEdit = ref(false)
-let query = reactive({
-  password: '',
-  checkPassword: ''
-})
-
-const handleClose = () => {
-  showEdit.value = false
-  query = {
-    password: '',
-    checkPassword: ''
-  }
-  stepper.value = '1'
-  passwordType.value = false
-  loading.value = false
-}
-
-// 密码效验
-const regex = /^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{4,10}$/
-const validPassword = computed(() => {
-  return regex.test(query.password) || '请输入4-10位数由数字、大小写字母组成的密码'
-})
-const passwordCheck = computed(() => {
-  return (query.checkPassword === query.password && regex.test(query.checkPassword)) || '两次密码输入不一致'
-})
 
 // 当前登录的用户信息
 const userInfo = JSON.parse(localStorage.getItem('userInfo'))
-
-const handleSubmit = async () => {
-  const { valid} = await passwordRef.value.validate()
-  if (!valid) return
-  loading.value = true
-  try {
-    await updatePassword({ password: query.password, code: phoneRef.value.loginData.code })
-    Snackbar.success('修改成功')
-  } finally {
-    loading.value = false
-    showEdit.value = false
-  }
-}
-
-const handleValidate = async () => {
-  const { valid } = await phoneRef.value.phoneForm.validate()
-  if (!valid) return
-  stepper.value = '2'
-}
 </script>
 
 <style lang="scss" scoped>
@@ -138,4 +32,10 @@ h3 {
   color: var(--color-666);
   font-weight: 600;
 }
+.editPage {
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+}
 </style>

+ 3 - 3
src/views/recruit/personal/accountSettings/index.vue

@@ -28,10 +28,10 @@ import { useI18n } from '@/hooks/web/useI18n'
 const { t } = useI18n()
 
 const items = [
-  { title: t('setting.accountBinding'), path: '/recruit/personal/accountSettings/accountBinding', },
-  { title: t('setting.realNameAuthentication'), path: '/recruit/personal/accountSettings/realAuthentication', },
+  // { title: t('setting.accountBinding'), path: '/recruit/personal/accountSettings/accountBinding', },
+  // { title: t('setting.realNameAuthentication'), path: '/recruit/personal/accountSettings/realAuthentication', },
   { title: t('setting.editPassword'), path: '/recruit/personal/accountSettings/editPassword', },
-  { title: t('setting.privacyPolicySettings'), path: '/recruit/personal/accountSettings/privacySettings' }
+  // { title: t('setting.privacyPolicySettings'), path: '/recruit/personal/accountSettings/privacySettings' }
 ]
 </script>
 

+ 1 - 7
src/views/recruit/personal/taskCenter/components/daily.vue

@@ -9,13 +9,7 @@
           <svg-icon class="mx-1" name="integral" size="24"></svg-icon>
           <span style="color: #10897bad;">{{ item.奖励积分数 }}</span>
         </div>
-        <v-btn
-          class="half-button"
-          :disabled="item.状态"
-          :color="item.状态 ? '' : 'primary'"
-        >
-          {{ item.状态 ? '已完成' : '未完成' }}
-        </v-btn>
+        <v-chip label :color="item.状态 ? 'success' : 'error'">{{ item.状态 ? '已完成' : '未完成' }}</v-chip>
       </div>
     </div>
   </div>

+ 1 - 10
src/views/recruit/personal/taskCenter/components/signIn.vue

@@ -2,11 +2,7 @@
 <template>
   <div>
     <integralShow ref="integralRef"></integralShow>
-    <div class="text-end signInRecord mt-3" @click="handleRecord">
-      {{ $t('taskCenter.signInRecord') }}
-      <v-icon>mdi-chevron-right</v-icon>
-    </div>
-    <div class="d-flex justify-center mt-3">
+    <div class="d-flex justify-center mt-10">
       <div v-for="(item, index) in configList" :key="'signInKey' + index" >
         <div
           class="borderRadius-5 mx-5 py-3 px-4"
@@ -90,11 +86,6 @@ const handleSignIn = async () => {
     await userStore.getUserAccountInfo()
   }, 1000)
 }
-
-const handleRecord = () => {
-  window.open('/recruit/personal/myWallet')
-}
-
 </script>
 
 <style lang="scss" scoped>

+ 1 - 7
src/views/recruit/personal/taskCenter/components/suggest.vue

@@ -9,13 +9,7 @@
           <svg-icon class="mx-1" name="integral" size="24"></svg-icon>
           <span style="color: #10897bad;">{{ item.奖励积分数 }}</span>
         </div>
-        <v-btn
-          class="half-button"
-          :disabled="item.状态"
-          :color="item.状态 ? '' : 'primary'"
-        >
-          {{ item.状态 ? '已完成' : '未完成' }}
-        </v-btn>
+        <v-chip label :color="item.状态 ? 'success' : 'error'">{{ item.状态 ? '已完成' : '未完成' }}</v-chip>
       </div>
     </div>
   </div>