diff --git a/api/model/config.js b/api/model/config.js index fac5102..29f08e5 100644 --- a/api/model/config.js +++ b/api/model/config.js @@ -7,6 +7,11 @@ const api = { url: '/employ/config/queryConfigList', method: 'GET', }, + // 查看配置信息 + queryConfig: { + url: '/employ/config/queryConfig', + method: 'GET', + }, } export default api \ No newline at end of file diff --git a/components/AddressPicker.vue b/components/AddressPicker.vue index 3cfea16..650543a 100644 --- a/components/AddressPicker.vue +++ b/components/AddressPicker.vue @@ -29,12 +29,33 @@ @@ -46,12 +67,34 @@ 返回{{ selectedProvince.adress }} + + + + + 选择整个{{ selectedCity.adress }} + + {{ item.adress }} + + + + + + @@ -71,6 +114,16 @@ onlyCity: { type: Boolean, default: false + }, + // 是否支持多选区县 + multiple: { + type: Boolean, + default: false + }, + // 是否显示"选择整个城市"选项 + showSelectWholeCity: { + type: Boolean, + default: false } }, data() { @@ -78,6 +131,8 @@ selectedProvince: null, // 选中的省份 selectedCity: null, // 选中的城市 selectedDistrict: null, // 选中的区县 + selectedCities: [], // 多选时选中的城市列表 + selectedDistricts: [], // 多选时选中的区县列表 cityList: [], // 城市列表 districtList: [], // 区县列表 } @@ -101,6 +156,8 @@ this.selectedProvince = null this.selectedCity = null this.selectedDistrict = null + this.selectedCities = [] + this.selectedDistricts = [] this.cityList = [] this.districtList = [] }, @@ -129,33 +186,96 @@ // 选择城市 async selectCity(city) { - this.selectedCity = city - this.selectedDistrict = null - - // 如果只选择到市级,直接确认 - if (this.onlyCity) { - this.confirm() - return - } - - // 获取区县列表 - try { - this.districtList = await this.$store.dispatch('getChildAddressList', city.id) - // 如果没有下级地址,直接确认 - if (this.districtList.length === 0) { + if (this.multiple) { + // 多选模式 + const index = this.selectedCities.findIndex(item => item.id === city.id) + if (index > -1) { + // 取消选择 + this.selectedCities.splice(index, 1) + } else { + // 添加选择 + this.selectedCities.push(city) + } + } else { + // 单选模式 + this.selectedCity = city + this.selectedDistrict = null + + // 如果只选择到市级,直接确认 + if (this.onlyCity) { + this.confirm() + return + } + + // 获取区县列表 + try { + this.districtList = await this.$store.dispatch('getChildAddressList', city.id) + // 如果没有下级地址,直接确认 + if (this.districtList.length === 0) { + this.confirm() + } + } catch (error) { + console.error('获取区县列表失败:', error) + this.districtList = [] + // 获取失败时也直接确认 this.confirm() } - } catch (error) { - console.error('获取区县列表失败:', error) - this.districtList = [] - // 获取失败时也直接确认 - this.confirm() } }, // 选择区县 selectDistrict(district) { - this.selectedDistrict = district + if (this.multiple) { + // 多选模式 + const index = this.selectedDistricts.findIndex(item => item.id === district.id) + if (index > -1) { + // 取消选择 + this.selectedDistricts.splice(index, 1) + } else { + // 添加选择 + this.selectedDistricts.push(district) + } + } else { + // 单选模式 + this.selectedDistrict = district + this.confirm() + } + }, + + // 检查城市是否被选中(多选模式) + isCitySelected(city) { + return this.selectedCities.some(item => item.id === city.id) + }, + + // 检查区县是否被选中(多选模式) + isDistrictSelected(district) { + return this.selectedDistricts.some(item => item.id === district.id) + }, + + // 选择整个省份 + selectWholeProvince() { + this.selectedCity = null + this.selectedCities = [] + this.selectedDistrict = null + this.selectedDistricts = [] + this.confirm() + }, + + // 选择整个城市 + selectWholeCity() { + this.selectedDistrict = null + this.selectedDistricts = [] + this.confirm() + }, + + // 确认多选城市选择 + confirmMultipleCitySelection() { + // 直接返回多选城市的数据 + this.confirm() + }, + + // 确认多选选择 + confirmMultipleSelection() { this.confirm() }, @@ -171,7 +291,9 @@ const result = { province: this.selectedProvince, city: this.selectedCity, - district: this.selectedDistrict + district: this.selectedDistrict, + cities: this.selectedCities, + districts: this.selectedDistricts } // 生成完整地址文本 @@ -179,15 +301,36 @@ if (this.selectedProvince) { fullAddress += this.selectedProvince.adress } - if (this.selectedCity) { + + // 多选城市模式 + if (this.multiple && this.selectedCities.length > 0) { + const cityNames = this.selectedCities.map(item => item.adress).join(',') + fullAddress += cityNames + result.selectedAddress = this.selectedProvince // 多选城市时返回省份作为选中地址 + result.selectedCities = this.selectedCities + } else if (this.selectedCity) { fullAddress += this.selectedCity.adress - } - if (this.selectedDistrict) { - fullAddress += this.selectedDistrict.adress + + // 多选区县模式 + if (this.multiple && this.selectedDistricts.length > 0) { + const districtNames = this.selectedDistricts.map(item => item.adress).join(',') + fullAddress += districtNames + result.selectedAddress = this.selectedCity // 多选时返回城市作为选中地址 + result.selectedDistricts = this.selectedDistricts + } else if (this.selectedDistrict) { + // 单选区县模式 + fullAddress += this.selectedDistrict.adress + result.selectedAddress = this.selectedDistrict + } else { + // 选择整个城市 + result.selectedAddress = this.selectedCity + } + } else { + // 选择整个省份 + result.selectedAddress = this.selectedProvince } result.fullAddress = fullAddress - result.selectedAddress = this.selectedDistrict || this.selectedCity || this.selectedProvince this.$emit('confirm', result) this.close() @@ -274,6 +417,53 @@ margin-right: 10rpx; } } + + &.whole-city-item { + display: flex; + align-items: center; + color: #3796F8; + background: rgba(#3796F8, 0.1); + font-weight: bold; + + uv-icon { + margin-right: 10rpx; + } + } + + &.selected { + background: rgba($uni-color, 0.1); + color: $uni-color; + font-weight: bold; + position: relative; + + &::after { + content: ''; + position: absolute; + right: 0; + top: 0; + bottom: 0; + width: 6rpx; + background: $uni-color; + } + } + } + + .confirm-btn { + position: sticky; + bottom: 0; + background: #fff; + padding: 20rpx; + border-top: 1px solid #eee; + + .confirm-button { + width: 100%; + background: $uni-color; + color: #fff; + border: none; + border-radius: 10rpx; + padding: 20rpx; + font-size: 28rpx; + } } } } diff --git a/components/base/tabbar.vue b/components/base/tabbar.vue index 5392cdf..06a7075 100644 --- a/components/base/tabbar.vue +++ b/components/base/tabbar.vue @@ -54,7 +54,7 @@ "selectedIconPath": "/static/image/tabbar/center-a.png", "iconPath": "/static/image/tabbar/center.png", "pagePath": "/pages/index/center", - "title": "会员中心" + "title": "个人中心" } ] }; diff --git a/components/config/configPopup.vue b/components/config/configPopup.vue index 4dfca72..9103059 100644 --- a/components/config/configPopup.vue +++ b/components/config/configPopup.vue @@ -18,12 +18,19 @@ } }, onShow(){ - }, + }, methods: { //打开配置信息菜单 open(key){ - this.content = this.configList[key] - this.$refs.popup.open('bottom'); + this.$api('queryConfig', { + paramCode : 'config_vip_service', + }) + .then(res => { + // this.content = this.configList[key] + this.content = res.result.paramValueText + this.$refs.popup.open('bottom'); + }) + this.$store.commit('initConfig') } }, diff --git a/components/screen/screenWork.vue b/components/screen/screenWork.vue index 0ea6115..61cba51 100644 --- a/components/screen/screenWork.vue +++ b/components/screen/screenWork.vue @@ -201,6 +201,9 @@ setTimeout(this.initData, 500) }, methods: { + init(){ + this.$refs.dropDown.init() + }, initData(){ if(this.addressList.length == 0){ @@ -371,8 +374,8 @@ value: addressResult.selectedAddress.adress, }) - // 关闭下拉菜单 - this.$refs.dropDown.close() + // 关闭下拉菜单 - 通过发送事件来关闭 + uni.$emit(`${this.sign}_CLOSEPOPUP`) }, } } diff --git a/pages/index/center.vue b/pages/index/center.vue index c0b1671..24a29e7 100644 --- a/pages/index/center.vue +++ b/pages/index/center.vue @@ -226,10 +226,10 @@ 考证咨询 - + diff --git a/pages/index/index.vue b/pages/index/index.vue index 5c38803..bc86be6 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -124,6 +124,9 @@ return this.banner.filter(n => n.type == 0) }, }, + onPageScroll(e){ + this.$refs.screenWork.init() + }, data() { return { productList: [], @@ -136,7 +139,11 @@ this.$refs.workList.getData(this.screenWorkList) this.$store.commit('getBanner') }, - onLoad(){ + onLoad(query) { + if (query.shareId) { + uni.setStorageSync('shareId', query.shareId) + this.$store.commit('login') + } uni.$on('initConfig', (e) => { this.config_other_job = e.config_other_job }) @@ -190,6 +197,7 @@ } this.$store.commit('setRole', !this.role) this.$nextTick(() => { + this.$refs.screenWork.init() this.$refs.workList.getData(this.screenWorkList) }) } diff --git a/pages_order/auth/wxLogin.vue b/pages_order/auth/wxLogin.vue index d597c80..44c63f7 100644 --- a/pages_order/auth/wxLogin.vue +++ b/pages_order/auth/wxLogin.vue @@ -70,7 +70,7 @@ icon:'none' }) } - this.$store.commit('login') + this.$store.commit('login', true) }, qux(){ uni.reLaunch({ diff --git a/pages_order/work/addResume.vue b/pages_order/work/addResume.vue index 1977527..df11ff8 100644 --- a/pages_order/work/addResume.vue +++ b/pages_order/work/addResume.vue @@ -127,7 +127,7 @@ @confirm="pickerConfirm"> - + @@ -303,6 +303,7 @@ this.list.forEach((n, i) => { // 如果是地址选择器,直接显示地址文字 if(n.useAddressPicker && this.form[n.type]) { + // 回显时直接使用存储的地址字符串,与提交格式保持一致 this.selectedAddress = this.form[n.type] } else { n.tag.forEach((e, index) => { @@ -322,8 +323,8 @@ }, // 地址选择确认回调 onAddressConfirm(addressResult) { + // 直接使用AddressPicker返回的fullAddress,确保格式一致 this.selectedAddress = addressResult.fullAddress - // 只保存地址文字,不保存ID this.form.expectAddress = addressResult.fullAddress }, }, diff --git a/pages_order/work/postConsult.vue b/pages_order/work/postConsult.vue index 3900a61..2d42494 100644 --- a/pages_order/work/postConsult.vue +++ b/pages_order/work/postConsult.vue @@ -12,7 +12,9 @@ :key="item.id" v-for="(item, index) in formList"> - {{ item.title }}{{ item.descrip }} + {{ item.title }} +
+ {{ item.descrip }}
{ + api('wxLogin', data, res => { uni.hideLoading() @@ -66,9 +72,13 @@ const store = new Vuex.Store({ return } + state.userInfo = res.result.userInfo uni.setStorageSync('token', res.result.token) + if(is){ + return + } if(!state.userInfo.nickName || !state.userInfo.headImage || !state.userInfo.phone){ uni.navigateTo({