feat: 学校列表以及详情页面调整
parent
95ad03bdf1
commit
7a4d32eaa2
|
|
@ -20,7 +20,7 @@ const userStore = useUserStore();
|
|||
const { userInfo } = storeToRefs(userStore)
|
||||
const isStar = ref(false)
|
||||
|
||||
const handlePreviewImage = (src: string, index: number) => {
|
||||
const handlePreviewImage = (src: string, index: number|string) => {
|
||||
uni.previewImage({
|
||||
urls: props.schoolDetail.imageList,
|
||||
current: index,
|
||||
|
|
@ -44,7 +44,7 @@ const starSchool = () => {
|
|||
onLoad(() => {
|
||||
getSchoolCollection().then((resp) => {
|
||||
if (resp.code === 200) {
|
||||
isStar.value = resp.result.some(school => school.id === props.schoolDetail.id)
|
||||
isStar.value = resp.result.some((school:any) => school.id === props.schoolDetail.id)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
@ -57,8 +57,15 @@ onLoad(() => {
|
|||
<view class="flex flex-col">
|
||||
<text class="font-600 text-[40rpx] text-[#000]">{{ schoolDetail.schoolName }}</text>
|
||||
<view class="flex items-center gap-[10rpx] my-[14rpx] flex-wrap" v-if="schoolDetail.tags">
|
||||
<view class="rounded-[8rpx] bg-[#E03C331A] px-[10rpx] py-[4rpx] text-[24rpx] text-[#E03C33] flex items-center gap-[4rpx]" v-if="schoolDetail.schoolName === '济南市深泉外国语学校'">
|
||||
<image
|
||||
src="https://lw-zk.oss-cn-hangzhou.aliyuncs.com/img/home/xuexiao_remen.png"
|
||||
mode="widthFix"
|
||||
class="w-[24rpx] h-[24rpx]"
|
||||
/>
|
||||
{{ new Date().getFullYear() - 1 }}招生计划完成率100%</view>
|
||||
<view
|
||||
class="rounded-[8rpx] bg-[#F8F8F8] px-[10rpx] py-[4rpx] text-[24rpx] text-[#666] first:border-solid border-red border-[1rpx]"
|
||||
class="bg-[#F8F8F8] px-[10rpx] py-[4rpx] text-[24rpx] text-[#666]"
|
||||
v-for="feature in schoolDetail.tags.split('、')" :key="feature">{{ feature }}</view>
|
||||
</view>
|
||||
<view class="text-[#303030] text-[24rpx] mb-[10rpx]">{{ schoolDetail.region }}·{{
|
||||
|
|
@ -72,7 +79,7 @@ onLoad(() => {
|
|||
收藏
|
||||
</view>
|
||||
</view>
|
||||
<swiper class="basis-full h-[126rpx]" circular :autoplay="true" :indicator="false" v-if="schoolDetail.imageList"
|
||||
<swiper class="basis-full h-[126rpx] grid grid-cols-3" circular :autoplay="true" :indicator="false" v-if="schoolDetail.imageList"
|
||||
:display-multiple-items="schoolDetail.imageList.length > 2 ? 3 : 1">
|
||||
<swiper-item v-for="(item, index) in schoolDetail.imageList" :key="item" class="flex justify-center">
|
||||
<image :src="item" mode="scaleToFill" class="w-full h-full mx-[4rpx] rounded-[8rpx]"
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@ definePage({
|
|||
excludeLoginPath: false,
|
||||
})
|
||||
// #endif
|
||||
const regions = ref([])
|
||||
const natureList = ref([])
|
||||
const regions = ref<any[]>([])
|
||||
const natureList = ref<any[]>([])
|
||||
|
||||
const schoolTypeList = ref([])
|
||||
const schoolTypeList = ref<any[]>([])
|
||||
|
||||
const searchParams = ref({
|
||||
region: null,
|
||||
|
|
@ -69,7 +69,7 @@ onLoad(() => {
|
|||
})
|
||||
|
||||
const paging = ref(null)
|
||||
const schoolList = ref([])
|
||||
const schoolList = ref<any[]>([])
|
||||
const queryList = (page: number, pageSize: number) => {
|
||||
getBusHightSchoolList({
|
||||
data: {
|
||||
|
|
@ -146,9 +146,16 @@ const handleComplete = () => {
|
|||
<view v-for="(val, index) in schoolList" :key="index" class="py-[30rpx] border-b-[#ededed] border-1 border-b-solid"
|
||||
@click="navigateToDetail(val.id)">
|
||||
<view class="text-[#000] text-[32rpx] font-600">{{ val.schoolName }}</view>
|
||||
<view class="flex items-center gap-[12rpx] my-[10rpx]">
|
||||
<view class="flex items-center flex-wrap gap-[12rpx] my-[10rpx]">
|
||||
<view class="rounded-[8rpx] bg-[#E03C331A] px-[10rpx] py-[4rpx] text-[24rpx] text-[#E03C33] flex items-center gap-[4rpx]" v-if="val.schoolName === '济南市深泉外国语学校'">
|
||||
<image
|
||||
src="https://lw-zk.oss-cn-hangzhou.aliyuncs.com/img/home/xuexiao_remen.png"
|
||||
mode="widthFix"
|
||||
class="w-[24rpx] h-[24rpx]"
|
||||
/>
|
||||
{{ new Date().getFullYear() - 1 }}招生计划完成率100%</view>
|
||||
<view class="rounded-[8rpx] bg-[#F8F8F8] px-[10rpx] py-[4rpx] text-[24rpx] text-[#666]"
|
||||
v-for="feature in val.tags.split('、').slice(0, 2)" :key="feature">{{ feature }}</view>
|
||||
v-for="feature in val.tags.split(/[\s,,、]+/).slice(0, 2)" :key="feature">{{ feature }}</view>
|
||||
</view>
|
||||
<view class="text-[#666] text-[24rpx]">{{ val.region }}·{{val.schoolNature }}</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
<script lang="ts" setup>
|
||||
import HighSchoolDetailHeader from './components/HighSchoolDetailHeader.vue'
|
||||
import MxTabs from "@/pages-sub/components/tabs/index.vue"
|
||||
import { systemInfo } from '@/utils/systemInfo'
|
||||
import SchoolIntroduce from './components/SchoolIntroduce.vue'
|
||||
import EnrollmentIntroDetail from './components/EnrollmentIntroDetail.vue'
|
||||
import QuotaAndScore from './components/QuotaAndScore.vue'
|
||||
import { getSchoolInfo } from '@/service'
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
|
|
@ -32,7 +29,7 @@ const handleBack = () => {
|
|||
}
|
||||
|
||||
|
||||
const tabs = [{ name: '院校简介' }, { name: "招生简章" }, { name: '名额分数' }]
|
||||
const tabs = [{ name: '院校简介' },]
|
||||
const activeIndex = ref(0)
|
||||
const handleChange = (val: number) => {
|
||||
activeIndex.value = val
|
||||
|
|
@ -41,7 +38,7 @@ const handleChange = (val: number) => {
|
|||
const schoolDetail = ref({})
|
||||
|
||||
onLoad((options) => {
|
||||
if(options.id){
|
||||
if(options?.id){
|
||||
getSchoolInfo({query:{id:options.id}}).then(resp => {
|
||||
if(resp.code == 200){
|
||||
schoolDetail.value = resp.result
|
||||
|
|
@ -59,13 +56,9 @@ onLoad((options) => {
|
|||
:root-style="{ '--sar-navbar-bg': `rgba(255, 255, 255, 0)`, 'padding-top': `${systemInfo?.statusBarHeight}px`, '--sar-navbar-item-color': 'black' }">
|
||||
</sar-navbar>
|
||||
<HighSchoolDetailHeader :schoolDetail="schoolDetail"/>
|
||||
<mx-tabs :tabsList="tabs" @tab-change="handleChange" />
|
||||
<view class="bg-[#f8f8f8] h-[20rpx]"></view>
|
||||
<SchoolIntroduce :schoolDetail="schoolDetail" v-if="activeIndex === 0" />
|
||||
<EnrollmentIntroDetail :schoolDetail="schoolDetail" v-if="activeIndex === 1" />
|
||||
<QuotaAndScore :schoolDetail="schoolDetail" v-if="activeIndex === 2" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
//</style>
|
||||
<style lang="scss" scoped></style>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* eslint-disable import/no-mutable-exports */
|
||||
// 获取屏幕边界到安全区域距离
|
||||
let systemInfo
|
||||
let safeAreaInsets
|
||||
let systemInfo: any
|
||||
let safeAreaInsets: any
|
||||
let headerBarHeight = 0
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
|
|
|
|||
Loading…
Reference in New Issue