Explorar o código

可发布职位数

lifanagju_citu hai 3 meses
pai
achega
60d5a4cde8
Modificáronse 2 ficheiros con 13 adicións e 9 borrados
  1. 0 1
      components/positionItem/components/extend.vue
  2. 13 8
      pages/index/position.vue

+ 0 - 1
components/positionItem/components/extend.vue

@@ -80,7 +80,6 @@ const getQuery = () => {
     major:  majorDataClone.value?.length ? majorName.value : '',
     majorId:  majorDataClone.value?.length ? majorDataClone.value.find(e => e.nameCn === majorName.value)?.id : ''
   }
-  console.log('扩展信息:', obj)
   return obj
 }
 

+ 13 - 8
pages/index/position.vue

@@ -20,9 +20,9 @@
               @confirm="onSearch"
             ></uni-search-bar>
             <!-- 可发布职位数 -->
-            <!-- <view v-if="publishJobCount" class="publishJobCountBox">
+            <view class="publishJobCountBox">
               <span>可发布职位数 <span class="color-primary">{{ publishJobCount }}</span> 个</span>
-            </view> -->
+            </view>
           </view>
           <view v-if="!positionListData?.length && more !== 'loading'" class="d-flex flex-column align-center justify-center ss-m-t-30">
             <view class="nodata-img-parent">
@@ -59,7 +59,7 @@ import { getJobAdvertisedList } from '@/api/new/position'
 import { onShow, onLoad } from '@dcloudio/uni-app'
 import { getAccessToken } from '@/utils/request'
 import { showAuthModal } from '@/hooks/useModal'
-// import { userStore } from '@/store/user'
+import { userStore } from '@/store/user'; const useUserStore = userStore()
 
 const tab = ref(1)
 
@@ -131,8 +131,16 @@ onShow(() => {
   // 设置当前tab页的下标index
   currentTabBar?.setData({ selected: 1 })
   init()
+  getPublishJobCount()
 })
 
+const publishJobCount = ref(0)
+const getPublishJobCount = async () => {
+  const info = await useUserStore.getUserInfos()
+  console.log('info:', info)
+  publishJobCount.value = info?.entitlement?.publishJobCount - 0 || 0
+}
+
 const init = () => {
   query.value.pageNo = 1
   getData()
@@ -152,13 +160,10 @@ const loadingMore = () => {
   getData()
 }
 
-// reset: 刷新列表 updatePublishJobCount: 更新可发布职位数量
-const refresh = async ({ reset = false, updatePublishJobCount = false }) => {
+// reset: 刷新列表
+const refresh = async ({ reset = false }) => {
   if (reset) query.value.pageNo = 1
   getData()
-  // if (updatePublishJobCount) {
-  //   userInfo.value = await useUserStore.getUserInfos()
-  // }
 }
 
 const handleClickAdd = () => {