提交 f584bbdd 作者: 吴佳伟

fix: 优化页面内容

上级 161e6901
......@@ -93,7 +93,7 @@
pageData.purchaseDemands = [...pageData.purchaseDemands, ...records]
pageData.purchaseDemands = pageData.purchaseDemands.map((item) => ({
...item,
location: getText(`${item.province},${item.city},${item.country}`),
location: getText(`${item.province},${item.city},${item.country}`, ' / '),
}))
pageData.total = total
})
......@@ -110,7 +110,7 @@
pageData.supplyInfos = [...pageData.supplyInfos, ...records]
pageData.supplyInfos = pageData.supplyInfos.map((item) => ({
...item,
location: getText(`${item.province},${item.city},${item.country}`),
location: getText(`${item.province},${item.city},${item.country}`, ' / '),
}))
pageData.total = total
})
......
......@@ -314,7 +314,7 @@ return
<text class="label">省/市/区县</text>
<view class="time-input" @click="show.address = true">
<text class="select-text" :class="{ placeholder: !form.address }">
{{ getText(form.address) || '请选择省/市/区县' }}
{{ getText(form.address, ' / ') || '请选择省/市/区县' }}
</text>
</view>
</view>
......
......@@ -314,7 +314,7 @@
<text class="label" style="font-size: 28rpx">请选择区域</text>
<view class="select-input" @click="show.address = true">
<text class="time-text" :class="{ placeholder: !form.address }">
{{ getText(form.address) || '请选择省/市/区县' }}
{{ getText(form.address, ' / ') || '请选择省/市/区县' }}
</text>
</view>
</view>
......
......@@ -7,6 +7,7 @@
import * as UserInfoAPI from '@/api/model/userInfo'
import { areaTree, getCodeByText, getTextByCode } from '@/utils/areaData'
import { useDictStore } from '@/store/modules/dict'
import { areaOptions } from '@/utils/dict/area'
const dictStore = useDictStore()
const userStore = useUserStore()
......@@ -113,7 +114,7 @@
const { show, options, form } = toRefs(pageData)
function initDict() {
pageData.options.area = areaTree
pageData.options.area = areaOptions
pageData.options.urgentdegree = dictStore.getDictList.employment_urgent.map((item) => {
return {
value: item.value,
......
......@@ -5,6 +5,7 @@
import { getTextByCode } from '@/utils/areaData'
import * as LinghuoyonggongAPI from '@/api/model/linghuoyonggong'
import Navigate from '@/utils/page/navigate'
import { getText } from '@/utils/dict/area'
onLoad((option) => {
pageData.currentEmploymentId = Number(option.type) || 1
......@@ -117,15 +118,7 @@
// 批量处理数据,避免多次DOM操作
const processedRecords = records.map((item) => {
// 缓存区域处理结果
const cacheKey = item.area
if (areaCache.has(cacheKey)) {
item.area = areaCache.get(cacheKey)
} else {
const areaCodes = item.area.split(',')
const areaText = `${getTextByCode(areaCodes[0])} ${getTextByCode(areaCodes[1])}`
areaCache.set(cacheKey, areaText)
item.area = areaText
}
item.area = getText(item.area, ' / ')
// 计算天数并缓存结果
if (item.starttime && item.estimatedendtime) {
......
......@@ -223,7 +223,7 @@
<text class="label">服务范围</text>
<view class="time-input" @click="show.address = true">
<text class="select-text" :class="{ placeholder: !pageData.form.scope }">
{{ getText(pageData.form.scope) || '请选择市/区县/乡镇' }}
{{ getText(pageData.form.scope, ' / ') || '请选择市/区县/乡镇' }}
</text>
</view>
</view>
......
......@@ -202,7 +202,7 @@
<text class="label">服务范围</text>
<view class="time-input" @click="show.address = true">
<text class="select-text" :class="{ placeholder: !pageData.form.scope }">
{{ getText(pageData.form.scope) || '请选择市/区县/乡镇' }}
{{ getText(pageData.form.scope, ' / ') || '请选择市/区县/乡镇' }}
</text>
</view>
</view>
......
......@@ -134,7 +134,7 @@ import { s } from 'vite/dist/node/types.d-aGj9QkWt'
<view class="codefun-flex-row codefun-justify-between section_2">
<text class="font_2 text_2">服务区域</text>
<view class="codefun-flex-row codefun-items-center" @click="pageData.show.address = true">
<text class="font_2 text_3">{{ getText(pageData.search.scope) || '选择区域' }}</text>
<text class="font_2 text_3">{{ getText(pageData.search.scope, ' / ') || '选择区域' }}</text>
<image
class="codefun-shrink-0 image_7 codefun-ml-4"
src="/static/images/codefun/774cfe989f8417dc655fb301635f5893.png"
......@@ -175,7 +175,7 @@ import { s } from 'vite/dist/node/types.d-aGj9QkWt'
>
<text class="font text_6">{{ item.name }}</text>
<text class="font_3 text_7 ellipsis" style="width: 100%; margin: 26rpx 0"
>服务范围:{{ getText(item.scope) }}</text
>服务范围:{{ getText(item.scope, ' / ') }}</text
>
</view>
<view class="flex justify-between" style="width: 100%">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论