Ver Fonte

对应跳转

zhengnaiwen_citu há 8 meses atrás
pai
commit
50f15da14e
2 ficheiros alterados com 14 adições e 6 exclusões
  1. 3 3
      components/ResumeStatus/index.vue
  2. 11 3
      pagesA/recommendation/index.vue

+ 3 - 3
components/ResumeStatus/index.vue

@@ -28,7 +28,7 @@ const items = ref([])
 
 const handleTo = (item) => {
 	uni.navigateTo({
-		url: "/pagesA/recommendation/index"
+		url: `/pagesA/recommendation/index?id=${item.value}`
 	})
 }
 
@@ -44,7 +44,7 @@ async function recommendCount () {
 				count: 0
 			}
 		})
-		console.log(items)
+		// console.log(items)
 		const { data } = await getRecommendCount()
 		if (!data) {
 			return
@@ -53,7 +53,7 @@ async function recommendCount () {
 			e.count = data.find(_e => _e.key === e.value)?.value || 0
 		})
 	} catch (error) {
-		console.log(error)
+		// console.log(error)
 	}
 }
 recommendCount()

+ 11 - 3
pagesA/recommendation/index.vue

@@ -24,8 +24,11 @@ import layoutPage from '@/layout'
 import MList from './list'
 import { getDict } from '@/hooks/useDictionaries.js'
 import { getRecommendationList } from '@/api/position.js'
-	
+import { onLoad } from '@dcloudio/uni-app'
+
 const current = ref(0)
+
+// 获取参数
 const controlList = ref([])
 const controlListText = ref([])
 const pageInfo = ref({
@@ -45,7 +48,7 @@ async function initDict () {
 		}
 		controlList.value = data.data
 		controlListText.value = data.data.map(e => e.label)
-		current.value = +controlList.value[0].value
+		// current.value = +controlList.value[0].value
 		init()
 	} catch (error) {
 		// console.log(error)
@@ -94,8 +97,13 @@ async function init () {
 	}
 }
 
+onLoad(async (options) => {
+  if (options?.id) {
+    current.value = +options.id
+	}
+	initDict()
+})
 
-initDict()
 </script>
 
 <style lang="scss" scoped>