Pārlūkot izejas kodu

skill result - api fit

abpcoder 4 dienas atpakaļ
vecāks
revīzija
e65145ea63

+ 5 - 1
src/api/modules/university.ts

@@ -1,6 +1,6 @@
 import {ApiResponse, ApiResponseList} from "@/types";
 import flyio from "../flyio";
-import {University, UniversityTier} from "@/types/university";
+import {University, UniversityDetail, UniversityTier} from "@/types/university";
 import {sleep} from "@/uni_modules/uv-ui-tools/libs/function";
 
 // 院校库 01 院校列表
@@ -435,6 +435,10 @@ export function universityListByTier() {
     return flyio.get('/front/university/listByTier') as Promise<ApiResponse<UniversityTier[]>>
 }
 
+export function universityDetail(params: any) {
+    return flyio.get('/front/university/detail', params) as Promise<ApiResponse<UniversityDetail>>
+}
+
 /**
  * 获取院校列表
  * @param params

+ 3 - 0
src/api/modules/voluntary.ts

@@ -76,6 +76,7 @@ export function getSkillRules(um: SelectedUniversityMajor) {
             category: '文化素质',
             content: '语数物300分',
             details: [{
+                defaultValue: 67,
                 enumInputType: 'Score',
                 enumRuleCategory: 'Enroll',
                 fieldName: '语',
@@ -83,6 +84,7 @@ export function getSkillRules(um: SelectedUniversityMajor) {
                 options: ['100'],
                 readonly: false,
             }, {
+                defaultValue: 78,
                 enumInputType: 'Score',
                 enumRuleCategory: 'Enroll',
                 fieldName: '数',
@@ -90,6 +92,7 @@ export function getSkillRules(um: SelectedUniversityMajor) {
                 options: ['100'],
                 readonly: false,
             }, {
+                defaultValue: 90,
                 enumInputType: 'Score',
                 enumRuleCategory: 'Enroll',
                 fieldName: '物',

+ 52 - 0
src/pagesOther/pages/skill/result/components/skill-result.vue

@@ -0,0 +1,52 @@
+<template>
+    <view class="mt-28 p-28 rounded-xl bg-white">
+        <voluntary-result-title title="测算结果">
+            <template #right>
+                <view class="w-fit text-23 text-primary border border-solid border-primary rounded-4 px-10 py-4">
+                    {{ target.majorName }}
+                </view>
+            </template>
+        </voluntary-result-title>
+        <view v-if="target.majorGroup" class="text-23 text-fore-title mt-20">
+            专业组:
+            <text class="text-primary">{{ target.majorGroup }}</text>
+        </view>
+        <view class="mt-28 bg-primary-100 p-28 rounded-lg text-24 leading-38 text-fore-title
+        flex justify-between items-center gap-20">
+            <view class="flex-1">
+                根据
+                <text class="text-primary">{{ skill.year }}</text>
+                年该校录取情况,预估考取本专业需要职业技能分:
+            </view>
+            <view class="flex flex-col items-center">
+                <view>
+                    <text class="text-42 text-primary-dark font-bold">{{ skill.skillScore }}</text>
+                    分
+                </view>
+            </view>
+        </view>
+        <view class="text-23 text-fore-title mt-28">
+            录取规则:
+            <view class="mt-10 bg-back-light p-28 rounded-lg text-24 leading-38 text-primary">
+                {{mergedRules}}
+            </view>
+        </view>
+    </view>
+</template>
+
+<script setup lang="ts">
+import VoluntaryResultTitle from "@/pagesOther/pages/voluntary/result/components/plus/voluntary-result-title.vue";
+import {VOLUNTARY_RESULT, VOLUNTARY_RULES, VOLUNTARY_TARGET} from "@/types/injectionSymbols";
+import {SelectedUniversityMajor, VoluntaryResult, VoluntaryResultSkill} from "@/types/voluntary";
+
+const target = inject(VOLUNTARY_TARGET) || ref({} as SelectedUniversityMajor)
+const result = inject(VOLUNTARY_RESULT) || ref({} as VoluntaryResult)
+const rules = inject(VOLUNTARY_RULES) || ref([])
+const skill = computed(() => result?.value.skill || {} as VoluntaryResultSkill)
+const mergedRules = computed(() => rules.value.map(r => r.content).join(' + '))
+
+</script>
+
+<style scoped>
+
+</style>

+ 18 - 6
src/pagesOther/pages/skill/result/result.vue

@@ -3,7 +3,12 @@
         <ie-navbar title="测职业技能分"/>
         <ie-image is-oss src="/volunteer/skill/index/bg.png" custom-class="w-full h-600 absolute"/>
         <view class="p-28 z-2">
-            <voluntary-form-major custom-class="bg-white !mt-0"/>
+            <view class="rounded-xl overflow-hidden">
+                <college-item :item="target.info" hidden-star reverse/>
+                <uv-line/>
+                <college-summary :college="target.info"/>
+            </view>
+            <skill-result />
         </view>
         <ie-safe-toolbar :height="84" :shadow="false">
             <view class="px-30 py-16">
@@ -15,21 +20,28 @@
 
 <script setup lang="ts">
 
-import {VOLUNTARY_FORM, VOLUNTARY_MODEL, VOLUNTARY_RESULT} from "@/types/injectionSymbols";
+import {VOLUNTARY_TARGET, VOLUNTARY_RULES, VOLUNTARY_MODEL, VOLUNTARY_RESULT} from "@/types/injectionSymbols";
 import {useTransferPage} from "@/hooks/useTransferPage";
 import {VoluntaryDto} from "@/types/voluntary";
 import VoluntaryFormMajor from "@/pagesOther/pages/voluntary/index/components/voluntary-form-major.vue";
+import CollegeItem from "@/pagesOther/pages/university/index/components/plus/college-item.vue";
+import CollegeSummary from "@/pagesOther/pages/university/index/components/plus/college-summary.vue";
+import SkillResult from "@/pagesOther/pages/skill/result/components/skill-result.vue";
+import {addVoluntary} from "@/api/modules/voluntary";
 
 const {prevData} = useTransferPage<VoluntaryDto, any>()
-const data = computed(() => prevData.value.data || {})
+const target = computed(() => prevData.value.target || {})
+const rules = computed(() => prevData.value.rules || {})
 const model = computed(() => prevData.value.model || {})
 const result = computed(() => prevData.value.result || {})
 
-const handleSubmit = () => {
-
+const handleSubmit = async () => {
+    await addVoluntary(target.value)
+    uni.$ie.showSuccess('保存成功')
 }
 
-provide(VOLUNTARY_FORM, data)
+provide(VOLUNTARY_TARGET, target)
+provide(VOLUNTARY_RULES, rules)
 provide(VOLUNTARY_MODEL, model)
 provide(VOLUNTARY_RESULT, result)
 // 为了让子组件触发页面滚动

+ 1 - 1
src/pagesOther/pages/university/index/components/college-list.vue

@@ -8,7 +8,7 @@
                            @clear="handleSearch"/>
             </template>
             <view class="p-20 flex flex-col gap-20">
-                <college-item v-for="i in list" :key="i.code" :item="i" class="mx-card" @click="handleDetail(i)"/>
+                <college-item v-for="i in list" :key="i.code" :item="i" @click="handleDetail(i)"/>
             </view>
         </z-paging>
     </view>

+ 1 - 1
src/pagesOther/pages/university/index/components/plus/college-item.vue

@@ -14,7 +14,7 @@
                          size="12" :text="item.address"/>
             </slot>
         </view>
-        <uv-image v-if="!hiddenLogo&&reverse" :src="item.logo" width="64" height="64" mode="aspectFit"/>
+        <ie-image v-if="!hiddenLogo&&reverse" :src="item.logo" mode="aspectFit" custom-class="w-120 h-120"/>
         <slot name="right"/>
     </view>
 </template>

+ 32 - 0
src/pagesOther/pages/university/index/components/plus/college-summary.vue

@@ -0,0 +1,32 @@
+<template>
+    <view class="bg-white grid grid-cols-4 items-center text-fore-tip text-xs py-20">
+        <view class="flex flex-col justify-center items-center">
+            <text class="text-fore-title font-bold">{{ college.hits || '-' }}</text>
+            热度
+        </view>
+        <view class="flex flex-col justify-center items-center">
+            <text class="text-fore-title font-bold">{{ college.star || '-' }}</text>
+            竞争力
+        </view>
+        <view class="flex flex-col justify-center items-center">
+            <text class="text-fore-title font-bold">{{ college.comScore || '-' }}</text>
+            综合评分
+        </view>
+        <view class="flex flex-col justify-center items-center">
+            <text class="text-fore-title font-bold">{{ college.collect }}</text>
+            收藏量
+        </view>
+    </view>
+</template>
+
+<script setup lang="ts">
+import {University} from "@/types/university";
+
+defineProps<{
+    college: University;
+}>()
+</script>
+
+<style scoped>
+
+</style>

+ 5 - 2
src/pagesOther/pages/voluntary/result/result.vue

@@ -36,6 +36,7 @@ import VoluntaryResultCompare from "@/pagesOther/pages/voluntary/result/componen
 import VoluntaryResultSkill from "@/pagesOther/pages/voluntary/result/components/voluntary-result-skill.vue";
 import VoluntaryResultDisclaimer from "@/pagesOther/pages/voluntary/result/components/voluntary-result-disclaimer.vue";
 import {useUserStore} from "@/store/userStore";
+import {addVoluntary} from "@/api/modules/voluntary";
 
 const userStore = useUserStore()
 const {prevData} = useTransferPage<VoluntaryDto, any>()
@@ -47,14 +48,16 @@ const result = computed(() => prevData.value.result || {})
 const showCompare = computed(() => userStore.getLocation == '湖南')
 
 const handleSubmit = async () => {
-
+    await addVoluntary(target.value)
+    uni.$ie.showSuccess('保存成功')
 }
 
 provide(VOLUNTARY_TARGET, target)
 provide(VOLUNTARY_RULES, rules)
 provide(VOLUNTARY_MODEL, model)
 provide(VOLUNTARY_RESULT, result)
-// 为了让子组件触发页面滚动
+
+// 为了让子组件触发页面滚动,不可缺少
 onPageScroll(() => {
 })
 </script>

+ 6 - 4
src/pagesStudy/pages/targeted-add/targeted-add.vue

@@ -22,9 +22,8 @@
                             <text class="text-30 text-fore-subtitle text-nowrap">选择专业</text>
                         </template>
                         <template #value>
-                            <text v-if="form.majorName" class="mx-10 text-30 text-fore-title">{{
-                                    form.majorName
-                                }}
+                            <text v-if="form.majorName" class="mx-10 text-30 text-fore-title">
+                                {{ form.majorName }}
                             </text>
                             <text v-else class="mr-10 text-30 text-fore-placeholder">请选择</text>
                         </template>
@@ -75,7 +74,9 @@
 
 <script lang="ts" setup>
 import {useTransferPage} from '@/hooks/useTransferPage';
-import {DirectedSchool, SelectedUniversityMajor, University, UniversityMajor} from '@/types/study';
+import {University} from '@/types/university';
+import {DirectedSchool, UniversityMajor} from '@/types/study';
+import {SelectedUniversityMajor} from '@/types/voluntary';
 import {getUniversityMajorList} from '@/api/modules/university';
 import {useUserStore} from '@/store/userStore';
 import {routes} from "@/common/routes";
@@ -109,6 +110,7 @@ const handleUniversitySelect = () => {
             form.value.universityId = university.code;
             form.value.universityName = university.name;
             form.value.universityLogo = university.logo;
+            form.value.info = university;
             loadMajorList(university.code);
         }
     });

+ 8 - 0
src/types/university.ts

@@ -20,6 +20,14 @@ export interface University {
     webSite: string;
 }
 
+export interface UniversityDetail {
+    baseInfo: University;
+    enrollBrochures: [];
+    enrollHistories: [];
+    planHistories: [];
+    professions: [];
+}
+
 export interface UniversityQueryDto {
     name: string | null;
     features: string[] | null;

+ 2 - 1
src/types/voluntary.ts

@@ -1,4 +1,5 @@
 import {DictItem, Study} from "@/types/index";
+import {University} from "@/types/university";
 
 export type EnumInputType = 'Score' | 'Number' | 'Text' | 'Radio' | 'Picker' | 'Checkbox' | 'Eyesight';
 export type EnumRuleCategory = 'Enroll' | 'Special';
@@ -71,7 +72,7 @@ export interface VoluntaryResult {
 }
 
 export interface SelectedUniversityMajor extends Study.SelectedUniversityMajor {
-
+    info?: University;
 }
 
 export interface VoluntaryDto {

+ 1 - 0
tailwind.config.js

@@ -65,6 +65,7 @@ module.exports = {
                     900: "var(--primary-color-900)",
                     950: "var(--primary-color-950)",
                     light: "var(--primary-light-color)",
+                    dark: "#0088FE"
                 },
                 warning: {
                     DEFAULT: "var(--warning)",