diff --git a/App.vue b/App.vue index dd7a106..e2099f2 100644 --- a/App.vue +++ b/App.vue @@ -3,17 +3,20 @@ import { reactive, inject, onMounted } from 'vue'; import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'; import useUserStore from './stores/useUserStore'; import useDictStore from './stores/useDictStore'; +import { tabbarManager } from './utils/tabbarManager'; const { $api, navTo, appendScriptTagElement } = inject('globalFunction'); import config from '@/config.js'; onLaunch((options) => { useUserStore().initSeesionId(); //更新 useDictStore().getDictData(); - // uni.hideTabBar(); - // 尝试从缓存恢复用户信息 + // 先尝试从缓存恢复用户信息 const restored = useUserStore().restoreUserInfo(); + // 用户信息恢复后再初始化自定义tabbar + tabbarManager.initTabBar(); + if (restored) { // 如果成功恢复用户信息,验证token是否有效 let token = uni.getStorageSync('token') || ''; diff --git a/components/CustomTabBar/CustomTabBar.vue b/components/CustomTabBar/CustomTabBar.vue new file mode 100644 index 0000000..22ff7e4 --- /dev/null +++ b/components/CustomTabBar/CustomTabBar.vue @@ -0,0 +1,281 @@ + + + + + diff --git a/components/UserTypeSwitcher/UserTypeSwitcher.vue b/components/UserTypeSwitcher/UserTypeSwitcher.vue index cee16dc..d968a7d 100644 --- a/components/UserTypeSwitcher/UserTypeSwitcher.vue +++ b/components/UserTypeSwitcher/UserTypeSwitcher.vue @@ -31,13 +31,13 @@ const userTypes = [ { value: 3, label: '政府人员' } ]; -const currentUserType = computed(() => userInfo.value?.userType || 0); +const currentUserType = computed(() => userInfo.value?.isCompanyUser !== undefined ? userInfo.value.isCompanyUser : 0); const switchUserType = (userType) => { console.log('切换用户类型:', userType); console.log('切换前 userInfo:', userInfo.value); - userInfo.value.userType = userType; + userInfo.value.isCompanyUser = userType; console.log('切换后 userInfo:', userInfo.value); diff --git a/components/selectPopup/selectPopup.vue b/components/selectPopup/selectPopup.vue index c91a6f7..3a235fa 100644 --- a/components/selectPopup/selectPopup.vue +++ b/components/selectPopup/selectPopup.vue @@ -13,7 +13,30 @@ 确认 + + + + 暂无数据 + + + + {{ getLabel(item) }} + + + + + this.selectedValues.includes(item[this.rowKey]) + ) : []; + }, }, methods: { open(newConfig = {}) { @@ -80,7 +112,10 @@ export default { rowKey = 'value', maskClick = false, defaultIndex = [], + multiSelect = false, + defaultValues = [], } = newConfig; + this.reset(); if (title) this.title = title; if (typeof success === 'function') this.confirmCallback = success; @@ -92,10 +127,16 @@ export default { this.rowKey = rowKey; this.maskClick = maskClick; this.unit = unit; + this.multiSelect = multiSelect; - this.selectedIndex = - defaultIndex.length === this.listData.length ? defaultIndex : new Array(this.listData.length).fill(0); - this.selectedItems = this.selectedIndex.map((val, index) => this.processedListData[index][val]); + if (multiSelect) { + this.selectedValues = defaultValues || []; + } else { + this.selectedIndex = + defaultIndex.length === this.listData.length ? defaultIndex : new Array(this.listData.length).fill(0); + this.selectedItems = this.selectedIndex.map((val, index) => this.processedListData[index][val]); + } + this.$nextTick(() => { this.$refs.popup.open(); }); @@ -117,6 +158,22 @@ export default { getLabel(item) { return item?.[this.rowLabel] ?? ''; }, + toggleSelect(item) { + if (!item || !this.rowKey || !item[this.rowKey]) { + return; + } + + const value = item[this.rowKey]; + const index = this.selectedValues.indexOf(value); + + if (index > -1) { + // 取消选中 + this.selectedValues.splice(index, 1); + } else { + // 选中 + this.selectedValues.push(value); + } + }, setColunm(index, list) { if (index > this.listData.length) { return console.warn('最长' + this.listData.length); @@ -135,7 +192,14 @@ export default { } try { - const result = await callback(this.selectedIndex, this.selectedItems); // 无论是 async 还是返回 Promise 的函数都可以 await + let result; + if (this.multiSelect) { + // 多选模式:传递 selectedValues 和 selectedItems + result = await callback(this.selectedValues, this.computedSelectedItems); + } else { + // 单选模式:传递 selectedIndex 和 selectedItems + result = await callback(this.selectedIndex, this.selectedItems); + } if (result !== false) { this.$refs.popup.close(); } @@ -154,6 +218,8 @@ export default { this.rowKey = 'value'; this.selectedItems = []; this.unit = ''; + this.multiSelect = false; + this.selectedValues = []; }, }, }; @@ -224,10 +290,83 @@ export default { color: #666d7f; line-height: 38rpx; } - .btn-confirm { + .btn-confirm { + font-weight: 400; + font-size: 32rpx; + color: #256bfa; + } + } + +.multi-select-list { + padding: 20rpx 30rpx; + max-height: calc(60vh - 120rpx); + overflow-y: auto; +} + +.empty-tip { + text-align: center; + padding: 60rpx 0; + color: #999999; + font-size: 28rpx; +} + +.skill-tags-container { + display: flex; + flex-wrap: wrap; + gap: 16rpx; + align-items: flex-start; +} + +.skill-tag { + display: inline-flex; + align-items: center; + padding: 12rpx 20rpx; + border-radius: 20rpx; + background-color: #f8f9fa; + border: 2rpx solid #e8eaee; + cursor: pointer; + transition: all 0.3s ease; + font-size: 24rpx; + color: #333333; + white-space: nowrap; + user-select: none; + + &:hover { + background-color: #e9ecef; + border-color: #d0d0d0; + transform: translateY(-1rpx); + box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1); + } + + &:active { + transform: translateY(0); + background-color: #dee2e6; + } + + .skill-tag-text { + font-size: 24rpx; + color: inherit; + line-height: 1.2; font-weight: 400; - font-size: 32rpx; - color: #256bfa; + } + + &.skill-tag-active { + background-color: #256bfa; + border-color: #256bfa; + color: #ffffff; + box-shadow: 0 2rpx 8rpx rgba(37, 107, 250, 0.3); + + .skill-tag-text { + color: #ffffff; + font-weight: 500; + } + + &:hover { + background-color: #1e5ce6; + border-color: #1e5ce6; + transform: translateY(-1rpx); + box-shadow: 0 4rpx 12rpx rgba(37, 107, 250, 0.4); + } } } diff --git a/components/tabbar/midell-box.vue b/components/tabbar/midell-box.vue index 78615a4..031ff12 100644 --- a/components/tabbar/midell-box.vue +++ b/components/tabbar/midell-box.vue @@ -10,7 +10,7 @@ > - {{ item.badge }} + {{ item.badge }} {{ item.text }} @@ -19,7 +19,7 @@ diff --git a/pages/job/publishJob.vue b/pages/job/publishJob.vue index f159601..0e9ebce 100644 --- a/pages/job/publishJob.vue +++ b/pages/job/publishJob.vue @@ -10,12 +10,11 @@ - - - - 岗位基本信息 + + + - 岗位名称 * + 岗位名称 - 岗位类型 * - - {{ selectedJobType || '请选择岗位类型' }} - - - - 工作地点 * + 招聘会公司 - - - - - 薪资待遇 - - - 最低薪资 - - - - - - 最高薪资 - - + + 最小薪资 (元/月) + - 薪资单位 - - {{ selectedSalaryUnit || '请选择薪资单位' }} - + 最大薪资 (元/月) + - - - - - 任职要求 学历要求 - {{ selectedEducation || '请选择学历要求' }} + {{ selectedEducation || '请选择学历要求' }} @@ -99,10 +64,23 @@ - {{ selectedExperience || '请选择工作经验' }} + {{ selectedExperience || '请选择工作经验' }} + + + + 工作区县 + + {{ selectedWorkDistrict || '请选择工作区县' }} @@ -114,21 +92,49 @@ v-model="formData.recruitCount" /> + + 工作地点 + + + + 选择位置 + + + + + 岗位分类 + + {{ selectedJobCategory || '请选择岗位分类' }} + + - - + + 岗位描述 - 岗位职责 + + + + + 任职要求 - 任职要求