feat: 组件样式优化

master
xjs 2025-04-15 10:52:11 +08:00
parent 705e2646ee
commit 89c5ac5ce6
36 changed files with 675 additions and 383 deletions

View File

@ -32,7 +32,14 @@ const handleChildMessage = (event) => {
console.log('子应用传递的消息', event) console.log('子应用传递的消息', event)
} }
onLoad(() => { onLoad((options) => {
console.log(options)
if (options.id) {
url.value += `&reportId=${options.id}`
}
if (options.type) {
url.value += `&reportType=${options.type}`
}
uni.getRecorderManager() uni.getRecorderManager()
uni.getBackgroundAudioManager() uni.getBackgroundAudioManager()
}) })

View File

@ -51,7 +51,7 @@
<view class="mt-auto bg-[#fff] p-[32rpx] box-shadow px-[32rpx] pt-[32rpx] pb-safe"> <view class="mt-auto bg-[#fff] p-[32rpx] box-shadow px-[32rpx] pt-[32rpx] pb-safe">
<view <view
class="text-[#fff] text-[32rpx] rounded-[8rpx] bg-[#1580FF] text-center py-[26rpx]" class="text-[#fff] text-[32rpx] rounded-[8rpx] bg-[#1580FF] text-center py-[26rpx] mb-[20rpx]"
@click="navigatorTo" @click="navigatorTo"
> >
智能选校 智能选校

View File

@ -5,10 +5,13 @@
v-for="(item, index) in titles" v-for="(item, index) in titles"
:key="index" :key="index"
class="drop-menu__item" class="drop-menu__item"
:class="{ 'drop-menu__item--active': index === activeIndex }" :class="{
'drop-menu__item--active': index === activeIndex || item.activation,
'drop-menu__disable': item.disabled,
}"
@click="handleTitleClick(index)" @click="handleTitleClick(index)"
> >
<text class="drop-menu__title">{{ item }}</text> <text class="drop-menu__title">{{ item.title }}</text>
<text <text
class="drop-menu__arrow i-carbon-chevron-down" class="drop-menu__arrow i-carbon-chevron-down"
:class="{ 'drop-menu__arrow--active': index === activeIndex }" :class="{ 'drop-menu__arrow--active': index === activeIndex }"
@ -46,15 +49,15 @@ const props = defineProps({
}) })
// //
const titles = ref<string[]>([]) const titles = ref<any[]>([])
// //
const activeIndex = ref(-1) const activeIndex = ref(-1)
const maskTop = ref('88px') const maskTop = ref('88px')
// //
const addTitle = (title: string) => { const addTitle = (options) => {
titles.value.push(title) titles.value.push({ ...options })
} }
const instance = getCurrentInstance() const instance = getCurrentInstance()
@ -62,6 +65,9 @@ const instance = getCurrentInstance()
const dropMenuRef = ref() const dropMenuRef = ref()
// //
const handleTitleClick = (index: number) => { const handleTitleClick = (index: number) => {
if (titles.value[index].disabled) {
return
}
// //
if (activeIndex.value === index) { if (activeIndex.value === index) {
activeIndex.value = -1 activeIndex.value = -1
@ -93,6 +99,10 @@ provide('dropMenu', {
direction: props.direction, direction: props.direction,
titles, // titles titles, // titles
}) })
defineExpose({
closeDropMenu,
})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@ -155,4 +165,8 @@ provide('dropMenu', {
background: rgba(0, 0, 0, 0.3); background: rgba(0, 0, 0, 0.3);
z-index: 9; z-index: 9;
} }
.drop-menu__disable {
color: #999;
}
</style> </style>

View File

@ -59,6 +59,14 @@ const props = defineProps({
type: String, type: String,
default: '', default: '',
}, },
disabled: {
type: Boolean,
default: false,
},
activation: {
type: Boolean,
default: false,
},
}) })
const emit = defineEmits(['update:modelValue', 'change', 'open']) const emit = defineEmits(['update:modelValue', 'change', 'open'])
@ -116,7 +124,7 @@ onMounted(() => {
// //
itemIndex.value = titles.value.length itemIndex.value = titles.value.length
// //
addTitle(props.title) addTitle({ title: props.title, disabled: props.disabled, activation: props.activation })
}) })
// //
@ -124,12 +132,19 @@ watch(
() => props.title, () => props.title,
(newTitle) => { (newTitle) => {
// //
if (titles.value[itemIndex.value] !== newTitle) { if (titles.value[itemIndex.value].title !== newTitle) {
titles.value[itemIndex.value] = newTitle titles.value[itemIndex.value].title = newTitle
} }
}, },
{ immediate: false }, { immediate: false },
) )
watch(
() => props.activation,
(newVal) => {
titles.value[itemIndex.value].activation = newVal
},
)
</script> </script>
<style scoped> <style scoped>

View File

@ -20,7 +20,7 @@
</template> </template>
</Navbar> </Navbar>
<view class="flex-1 overflow-auto pb-[30rpx] relative mt-[40rpx]"> <view class="flex-1 overflow-auto relative mt-[40rpx]">
<!-- 顶部卡片 --> <!-- 顶部卡片 -->
<view class="flex flex-col pt-[32rpx] px-[84rpx] h-[244rpx] mb-[-116rpx] font-700"> <view class="flex flex-col pt-[32rpx] px-[84rpx] h-[244rpx] mb-[-116rpx] font-700">
<image src="https://api.static.ycymedu.com/src/images/evaluate/bg.png" class="header-bg" /> <image src="https://api.static.ycymedu.com/src/images/evaluate/bg.png" class="header-bg" />
@ -38,9 +38,19 @@
<InterestingThings :tag="studyRecord.hTag" :description="studyRecord.description" /> <InterestingThings :tag="studyRecord.hTag" :description="studyRecord.description" />
<!-- 底部AI智能顾问 --> <!-- 底部AI智能顾问 -->
<!-- <view class="ai-assistant mt-[20rpx] mb-[10rpx] flex items-center justify-center"> <!-- <view
<image src="" class="w-[32rpx] h-[32rpx] mr-[10rpx]"></image> class="pt-[16rpx] px-[32rpx] mt-[20rpx] flex items-center justify-center bg-[#fff] pb-safe"
<text class="text-[#117CFC] text-[26rpx]">智能AI顾问</text> @click="toAiAssistant"
>
<view
class="rounded-[8rpx] border-[#1580FF] border-[2rpx] border-solid w-full pt-[22rpx] pb-[20rpx] flex items-center justify-center"
>
<image
src="https://api.static.ycymedu.com/images/btn-bottom.png"
class="w-[52rpx] h-[52rpx] mr-[10rpx]"
></image>
<text class="text-[#1580FF] text-[32rpx] font-700">智能AI顾问</text>
</view>
</view> --> </view> -->
</view> </view>
</view> </view>
@ -63,6 +73,12 @@ const handleBack = () => {
const studyRecord = ref({ description: '', title: '', picCharts: {}, reportItems: [], hTag: '' }) const studyRecord = ref({ description: '', title: '', picCharts: {}, reportItems: [], hTag: '' })
const toAiAssistant = () => {
uni.navigateTo({
url: `/aiService-sub/index/index?id=${pageId.value}&type=${pageType.value}`,
})
}
onLoad((options) => { onLoad((options) => {
pageType.value = +options.type pageType.value = +options.type
pageId.value = options.id pageId.value = options.id

View File

@ -50,8 +50,6 @@ const personList = ref([])
watch( watch(
() => props.tag, () => props.tag,
(newV) => { (newV) => {
console.log(newV)
getTagMapPerson({ tag: newV }).then((resp) => { getTagMapPerson({ tag: newV }).then((resp) => {
if (resp.code === 200) { if (resp.code === 200) {
personList.value = resp.result as any[] personList.value = resp.result as any[]

View File

@ -39,8 +39,6 @@ const majorList = ref([])
watch( watch(
() => props.tag, () => props.tag,
(newV) => { (newV) => {
console.log(newV)
getTagMapPro({ tag: newV }).then((resp) => { getTagMapPro({ tag: newV }).then((resp) => {
if (resp.code === 200) { if (resp.code === 200) {
majorList.value = resp.result as any[] majorList.value = resp.result as any[]

View File

@ -20,23 +20,18 @@
></Navbar> ></Navbar>
<view class="custom-background h-[200rpx] w-full absolute top-0 left-0 z-[-1]"></view> <view class="custom-background h-[200rpx] w-full absolute top-0 left-0 z-[-1]"></view>
</view> </view>
<drop-menu> <drop-menu ref="dropMenuRef">
<drop-menu-item <drop-menu-item
:key="1" :key="1"
:title="searchParams.locationName || '省份'" :title="searchParams.locationName || '省份'"
custom-class="flex items-center" custom-class="flex items-center"
> :disabled="true"
<Region ></drop-menu-item>
:defaultValue="searchParams.locationCode ? [searchParams.locationCode] : []"
:max="1"
@changeName="handleRegionChange"
@change="handleRegionChangeCode"
/>
</drop-menu-item>
<drop-menu-item <drop-menu-item
:key="2" :key="2"
:title="searchParams.year || '年份'" :title="searchParams.year || '年份'"
custom-class="flex items-center" custom-class=""
:activation="searchParams.year !== ''"
> >
<CheckGroup <CheckGroup
:list="checkYearList" :list="checkYearList"
@ -45,13 +40,8 @@
labelKey="year" labelKey="year"
valueKey="year" valueKey="year"
:max="1" :max="1"
/> class="custom-check-group"
</drop-menu-item> width="100%"
<drop-menu-item :key="3" title="类别" custom-class="flex items-center">
<UniType
@change="handleUniTypeChange"
:max="1"
:default-value="searchParams.type ? [searchParams.type] : []"
/> />
</drop-menu-item> </drop-menu-item>
</drop-menu> </drop-menu>
@ -118,8 +108,6 @@
import Navbar from '@/pages-evaluation-sub/components/navbar/Navbar.vue' import Navbar from '@/pages-evaluation-sub/components/navbar/Navbar.vue'
import DropMenu from '@/pages-evaluation-sub/components/drop-menu/DropMenu.vue' import DropMenu from '@/pages-evaluation-sub/components/drop-menu/DropMenu.vue'
import DropMenuItem from '@/pages-evaluation-sub/components/drop-menu/DropMenuItem.vue' import DropMenuItem from '@/pages-evaluation-sub/components/drop-menu/DropMenuItem.vue'
import Region from './components/Region.vue'
import UniType from './components/UniType.vue'
import CheckGroup from '@/pages-evaluation-sub/components/check-group/CheckGroup.vue' import CheckGroup from '@/pages-evaluation-sub/components/check-group/CheckGroup.vue'
import LEchart from '@/pages-evaluation-sub/uni_modules/lime-echart/components/l-echart/l-echart.vue' import LEchart from '@/pages-evaluation-sub/uni_modules/lime-echart/components/l-echart/l-echart.vue'
@ -155,15 +143,7 @@ const handleConfirm = () => {
} }
const checkYearList = ref([]) const checkYearList = ref([])
const dropMenuRef = ref()
const handleRegionChange = (val) => {
searchParams.value.locationName = val.join(',')
}
const handleRegionChangeCode = (val) => {
searchParams.value.locationCode = val[0]
getScoreSectionData()
}
const handleYearChange = (val) => { const handleYearChange = (val) => {
let _yearList = [] let _yearList = []
@ -173,11 +153,10 @@ const handleYearChange = (val) => {
_yearList = val _yearList = val
} }
searchParams.value.year = _yearList.join(',') searchParams.value.year = _yearList.join(',')
getScoreSectionData()
}
const handleUniTypeChange = (val) => { if (val.length !== 0) {
searchParams.value.type = val[0] dropMenuRef.value.closeDropMenu()
}
getScoreSectionData() getScoreSectionData()
} }
@ -252,6 +231,7 @@ onBeforeMount(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/pages-evaluation-sub/styles/navbar-background.scss'; @import '@/pages-evaluation-sub/styles/navbar-background.scss';
@import '@/pages-evaluation-sub/styles/grid-checkbox.scss';
.input-wrapper-class { .input-wrapper-class {
border-radius: 8rpx; border-radius: 8rpx;

View File

@ -0,0 +1,12 @@
.custom-check-group {
:deep(.checkbox-group) {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
gap: 16rpx;
padding: 32rpx 16rpx 16rpx;
}
:deep(.custom-checkbox) {
--checkbox-width: 100%;
}
}

View File

@ -103,10 +103,10 @@ const handleClose = () => {
flex: 1 1 auto; flex: 1 1 auto;
} }
&-footer { // &-footer {
padding: 24rpx 32rpx; // padding: 20rpx 32rpx;
border-top: 2rpx solid #f5f5f5; // border-top: 2rpx solid #f5f5f5;
box-shadow: 0rpx -8rpx 8rpx 0rpx rgba(225, 225, 225, 0.2); // box-shadow: 0rpx -8rpx 8rpx 0rpx rgba(225, 225, 225, 0.2);
} // }
} }
</style> </style>

View File

@ -110,7 +110,6 @@ const checkboxStyle = computed(() => {
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
gap: 16rpx; gap: 16rpx;
// padding: 32rpx 16rpx 16rpx;
} }
:deep(.checkbox-active) { :deep(.checkbox-active) {

View File

@ -45,7 +45,6 @@ const emitValue = (val) => {
// //
const register = (childInstance) => { const register = (childInstance) => {
console.log('注册子组件:', childInstance.nameSync)
childrens.value.push(childInstance) childrens.value.push(childInstance)
} }
@ -58,8 +57,6 @@ const unregister = (childInstance) => {
} }
// - // -
const setOpen = (val) => { const setOpen = (val) => {
console.log('设置打开状态:', val, childrens.value.length)
// //
const isString = typeof val === 'string' || typeof val === 'number' const isString = typeof val === 'string' || typeof val === 'number'
const isArray = Array.isArray(val) const isArray = Array.isArray(val)
@ -105,7 +102,6 @@ const setOpen = (val) => {
watch( watch(
() => dataValue.value, () => dataValue.value,
(val) => { (val) => {
console.log('折叠面板值变化:', val, '手风琴模式:', props.accordion)
if (val !== undefined && val !== null) { if (val !== undefined && val !== null) {
setOpen(val) setOpen(val)
} }
@ -117,8 +113,6 @@ watch(
const setAccordion = (self) => { const setAccordion = (self) => {
if (!props.accordion) return if (!props.accordion) return
console.log('设置手风琴模式,当前组件:', self?.uid || self?.nameSync)
childrens.value.forEach((vm) => { childrens.value.forEach((vm) => {
// //
const isSameComponent = const isSameComponent =
@ -131,7 +125,6 @@ const setAccordion = (self) => {
// //
if (!isSameComponent) { if (!isSameComponent) {
console.log('关闭其他面板:', vm.nameSync)
vm.isOpen = false vm.isOpen = false
} }
}) })
@ -167,7 +160,6 @@ const onChange = (isOpen, self) => {
activeItem = activeItems activeItem = activeItems
} }
console.log('折叠面板状态变化:', activeItem)
emit('change', activeItem) emit('change', activeItem)
emitValue(activeItem) emitValue(activeItem)
} }
@ -196,7 +188,6 @@ provide('uniCollapseContext', {
// //
onMounted(() => { onMounted(() => {
nextTick(() => { nextTick(() => {
console.log('折叠面板挂载完成,当前值:', dataValue.value)
if (dataValue.value !== undefined && dataValue.value !== null && dataValue.value !== '') { if (dataValue.value !== undefined && dataValue.value !== null && dataValue.value !== '') {
setOpen(dataValue.value) setOpen(dataValue.value)
} }

View File

@ -5,10 +5,13 @@
v-for="(item, index) in titles" v-for="(item, index) in titles"
:key="index" :key="index"
class="drop-menu__item" class="drop-menu__item"
:class="{ 'drop-menu__item--active': index === activeIndex }" :class="{
@click.self.stop="handleTitleClick(index)" 'drop-menu__item--active': index === activeIndex || item.activation,
'drop-menu__disable': item.disabled,
}"
@click="handleTitleClick(index)"
> >
<text class="drop-menu__title">{{ item }}</text> <text class="drop-menu__title">{{ item.title }}</text>
<text <text
class="drop-menu__arrow i-carbon-chevron-down" class="drop-menu__arrow i-carbon-chevron-down"
:class="{ 'drop-menu__arrow--active': index === activeIndex }" :class="{ 'drop-menu__arrow--active': index === activeIndex }"
@ -22,7 +25,7 @@
v-if="activeIndex !== -1" v-if="activeIndex !== -1"
class="drop-menu__mask" class="drop-menu__mask"
:style="{ top: maskTop }" :style="{ top: maskTop }"
@click.self.stop="closeDropMenu" @click="closeDropMenu"
></view> ></view>
</view> </view>
</template> </template>
@ -46,23 +49,30 @@ const props = defineProps({
}) })
// //
const titles = ref<string[]>([]) const titles = ref<any[]>([])
// //
const activeIndex = ref(-1) const activeIndex = ref(-1)
const maskTop = ref('88px') const maskTop = ref('88px')
const addTitle = (title: string) => { //
titles.value.push(title) const addTitle = (options) => {
titles.value.push({ ...options })
} }
const instance = getCurrentInstance() const instance = getCurrentInstance()
const dropMenuRef = ref() const dropMenuRef = ref()
//
const handleTitleClick = (index: number) => { const handleTitleClick = (index: number) => {
if (titles.value[index].disabled) {
return
}
//
if (activeIndex.value === index) { if (activeIndex.value === index) {
activeIndex.value = -1 activeIndex.value = -1
} else { } else {
//
activeIndex.value = index activeIndex.value = index
} }
const query = uni.createSelectorQuery().in(instance.proxy) const query = uni.createSelectorQuery().in(instance.proxy)
@ -155,4 +165,8 @@ defineExpose({
background: rgba(0, 0, 0, 0.3); background: rgba(0, 0, 0, 0.3);
z-index: 9; z-index: 9;
} }
.drop-menu__disable {
color: #999;
}
</style> </style>

View File

@ -1,6 +1,5 @@
<template> <template>
<view <view
v-if="mounted"
class="drop-menu-item" class="drop-menu-item"
:class="[customClass, { 'drop-menu-item--show': isShow }]" :class="[customClass, { 'drop-menu-item--show': isShow }]"
:style="{ :style="{
@ -10,14 +9,14 @@
> >
<view class="drop-menu-item__wrapper" :class="{ 'drop-menu-item__wrapper--show': isShow }"> <view class="drop-menu-item__wrapper" :class="{ 'drop-menu-item__wrapper--show': isShow }">
<!-- 默认选项列表 --> <!-- 默认选项列表 -->
<scroll-view v-if="isShow && !$slots.default" scroll-y class="drop-menu-item__content"> <scroll-view v-if="!$slots.default" scroll-y class="drop-menu-item__content">
<view class="drop-menu-item__option-list"> <view class="drop-menu-item__option-list">
<view <view
v-for="(option, index) in options" v-for="(option, index) in options"
:key="index" :key="index"
class="drop-menu-item__option" class="drop-menu-item__option"
:class="{ 'drop-menu-item__option--active': isOptionActive(option) }" :class="{ 'drop-menu-item__option--active': isOptionActive(option) }"
@click.self.stop="handleOptionClick(option)" @click="handleOptionClick(option)"
> >
<text class="drop-menu-item__text">{{ getOptionText(option) }}</text> <text class="drop-menu-item__text">{{ getOptionText(option) }}</text>
<text v-if="isOptionActive(option)" class="drop-menu-item__icon"></text> <text v-if="isOptionActive(option)" class="drop-menu-item__icon"></text>
@ -25,7 +24,7 @@
</view> </view>
</scroll-view> </scroll-view>
<!-- 自定义内容插槽 --> <!-- 自定义内容插槽 -->
<view v-if="isShow && $slots.default" class="drop-menu-item__custom-content"> <view v-else class="drop-menu-item__custom-content">
<slot></slot> <slot></slot>
</view> </view>
</view> </view>
@ -33,7 +32,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, inject, onMounted, computed, watch, nextTick } from 'vue' import { ref, inject, onMounted, computed, watch } from 'vue'
const props = defineProps({ const props = defineProps({
modelValue: { modelValue: {
@ -60,17 +59,25 @@ const props = defineProps({
type: String, type: String,
default: '', default: '',
}, },
disabled: {
type: Boolean,
default: false,
},
activation: {
type: Boolean,
default: false,
},
}) })
const emit = defineEmits(['update:modelValue', 'change', 'open']) const emit = defineEmits(['update:modelValue', 'change', 'open'])
// //
const { activeIndex, addTitle, closeDropMenu, zIndex, duration, titles } = inject('dropMenu') as any const { activeIndex, addTitle, closeDropMenu, zIndex, duration, direction, titles } = inject(
'dropMenu',
) as any
// //
const itemIndex = ref(-1) const itemIndex = ref(-1)
//
const mounted = ref(false)
// //
const isShow = computed(() => activeIndex.value === itemIndex.value) const isShow = computed(() => activeIndex.value === itemIndex.value)
@ -117,12 +124,7 @@ onMounted(() => {
// //
itemIndex.value = titles.value.length itemIndex.value = titles.value.length
// //
addTitle(props.title) addTitle({ title: props.title, disabled: props.disabled, activation: props.activation })
//
nextTick(() => {
mounted.value = true
})
}) })
// //
@ -130,12 +132,19 @@ watch(
() => props.title, () => props.title,
(newTitle) => { (newTitle) => {
// //
if (titles.value[itemIndex.value] !== newTitle) { if (titles.value[itemIndex.value].title !== newTitle) {
titles.value[itemIndex.value] = newTitle titles.value[itemIndex.value].title = newTitle
} }
}, },
{ immediate: false }, { immediate: false },
) )
watch(
() => props.activation,
(newVal) => {
titles.value[itemIndex.value].activation = newVal
},
)
</script> </script>
<style scoped> <style scoped>
@ -154,17 +163,15 @@ watch(
transition: all 0.25s ease; transition: all 0.25s ease;
overflow: hidden; overflow: hidden;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1); box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
display: none;
visibility: hidden;
opacity: 0; opacity: 0;
visibility: hidden;
z-index: 11; z-index: 11;
} }
.drop-menu-item__wrapper--show { .drop-menu-item__wrapper--show {
transform: translateY(0); transform: translateY(0);
display: inline-block;
visibility: visible;
opacity: 1; opacity: 1;
visibility: visible;
} }
.drop-menu-item__content { .drop-menu-item__content {

View File

@ -7,9 +7,9 @@
}" }"
@click="handleClick" @click="handleClick"
> >
<view class="radio__icon" :class="{ 'radio__icon--checked': isChecked }"> <!-- <view class="radio__icon" :class="{ 'radio__icon--checked': isChecked }">
<view v-if="isChecked" class="radio__icon-dot"></view> <view v-if="isChecked" class="radio__icon-dot"></view>
</view> </view> -->
<view class="radio__label"> <view class="radio__label">
<slot>{{ label }}</slot> <slot>{{ label }}</slot>
</view> </view>
@ -79,28 +79,28 @@ const handleClick = () => {
opacity: 0.5; opacity: 0.5;
} }
&__icon { // &__icon {
width: 40rpx; // width: 40rpx;
height: 40rpx; // height: 40rpx;
border: 2rpx solid #dcdfe6; // border: 2rpx solid #dcdfe6;
border-radius: 50%; // border-radius: 50%;
display: flex; // display: flex;
align-items: center; // align-items: center;
justify-content: center; // justify-content: center;
margin-right: 8rpx; // margin-right: 8rpx;
transition: all 0.2s; // transition: all 0.2s;
&--checked { // &--checked {
border-color: #0083ff; // border-color: #0083ff;
} // }
} // }
&__icon-dot { // &__icon-dot {
width: 20rpx; // width: 20rpx;
height: 20rpx; // height: 20rpx;
background-color: #0083ff; // background-color: #0083ff;
border-radius: 50%; // border-radius: 50%;
} // }
&__label { &__label {
line-height: 1; line-height: 1;
@ -109,5 +109,7 @@ const handleClick = () => {
.radio-active { .radio-active {
color: #0083ff; color: #0083ff;
border: 2rpx solid #0083ff;
border-radius: 8rpx;
} }
</style> </style>

View File

@ -101,6 +101,7 @@ import Checkbox from '@/pages-sub/components/check-group/Checkbox.vue'
import CheckboxGroup from '@/pages-sub/components/check-group/CheckboxGroup.vue' import CheckboxGroup from '@/pages-sub/components/check-group/CheckboxGroup.vue'
import { useUserStore } from '@/store/user' import { useUserStore } from '@/store/user'
import { useRouterDetail } from './useRouterDetail'
const userStore = useUserStore() const userStore = useUserStore()
@ -220,8 +221,13 @@ const handleSubmit = () => {
params.inputs = _inputs params.inputs = _inputs
saveBusScaleAnswer(params).then((res) => { saveBusScaleAnswer(params).then((res) => {
isLoading.value = false isLoading.value = false
let _result = res.result as {
reportId: string
type: number
}
if (res.code === 200) { if (res.code === 200) {
uni.navigateBack() // uni.navigateBack()
useRouterDetail({ reportsId: _result.reportId, type: _result.type })
} else { } else {
uni.showToast({ uni.showToast({
title: res.message, title: res.message,

View File

@ -0,0 +1,51 @@
export const useRouterDetail = (item: { reportsId: string; type: number }) => {
// type=0 兴趣测评报告
// =1 性格测评报告
// =2 能力测评
// =3 学生考试考虑
// =4 学习风格
// =5 学习技能
// =6 SAS
// =7 SDS
// =8 SCL-90
// =9 MHT
/// =-1 价值观
/// =-2 留学咨询
let url = ''
if (item.type === 0) {
url = `/pages-evaluation-sub/evaluate/academicReport/interestReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 1) {
url = `/pages-evaluation-sub/evaluate/academicReport/characterReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 2) {
url = `/pages-evaluation-sub/evaluate/academicReport/capabilityReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === -1) {
url = `/pages-evaluation-sub/evaluate/academicReport/opinionAboutReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 6) {
url = `/pages-evaluation-sub/evaluate/psychologicalReport/sasReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 7) {
url = `/pages-evaluation-sub/evaluate/psychologicalReport/sdsReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 9) {
// url = `/pages-evaluation-sub/evaluate/psychologicalReport/mhtReport?id=${item.reportsId}&type=${item.type}`
uni.showToast({
title: '开发中....',
icon: 'none',
})
return
} else if (item.type === 4) {
url = `/pages-evaluation-sub/evaluate/studyReport/learnStudyReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 5) {
url = `/pages-evaluation-sub/evaluate/studyReport/learnSkillReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 3) {
url = `/pages-evaluation-sub/evaluate/studyReport/anxietyReport?id=${item.reportsId}&type=${item.type}`
} else {
uni.showToast({
title: '开发中....',
icon: 'none',
})
return
}
uni.navigateTo({
url,
})
}

View File

@ -36,7 +36,7 @@
> >
<FilterMenu ref="filterMenuRef" /> <FilterMenu ref="filterMenuRef" />
<template #footer> <template #footer>
<view class="flex items-center"> <view class="flex items-center px-[32rpx]">
<button <button
plain plain
class="border-[#f5f5f5]! flex-auto bg-[#f5f5f5]! rounded-[8rpx]! text-[#1580FF]! text-[32rpx]! font-normal! mr-[22rpx]" class="border-[#f5f5f5]! flex-auto bg-[#f5f5f5]! rounded-[8rpx]! text-[#1580FF]! text-[32rpx]! font-normal! mr-[22rpx]"
@ -48,7 +48,7 @@
class="border-[#1580FF]! flex-auto bg-[#1580FF]! rounded-[8rpx]! text-[#fff]! text-[32rpx]! font-normal!" class="border-[#1580FF]! flex-auto bg-[#1580FF]! rounded-[8rpx]! text-[#fff]! text-[32rpx]! font-normal!"
@click="handleResult" @click="handleResult"
> >
查看结果 确定
</button> </button>
</view> </view>
</template> </template>
@ -80,6 +80,8 @@ const handleResult = () => {
let _params = filterMenuRef.value.handleConfirm() let _params = filterMenuRef.value.handleConfirm()
countBadgeValue(_params) countBadgeValue(_params)
console.log(_params)
let params = { let params = {
p: userStore.userInfo.estimatedAchievement.sp, p: userStore.userInfo.estimatedAchievement.sp,
location: userStore.userInfo.estimatedAchievement.provinceCode, location: userStore.userInfo.estimatedAchievement.provinceCode,

View File

@ -38,33 +38,35 @@
<view style="box-shadow: 0rpx 8rpx 8rpx 0rpx rgba(225, 225, 225, 0.2)"> <view style="box-shadow: 0rpx 8rpx 8rpx 0rpx rgba(225, 225, 225, 0.2)">
<drop-menu ref="dropMenuRef"> <drop-menu ref="dropMenuRef">
<drop-menu-item <drop-menu-item
v-for="item in subMenu" v-for="(item, index) in subMenu"
:key="item.id" :key="item.id"
:title="item.title" :title="item.title"
@open="handleOpenSubMenu(item.id)" @open="handleOpenSubMenu(item.id)"
custom-class="flex items-center" custom-class="flex items-center"
:activation="item.activation"
> >
<view class="mx-[24rpx] my-[16rpx]"> <Region
<Region :defaultValue="regionKeyInfo"
:defaultValue="regionKeyInfo" v-if="currentMenu === 1"
v-if="currentMenu === 1" @changeName="handleRegionChange"
@changeName="handleRegionChange" @change="handleRegionIdChange"
@change="handleRegionIdChange" class="custom-check-group"
/> />
<Nature <Nature
v-if="currentMenu === 2" v-if="currentMenu === 2"
:defaultValue="natureKeyInfo" :defaultValue="natureKeyInfo"
@changeName="handleNatureChange" @changeName="handleNatureChange"
@change="handleNatureIdChange" @change="handleNatureIdChange"
/> class="custom-check-group"
<UniType />
v-if="currentMenu === 3" <UniType
:defaultValue="uniTypeKeyInfo" v-if="currentMenu === 3"
@changeName="handleUniTypeChange" :defaultValue="uniTypeKeyInfo"
@change="handleUniTypeIdChange" @changeName="handleUniTypeChange"
/> @change="handleUniTypeIdChange"
</view> class="custom-check-group"
<view class="flex items-center justify-between px-[32rpx] pb-[32rpx]"> />
<view class="flex items-center justify-between px-[16rpx] pb-[32rpx]">
<view class="cancel-btn" @click="handleClear"></view> <view class="cancel-btn" @click="handleClear"></view>
<view class="submit-btn" @click="handleCheck"></view> <view class="submit-btn" @click="handleCheck"></view>
</view> </view>
@ -128,11 +130,11 @@ const navigatorBack = () => {
uni.navigateBack() uni.navigateBack()
} }
const subMenu = [ const subMenu = ref([
{ id: 1, title: '省份' }, { id: 1, title: '省份', activation: false },
{ id: 2, title: '层次' }, { id: 2, title: '层次', activation: false },
{ id: 3, title: '类型' }, { id: 3, title: '类型', activation: false },
] ])
const dropMenuRef = ref() const dropMenuRef = ref()
@ -178,11 +180,15 @@ const handleClear = () => {
regionKeyInfo.value = [] regionKeyInfo.value = []
uniTypeKeyInfo.value = [] uniTypeKeyInfo.value = []
natureKeyInfo.value = [] natureKeyInfo.value = []
subMenu.value.forEach((item) => {
item.activation = false
})
dropMenuRef.value.closeDropMenu() dropMenuRef.value.closeDropMenu()
} }
const handleRegionIdChange = (val) => { const handleRegionIdChange = (val) => {
regionKeyInfo.value = val regionKeyInfo.value = val
subMenu.value[0].activation = val.length !== 0
} }
const handleRegionChange = (val) => { const handleRegionChange = (val) => {
@ -191,6 +197,7 @@ const handleRegionChange = (val) => {
const handleUniTypeIdChange = (val) => { const handleUniTypeIdChange = (val) => {
uniTypeKeyInfo.value = val uniTypeKeyInfo.value = val
subMenu.value[2].activation = val.length !== 0
} }
const handleUniTypeChange = (val) => { const handleUniTypeChange = (val) => {
@ -199,6 +206,7 @@ const handleUniTypeChange = (val) => {
const handleNatureIdChange = (val) => { const handleNatureIdChange = (val) => {
natureKeyInfo.value = val natureKeyInfo.value = val
subMenu.value[1].activation = val.length !== 0
} }
const handleNatureChange = (val) => { const handleNatureChange = (val) => {
@ -218,4 +226,5 @@ onShow(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../styles/navbar_search.scss'; @import '../styles/navbar_search.scss';
@import '@/pages-sub/home/styles/picker-view-btn.scss'; @import '@/pages-sub/home/styles/picker-view-btn.scss';
@import '@/pages-sub/home/styles/grid-checkbox.scss';
</style> </style>

View File

@ -6,6 +6,7 @@
value-key="id" value-key="id"
label-key="name" label-key="name"
v-bind="$attrs" v-bind="$attrs"
width="100%"
/> />
</template> </template>
@ -23,10 +24,14 @@ getUniversityFeature().then((res) => {
const defaultInfo = ref<string[]>([]) const defaultInfo = ref<string[]>([])
const emits = defineEmits(['changeName']) const emits = defineEmits(['changeName', 'changeObj'])
const handleChange = (val: any) => { const handleChange = (val: any) => {
const names = infoList.value.filter((item) => val.includes(item.id)).map((item) => item.name) const chooseObj = infoList.value.filter((item) => val.includes(item.id))
emits('changeName', names) emits(
'changeName',
chooseObj.map((item) => item.name),
)
emits('changeObj', chooseObj)
} }
</script> </script>

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="flex flex-col sheet-body-border"> <view class="flex flex-col sheet-body-border">
<view class="flex"> <view class="flex flex-1">
<view class="w-[176rpx] h-initial bg-[#F7F8FA] flex flex-col items-center"> <view class="w-[176rpx] h-initial bg-[#F7F8FA] flex flex-col items-center">
<view <view
:class="`text-[#666] flex items-center justify-center h-[104rpx] w-full ${item.id === currentMenu ? 'active' : ''}`" :class="`text-[#666] flex items-center justify-center h-[104rpx] w-full ${item.id === currentMenu ? 'active' : ''}`"
@ -11,55 +11,65 @@
{{ item.name }} {{ item.name }}
</view> </view>
</view> </view>
<scroll-view class="flex-1 pb-[24rpx] h-[50vh] mt-[32rpx] mx-[32rpx]" :scroll-y="true"> <scroll-view class="h-[40vh] pb-[14rpx] pt-[32rpx]" :scroll-y="true">
<Phase v-show="currentMenu === 1" @change="handlePhaseChange" /> <view class="px-[32rpx]">
<CollegeFeature <Phase
v-show="currentMenu === 5" v-show="currentMenu === 1"
width="240rpx" :defaultValue="defaultPhase"
height="60rpx" @change="handlePhaseChange"
class="justify-center!" />
:defaultValue="defaultCollegeFeature" <CollegeFeature
@change-name="handleCollegeFeatureChange" v-show="currentMenu === 5"
/> width="240rpx"
<Region height="60rpx"
width="240rpx" class="custom-pl"
height="60rpx" :defaultValue="defaultCollegeFeature"
class="justify-center!" @change-obj="handleCollegeFeatureChangeObj"
v-show="currentMenu === 2" />
:defaultValue="defaultRegion" <Region
@change-name="handleRegionChange" width="240rpx"
/> height="60rpx"
<UniType class="custom-pl"
width="240rpx" v-show="currentMenu === 2"
height="60rpx" :defaultValue="defaultRegion"
class="justify-center!" @change-obj="handleRegionChangeObj"
v-show="currentMenu === 3" />
:defaultValue="defaultUniType" <UniType
@change-name="handleUniTypeChange" width="240rpx"
/> height="60rpx"
<Nature class=""
width="240rpx" v-show="currentMenu === 3"
height="60rpx" :defaultValue="defaultUniType"
class="justify-center!" @change-obj="handleUniTypeChangeObj"
v-show="currentMenu === 4" />
:defaultValue="defaultNature" <Nature
@change-name="handleNatureChange" width="240rpx"
/> height="60rpx"
class="justify-center!"
v-show="currentMenu === 4"
:defaultValue="defaultNature"
@change-obj="handleNatureChangeObj"
/>
</view>
</scroll-view> </scroll-view>
</view> </view>
<!-- <view class="pt-[32rpx] px-[32rpx] wei-xin-pt box-shadow"> <scroll-view class="box-shadow" :scroll-x="true">
<view class="flex items-center flex-wrap gap-[24rpx]"> <view class="flex items-center gap-[24rpx] w-max px-[32rpx] pt-[32rpx] pb-[40rpx]">
<view <view
class="px-[20rpx] py-[12rpx] bg-[#f8f8f8] rounded-[8rpx]" class="px-[20rpx] py-[12rpx] bg-[#f8f8f8] rounded-[8rpx]"
v-for="item in 4" v-for="(item, index) in filterParams"
:key="item" :key="item.value.name"
> >
<text class="text-[#303030] text-[24rpx] font-medium mr-[16rpx]">中外合作</text> <text class="text-[#303030] text-[24rpx] font-medium mr-[16rpx]">
<view class="i-carbon-close-filled"></view> {{ item.value.name }}
</text>
<view
class="i-carbon-close-filled text-[#CBCBCB] text-[24rpx]"
@click="handleRemove(item, index)"
></view>
</view>
</view> </view>
</view> </scroll-view>
</view> -->
</view> </view>
</template> </template>
@ -104,30 +114,105 @@ const defaultUniType = ref([])
const defaultCollegeFeature = ref([]) const defaultCollegeFeature = ref([])
const defaultPhase = ref('') const defaultPhase = ref('')
const filterParams = ref([])
const chooseRegion = ref([]) const chooseRegion = ref([])
const chooseNature = ref([]) const chooseNature = ref([])
const chooseUniType = ref([]) const chooseUniType = ref([])
const chooseCollegeFeature = ref([]) const chooseCollegeFeature = ref([])
const choosePhase = ref('') const choosePhase = ref('')
const handleRegionChange = (val: string[]) => { const handleRegionChangeObj = (val: any[]) => {
chooseRegion.value = val console.log(val)
defaultRegion.value = val.map((item) => item.code)
chooseRegion.value = val.map((item) => item.name)
filterParams.value = filterParams.value.filter((item) => item.type !== 'region')
val.forEach((item) => {
filterParams.value.push({
type: 'region',
value: item,
})
})
} }
const handleNatureChange = (val: string[]) => { const handleNatureChangeObj = (val: any[]) => {
chooseNature.value = val defaultNature.value = val.map((item) => item.id)
chooseNature.value = val.map((item) => item.name)
filterParams.value = filterParams.value.filter((item) => item.type !== 'nature')
val.forEach((item) => {
filterParams.value.push({
type: 'nature',
value: item,
})
})
} }
const handleUniTypeChange = (val: string[]) => { const handleUniTypeChangeObj = (val: any[]) => {
chooseUniType.value = val defaultUniType.value = val.map((item) => item.id)
chooseUniType.value = val.map((item) => item.name)
filterParams.value = filterParams.value.filter((item) => item.type !== 'uniType')
val.forEach((item) => {
filterParams.value.push({
type: 'uniType',
value: item,
})
})
} }
const handleCollegeFeatureChange = (val: string[]) => { const handleCollegeFeatureChangeObj = (val: any[]) => {
chooseCollegeFeature.value = val chooseCollegeFeature.value = val.map((item) => item.name)
filterParams.value = filterParams.value.filter((item) => item.type !== 'collegeFeature')
val.forEach((item) => {
filterParams.value.push({
type: 'collegeFeature',
value: item,
})
})
} }
const handlePhaseChange = (val: string) => { const handlePhaseChange = (val: any) => {
choosePhase.value = val choosePhase.value = val.batch
filterParams.value = filterParams.value.filter((item) => item.type !== 'phase')
filterParams.value.push({
type: 'phase',
value: { ...val, name: val.batch },
})
}
const handleRemove = (removeItem: { type: string; value: any }, index: number) => {
if (removeItem.type === 'region') {
defaultRegion.value = filterParams.value
.filter((item) => item.type === 'region' && item.value.code !== removeItem.value.code)
.map((item) => item.value.code)
console.log(defaultRegion.value)
}
if (removeItem.type === 'nature') {
defaultNature.value = filterParams.value
.filter((item) => item.type === 'nature' && item.value.id !== removeItem.value.id)
.map((item) => item.value.id)
}
if (removeItem.type === 'uniType') {
defaultUniType.value = filterParams.value
.filter((item) => item.type === 'uniType' && item.value.id !== removeItem.value.id)
.map((item) => item.value.id)
}
if (removeItem.type === 'collegeFeature') {
defaultCollegeFeature.value = filterParams.value
.filter((item) => item.type === 'collegeFeature' && item.value.id !== removeItem.value.id)
.map((item) => item.value.id)
}
if (removeItem.type === 'phase') {
uni.showToast({
title: '该项不可删除',
icon: 'none',
})
return
} else {
filterParams.value.splice(index, 1)
}
} }
const handleConfirm = () => { const handleConfirm = () => {
@ -145,6 +230,7 @@ const clearForm = () => {
defaultUniType.value = [] defaultUniType.value = []
defaultNature.value = [] defaultNature.value = []
defaultRegion.value = [] defaultRegion.value = []
defaultPhase.value = ''
} }
defineExpose({ defineExpose({
@ -173,12 +259,3 @@ defineExpose({
border-top: 2rpx solid #f5f5f5; border-top: 2rpx solid #f5f5f5;
} }
</style> </style>
<style lang="scss">
.large-checkbox {
:deep(.custom-checkbox) {
--checkbox-width: 240rpx;
--checkbox-height: 60rpx;
}
}
</style>

View File

@ -5,6 +5,7 @@
value-key="id" value-key="id"
label-key="name" label-key="name"
v-bind="$attrs" v-bind="$attrs"
width="100%"
/> />
</template> </template>
@ -20,11 +21,15 @@ getNature().then((res) => {
} }
}) })
const emits = defineEmits(['changeName', 'change']) const emits = defineEmits(['changeName', 'change', 'changeObj'])
const handleChange = (val: any) => { const handleChange = (val: any) => {
const names = infoList.value.filter((item) => val.includes(item.id)).map((item) => item.name) const chooseObj = val.map((id) => infoList.value.find((item) => item.id === id))
emits('changeName', names) emits(
'changeName',
chooseObj.map((item) => item.name),
)
emits('change', val) emits('change', val)
emits('changeObj', chooseObj)
} }
</script> </script>

View File

@ -1,6 +1,11 @@
<template> <template>
<view class=""> <view class="">
<RadioGroup v-model="choosePhase" class="custom-radio-group" @change="handleChange"> <RadioGroup
v-model="choosePhase"
class="custom-radio-group"
@change="handleChange"
v-bind="$attrs"
>
<Radio v-for="item in phaseList" :key="item.batch" :name="item.batch" class="custom-radio"> <Radio v-for="item in phaseList" :key="item.batch" :name="item.batch" class="custom-radio">
{{ item.batch }} {{ item.batch }}
</Radio> </Radio>
@ -17,7 +22,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { getBatchDynamicData, getWxUserInfo } from '@/service/index/api' import { getBatchDynamicData } from '@/service/index/api'
import RadioGroup from '@/pages-sub/components/radio-group/RadioGroup.vue' import RadioGroup from '@/pages-sub/components/radio-group/RadioGroup.vue'
import Radio from '@/pages-sub/components/radio-group/Radio.vue' import Radio from '@/pages-sub/components/radio-group/Radio.vue'
import { useUserStore } from '@/store/user' import { useUserStore } from '@/store/user'
@ -25,12 +30,6 @@ import { useRules } from '@/pages-sub/home/inputScore/useRules'
const userStore = useUserStore() const userStore = useUserStore()
defineOptions({
options: {
styleIsolation: 'shared',
},
})
const phaseList = ref([]) const phaseList = ref([])
const choosePhase = ref('') const choosePhase = ref('')
@ -46,41 +45,21 @@ const fetchBatchData = () => {
}).then((res) => { }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
phaseList.value = (res.result as { batches: any[] }).batches phaseList.value = (res.result as { batches: any[] }).batches
choosePhase.value = userStore.userInfo.batchName
handleChange(choosePhase.value)
} }
}) })
choosePhase.value = userStore.userInfo.batchName
handleChange(choosePhase.value)
} }
onLoad(() => { onLoad(() => {
useRules(fetchBatchData) useRules(fetchBatchData)
// if (userStore.userInfo.batchDataUrl) {
// fetchBatchData()
// } else {
// getWxUserInfo().then((resp) => {
// if (resp.code === 200) {
// const infoData = resp.result as unknown as {
// userExtend: { provinceCode: string }
// zyBatches: any[]
// batchDataUrl: string
// batchName: string
// }
// userStore.setEstimatedAchievement(infoData.userExtend)
// userStore.setZyBatches(infoData.zyBatches)
// userStore.setBatchDataUrl(infoData.batchDataUrl)
// userStore.setBatchName(infoData.batchName)
// fetchBatchData()
// }
// })
// }
}) })
const handleChange = (val: string) => { const handleChange = (val: string) => {
const phase = phaseList.value.find((item) => item.batch === val)
choosePhase.value = val choosePhase.value = val
emits('changeName', val) emits('changeName', val)
emits('change', val) emits('change', phase)
} }
</script> </script>

View File

@ -1,5 +1,11 @@
<template> <template>
<CheckGroup :list="regionList" @change="handleChange" label-key="simplename" v-bind="$attrs" /> <CheckGroup
:list="regionList"
@change="handleChange"
label-key="simplename"
v-bind="$attrs"
width="100%"
/>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -25,11 +31,16 @@ getRegionInfo().then((res) => {
} }
}) })
const emits = defineEmits(['change', 'changeName']) const emits = defineEmits(['change', 'changeName', 'changeObj'])
const handleChange = (val: any) => { const handleChange = (val: any) => {
const names = regionList.value.filter((item) => val.includes(item.code)).map((item) => item.name) const chooseObj = val.map((code) => regionList.value.find((item) => item.code === code))
emits('changeName', names)
emits(
'changeName',
chooseObj.map((item) => item.name),
)
emits('change', val) emits('change', val)
emits('changeObj', chooseObj)
} }
</script> </script>

View File

@ -6,6 +6,7 @@
value-key="id" value-key="id"
label-key="name" label-key="name"
v-bind="$attrs" v-bind="$attrs"
width="100%"
/> />
</template> </template>
@ -22,11 +23,15 @@ getUniversityType().then((res) => {
const defaultInfo = ref<string[]>([]) const defaultInfo = ref<string[]>([])
const emits = defineEmits(['change', 'changeName']) const emits = defineEmits(['change', 'changeName', 'changeObj'])
const handleChange = (val: any) => { const handleChange = (val: any) => {
const names = infoList.value.filter((item) => val.includes(item.id)).map((item) => item.name) const chooseObj = val.map((id) => infoList.value.find((item) => item.id === id))
emits('changeName', names) emits(
'changeName',
chooseObj.map((item) => item.name),
)
emits('change', val) emits('change', val)
emits('changeObj', chooseObj)
} }
</script> </script>

View File

@ -96,13 +96,14 @@
<ActionSheet v-model:show="show" title=""> <ActionSheet v-model:show="show" title="">
<template> <template>
<view class="py-[32rpx] flex flex-col items-center justify-center"> <view class="pt-[32rpx] flex flex-col items-center justify-center">
<text class="text-[#303030] text-[36rpx] font-bold mb-[18rpx]">省份</text> <text class="text-[#303030] text-[36rpx] font-bold">省份</text>
<Region <Region
@change="handleRegionChangeCode" @change="handleRegionChangeCode"
@change-name="handleRegionChangeName" @change-name="handleRegionChangeName"
:defaultValue="searchParams.locationCode ? [searchParams.locationCode] : []" :defaultValue="searchParams.locationCode ? [searchParams.locationCode] : []"
:max="1" :max="1"
class="custom-check-group w-full"
/> />
</view> </view>
</template> </template>
@ -174,6 +175,7 @@ onLoad(() => {
@import '@/pages-evaluation-sub/styles/navbar-background.scss'; @import '@/pages-evaluation-sub/styles/navbar-background.scss';
@import '@/pages-sub/home/styles/search-input.scss'; @import '@/pages-sub/home/styles/search-input.scss';
@import '@/pages-sub/home/styles/picker-view-btn.scss'; @import '@/pages-sub/home/styles/picker-view-btn.scss';
@import '@/pages-sub/home/styles/grid-checkbox.scss';
.border-right { .border-right {
border-right: 2rpx solid #eeeeee; border-right: 2rpx solid #eeeeee;

View File

@ -29,24 +29,38 @@
/> />
<view class="custom-background h-[200rpx] w-full absolute top-0 left-0 z-[-1]"></view> <view class="custom-background h-[200rpx] w-full absolute top-0 left-0 z-[-1]"></view>
</view> </view>
<drop-menu> <drop-menu ref="dropMenuRef">
<drop-menu-item :key="1" :title="'省份'" custom-class="flex items-center"> <drop-menu-item
<view class="pl-[32rpx] pb-[32rpx] pt-[16rpx]"> :key="item.id"
<Region :title="item.title"
:defaultValue="searchParams.locationCode" custom-class="flex items-center"
@changeName="handleRegionChange" v-for="item in subMenu"
@change="handleRegionChangeCode" :activation="item.activation"
/> >
</view> <Region
</drop-menu-item> :defaultValue="regionKeyInfo"
<drop-menu-item :key="2" :title="'层次'" custom-class="flex items-center"> @changeName="handleRegionChange"
<view class="pl-[32rpx] pb-[32rpx] pt-[16rpx]"> @change="handleRegionChangeCode"
<Nature @changeName="handleNatureChange" /> class="custom-check-group"
</view> v-if="item.id === 1"
</drop-menu-item> />
<drop-menu-item :key="3" title="类别" custom-class="flex items-center"> <Nature
<view class="pl-[32rpx] pb-[32rpx] pt-[16rpx]"> :defaultValue="natureKeyInfo"
<UniType @change-name="handleUniTypeChange" /> @changeName="handleNatureChange"
@change="handleNatureChangeCode"
class="custom-check-group"
v-if="item.id === 2"
/>
<UniType
:defaultValue="uniTypeKeyInfo"
@change-name="handleUniTypeChange"
@change="handleUniTypeChangeCode"
class="custom-check-group"
v-if="item.id === 3"
/>
<view class="flex items-center justify-between px-[16rpx] pb-[32rpx]">
<view class="cancel-btn" @click="handleClear"></view>
<view class="submit-btn" @click="handleCheck"></view>
</view> </view>
</drop-menu-item> </drop-menu-item>
</drop-menu> </drop-menu>
@ -138,8 +152,7 @@ import { getAdmissionTrends } from '@/service/index/api'
const userStore = useUserStore() const userStore = useUserStore()
const searchParams = ref({ const searchParams = ref({
locationCode: [userStore.userInfo.estimatedAchievement.provinceCode || '370000'], locationName: [],
locationName: [userStore.userInfo.estimatedAchievement.provinceName || '山东省'],
type: [], type: [],
searchNature: [], searchNature: [],
collegeName: '', collegeName: '',
@ -153,22 +166,29 @@ const navigatorBack = () => {
uni.navigateBack() uni.navigateBack()
} }
const handleNatureChangeCode = (val) => {
natureKeyInfo.value = val
}
const handleUniTypeChangeCode = (val) => {
uniTypeKeyInfo.value = val
}
const handleRegionChangeCode = (val) => {
regionKeyInfo.value = val
}
const handleRegionChange = (val) => { const handleRegionChange = (val) => {
searchParams.value.locationName = val searchParams.value.locationName = val
subMenu.value[0].activation = val.length !== 0
} }
const handleRegionChangeCode = (val) => { const handleNatureChange = (val) => {
searchParams.value.locationCode = val searchParams.value.searchNature = val
paging.value.reload() subMenu.value[1].activation = val.length !== 0
} }
const handleUniTypeChange = (val) => { const handleUniTypeChange = (val) => {
searchParams.value.type = val searchParams.value.type = val
paging.value.reload() subMenu.value[2].activation = val.length !== 0
}
const handleNatureChange = (val) => {
searchParams.value.searchNature = val
paging.value.reload()
} }
const lineList = ref([]) const lineList = ref([])
@ -196,9 +216,37 @@ const queryList = (page: number, pageSize: number) => {
const virtualListChange = (_vList) => { const virtualListChange = (_vList) => {
lineList.value = _vList lineList.value = _vList
} }
const subMenu = ref([
{ id: 1, title: '省份', activation: false },
{ id: 2, title: '层次', activation: false },
{ id: 3, title: '类别', activation: false },
])
const dropMenuRef = ref()
const regionKeyInfo = ref([]) //
const uniTypeKeyInfo = ref([]) //
const natureKeyInfo = ref([]) //
const handleClear = () => {
regionKeyInfo.value = []
uniTypeKeyInfo.value = []
natureKeyInfo.value = []
subMenu.value.forEach((item) => {
item.activation = false
})
dropMenuRef.value.closeDropMenu()
}
const handleCheck = () => {
dropMenuRef.value.closeDropMenu()
handleConfirm()
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/pages-sub/home/styles/navbar-background.scss'; @import '@/pages-sub/home/styles/navbar-background.scss';
@import '@/pages-sub/home/styles/search-input.scss'; @import '@/pages-sub/home/styles/search-input.scss';
@import '@/pages-sub/home/styles/grid-checkbox.scss';
@import '@/pages-sub/home/styles/picker-view-btn.scss';
</style> </style>

View File

@ -19,41 +19,36 @@
/> />
<view class="custom-background h-[200rpx] w-full absolute top-0 left-0 z-[-1]"></view> <view class="custom-background h-[200rpx] w-full absolute top-0 left-0 z-[-1]"></view>
</view> </view>
<drop-menu> <drop-menu ref="dropMenuRef">
<drop-menu-item :key="1" :title="searchParams.locationName || '省份'"> <drop-menu-item
<view class="pl-[32rpx] pb-[32rpx] pt-[16rpx]"> :key="1"
<Region :title="searchParams.locationName || '省份'"
:defaultValue="searchParams.locationCode ? [searchParams.locationCode] : []" :activation="searchParams.locationName !== ''"
:max="1" >
@changeName="handleRegionChange" <Region
@change="handleRegionChangeCode" :defaultValue="searchParams.locationCode ? [searchParams.locationCode] : []"
/> :max="1"
</view> class="custom-check-group"
@changeName="handleRegionChange"
@change="handleRegionChangeCode"
/>
</drop-menu-item> </drop-menu-item>
<drop-menu-item <drop-menu-item
:key="2" :key="2"
:title="searchParams.year || '年份'" :title="searchParams.year || '年份'"
custom-class="flex items-center" custom-class="flex items-center"
:activation="searchParams.year !== ''"
> >
<view class="pl-[32rpx] pb-[32rpx] pt-[16rpx]"> <CheckGroup
<CheckGroup :list="checkYearList"
:list="checkYearList" :default-value="searchParams.year ? [searchParams.year] : []"
:default-value="searchParams.year ? [searchParams.year] : []" @change="handleYearChange"
@change="handleYearChange" labelKey="year"
labelKey="year" valueKey="year"
valueKey="year" :max="1"
:max="1" class="custom-check-group"
/> width="100%"
</view> />
</drop-menu-item>
<drop-menu-item :key="3" title="类别" custom-class="flex items-center">
<view class="pl-[32rpx] pb-[32rpx] pt-[16rpx]">
<UniType
@change="handleUniTypeChange"
:max="1"
:default-value="searchParams.type ? [searchParams.type] : []"
/>
</view>
</drop-menu-item> </drop-menu-item>
</drop-menu> </drop-menu>
<WXXTable :data="lineList" class="px-[32rpx] mt-[16rpx] pb-safe flex-1"> <WXXTable :data="lineList" class="px-[32rpx] mt-[16rpx] pb-safe flex-1">
@ -72,7 +67,6 @@ import { useUserStore } from '@/store'
import DropMenu from '@/pages-sub/components/drop-menu/DropMenu.vue' import DropMenu from '@/pages-sub/components/drop-menu/DropMenu.vue'
import DropMenuItem from '@/pages-sub/components/drop-menu/DropMenuItem.vue' import DropMenuItem from '@/pages-sub/components/drop-menu/DropMenuItem.vue'
import Region from '@/pages-sub/home/components/Region.vue' import Region from '@/pages-sub/home/components/Region.vue'
import UniType from '@/pages-sub/home/components/UniType.vue'
import CheckGroup from '@/pages-sub/components/check-group/CheckGroup.vue' import CheckGroup from '@/pages-sub/components/check-group/CheckGroup.vue'
import WXXTable from '@/pages-sub/components/table/Table.vue' import WXXTable from '@/pages-sub/components/table/Table.vue'
@ -91,6 +85,8 @@ const searchParams = ref({
const checkYearList = ref([]) const checkYearList = ref([])
const dropMenuRef = ref()
const navigatorBack = () => { const navigatorBack = () => {
uni.navigateBack() uni.navigateBack()
} }
@ -101,11 +97,9 @@ const handleRegionChange = (val) => {
const handleRegionChangeCode = (val) => { const handleRegionChangeCode = (val) => {
searchParams.value.locationCode = val[0] searchParams.value.locationCode = val[0]
getBatchListData() getBatchListData()
} if (val.length !== 0) {
dropMenuRef.value.closeDropMenu()
const handleUniTypeChange = (val) => { }
searchParams.value.type = val[0]
getBatchListData()
} }
const handleYearChange = (val) => { const handleYearChange = (val) => {
@ -161,4 +155,5 @@ onBeforeMount(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
@import '@/pages-sub/home/styles/navbar-background.scss'; @import '@/pages-sub/home/styles/navbar-background.scss';
@import '@/pages-sub/home/styles/grid-checkbox.scss';
</style> </style>

View File

@ -36,7 +36,7 @@
/> />
<image <image
class="h-[190rpx] w-[190rpx] absolute top-[194rpx] left-[460rpx] mix-blend-multiply z-[-1]" class="h-[190rpx] w-[190rpx] absolute top-[194rpx] left-[460rpx] mix-blend-multiply z-[-1]"
src="https://api.static.ycymedu.com/sub/images/schoolRank/trophy.jpg" src="https://api.static.ycymedu.com/sub/images/schoolRank/trophy.png"
/> />
</view> </view>
<view class="my-[24rpx]"> <view class="my-[24rpx]">

View File

@ -0,0 +1,12 @@
.custom-check-group {
:deep(.checkbox-group) {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
gap: 16rpx;
padding: 32rpx 16rpx 16rpx;
}
:deep(.custom-checkbox) {
--checkbox-width: 100%;
}
}

View File

@ -13,7 +13,7 @@
v-for="(item, index) in list" v-for="(item, index) in list"
:key="index" :key="index"
class="flex gap-[24rpx] wish-border justify-between p-[32rpx] rounded-[8rpx]" class="flex gap-[24rpx] wish-border justify-between p-[32rpx] rounded-[8rpx]"
@click="toDetail(item)" @click="useRouterDetail(item)"
> >
<view class="flex flex-col gap-[14rpx]"> <view class="flex flex-col gap-[14rpx]">
<text class="text-[#303030] text-[32rpx] font-semibold"> <text class="text-[#303030] text-[32rpx] font-semibold">
@ -29,63 +29,12 @@
<script setup lang="ts"> <script setup lang="ts">
import { getMyBusReports } from '@/service/index/api' import { getMyBusReports } from '@/service/index/api'
import { useUserStore } from '@/store' import { useUserStore } from '@/store'
import { useRouterDetail } from './useRouterDetail'
const userStore = useUserStore() const userStore = useUserStore()
const list = ref([]) const list = ref([])
const toDetail = (item: any) => {
// type=0
// =1
// =2
// =3
// =4
// =5
// =6 SAS
// =7 SDS
// =8 SCL-90
// =9 MHT
/// =-1
/// =-2
let url = ''
if (item.type === 0) {
url = `/pages-evaluation-sub/evaluate/academicReport/interestReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 1) {
url = `/pages-evaluation-sub/evaluate/academicReport/characterReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 2) {
url = `/pages-evaluation-sub/evaluate/academicReport/capabilityReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === -1) {
url = `/pages-evaluation-sub/evaluate/academicReport/opinionAboutReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 6) {
url = `/pages-evaluation-sub/evaluate/psychologicalReport/sasReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 7) {
url = `/pages-evaluation-sub/evaluate/psychologicalReport/sdsReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 9) {
// url = `/pages-evaluation-sub/evaluate/psychologicalReport/mhtReport?id=${item.reportsId}&type=${item.type}`
uni.showToast({
title: '开发中....',
icon: 'none',
})
return
} else if (item.type === 4) {
url = `/pages-evaluation-sub/evaluate/studyReport/learnStudyReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 5) {
url = `/pages-evaluation-sub/evaluate/studyReport/learnSkillReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 3) {
url = `/pages-evaluation-sub/evaluate/studyReport/anxietyReport?id=${item.reportsId}&type=${item.type}`
} else {
uni.showToast({
title: '开发中....',
icon: 'none',
})
return
}
uni.navigateTo({
url,
})
}
onLoad(() => { onLoad(() => {
getMyBusReports({ CustomId: userStore.userInfo?.estimatedAchievement.wxId }).then((res) => { getMyBusReports({ CustomId: userStore.userInfo?.estimatedAchievement.wxId }).then((res) => {
if (res.code === 200) { if (res.code === 200) {

View File

@ -0,0 +1,51 @@
export const useRouterDetail = (item: { reportsId: string; type: number }) => {
// type=0 兴趣测评报告
// =1 性格测评报告
// =2 能力测评
// =3 学生考试考虑
// =4 学习风格
// =5 学习技能
// =6 SAS
// =7 SDS
// =8 SCL-90
// =9 MHT
/// =-1 价值观
/// =-2 留学咨询
let url = ''
if (item.type === 0) {
url = `/pages-evaluation-sub/evaluate/academicReport/interestReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 1) {
url = `/pages-evaluation-sub/evaluate/academicReport/characterReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 2) {
url = `/pages-evaluation-sub/evaluate/academicReport/capabilityReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === -1) {
url = `/pages-evaluation-sub/evaluate/academicReport/opinionAboutReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 6) {
url = `/pages-evaluation-sub/evaluate/psychologicalReport/sasReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 7) {
url = `/pages-evaluation-sub/evaluate/psychologicalReport/sdsReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 9) {
// url = `/pages-evaluation-sub/evaluate/psychologicalReport/mhtReport?id=${item.reportsId}&type=${item.type}`
uni.showToast({
title: '开发中....',
icon: 'none',
})
return
} else if (item.type === 4) {
url = `/pages-evaluation-sub/evaluate/studyReport/learnStudyReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 5) {
url = `/pages-evaluation-sub/evaluate/studyReport/learnSkillReport?id=${item.reportsId}&type=${item.type}`
} else if (item.type === 3) {
url = `/pages-evaluation-sub/evaluate/studyReport/anxietyReport?id=${item.reportsId}&type=${item.type}`
} else {
uni.showToast({
title: '开发中....',
icon: 'none',
})
return
}
uni.navigateTo({
url,
})
}

View File

@ -1,5 +1,9 @@
<template> <template>
<view class="item-wrapper relative mt-[32rpx]" @click="toAssessmentPage"> <view
class="item-wrapper relative mt-[32rpx]"
:style="`--start-color: ${startColor}; --end-color: ${endColor}`"
@click="toAssessmentPage"
>
<view <view
class="flag text-[22rpx] text-center absolute top-0 right-0" class="flag text-[22rpx] text-center absolute top-0 right-0"
:class="{ free: item.isFree }" :class="{ free: item.isFree }"
@ -37,6 +41,14 @@ const props = defineProps({
type: Object, type: Object,
default: () => {}, default: () => {},
}, },
startColor: {
type: String,
default: '#e5f2fa',
},
endColor: {
type: String,
default: '#dae8fa',
},
}) })
const toAssessmentPage = () => { const toAssessmentPage = () => {
@ -59,7 +71,7 @@ const toAssessmentPage = () => {
<style scoped lang="scss"> <style scoped lang="scss">
.item-wrapper { .item-wrapper {
background: linear-gradient(270deg, #e5f2fa 0%, #dae8fa 100%); background: linear-gradient(90deg, #e5f2fa 0%, #dae8fa 100%);
border-radius: 18rpx; border-radius: 18rpx;
padding: 32rpx; padding: 32rpx;

View File

@ -13,17 +13,35 @@
<swiper class="flex-1" :current="currentIndex" @change="handleSwiperChange"> <swiper class="flex-1" :current="currentIndex" @change="handleSwiperChange">
<swiper-item> <swiper-item>
<view class="mx-[32rpx] overflow-auto h-full"> <view class="mx-[32rpx] overflow-auto h-full">
<EvaluationItem v-for="item in academicList" :key="item.id" :item="item"></EvaluationItem> <EvaluationItem
v-for="item in academicList"
:key="item.id"
:item="item"
start-color="#e5f2fa"
end-color="#dae8fa"
></EvaluationItem>
</view> </view>
</swiper-item> </swiper-item>
<swiper-item> <swiper-item>
<view class="mx-[32rpx] overflow-auto h-full"> <view class="mx-[32rpx] overflow-auto h-full">
<EvaluationItem v-for="item in healthList" :key="item.id" :item="item"></EvaluationItem> <EvaluationItem
v-for="item in healthList"
:key="item.id"
:item="item"
start-color="#E6F4F2"
end-color="#CAF4F0"
></EvaluationItem>
</view> </view>
</swiper-item> </swiper-item>
<swiper-item> <swiper-item>
<view class="mx-[32rpx] overflow-auto h-full"> <view class="mx-[32rpx] overflow-auto h-full">
<EvaluationItem v-for="item in learningList" :key="item.id" :item="item"></EvaluationItem> <EvaluationItem
v-for="item in learningList"
:key="item.id"
:item="item"
start-color="#E9EFFF"
end-color="#D8DFFD"
></EvaluationItem>
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>

View File

@ -111,8 +111,10 @@ const handleAppointment = (
if (res.code === 200) { if (res.code === 200) {
list.value[index].isAppointment = !item.isAppointment list.value[index].isAppointment = !item.isAppointment
list.value[index].appointId = res.result list.value[index].appointId = res.result
uni.showToast({ uni.showModal({
title: item.isAppointment ? '预约成功' : '取消预约成功', title: '预约成功',
content: '稍后会有老师联系您',
showCancel: false,
}) })
} else { } else {
uni.showToast({ uni.showToast({

View File

@ -101,7 +101,7 @@ onShow(() => {
onShareAppMessage(() => { onShareAppMessage(() => {
return { return {
title: '六维志愿', title: '六维志愿',
path: '/pages/index/index', path: '/pages/home/index/index',
imageUrl: 'https://api.static.ycymedu.com/images/share.png', imageUrl: 'https://api.static.ycymedu.com/images/share.png',
} }
}) })