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/common/globalFunction.js b/common/globalFunction.js index 80aba7a..7f6e7f8 100644 --- a/common/globalFunction.js +++ b/common/globalFunction.js @@ -2,7 +2,8 @@ import useUserStore from "../stores/useUserStore"; import { request, createRequest, - uploadFile + uploadFile, + myRequest } from "../utils/request"; import streamRequest, { chatRequest @@ -885,7 +886,8 @@ export const $api = { uploadFile, formatFileSize, sendingMiniProgramMessage, - copyText + copyText, + myRequest } @@ -916,4 +918,4 @@ export default { insertSortData, isInWechatMiniProgramWebview, isEmptyObject, -} \ No newline at end of file +} diff --git a/components/AppLayout/AppLayout.vue b/components/AppLayout/AppLayout.vue index e9b405f..c439a44 100644 --- a/components/AppLayout/AppLayout.vue +++ b/components/AppLayout/AppLayout.vue @@ -6,6 +6,7 @@ > @@ -49,7 +50,7 @@ const emit = defineEmits(['onScrollBottom']); defineProps({ title: { type: String, - default: '标题', + default: '', }, border: { type: Boolean, diff --git a/components/CustomTabBar/CustomTabBar.vue b/components/CustomTabBar/CustomTabBar.vue new file mode 100644 index 0000000..72cc36a --- /dev/null +++ b/components/CustomTabBar/CustomTabBar.vue @@ -0,0 +1,337 @@ + + + + + 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..6df2aaa 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/packageA/pages/addWorkExperience/addWorkExperience.vue b/packageA/pages/addWorkExperience/addWorkExperience.vue index 2129178..a0090af 100644 --- a/packageA/pages/addWorkExperience/addWorkExperience.vue +++ b/packageA/pages/addWorkExperience/addWorkExperience.vue @@ -1,16 +1,5 @@