feat: 找大学编写中
parent
6950ec7ed2
commit
9c56a6952a
|
|
@ -123,6 +123,7 @@
|
||||||
"useNewsList": true,
|
"useNewsList": true,
|
||||||
"newsList": true,
|
"newsList": true,
|
||||||
"useLogin": true,
|
"useLogin": true,
|
||||||
"useWxInfo": true
|
"useWxInfo": true,
|
||||||
|
"useUniversityInfo": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ VITE_APP_TITLE = '六维志愿'
|
||||||
VITE_APP_PORT = 9000
|
VITE_APP_PORT = 9000
|
||||||
|
|
||||||
VITE_UNI_APPID = 'H57F2ACE4'
|
VITE_UNI_APPID = 'H57F2ACE4'
|
||||||
VITE_WX_APPID = '__UNI__7AE2402'
|
VITE_WX_APPID = 'wx05e75004e657527c'
|
||||||
|
|
||||||
# h5部署网站的base,配置到 manifest.config.ts 里的 h5.router.base
|
# h5部署网站的base,配置到 manifest.config.ts 里的 h5.router.base
|
||||||
VITE_APP_PUBLIC_BASE=
|
VITE_APP_PUBLIC_BASE=
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<wd-checkbox-group
|
<wd-checkbox-group
|
||||||
v-model="defValue"
|
v-model="defValue"
|
||||||
custom-class="flex flex-wrap gap-[16rpx] justify-items-center items-center"
|
custom-class="flex flex-wrap gap-[16rpx] px-[32rpx] pb-[16rpx] items-center"
|
||||||
checked-color="#1580FF"
|
checked-color="#1580FF"
|
||||||
@change="handleChange"
|
@change="handleChange"
|
||||||
>
|
>
|
||||||
|
|
@ -11,8 +11,8 @@
|
||||||
:model-value="item[valueKey]"
|
:model-value="item[valueKey]"
|
||||||
cell
|
cell
|
||||||
shape="button"
|
shape="button"
|
||||||
custom-class="w-[152rpx]! h-[76rpx] p-0! mr-0!"
|
custom-class="w-auto! h-[76rpx] p-0! mr-0!"
|
||||||
custom-label-class="w-[152rpx]! h-[76rpx]! rounded-[8rpx]! checkbox-item-border bg-[#f7f8fa]!"
|
custom-label-class="min-w-[152rpx]! h-[76rpx]! rounded-[8rpx]! checkbox-item-border bg-[#f7f8fa]!"
|
||||||
>
|
>
|
||||||
{{ item[labelKey] }}
|
{{ item[labelKey] }}
|
||||||
</wd-checkbox>
|
</wd-checkbox>
|
||||||
|
|
@ -55,7 +55,7 @@ watch(
|
||||||
{ immediate: true },
|
{ immediate: true },
|
||||||
)
|
)
|
||||||
|
|
||||||
const handleChange = (val: string[]) => {
|
const handleChange = (val: unknown) => {
|
||||||
emits('change', val)
|
emits('change', val)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,12 @@ import { useNatureList } from '@/hooks/useFilterSchool'
|
||||||
const { natureList: infoList } = useNatureList()
|
const { natureList: infoList } = useNatureList()
|
||||||
const defaultInfo = ref<string[]>([])
|
const defaultInfo = ref<string[]>([])
|
||||||
|
|
||||||
const handleChange = (val: string[]) => {
|
const emits = defineEmits(['changeName'])
|
||||||
console.log(val)
|
|
||||||
|
const handleChange = (val: any) => {
|
||||||
|
const names = infoList.value
|
||||||
|
.filter((item) => val.value.includes(item.id))
|
||||||
|
.map((item) => item.name)
|
||||||
|
emits('changeName', names)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -17,10 +17,22 @@ defineOptions({
|
||||||
})
|
})
|
||||||
|
|
||||||
const { regionList } = useRegionInfo()
|
const { regionList } = useRegionInfo()
|
||||||
const regionInfo = ref<string[]>(['110000', '120000'])
|
|
||||||
|
|
||||||
const handleChange = (val: string[]) => {
|
const props = defineProps({
|
||||||
console.log(val)
|
regionInfo: {
|
||||||
|
type: Array as PropType<string[]>,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const emits = defineEmits(['change', 'changeName'])
|
||||||
|
|
||||||
|
const handleChange = (val: any) => {
|
||||||
|
const names = regionList.value
|
||||||
|
.filter((item) => val.value.includes(item.code))
|
||||||
|
.map((item) => item.name)
|
||||||
|
emits('changeName', names)
|
||||||
|
emits('change', val)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -15,7 +15,13 @@ import { useUniversityType } from '@/hooks/useFilterSchool'
|
||||||
const { typeList: infoList } = useUniversityType()
|
const { typeList: infoList } = useUniversityType()
|
||||||
const defaultInfo = ref<string[]>([])
|
const defaultInfo = ref<string[]>([])
|
||||||
|
|
||||||
const handleChange = (val: string[]) => {
|
const emits = defineEmits(['change', 'changeName'])
|
||||||
console.log(val)
|
|
||||||
|
const handleChange = (val: any) => {
|
||||||
|
const names = infoList.value
|
||||||
|
.filter((item) => val.value.includes(item.id))
|
||||||
|
.map((item) => item.name)
|
||||||
|
emits('changeName', names)
|
||||||
|
emits('change', val)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<wd-overlay :show="show" @click="handleClose">
|
<wd-overlay :show="show">
|
||||||
<view
|
<view
|
||||||
class="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[10071] flex flex-col items-center bg-white p-[40rpx] rounded-[32rpx]"
|
class="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 flex flex-col items-center bg-white p-[40rpx] rounded-[32rpx]"
|
||||||
>
|
>
|
||||||
<image
|
<image
|
||||||
class="w-[200rpx] h-[200rpx]"
|
class="w-[200rpx] h-[200rpx]"
|
||||||
|
|
@ -15,14 +15,14 @@
|
||||||
<wd-button
|
<wd-button
|
||||||
size="large"
|
size="large"
|
||||||
custom-class="w-[493rpx] mb-[40rpx]"
|
custom-class="w-[493rpx] mb-[40rpx]"
|
||||||
@click="handleClick"
|
@click.stop="handleClick"
|
||||||
open-type="getPhoneNumber"
|
open-type="getPhoneNumber"
|
||||||
@getphonenumber="getPhoneNumber"
|
@getphonenumber="getPhoneNumber"
|
||||||
>
|
>
|
||||||
手机号快捷登录
|
手机号快捷登录
|
||||||
</wd-button>
|
</wd-button>
|
||||||
|
|
||||||
<view class="flex items-center flex-nowrap" @click="checked = true">
|
<view class="flex items-center flex-nowrap" @click.stop="checked = true">
|
||||||
<wd-radio-group v-model="checked" custom-class="mr-10rpx">
|
<wd-radio-group v-model="checked" custom-class="mr-10rpx">
|
||||||
<wd-radio :value="true" shape="dot"></wd-radio>
|
<wd-radio :value="true" shape="dot"></wd-radio>
|
||||||
</wd-radio-group>
|
</wd-radio-group>
|
||||||
|
|
@ -38,9 +38,15 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useToast } from 'wot-design-uni'
|
import { useToast } from 'wot-design-uni'
|
||||||
import { useLogin, useWxInfo } from '@/hooks/useUserInfo'
|
import { useLogin } from '@/hooks/useUserInfo'
|
||||||
import { getSessionKey } from '@/service/index/api'
|
import {
|
||||||
|
getSessionKey,
|
||||||
|
getVolunteerInitialization,
|
||||||
|
getWxUserInfo,
|
||||||
|
setWxInfo,
|
||||||
|
} from '@/service/index/api'
|
||||||
import { useUserStore } from '@/store'
|
import { useUserStore } from '@/store'
|
||||||
|
import { City } from '@/types/app-type'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
show: {
|
show: {
|
||||||
|
|
@ -54,12 +60,13 @@ defineOptions({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const emits = defineEmits(['update:close'])
|
const emits = defineEmits(['update:show', 'authReady'])
|
||||||
|
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
emits('update:close', false)
|
emits('update:show', false)
|
||||||
}
|
}
|
||||||
|
|
||||||
const phone = ref(true) // 手机号登陆
|
const phone = ref(true) // 手机号登陆
|
||||||
|
|
@ -74,8 +81,7 @@ const getPhoneNumber = async (e: any) => {
|
||||||
code: e.code,
|
code: e.code,
|
||||||
}
|
}
|
||||||
getPhoneInfo.value = _getPhoneInfo
|
getPhoneInfo.value = _getPhoneInfo
|
||||||
getUserInfo(e.code)
|
await getUserInfo(e.code)
|
||||||
// this.phone = false
|
|
||||||
} else if (e.errMsg == 'getPhoneNumber:fail not login') {
|
} else if (e.errMsg == 'getPhoneNumber:fail not login') {
|
||||||
toast.warning('请先登录')
|
toast.warning('请先登录')
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -91,21 +97,44 @@ const handleClick = () => {
|
||||||
|
|
||||||
const getUserInfo = async (code: string) => {
|
const getUserInfo = async (code: string) => {
|
||||||
let userInfo = (await useLogin()) as { code: string; errMsg: string }
|
let userInfo = (await useLogin()) as { code: string; errMsg: string }
|
||||||
console.log(userInfo)
|
|
||||||
|
|
||||||
if (userInfo.errMsg == 'login:ok') {
|
if (userInfo.errMsg == 'login:ok') {
|
||||||
const resp = await getSessionKey({ JsCode: userInfo.code })
|
const resp = await getSessionKey({ JsCode: userInfo.code })
|
||||||
if (resp.code == 200) {
|
if (resp.code == 200) {
|
||||||
|
const result = resp.result as { accessToken: string; openId: string }
|
||||||
|
userStore.setUserToken(result.accessToken)
|
||||||
|
userStore.setUserOpenId(result.openId)
|
||||||
|
|
||||||
|
setWxInfo({ code: userInfo.code, openId: result.openId })
|
||||||
|
|
||||||
|
// 根据微信的信息获取用户信息
|
||||||
|
getWxUserInfo().then((resp) => {
|
||||||
|
const infoData = resp.result as unknown as { userExtend: { provinceCode: string } }
|
||||||
|
userStore.setEstimatedAchievement(infoData.userExtend)
|
||||||
|
if (resp.code === 200) {
|
||||||
|
// 根据用户信息中的城市设置对应城市的分数等信息
|
||||||
|
getVolunteerInitialization().then((res) => {
|
||||||
|
let list = res.result as any[]
|
||||||
|
let code = infoData.userExtend ? infoData.userExtend.provinceCode : ''
|
||||||
|
let addressItem: City
|
||||||
|
if (code !== '') {
|
||||||
|
for (let i = 0; i < list.length; i++) {
|
||||||
|
if (list[i].code == code) {
|
||||||
|
addressItem = list[i]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
userStore.setUserCity(addressItem)
|
||||||
|
handleClose()
|
||||||
|
emits('authReady')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
// useWxInfo({ code, OpenId: (resp.result as { openId: string }).openId })
|
|
||||||
} else {
|
} else {
|
||||||
toast.warning('您需先授权')
|
toast.warning('您需先授权')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const parsePhoneNumber = (code: string, openId: string) => {
|
|
||||||
// 解析手机号
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -1,170 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<!-- 使用 scroll-view 组件来实现滚动 -->
|
|
||||||
<scroll-view
|
|
||||||
ref="list"
|
|
||||||
:scroll-y="true"
|
|
||||||
class="list-container"
|
|
||||||
@scroll="handleScroll"
|
|
||||||
:scroll-top="state.startOffset"
|
|
||||||
>
|
|
||||||
<view class="list-phantom" :style="{ height: `${listHeight}${itemSizeUnit}` }"></view>
|
|
||||||
<view class="list" :style="{ transform: getTransform }">
|
|
||||||
<view
|
|
||||||
v-for="(item, index) in visibleData"
|
|
||||||
class="list-item"
|
|
||||||
:key="index"
|
|
||||||
:ref="setItemRef"
|
|
||||||
:style="`height:${state.itemHeights[index]}${itemSizeUnit}`"
|
|
||||||
>
|
|
||||||
<!-- <slot name="cell" :item="item" :index="index"></slot> -->
|
|
||||||
<text class="">
|
|
||||||
{{ item.name }}
|
|
||||||
</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { reactive, onMounted, computed } from 'vue'
|
|
||||||
|
|
||||||
const state = reactive({
|
|
||||||
listHeight: 0,
|
|
||||||
screenHeight: 0, // 屏幕高度即可视区域高度
|
|
||||||
startOffset: 0, // 顶部偏移量
|
|
||||||
startIndex: 0, // 可视化区域的数据开始下标
|
|
||||||
endIndex: 0, // 可视化区域的数据结束下标
|
|
||||||
itemHeights: [] as number[], // 用来存储每个列表项的高度
|
|
||||||
})
|
|
||||||
const props = defineProps({
|
|
||||||
listData: {
|
|
||||||
type: Array<{ name: string; id: number }>,
|
|
||||||
default: () => [],
|
|
||||||
},
|
|
||||||
//每项高度
|
|
||||||
itemSize: {
|
|
||||||
type: Number,
|
|
||||||
default: 200,
|
|
||||||
},
|
|
||||||
itemSizeUnit: {
|
|
||||||
type: String,
|
|
||||||
default: 'px',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
// const listHeight = computed(() => {
|
|
||||||
// return props.listData.length * props.itemSize
|
|
||||||
// })
|
|
||||||
|
|
||||||
const listHeight = computed(() => {
|
|
||||||
// 总高度是所有项高度的总和
|
|
||||||
return state.itemHeights.reduce((sum, height) => sum + height, 0) || 0
|
|
||||||
})
|
|
||||||
|
|
||||||
const visibleCount = computed(() => {
|
|
||||||
return Math.ceil(state.screenHeight / props.itemSize) || 0
|
|
||||||
})
|
|
||||||
const getTransform = computed(() => {
|
|
||||||
return `translate3d(0,${state.startOffset}${props.itemSizeUnit},0)`
|
|
||||||
})
|
|
||||||
const visibleData = computed(() => {
|
|
||||||
return props.listData.slice(state.startIndex, Math.min(state.endIndex, props.listData.length))
|
|
||||||
})
|
|
||||||
onMounted(() => {
|
|
||||||
init()
|
|
||||||
})
|
|
||||||
const init = () => {
|
|
||||||
getScreenHeight()
|
|
||||||
|
|
||||||
// 设置初始滚动距离 state.startIndex = 0 如果不是从第一个开始滚动 num为第几个开始 state.startIndex = num state.startOffset = num * props.itemSize
|
|
||||||
// state.startIndex = 0
|
|
||||||
state.startIndex = 0
|
|
||||||
state.startOffset = 0
|
|
||||||
state.endIndex = state.startIndex + visibleCount.value
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取屏幕高度即可视化区域高度
|
|
||||||
const getScreenHeight = () => {
|
|
||||||
uni.getSystemInfo({
|
|
||||||
success: function (res) {
|
|
||||||
state.screenHeight = res.screenHeight
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 防抖 节流方法 debounce第三个参数没用 可以删除
|
|
||||||
const debounce = (fn, delay, _this) => {
|
|
||||||
var delay = delay || 200
|
|
||||||
var timer = null
|
|
||||||
return function () {
|
|
||||||
let self = _this
|
|
||||||
let args = arguments
|
|
||||||
timer && clearTimeout(timer)
|
|
||||||
timer = setTimeout(function () {
|
|
||||||
timer = null
|
|
||||||
fn.apply(self, args)
|
|
||||||
}, delay)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const handleScroll = debounce(
|
|
||||||
(e) => {
|
|
||||||
//当前滚动位置
|
|
||||||
let scrollTop = e.detail.scrollTop
|
|
||||||
//开始索引
|
|
||||||
state.startIndex = Math.floor(scrollTop / props.itemSize)
|
|
||||||
//结束索引
|
|
||||||
state.endIndex = state.startIndex + visibleCount.value
|
|
||||||
//顶部偏移量
|
|
||||||
state.startOffset = scrollTop - (scrollTop % props.itemSize)
|
|
||||||
},
|
|
||||||
10,
|
|
||||||
'',
|
|
||||||
)
|
|
||||||
|
|
||||||
const itemRefs = ref([])
|
|
||||||
const setItemRef = (el) => {
|
|
||||||
if (el) {
|
|
||||||
itemRefs.value.push(el)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 计算每个列表项的高度
|
|
||||||
const calculateItemHeights = () => {
|
|
||||||
state.itemHeights = props.listData.map((_, index) => {
|
|
||||||
const refItem = itemRefs.value[index]
|
|
||||||
return refItem && refItem.$el ? refItem.$el.offsetHeight : props.itemSize // 如果有真实内容,则获取实际高度;否则,使用默认高度
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
watch(itemRefs.value, () => {
|
|
||||||
calculateItemHeights()
|
|
||||||
})
|
|
||||||
|
|
||||||
// 监听插槽内容变化,重新计算列表项高度
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.content {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
.list-container {
|
|
||||||
height: 100%;
|
|
||||||
overflow: auto;
|
|
||||||
position: relative;
|
|
||||||
.list-phantom {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
z-index: -1;
|
|
||||||
}
|
|
||||||
.list {
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
position: absolute;
|
|
||||||
.list-item {
|
|
||||||
text-align: center;
|
|
||||||
border-bottom: 1px solid #ccc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,9 +1,4 @@
|
||||||
import {
|
import { getNewsTop, getProvinceInitialization, getNewsDetailInfo } from '@/service/index/api'
|
||||||
getNewsTop,
|
|
||||||
getVolunteerInitialization,
|
|
||||||
getNewsDetailInfo,
|
|
||||||
getNewsList,
|
|
||||||
} from '@/service/index/api'
|
|
||||||
import { useCityStore } from '@/store/city'
|
import { useCityStore } from '@/store/city'
|
||||||
import { useUserStore } from '@/store/user'
|
import { useUserStore } from '@/store/user'
|
||||||
import { City, News, NewsDetail } from '@/types/app-type'
|
import { City, News, NewsDetail } from '@/types/app-type'
|
||||||
|
|
@ -18,7 +13,7 @@ const userStore = useUserStore()
|
||||||
|
|
||||||
export const cities = []
|
export const cities = []
|
||||||
export const useCityInfo = () => {
|
export const useCityInfo = () => {
|
||||||
getVolunteerInitialization().then((res) => {
|
getProvinceInitialization().then((res) => {
|
||||||
if (res.result) {
|
if (res.result) {
|
||||||
const list = res.result as Province[]
|
const list = res.result as Province[]
|
||||||
const li = groupByFirstLetter(list)
|
const li = groupByFirstLetter(list)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { getWxInfo } from '@/service/index/api'
|
import { getUniversityInfo, setWxInfo } from '@/service/index/api'
|
||||||
|
import { useUserStore } from '@/store'
|
||||||
|
|
||||||
//uniapp 登陆获取用户信息
|
//uniapp 登陆获取用户信息
|
||||||
export const useLogin = () => {
|
export const useLogin = () => {
|
||||||
|
|
@ -18,10 +19,24 @@ export const useLogin = () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useWxInfo = ({ code, OpenId }) => {
|
export const useWxInfo = ({ code, openId }) => {
|
||||||
getWxInfo({ code, OpenId }).then((res) => {
|
setWxInfo({ code, openId }).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
console.log(res.result)
|
console.log(res.result)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const useUniversityInfo = (provinceCode: number) => {
|
||||||
|
const userStore = useUserStore()
|
||||||
|
const universityBaseInfo = ref({})
|
||||||
|
getUniversityInfo({ Cid: userStore.userInfo.estimatedAchievement.id, Id: provinceCode }).then(
|
||||||
|
(res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
universityBaseInfo.value = res.result
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
return { universityBaseInfo }
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@
|
||||||
},
|
},
|
||||||
"quickapp": {},
|
"quickapp": {},
|
||||||
"mp-weixin": {
|
"mp-weixin": {
|
||||||
"appid": "__UNI__7AE2402",
|
"appid": "wx05e75004e657527c",
|
||||||
"setting": {
|
"setting": {
|
||||||
"urlCheck": false
|
"urlCheck": false
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
<view class="py-[48rpx] mx-[48rpx] avatar-border flex justify-center items-center">
|
<view class="py-[48rpx] mx-[48rpx] avatar-border flex justify-center items-center">
|
||||||
<image
|
<image
|
||||||
class="w-[144rpx] h-[144rpx] rounded-full"
|
class="w-[144rpx] h-[144rpx] rounded-full"
|
||||||
src="@/pages-sub/static/images/customerService/avatar.svg"
|
src="@/pages-sub/static/images/customerService/avatar.jpg"
|
||||||
></image>
|
></image>
|
||||||
<view class="flex flex-col text-[#000] ml-[32rpx]">
|
<view class="flex flex-col text-[#000] ml-[32rpx]">
|
||||||
<text class="mb-[12rpx] font-normal text-[28rpx]">专属客服为您服务</text>
|
<text class="mb-[12rpx] font-normal text-[28rpx]">专属客服为您服务</text>
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
style: {
|
style: {
|
||||||
navigationStyle: 'custom',
|
navigationStyle: 'custom',
|
||||||
},
|
},
|
||||||
|
needLogin: true,
|
||||||
}
|
}
|
||||||
</route>
|
</route>
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -26,7 +27,7 @@
|
||||||
|
|
||||||
<image
|
<image
|
||||||
class="w-[286rpx] h-[286rpx] mt-[134rpx]"
|
class="w-[286rpx] h-[286rpx] mt-[134rpx]"
|
||||||
src="@/pages-sub/static/images/autoFill/auto-fill.svg"
|
src="@/pages-sub/static/images/autoFill/auto-fill.jpg"
|
||||||
></image>
|
></image>
|
||||||
</view>
|
</view>
|
||||||
<FilterMenu v-model:show="show" />
|
<FilterMenu v-model:show="show" />
|
||||||
|
|
@ -34,7 +35,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import FilterMenu from '@/components-sub/FilterMenu/FilterMenu.vue'
|
import FilterMenu from '@/components/filterMenu/FilterMenu.vue'
|
||||||
|
|
||||||
const navigatorBack = () => {
|
const navigatorBack = () => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,8 @@ const navigatorBack = () => {
|
||||||
const chooseCity = (city: City) => {
|
const chooseCity = (city: City) => {
|
||||||
userStore.setUserCity(city)
|
userStore.setUserCity(city)
|
||||||
if (
|
if (
|
||||||
userStore.userInfo.estimatedAchievement.cityCode &&
|
userStore.userInfo.estimatedAchievement.provinceCode &&
|
||||||
userStore.userInfo.estimatedAchievement.cityCode !== city.code
|
userStore.userInfo.estimatedAchievement.provinceCode !== city.code
|
||||||
) {
|
) {
|
||||||
userStore.clearUserEstimatedAchievement()
|
userStore.clearUserEstimatedAchievement()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,173 @@
|
||||||
|
<route lang="json5" type="page">
|
||||||
|
{
|
||||||
|
style: {
|
||||||
|
navigationStyle: 'custom',
|
||||||
|
},
|
||||||
|
needLogin: true,
|
||||||
|
}
|
||||||
|
</route>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<text>找大学</text>
|
<view class="content">
|
||||||
|
<z-paging
|
||||||
|
ref="paging"
|
||||||
|
use-virtual-list
|
||||||
|
:force-close-inner-list="true"
|
||||||
|
cell-height-mode="dynamic"
|
||||||
|
@virtualListChange="virtualListChange"
|
||||||
|
@query="queryList"
|
||||||
|
:auto-show-system-loading="true"
|
||||||
|
>
|
||||||
|
<template #top>
|
||||||
|
<wd-navbar
|
||||||
|
safeAreaInsetTop
|
||||||
|
custom-class="bg-white!"
|
||||||
|
:bordered="false"
|
||||||
|
left-arrow
|
||||||
|
@click-left="navigatorBack"
|
||||||
|
>
|
||||||
|
<template #title>
|
||||||
|
<wd-input
|
||||||
|
type="text"
|
||||||
|
v-model="searchValue"
|
||||||
|
placeholder="院校名称"
|
||||||
|
@confirm="handleChange"
|
||||||
|
no-border
|
||||||
|
prefixIcon="search"
|
||||||
|
custom-class="rounded-[48rpx] bg-[#F7F7F7]! flex items-center border-none! px-[24rpx] py-[12rpx]"
|
||||||
|
custom-input-class="h-full flex items-center"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</wd-navbar>
|
||||||
|
<wd-drop-menu>
|
||||||
|
<wd-drop-menu-item
|
||||||
|
v-for="item in subMenu"
|
||||||
|
:key="item.id"
|
||||||
|
:title="item.title"
|
||||||
|
@open="handleOpenSubMenu(item.id)"
|
||||||
|
custom-class="flex items-center"
|
||||||
|
>
|
||||||
|
<Region v-show="currentMenu === 1" @changeName="handleRegionChange" />
|
||||||
|
<UniType v-show="currentMenu === 2" @changeName="handleUniTypeChange" />
|
||||||
|
<Nature v-show="currentMenu === 3" @changeName="handleNatureChange" />
|
||||||
|
</wd-drop-menu-item>
|
||||||
|
</wd-drop-menu>
|
||||||
|
</template>
|
||||||
|
<view
|
||||||
|
class="item-wrapper"
|
||||||
|
:id="`zp-id-${item.zp_index}`"
|
||||||
|
:key="item.zp_index"
|
||||||
|
v-for="(item, index) in schoolList"
|
||||||
|
@click="itemClick(item, item.zp_index)"
|
||||||
|
>
|
||||||
|
<view class="flex items-center p-[32rpx] w-full">
|
||||||
|
<image class="w-[80rpx] h-[80rpx] ml-[18rpx] mr-[24rpx]" :src="item.logo"></image>
|
||||||
|
<view class="flex justify-between items-center flex-1">
|
||||||
|
<view class="flex flex-col" hover-class="none">
|
||||||
|
<text class="text-[28rpx] text-[#333] font-semibold mb-[6rpx]">
|
||||||
|
{{ item.name }}
|
||||||
|
</text>
|
||||||
|
<view class="flex items-center gap-[8rpx] mb-[16rpx]">
|
||||||
|
<view
|
||||||
|
class="truncate max-w-[176rpx] bg-[#f8f8f8] rounded-[4rpx] text-[20rpx] px-[8rpx] py-[2rpx]"
|
||||||
|
v-for="(fea, fIndex) in item.features.slice(0, 5)"
|
||||||
|
:key="fIndex"
|
||||||
|
>
|
||||||
|
{{ fea }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<text class="text-[22rpx] text-[#999] font-normal">
|
||||||
|
{{ item.cityName }}.{{ item.nature }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="w-full h-[2rpx] bg-[#eee]" hover-class="none"></view>
|
||||||
|
</view>
|
||||||
|
</z-paging>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup></script>
|
<script lang="ts" setup>
|
||||||
|
import Region from '@/components/filterMenu/Region.vue'
|
||||||
|
import UniType from '@/components/filterMenu/UniType.vue'
|
||||||
|
import Nature from '@/components/filterMenu/Nature.vue'
|
||||||
|
import { getUniversityList } from '@/service/index/api'
|
||||||
|
|
||||||
|
const searchValue = ref('')
|
||||||
|
|
||||||
|
const handleChange = (e: any) => {
|
||||||
|
paging.value.reload()
|
||||||
|
}
|
||||||
|
const navigatorBack = () => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
|
||||||
|
const subMenu = [
|
||||||
|
{ id: 1, title: '省份' },
|
||||||
|
{ id: 2, title: '层次' },
|
||||||
|
{ id: 3, title: '类型' },
|
||||||
|
]
|
||||||
|
|
||||||
|
const regionInfo = ref([]) // 省份信息
|
||||||
|
const uniTypeInfo = ref([]) // 层次信息
|
||||||
|
const natureInfo = ref([]) // 类型信息
|
||||||
|
|
||||||
|
const currentMenu = ref(1)
|
||||||
|
const handleOpenSubMenu = (id: number) => {
|
||||||
|
currentMenu.value = id
|
||||||
|
}
|
||||||
|
|
||||||
|
const schoolList = ref([])
|
||||||
|
const paging = ref(null)
|
||||||
|
|
||||||
|
const queryList = (page: number, pageSize: number) => {
|
||||||
|
getUniversityList({
|
||||||
|
pageIndex: page,
|
||||||
|
pageSize,
|
||||||
|
name: searchValue.value,
|
||||||
|
provinceName: regionInfo.value,
|
||||||
|
utype: uniTypeInfo.value,
|
||||||
|
nature: natureInfo.value,
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
paging.value.complete((res.result as { rows: any[] }).rows)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const virtualListChange = (_vList) => {
|
||||||
|
schoolList.value = _vList
|
||||||
|
}
|
||||||
|
|
||||||
|
const itemClick = (item, index) => {
|
||||||
|
uni.navigateTo({ url: `/pages-sub/home/college/info?collegeCode=${item.collegeCode}` })
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleRegionChange = (val) => {
|
||||||
|
regionInfo.value = val
|
||||||
|
paging.value.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleUniTypeChange = (val) => {
|
||||||
|
uniTypeInfo.value = val
|
||||||
|
paging.value.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleNatureChange = (val) => {
|
||||||
|
natureInfo.value = val
|
||||||
|
paging.value.reload()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.wd-navbar__content) {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.wd-navbar__title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-left: 112rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
<route lang="json5" type="page">
|
||||||
|
{
|
||||||
|
layout: 'page',
|
||||||
|
style: {
|
||||||
|
navigationStyle: 'custom',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</route>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<view class="h-screen pb-safe flex flex-col">
|
||||||
|
<view class="relative">
|
||||||
|
<wd-navbar
|
||||||
|
safeAreaInsetTop
|
||||||
|
custom-class="bg-transparent!"
|
||||||
|
:bordered="false"
|
||||||
|
left-arrow
|
||||||
|
@click-left="navigatorBack"
|
||||||
|
></wd-navbar>
|
||||||
|
<view class="custom-background h-[250rpx] w-full absolute top-0 left-0 z-[-1]"></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="pb-safe flex-1"></view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { useUniversityInfo } from '@/hooks/useUserInfo'
|
||||||
|
const navigatorBack = () => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
|
||||||
|
onLoad((options) => {
|
||||||
|
const collegeCode = Number(options.collegeCode) || 0
|
||||||
|
const { universityBaseInfo } = useUniversityInfo(collegeCode)
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.custom-background) {
|
||||||
|
background-image: linear-gradient(
|
||||||
|
180deg,
|
||||||
|
rgb(177, 221, 250) 0,
|
||||||
|
rgb(177, 221, 250) 14%,
|
||||||
|
rgb(232, 244, 252) 68%,
|
||||||
|
rgba(255, 255, 255, 1) 86%,
|
||||||
|
rgba(255, 255, 255, 1) 100%,
|
||||||
|
rgba(255, 255, 255, 1) 100%
|
||||||
|
);
|
||||||
|
background-position: 50% 50%;
|
||||||
|
background-origin: padding-box;
|
||||||
|
background-clip: border-box;
|
||||||
|
background-size: auto auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -130,7 +130,7 @@ const navigatorBack = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 输入成绩
|
// 输入成绩
|
||||||
const score = ref<number | string>(userStore.userInfo.estimatedAchievement.score || '')
|
const score = ref<number | string>(userStore.userInfo.estimatedAchievement.expectedScore || '')
|
||||||
const handleChange = (e: any) => {
|
const handleChange = (e: any) => {
|
||||||
const _score = Number(score.value) || 0
|
const _score = Number(score.value) || 0
|
||||||
if (_score > userStore.userInfo.city.allscore) {
|
if (_score > userStore.userInfo.city.allscore) {
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,6 @@
|
||||||
</route>
|
</route>
|
||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<!-- 如果页面中的cell高度是固定不变的,则不需要设置cell-height-mode,如果页面中高度是动态改变的,则设置cell-height-mode="dynamic" -->
|
|
||||||
<!-- 原先的v-model修改为@virtualListChange="virtualListChange"并赋值处理后的虚拟列表 -->
|
|
||||||
<z-paging
|
<z-paging
|
||||||
ref="paging"
|
ref="paging"
|
||||||
use-virtual-list
|
use-virtual-list
|
||||||
|
|
@ -110,7 +108,6 @@ const itemClick = (item, index) => {
|
||||||
}
|
}
|
||||||
const tabsChange = (index, name) => {
|
const tabsChange = (index, name) => {
|
||||||
tabIndex.value = name
|
tabIndex.value = name
|
||||||
// 当切换tab或搜索时请调用组件的reload方法,请勿直接调用:queryList方法!!
|
|
||||||
paging.value.reload()
|
paging.value.reload()
|
||||||
}
|
}
|
||||||
const { unSortTypeList } = useUnSortType()
|
const { unSortTypeList } = useUnSortType()
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 1.0 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.9 KiB |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 1.1 MiB |
|
|
@ -137,7 +137,8 @@
|
||||||
"layout": "page",
|
"layout": "page",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
},
|
||||||
|
"needLogin": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "home/career/index",
|
"path": "home/career/index",
|
||||||
|
|
@ -153,7 +154,19 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "home/college/index",
|
"path": "home/college/index",
|
||||||
"type": "page"
|
"type": "page",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
},
|
||||||
|
"needLogin": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "home/college/info",
|
||||||
|
"type": "page",
|
||||||
|
"layout": "page",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "home/distinguish/index",
|
"path": "home/distinguish/index",
|
||||||
|
|
@ -212,31 +225,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
"root": "components-sub",
|
|
||||||
"pages": [
|
|
||||||
{
|
|
||||||
"path": "FilterMenu/FilterMenu",
|
|
||||||
"type": "page"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "FilterMenu/Nature",
|
|
||||||
"type": "page"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "FilterMenu/Phase",
|
|
||||||
"type": "page"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "FilterMenu/Region",
|
|
||||||
"type": "page"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "FilterMenu/UniType",
|
|
||||||
"type": "page"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -19,10 +19,7 @@
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</wd-navbar>
|
</wd-navbar>
|
||||||
<image
|
<view class="h-[700rpx] w-full custom-background absolute top-0 left-0 z-[-1]"></view>
|
||||||
class="h-[700rpx] w-full absolute top-0 left-0 z-[-1]"
|
|
||||||
src="/static/images/home/home-background.png"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="h-full mt-[48rpx]">
|
<view class="h-full mt-[48rpx]">
|
||||||
<Banner />
|
<Banner />
|
||||||
|
|
@ -84,4 +81,18 @@ const onRefresherRefresh = async () => {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.custom-background {
|
||||||
|
background-image: linear-gradient(
|
||||||
|
173deg,
|
||||||
|
rgb(177, 221, 250) 0,
|
||||||
|
rgb(177, 221, 250) 13%,
|
||||||
|
rgba(255, 255, 255, 1) 80%,
|
||||||
|
rgba(255, 255, 255, 1) 100%
|
||||||
|
);
|
||||||
|
background-position: 50% 50%;
|
||||||
|
background-origin: padding-box;
|
||||||
|
background-clip: border-box;
|
||||||
|
background-size: auto auto;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -22,19 +22,24 @@
|
||||||
></image>
|
></image>
|
||||||
<wd-button @click="handleLogin">立即登陆</wd-button>
|
<wd-button @click="handleLogin">立即登陆</wd-button>
|
||||||
</view>
|
</view>
|
||||||
<LoginMask v-bind:show="show" />
|
<LoginMask v-model:show="show" @auth-ready="handleAuthReady" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useUserStore } from '@/store/user'
|
|
||||||
import LoginMask from '@/components/login/LoginMask.vue'
|
import LoginMask from '@/components/login/LoginMask.vue'
|
||||||
|
// import { useUserStore } from '@/store/user'
|
||||||
|
|
||||||
const userStore = useUserStore()
|
// const userStore = useUserStore()
|
||||||
const { token } = userStore.userInfo as unknown as IUserInfo
|
// const { token } = userStore.userInfo as unknown as IUserInfo
|
||||||
const show = ref(false)
|
const show = ref(false)
|
||||||
|
|
||||||
const handleLogin = () => {
|
const handleLogin = () => {
|
||||||
show.value = true
|
show.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 授权完成之后返回到上一个目录去
|
||||||
|
const handleAuthReady = () => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ export const sysDictType = (params: any) => {
|
||||||
return http.get('/api/sysDictData/dicStatus', params)
|
return http.get('/api/sysDictData/dicStatus', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getVolunteerInitialization = () => {
|
export const getProvinceInitialization = () => {
|
||||||
return http.get('/api/busProvinceInitialization/list')
|
return http.get('/api/busProvinceInitialization/list')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,6 +69,30 @@ export const getSessionKey = (params: { JsCode: string }) => {
|
||||||
return http.get('/api/sysWxOpen/wxOpenId', params)
|
return http.get('/api/sysWxOpen/wxOpenId', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getWxInfo = (params: { code: string; OpenId: string }) => {
|
export const setWxInfo = (params: { code: string; openId: string }) => {
|
||||||
return http.get('/api/weChatUserEx/wxInfo', params)
|
return http.post('/api/weChatUserEx/wxInfo', params)
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getWxUserInfo = () => {
|
||||||
|
return http.get('/api/weChatUserEx/userInfo')
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getVolunteerInitialization = () => {
|
||||||
|
return http.get('/api/v1/base/volunteerInitialization.json', { staticType: 'static' })
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getUniversityList = (params: {
|
||||||
|
pageIndex: number
|
||||||
|
pageSize: number
|
||||||
|
name?: string
|
||||||
|
provinceName?: string[]
|
||||||
|
utype?: string[]
|
||||||
|
nature?: string[]
|
||||||
|
}) => {
|
||||||
|
return http.post('/api/zhiYuan/university', params)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取大学信息
|
||||||
|
export const getUniversityInfo = (params: { Cid: number; Id: number }) => {
|
||||||
|
return http.get('/api/zhiYuan/universityDetail', params)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 139 KiB |
|
|
@ -16,14 +16,39 @@ const initState = {
|
||||||
},
|
},
|
||||||
estimatedAchievement: {
|
estimatedAchievement: {
|
||||||
year: 0, // 学期
|
year: 0, // 学期
|
||||||
score: '', // 成绩
|
expectedScore: '', // 成绩
|
||||||
requireSubject: { code: 0, name: '', simplename: '' },
|
requireSubject: { code: 0, name: '', simplename: '' },
|
||||||
optionalSubject: [],
|
optionalSubject: [],
|
||||||
cityCode: '',
|
provinceCode: '',
|
||||||
|
|
||||||
|
className: null,
|
||||||
|
createTime: '',
|
||||||
|
createUserId: 0,
|
||||||
|
createUserName: null,
|
||||||
|
|
||||||
|
id: 0,
|
||||||
|
init: false,
|
||||||
|
isDelete: false,
|
||||||
|
isUpdateScore: 0,
|
||||||
|
isVIP: false,
|
||||||
|
|
||||||
|
provinceName: '',
|
||||||
|
rank: 0,
|
||||||
|
schoolName: null,
|
||||||
|
sp: 0,
|
||||||
|
subjectGroup: '',
|
||||||
|
updateTime: null,
|
||||||
|
updateUserId: null,
|
||||||
|
updateUserName: null,
|
||||||
|
uuid: null,
|
||||||
|
vipCode: null,
|
||||||
|
wxId: 0,
|
||||||
},
|
},
|
||||||
userFilterParams: {
|
userFilterParams: {
|
||||||
phase: 0,
|
phase: 0,
|
||||||
},
|
},
|
||||||
|
token: '',
|
||||||
|
openid: '',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useUserStore = defineStore(
|
export const useUserStore = defineStore(
|
||||||
|
|
@ -43,12 +68,35 @@ export const useUserStore = defineStore(
|
||||||
|
|
||||||
// 设置预估成绩
|
// 设置预估成绩
|
||||||
const setEstimatedAchievement = (val: any) => {
|
const setEstimatedAchievement = (val: any) => {
|
||||||
userInfo.value.estimatedAchievement = val
|
userInfo.value.estimatedAchievement = Object.assign(userInfo.value.estimatedAchievement, val)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置用户token
|
||||||
|
const setUserToken = (val: string) => {
|
||||||
|
userInfo.value.token = val
|
||||||
|
}
|
||||||
|
|
||||||
|
const setUserOpenId = (val: string) => {
|
||||||
|
userInfo.value.openid = val
|
||||||
|
}
|
||||||
|
|
||||||
|
const setUserNickName = (val: string) => {
|
||||||
|
userInfo.value.nickname = val
|
||||||
|
}
|
||||||
|
|
||||||
|
const setUserAvatar = (val: string) => {
|
||||||
|
userInfo.value.avatar = val
|
||||||
}
|
}
|
||||||
|
|
||||||
// 清除预估成绩
|
// 清除预估成绩
|
||||||
const clearUserEstimatedAchievement = () => {
|
const clearUserEstimatedAchievement = () => {
|
||||||
userInfo.value.estimatedAchievement = { ...initState.estimatedAchievement }
|
userInfo.value.estimatedAchievement = Object.assign(userInfo.value.estimatedAchievement, {
|
||||||
|
year: 0, // 学期
|
||||||
|
expectedScore: '', // 成绩
|
||||||
|
requireSubject: { code: 0, name: '', simplename: '' },
|
||||||
|
optionalSubject: [],
|
||||||
|
provinceCode: '',
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 清除用户信息
|
// 清除用户信息
|
||||||
|
|
@ -70,6 +118,10 @@ export const useUserStore = defineStore(
|
||||||
setUserCity,
|
setUserCity,
|
||||||
setEstimatedAchievement,
|
setEstimatedAchievement,
|
||||||
clearUserEstimatedAchievement,
|
clearUserEstimatedAchievement,
|
||||||
|
setUserToken,
|
||||||
|
setUserOpenId,
|
||||||
|
setUserNickName,
|
||||||
|
setUserAvatar,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,32 @@ export type ExtraUserInfo = {
|
||||||
city?: City
|
city?: City
|
||||||
estimatedAchievement: {
|
estimatedAchievement: {
|
||||||
year: number
|
year: number
|
||||||
score: number | string
|
expectedScore: number | string
|
||||||
requireSubject: Rule
|
requireSubject: Rule
|
||||||
optionalSubject: Rule[]
|
optionalSubject: Rule[]
|
||||||
cityCode: string
|
provinceCode: string
|
||||||
|
|
||||||
|
className: string | null
|
||||||
|
createTime: string // "YYYY-MM-DD HH:MM:SS"
|
||||||
|
createUserId: number
|
||||||
|
createUserName: string | null
|
||||||
|
id: number
|
||||||
|
init: boolean
|
||||||
|
isDelete: boolean
|
||||||
|
isUpdateScore: number
|
||||||
|
isVIP: boolean
|
||||||
|
|
||||||
|
provinceName: string
|
||||||
|
rank: number
|
||||||
|
schoolName: string | null
|
||||||
|
sp: number
|
||||||
|
subjectGroup: string // "物,化,生"
|
||||||
|
updateTime: string | null // "YYYY-MM-DD HH:MM:SS"
|
||||||
|
updateUserId: number | null
|
||||||
|
updateUserName: string | null
|
||||||
|
uuid: string | null
|
||||||
|
vipCode: string | null
|
||||||
|
wxId: number
|
||||||
}
|
}
|
||||||
} & IUserInfo
|
} & IUserInfo
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,7 @@ declare global {
|
||||||
const useSlots: typeof import('vue')['useSlots']
|
const useSlots: typeof import('vue')['useSlots']
|
||||||
const useTemplateRef: typeof import('vue')['useTemplateRef']
|
const useTemplateRef: typeof import('vue')['useTemplateRef']
|
||||||
const useUnSortType: typeof import('../hooks/useUnSortType')['useUnSortType']
|
const useUnSortType: typeof import('../hooks/useUnSortType')['useUnSortType']
|
||||||
|
const useUniversityInfo: typeof import('../hooks/useUserInfo')['useUniversityInfo']
|
||||||
const useUniversityLevel: typeof import('../hooks/useFilterSchool')['useUniversityLevel']
|
const useUniversityLevel: typeof import('../hooks/useFilterSchool')['useUniversityLevel']
|
||||||
const useUniversityRank: typeof import('../hooks/useUnSortType')['useUniversityRank']
|
const useUniversityRank: typeof import('../hooks/useUnSortType')['useUniversityRank']
|
||||||
const useUniversityType: typeof import('../hooks/useFilterSchool')['useUniversityType']
|
const useUniversityType: typeof import('../hooks/useFilterSchool')['useUniversityType']
|
||||||
|
|
@ -222,6 +223,7 @@ declare module 'vue' {
|
||||||
readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
|
readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
|
||||||
readonly useTemplateRef: UnwrapRef<typeof import('vue')['useTemplateRef']>
|
readonly useTemplateRef: UnwrapRef<typeof import('vue')['useTemplateRef']>
|
||||||
readonly useUnSortType: UnwrapRef<typeof import('../hooks/useUnSortType')['useUnSortType']>
|
readonly useUnSortType: UnwrapRef<typeof import('../hooks/useUnSortType')['useUnSortType']>
|
||||||
|
readonly useUniversityInfo: UnwrapRef<typeof import('../hooks/useUserInfo')['useUniversityInfo']>
|
||||||
readonly useUniversityLevel: UnwrapRef<typeof import('../hooks/useFilterSchool')['useUniversityLevel']>
|
readonly useUniversityLevel: UnwrapRef<typeof import('../hooks/useFilterSchool')['useUniversityLevel']>
|
||||||
readonly useUniversityRank: UnwrapRef<typeof import('../hooks/useUnSortType')['useUniversityRank']>
|
readonly useUniversityRank: UnwrapRef<typeof import('../hooks/useUnSortType')['useUniversityRank']>
|
||||||
readonly useUniversityType: UnwrapRef<typeof import('../hooks/useFilterSchool')['useUniversityType']>
|
readonly useUniversityType: UnwrapRef<typeof import('../hooks/useFilterSchool')['useUniversityType']>
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ interface NavigateToOptions {
|
||||||
"/pages-sub/home/career/index" |
|
"/pages-sub/home/career/index" |
|
||||||
"/pages-sub/home/city/index" |
|
"/pages-sub/home/city/index" |
|
||||||
"/pages-sub/home/college/index" |
|
"/pages-sub/home/college/index" |
|
||||||
|
"/pages-sub/home/college/info" |
|
||||||
"/pages-sub/home/distinguish/index" |
|
"/pages-sub/home/distinguish/index" |
|
||||||
"/pages-sub/home/evaluation/index" |
|
"/pages-sub/home/evaluation/index" |
|
||||||
"/pages-sub/home/expand/index" |
|
"/pages-sub/home/expand/index" |
|
||||||
|
|
@ -25,12 +26,7 @@ interface NavigateToOptions {
|
||||||
"/pages-sub/home/news/index" |
|
"/pages-sub/home/news/index" |
|
||||||
"/pages-sub/home/news/newsList" |
|
"/pages-sub/home/news/newsList" |
|
||||||
"/pages-sub/home/rank/index" |
|
"/pages-sub/home/rank/index" |
|
||||||
"/pages-sub/home/schoolRank/index" |
|
"/pages-sub/home/schoolRank/index";
|
||||||
"/components-sub/FilterMenu/FilterMenu" |
|
|
||||||
"/components-sub/FilterMenu/Nature" |
|
|
||||||
"/components-sub/FilterMenu/Phase" |
|
|
||||||
"/components-sub/FilterMenu/Region" |
|
|
||||||
"/components-sub/FilterMenu/UniType";
|
|
||||||
}
|
}
|
||||||
interface RedirectToOptions extends NavigateToOptions {}
|
interface RedirectToOptions extends NavigateToOptions {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ export default ({ command, mode }) => {
|
||||||
routeBlockLang: 'json5', // 虽然设了默认值,但是vue文件还是要加上 lang="json5", 这样才能很好地格式化
|
routeBlockLang: 'json5', // 虽然设了默认值,但是vue文件还是要加上 lang="json5", 这样才能很好地格式化
|
||||||
// homePage 通过 vue 文件的 route-block 的type="home"来设定
|
// homePage 通过 vue 文件的 route-block 的type="home"来设定
|
||||||
// pages 目录为 src/pages,分包目录不能配置在pages目录下
|
// pages 目录为 src/pages,分包目录不能配置在pages目录下
|
||||||
subPackages: ['src/pages-sub', 'src/components-sub'], // 是个数组,可以配置多个,但是不能为pages里面的目录
|
subPackages: ['src/pages-sub'], // 是个数组,可以配置多个,但是不能为pages里面的目录
|
||||||
dts: 'src/types/uni-pages.d.ts',
|
dts: 'src/types/uni-pages.d.ts',
|
||||||
}),
|
}),
|
||||||
UniLayouts(),
|
UniLayouts(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue