Jelajahi Sumber

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

lifanagju_citu 4 bulan lalu
induk
melakukan
fd62e96997

+ 2 - 0
.env.demo

@@ -1,5 +1,7 @@
 NODE_ENV = 'production'
 
+VITE_NODE_ENV = 'test'
+
 VITE_APP_TITLE = 门墩儿
 
 # 访问路径

+ 1 - 0
.env.localDev

@@ -1,4 +1,5 @@
 NODE_ENV = 'development'
+VITE_NODE_ENV = 'development'
 
 VITE_APP_TITLE = 门墩儿
 

+ 2 - 0
.env.production

@@ -1,5 +1,7 @@
 NODE_ENV = 'production'
 
+VITE_NODE_ENV = 'production'
+
 VITE_APP_TITLE = 门墩儿
 
 # 访问路径

+ 3 - 1
src/components/Enterprise/hotPromoted.vue

@@ -55,6 +55,7 @@ import { ref, watch, nextTick } from 'vue'
 import { timesTampChange } from '@/utils/date'
 import { formatName } from '@/utils/getText'
 import { jumpToEnterpriseDetail } from '@/utils/position'
+import { useRouter } from 'vue-router'
 
 const props = defineProps({
   items: {
@@ -63,6 +64,7 @@ const props = defineProps({
   }
 })
 
+const router = useRouter()
 const companyNameRefs = ref({})
 const isTextOverflow = ref({})
 
@@ -91,7 +93,7 @@ const desc = ['areaName', 'eduName', 'expName']
 
 // 职位详情
 const handleClickPosition = (k) => {
-  window.open(`/recruit/personal/position/details/${k.id}`)
+  router.push(`/recruit/personal/position/details/${k.id}`)
 }
 
 // 查看更多职位

+ 5 - 1
src/components/Position/item.vue

@@ -30,7 +30,7 @@
           </div>
           <div v-if="tab === 2" class="font-size-14 mb-3 text-end" style="color: #345768;">发布时间:{{ timesTampChange(item.createTime, 'Y-M-D h:m') }}</div>
         </div>
-        <div class="sub-li-bottom" @click.stop="jumpToEnterpriseDetail(item.enterpriseId, true)">
+        <div class="sub-li-bottom" @click.stop="jumpToEnterpriseDetail(item.enterpriseId, isOpenWindow)">
           <div class="user-info">
             <div class="d-flex align-center">
               <v-avatar size="35">
@@ -67,6 +67,10 @@ const props = defineProps({
   tab: {
     type: Number,
     default: 1
+  },
+  isOpenWindow: {
+    type: Boolean,
+    default: true
   }
 })
 const list = ref([])

+ 4 - 0
src/layout/company/side.vue

@@ -50,6 +50,7 @@ import enterpriseRoute from '@/router/modules/components/recruit/enterprise'
 const list = computed(() => {
   return getList(enterpriseRoute)
 })
+console.log(import.meta.env.VITE_NODE_ENV, '当前环境变量============')
 
 const info = localStorage.getItem('entBaseInfo') ? JSON.parse(localStorage.getItem('entBaseInfo')) : {}
 const getList = (arr, obj = []) => {
@@ -89,6 +90,9 @@ const getList = (arr, obj = []) => {
   if (info && Object.keys(info).length && !info?.entitlement?.personMap) obj = obj.filter(e => !e.isPersonMap)
   // 全员猎寻是否可看
   if (info && Object.keys(info).length && !info?.entitlement?.hireJob) obj = obj.filter(e => !e.hireJob)
+
+  // 生产环境隐藏门墩儿新任命
+  if (import.meta.env.VITE_NODE_ENV === 'production') obj = obj.filter(e => e.path !== '/recruit/enterprise/newlyAppointed')
   return obj
 }
 

+ 10 - 18
src/layout/personal/navBar.vue

@@ -168,31 +168,23 @@ const paths = [ // 有选中样式-路由列表
   '/recruit/personal/personalCenter/wallet', // 6
 ]
 
-const navList = [
-  // {
-  //   title: '招聘',
-  //   children: [
-  //     {
-  //       title: '门墩儿招聘',
-  //       appList: [
-  //         [{ title: '职位', path: paths[1] }, { title: '公司', path: paths[2] }]
-  //       ]
-  //     }
-  //   ]
-  // },
-  { title: '门墩儿招聘', path: '/recruit/personal/recommend', noLeaving: true },
+const navList = ref([
+  { title: '门墩儿招聘', path: '/recruit/personal/recommend' },
   { title: '门墩儿猎头', path: '/headhunting' },
   // { title: '门墩儿商城', path: '/pointsExchange' },
-  { title: '门墩儿商城', path: '/mall' },
+  { title: '门墩儿商城', path: '/pointsExchange', isEdit: true },
   { title: '火苗儿校企' },
-  // { title: '产业联合会' },
-  // { title: '数据' },
   { title: '了解门墩儿', path: '/about' }
-]
+])
+
+const mode = import.meta.env.VITE_NODE_ENV
+const mall = navList.value.find(item => item.isEdit)
+// 区分生产环境展示地址
+mall.path = mode === 'production' ? '/pointsExchange' : '/mall'
 
 const handleClick = (e, status) => {
   if (!e.path) return
-  if (status && !e.noLeaving) window.open(e.path)
+  if (status) window.open(e.path)
   else router.push(e.path)
 }
 

+ 7 - 2
src/utils/position.js

@@ -1,4 +1,4 @@
-import { reactive, ref } from 'vue'
+import { reactive, ref, nextTick } from 'vue'
 import { getDict } from '@/hooks/web/useDictionaries'
 import { getPublicRatio } from '@/api/recruit/enterprise/position'
 
@@ -120,5 +120,10 @@ export const jumpToEnterpriseDetail = async (id, isOpenWindow = false, tabKey =
 
   // 不在优选集团中跳转企业详情
   const key = tabKey ? 'recruitmentPositions' : 'briefIntroduction'
-  isOpenWindow ? window.open(`/recruit/personal/company/details/${id}?key=${key}`) : router.push(`/recruit/personal/company/details/${id}?key=${key}`)
+  if (isOpenWindow) {
+    window.open(`/recruit/personal/company/details/${id}?key=${key}`)
+  } else {
+    await router.push(`/recruit/personal/company/details/${id}?key=${key}`)
+    await nextTick()
+  }
 }

+ 2 - 0
src/views/recruit/personal/PersonalCenter/index.vue

@@ -75,6 +75,8 @@ const getList = (arr, obj = []) => {
     }
     obj.push(data)
   })
+  // 生产环境暂时不展示收货地址
+  if (import.meta.env.VITE_NODE_ENV === 'production') obj = obj.filter(e => e.path !== '/recruit/personal/personalCenter/shippingAddress')
   return obj
 }
 

+ 6 - 1
src/views/recruit/personal/PersonalCenter/tradeOrder/index.vue

@@ -16,13 +16,18 @@ import PointExchangeRecord from './dynamic/pointExchangeRecord.vue'
 import MyPrize from './dynamic/myPrize.vue'
 import { useRoute } from 'vue-router'
 
+const mode = import.meta.env.VITE_NODE_ENV
 const tab = ref(0)
-const items = shallowRef([
+const items = shallowRef(mode === 'production' ? [
+  { label: '余额充值、购买会员订单', value: 0, path: RechargeVipOrder }
+] : [
   { label: '余额充值、购买会员订单', value: 0, path: RechargeVipOrder },
   { label: '商城交易订单', value: 1, path: MallOrder },
   { label: '积分兑换记录', value: 2, path: PointExchangeRecord },
   { label: '我的奖品', value: 3, path: MyPrize }
 ])
+
+
 const route = useRoute()
 const { key } = route.query
 if (key) tab.value = Number(key)

+ 1 - 3
src/views/recruit/personal/home/components/homeJobTypeCard/index.vue

@@ -75,9 +75,7 @@
 import { getPositionTreeClick } from '@/api/common/index'
 import { getDict } from '@/hooks/web/useDictionaries'
 import { reactive, ref } from 'vue';
-import { useRouter } from 'vue-router'
 import { getWebContent } from '@/api/common'
-const router = useRouter()
 defineOptions({ name:'common-components-homepage-jobTypeCard'})
 
 // 轮播图片
@@ -96,7 +94,7 @@ getSystemWebContent()
 const handleJobClick = async (val) => {
   if (!val?.id) return
   await getPositionTreeClick({ id: val.id }) // 埋点
-  router.push(`/recruit/personal/position?positionId=${val.id}`)
+  window.open(`/recruit/personal/position?positionId=${val.id}`)
   // const obj = selectItems.value.includes(val.id)
   // if (props.isSingle) {
   //   selectItems.value = obj ? [] : [val.id]

+ 2 - 2
src/views/recruit/personal/home/components/hotJobs.vue

@@ -19,9 +19,9 @@ const router = useRouter()
 const handleClick = (item) => { 
   if (!item?.id) {
     console.log('岗位信息失效 岗位id不存在')
-    return Snackbar.warning('岗位信息失效')
+    return Snackbar.warning('岗位信息失效,请更换岗位查看详情')
   }
-  router.push({ path: '/recruit/personal/position',query: { positionId: item.id } })
+  window.open('/recruit/personal/position?positionId=' + item.id)
  }
 
 // 获取行业树形

+ 10 - 7
src/views/recruit/personal/home/components/hotPromotedPositions.vue

@@ -13,20 +13,20 @@
     </v-tabs>
     <v-window v-model="tab" class="mt-5">
       <v-window-item :value="1">
-        <PositionCard v-if="items.filter(Boolean) && items.length" :items="items" :tab="tab" @position="handlePosition" @enterprise="handleEnterprise"></PositionCard>
+        <PositionCard v-if="items.filter(Boolean) && items.length" :isOpenWindow="true" :items="items" :tab="tab" @position="handlePosition"></PositionCard>
         <Empty v-else class="mb-3" :elevation="false"></Empty>
       </v-window-item>
       <v-window-item :value="2">
-        <PositionCard v-if="items.filter(Boolean) && items.length" :items="items" :tab="tab" @position="handlePosition" @enterprise="handleEnterprise"></PositionCard>
+        <PositionCard v-if="items.filter(Boolean) && items.length" :isOpenWindow="true" :items="items" :tab="tab" @position="handlePosition"></PositionCard>
         <Empty v-else class="mb-3" :elevation="false"></Empty>
       </v-window-item>
       <v-window-item :value="3">
-        <PositionCard v-if="items.filter(Boolean) && items.length" :items="items" :tab="tab" @position="handlePosition" @enterprise="handleEnterprise"></PositionCard>
+        <PositionCard v-if="items.filter(Boolean) && items.length" :isOpenWindow="true" :items="items" :tab="tab" @position="handlePosition"></PositionCard>
         <Empty v-else class="mb-3" :elevation="false"></Empty>
       </v-window-item>
     </v-window>
     <div class="text-center mt-5" style="border-top: 1px solid #ccc; padding-top: 30px;">
-      <v-btn class="buttons btnColor" to="/recruit/personal/position">{{ $t('position.moreBtn') }}</v-btn>
+      <v-btn class="buttons btnColor" @click.stop="handleToMore">{{ $t('position.moreBtn') }}</v-btn>
     </div>
   </div>
 </template>
@@ -36,7 +36,9 @@ import PositionCard from '@/components/Position/item.vue'
 import { ref } from 'vue'
 import { getPromotedPosition, getLatestPosition, getHirePosition } from '@/api/position'
 import { dealDictArrayData } from '@/utils/position'
+import { useRouter } from 'vue-router'
 
+const router = useRouter()
 const tab = ref(1)
 const items = ref([])
 
@@ -51,10 +53,11 @@ getPositionList()
 // 职位详情
 const handlePosition = (item) => {
   if (!item.id) return
-  window.open(`/recruit/personal/position/details/${item.id}`)
+  router.push(`/recruit/personal/position/details/${item.id}`)
 }
-const handleEnterprise = (item) => {
-  window.open(`/recruit/personal/company/details/${item.enterpriseId}?key=briefIntroduction`)
+
+const handleToMore = () => {
+  window.open('/recruit/personal/position')
 }
 </script>
 

+ 5 - 1
src/views/recruit/personal/home/components/popularEnterprises.vue

@@ -9,7 +9,7 @@
     <HotPromoted v-if="items.length" class="mt-5" :items="items"></HotPromoted>
     <Empty v-else :elevation="false" class="mt-3" message="暂无精选企业"></Empty>
     <div v-if="items.length" class="text-center">
-      <v-btn class="buttons btnColor" color="primary" to="/recruit/personal/company">{{ $t('enterprise.moreBtn') }}</v-btn>
+      <v-btn class="buttons btnColor" color="primary" @click.stop="handleToMore">{{ $t('enterprise.moreBtn') }}</v-btn>
     </div>
   </div>
 </template>
@@ -33,4 +33,8 @@ const getHotEnterpriseList = async () => {
   })
 }
 getHotEnterpriseList()
+
+const handleToMore = () => {
+  window.open('/recruit/personal/company')
+}
 </script>

+ 1 - 1
src/views/recruit/personal/home/index.vue

@@ -97,7 +97,7 @@ const handleLeftClick = (val) => {
 
 const router = useRouter()
 const handleSearch = (val) => {
-  if (val) router.push(`/recruit/personal/position?content=${val}`)
+  window.open(val ? `/recruit/personal/position?content=${val}` : `/recruit/personal/position`)
 }
 
 // const store = useUserStore()