Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
basic-uniapp-v3
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-uniapp-v3
Commits
e266b465
提交
e266b465
authored
11月 07, 2025
作者:
15973817745_JPN
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'main' of
https://gitee.com/mrf/agri-app
上级
b644e698
005e1fbe
全部展开
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
501 行增加
和
89 行删除
+501
-89
fui-app.css
src/common/fui-app.css
+36
-0
chanxiao.vue
src/pages/chanxiao/chanxiao.vue
+10
-5
price-dialog.vue
src/pages/chanxiao/components/price-dialog.vue
+7
-1
purchaseXuQiu.vue
src/pages/chanxiao/purchaseXuQiu.vue
+0
-0
fuwu.vue
src/pages/fuwu/fuwu.vue
+18
-10
form.vue
src/pages/linghuoyonggong/form.vue
+0
-0
linghuoyonggong.vue
src/pages/linghuoyonggong/linghuoyonggong.vue
+111
-16
farm-form.vue
src/pages/nongjifuwu/farm-form.vue
+0
-0
machine-form.vue
src/pages/nongjifuwu/machine-form.vue
+282
-16
nongjifuwu.vue
src/pages/nongjifuwu/nongjifuwu.vue
+11
-6
8a063bccb4a75c449a7ba2a1adc8caaf.png
...tatic/images/codefun/8a063bccb4a75c449a7ba2a1adc8caaf.png
+0
-0
areaData.ts
src/utils/areaData.ts
+26
-35
没有找到文件。
src/common/fui-app.css
浏览文件 @
e266b465
...
...
@@ -180,3 +180,39 @@ page {
.fui-relative
{
position
:
relative
;
}
.fab-icon
{
position
:
relative
;
width
:
40
rpx
;
height
:
40
rpx
;
font-size
:
0
;
margin
:
auto
;
}
.fab-icon
::before
,
.fab-icon
::after
{
content
:
''
;
position
:
absolute
;
border-radius
:
20
rpx
;
background
:
linear-gradient
(
90deg
,
#ffffff
0%
,
#ffffff
100%
);
}
.fab-icon
::before
{
/* 横线 */
top
:
50%
;
left
:
25%
;
right
:
25%
;
height
:
4
rpx
;
transform
:
translateY
(
-50%
);
}
.fab-icon
::after
{
/* 竖线 */
left
:
50%
;
top
:
25%
;
bottom
:
25%
;
width
:
4
rpx
;
transform
:
translateX
(
-50%
);
border-radius
:
20
rpx
;
background
:
linear-gradient
(
90deg
,
#ffffff
0%
,
#ffffff
100%
);
}
src/pages/chanxiao/chanxiao.vue
浏览文件 @
e266b465
...
...
@@ -395,14 +395,14 @@
</view>
</view>
</view>
<fui-fab
background=
"#5db66f"
position=
"right"
distance=
"10"
bottom=
"240"
width=
"120
"
@
click=
"handlePublish"
>
<fui-fab
position=
"right"
distance=
"10"
bottom=
"240"
width=
"96
"
@
click=
"handlePublish"
>
<view
v-show=
"pageData.currentTransactionTab === 1"
class=
"text-white text-center"
>
<
image
src=
"/src/static/images/chanxiao/notepad.svg"
style=
"width: 40rpx"
mode=
"widthFix"
></image
>
<view
style=
"font-size: 24rpx"
>
发布
需求
</view>
<
view
class=
"fab-icon"
></view
>
<view
style=
"font-size: 24rpx"
>
发布
</view>
</view>
<view
v-show=
"pageData.currentTransactionTab === 2"
class=
"text-white text-center"
>
<
image
src=
"/src/static/images/chanxiao/flower.svg"
style=
"width: 50rpx"
mode=
"widthFix"
></image
>
<view
style=
"font-size: 24rpx"
>
发布
供应
</view>
<
view
class=
"fab-icon"
></view
>
<view
style=
"font-size: 24rpx"
>
发布
</view>
</view>
</fui-fab>
...
...
@@ -827,4 +827,9 @@
border-top
:
solid
1
rpx
#e7e7e7
;
}
}
::v-deep
.fui-fab__btn-main
{
background
:
linear-gradient
(
124.25deg
,
#a5d63f
0%
,
#5db66f
100%
)
!important
;
box-shadow
:
0px
1px
8px
#5db66f
;
}
</
style
>
src/pages/chanxiao/components/price-dialog.vue
浏览文件 @
e266b465
...
...
@@ -77,7 +77,13 @@
<fui-form
ref=
"formRef"
top=
"180"
color=
"#000"
>
<fui-input
marginTop=
"30"
size=
"28"
placeholder=
"请填写联系人姓名"
v-model=
"pageData.form.supplyName"
/>
<fui-input
marginTop=
"30"
size=
"28"
placeholder=
"请填写联系电话"
v-model=
"pageData.form.phone"
/>
<fui-input
marginTop=
"30"
size=
"28"
placeholder=
"请填写价格"
v-model=
"pageData.form.supplyPrice"
>
<fui-input
type=
"number"
marginTop=
"30"
size=
"28"
placeholder=
"请填写价格"
v-model=
"pageData.form.supplyPrice"
>
<view
class=
"flex"
>
<view
class=
"mr-3"
style=
"color: #ccc"
>
|
</view>
<view>
元
</view>
...
...
src/pages/chanxiao/purchaseXuQiu.vue
浏览文件 @
e266b465
差异被折叠。
点击展开。
src/pages/fuwu/fuwu.vue
浏览文件 @
e266b465
...
...
@@ -3,6 +3,7 @@
import
{
onPullDownRefresh
,
onLoad
}
from
'@dcloudio/uni-app'
import
*
as
NongzhiAPI
from
'@/api/model/nongzhi'
import
Navigate
from
'@/utils/page/navigate'
import
{
url
}
from
'inspector'
// 下拉刷新
onPullDownRefresh
(()
=>
{
...
...
@@ -47,6 +48,7 @@
title
:
'季节性用工'
,
description
:
'三农区域灵活用工服务'
,
actionText
:
'去发布'
,
url
:
'/pages/nongjifuwu/farm-form'
,
},
{
id
:
2
,
...
...
@@ -54,14 +56,15 @@
title
:
'农机手调度'
,
description
:
'专业人员作业安排'
,
actionText
:
'去预约'
,
url
:
'/pages/nongjifuwu/nongjifuwu'
,
},
{
id
:
3
,
image
:
'/static/images/codefun/06319419d17b7630c1d5bc415bcd26ef.png'
,
title
:
'作业质量评价'
,
description
:
'农机定位精度≤50米'
,
actionText
:
'去评价'
,
},
//
{
//
id: 3,
//
image: '/static/images/codefun/06319419d17b7630c1d5bc415bcd26ef.png',
//
title: '作业质量评价',
//
description: '农机定位精度≤50米',
//
actionText: '去评价',
//
},
],
// 助农金融产品
...
...
@@ -347,7 +350,12 @@
</view>
<view
class=
"codefun-flex-col group_8"
>
<view
class=
"codefun-flex-col section_4 flex gap-4"
>
<view
v-for=
"service in pageData.flexibleEmploymentServices"
:key=
"service.id"
>
<navigator
v-for=
"service in pageData.flexibleEmploymentServices"
:key=
"service.id"
:url=
"service.url"
hover-class=
"none"
>
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center"
>
<view
class=
"codefun-flex-row"
>
<image
class=
"image_8"
:src=
"service.image"
/>
...
...
@@ -367,7 +375,7 @@
<text
class=
"font_8"
:class=
"`text_$
{9 + service.id}`">
{{
service
.
actionText
}}
</text>
</view>
</view>
</
view
>
</
navigator
>
</view>
<view
class=
"codefun-flex-col codefun-mt-24"
>
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center group_11"
>
...
...
@@ -503,7 +511,7 @@
class=
"codefun-flex-row codefun-justify-between codefun-items-center codefun-self-stretch group_14"
>
<text
class=
"font_5"
>
一站式解决农机问题
</text>
<
text
class=
"font_6 text_37"
@
click=
"onViewAllMachineryCases"
>
全部案例
</text
>
<
!-- <text class="font_6 text_37" @click="onViewAllMachineryCases">全部案例</text> --
>
</view>
<view
class=
"codefun-flex-col codefun-self-stretch section_14"
>
<view
class=
"codefun-flex-row"
>
...
...
src/pages/linghuoyonggong/form.vue
浏览文件 @
e266b465
差异被折叠。
点击展开。
src/pages/linghuoyonggong/linghuoyonggong.vue
浏览文件 @
e266b465
...
...
@@ -113,23 +113,107 @@
total
:
0
,
})
// 缓存已处理的区域数据,避免重复计算
const
areaCache
=
new
Map
()
// 请求重试配置
const
requestConfig
=
{
maxRetries
:
2
,
retryDelay
:
1000
,
}
// 带重试机制的API调用
async
function
fetchWithRetry
(
apiCall
,
maxRetries
=
requestConfig
.
maxRetries
)
{
const
startTime
=
Date
.
now
()
for
(
let
attempt
=
1
;
attempt
<=
maxRetries
;
attempt
++
)
{
try
{
const
result
=
await
apiCall
()
const
endTime
=
Date
.
now
()
// 记录API性能数据(仅在开发环境)
if
(
import
.
meta
.
env
.
DEV
)
{
console
.
log
(
`API请求成功,耗时:
${
endTime
-
startTime
}
ms`
)
}
return
result
}
catch
(
error
)
{
console
.
warn
(
`API请求失败 (尝试
${
attempt
}
/
${
maxRetries
}
):`
,
error
)
if
(
attempt
===
maxRetries
)
{
const
endTime
=
Date
.
now
()
if
(
import
.
meta
.
env
.
DEV
)
{
console
.
error
(
`API请求最终失败,总耗时:
${
endTime
-
startTime
}
ms`
)
}
throw
error
}
// 指数退避策略
await
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
requestConfig
.
retryDelay
*
attempt
))
}
}
}
function
getEmploymentList
()
{
// 如果正在加载或没有更多数据,直接返回
if
(
pageData
.
loading
||
(
pageData
.
total
>
0
&&
pageData
.
employmentList
.
length
>=
pageData
.
total
))
{
return
}
pageData
.
loading
=
true
LinghuoyonggongAPI
.
employmentList
(
pageData
.
search
)
.
then
((
res
)
=>
{
// 添加请求防抖,避免快速连续请求
if
(
pageData
.
requestDebounce
)
{
clearTimeout
(
pageData
.
requestDebounce
)
}
pageData
.
requestDebounce
=
setTimeout
(
async
()
=>
{
try
{
const
res
=
await
fetchWithRetry
(()
=>
LinghuoyonggongAPI
.
employmentList
(
pageData
.
search
))
const
{
records
,
total
}
=
res
console
.
log
(
'records'
,
records
)
records
.
map
((
item
)
=>
{
item
.
area
=
item
.
area
.
split
(
','
)
item
.
area
=
getTextByCode
(
item
.
area
[
0
])
+
' '
+
getTextByCode
(
item
.
area
[
1
])
// 批量处理数据,避免多次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
}
// 计算天数并缓存结果
if
(
item
.
starttime
&&
item
.
estimatedendtime
)
{
item
.
daysDiff
=
getDaysDiff
(
item
.
starttime
,
item
.
estimatedendtime
)
}
return
item
})
pageData
.
employmentList
=
[...
pageData
.
employmentList
,
...
records
]
// 一次性更新数据,避免多次响应式更新
if
(
pageData
.
search
.
pageNo
===
1
)
{
pageData
.
employmentList
=
processedRecords
}
else
{
// 避免重复数据加载
const
existingIds
=
new
Set
(
pageData
.
employmentList
.
map
((
item
)
=>
item
.
id
))
const
newRecords
=
processedRecords
.
filter
((
item
)
=>
!
existingIds
.
has
(
item
.
id
))
pageData
.
employmentList
=
[...
pageData
.
employmentList
,
...
newRecords
]
}
pageData
.
total
=
total
})
.
finally
(()
=>
{
}
catch
(
error
)
{
console
.
error
(
'获取用工列表失败:'
,
error
)
// 这里可以添加用户友好的错误提示
// uni.showToast({ title: '网络异常,请稍后重试', icon: 'none' })
}
finally
{
pageData
.
loading
=
false
})
pageData
.
requestDebounce
=
null
}
},
150
)
}
// 分类标签点击事件
...
...
@@ -251,7 +335,7 @@
@
click=
"onEmploymentItemClick(item)"
>
<view
class=
"codefun-flex-row"
>
<image
class=
"image_7"
:src=
"item.picture"
/>
<image
class=
"image_7"
:src=
"item.picture"
lazy-load
/>
<view
class=
"codefun-flex-col codefun-flex-1 codefun-self-center group_4"
>
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center"
>
<text
class=
"codefun-self-start font"
>
{{
item
.
name
}}
</text>
...
...
@@ -269,7 +353,9 @@
<view
class=
"flex codefun-items-center gap-1"
>
<image
class=
"image_9"
src=
"/src/static/images/time.svg"
/>
<text
class=
"font_4"
>
预计
{{
getDaysDiff
(
item
.
starttime
,
item
.
estimatedendtime
)
}}
天
</text
>
预计
{{
item
.
daysDiff
||
getDaysDiff
(
item
.
starttime
,
item
.
estimatedendtime
)
}}
天
</text
>
</view>
<view
class=
"flex codefun-items-center gap-1"
>
...
...
@@ -304,10 +390,11 @@
<!-- <image class="codefun-self-end image_7 image_12 mt-269" :src="pageData.bottomImage" /> -->
</view>
<fui-fab
background=
"#5db66f"
position=
"right"
distance=
"10"
bottom=
"240"
width=
"120
"
@
click=
"handlePublish"
>
<fui-fab
position=
"right"
distance=
"10"
bottom=
"240"
width=
"96
"
@
click=
"handlePublish"
>
<view
class=
"text-white text-center"
>
<image
src=
"/src/static/images/chanxiao/notepad.svg"
style=
"width: 40rpx"
mode=
"widthFix"
></image>
<view
style=
"font-size: 24rpx"
>
发布用工
</view>
<!-- <image src="/src/static/images/chanxiao/notepad.svg" style="width: 40rpx" mode="widthFix"></image> -->
<view
class=
"fab-icon"
></view>
<view
style=
"font-size: 24rpx"
>
发布
</view>
</view>
</fui-fab>
<register-dialog
ref=
"registerDialogRef"
></register-dialog>
...
...
@@ -315,6 +402,9 @@
</template>
<
style
scoped
lang=
"scss"
>
body
{
background-color
:
#e6f5e8
;
}
.mt-19
{
margin-top
:
38
rpx
;
}
...
...
@@ -331,7 +421,7 @@
margin-top
:
538
rpx
;
}
.page
{
padding-bottom
:
128
rpx
;
//
padding-bottom
:
128
rpx
;
background-color
:
#e6f5e8
;
mix-blend-mode
:
NOTTHROUGH
;
width
:
100%
;
...
...
@@ -544,9 +634,14 @@
.image_7
{
width
:
96
rpx
;
height
:
96
rpx
;
border-radius
:
50%
;
}
.image_12
{
margin-right
:
58
rpx
;
}
}
::v-deep
.fui-fab__btn-main
{
background
:
linear-gradient
(
124.25deg
,
#a5d63f
0%
,
#5db66f
100%
)
!important
;
box-shadow
:
0px
1px
8px
#5db66f
;
}
</
style
>
src/pages/nongjifuwu/farm-form.vue
浏览文件 @
e266b465
差异被折叠。
点击展开。
src/pages/nongjifuwu/machine-form.vue
浏览文件 @
e266b465
差异被折叠。
点击展开。
src/pages/nongjifuwu/nongjifuwu.vue
浏览文件 @
e266b465
...
...
@@ -126,7 +126,7 @@
:src=
"item.picture"
@
click=
"handleDetails(item)"
/>
<view
style=
"width: 7
5
%"
>
<view
style=
"width: 7
0
%"
>
<view
class=
"codefun-flex-col codefun-items-start codefun-flex-1 codefun-self-center"
@
click=
"handleDetails(item)"
...
...
@@ -270,12 +270,10 @@
</view>
-->
</view>
</view>
<fui-fab
background=
"#5db66f"
position=
"right"
distance=
"10"
bottom=
"240"
width=
"130
"
@
click=
"handlePublish"
>
<fui-fab
position=
"right"
distance=
"10"
bottom=
"240"
width=
"96
"
@
click=
"handlePublish"
>
<view
class=
"text-white text-center"
>
<image
src=
"/src/static/images/chanxiao/notepad.svg"
style=
"width: 40rpx"
mode=
"widthFix"
></image>
<view
style=
"font-size: 24rpx"
>
发布
{{
pageData
.
categoryTabs
.
find
((
item
)
=>
item
.
id
===
pageData
.
search
.
serviceType
)?.
name
}}
</view
>
<view
class=
"fab-icon"
></view>
<view
style=
"font-size: 24rpx"
>
发布
</view>
</view>
</fui-fab>
...
...
@@ -462,6 +460,8 @@
.image_8
{
width
:
160
rpx
;
height
:
160
rpx
;
border-radius
:
10
rpx
;
margin-right
:
20
rpx
;
}
.font_6
{
font-size
:
24
rpx
;
...
...
@@ -641,4 +641,9 @@
color
:
#333333
;
}
}
::v-deep
.fui-fab__btn-main
{
background
:
linear-gradient
(
124.25deg
,
#a5d63f
0%
,
#5db66f
100%
)
!important
;
box-shadow
:
0px
1px
8px
#5db66f
;
}
</
style
>
src/static/images/codefun/8a063bccb4a75c449a7ba2a1adc8caaf.png
查看替换文件 @
b644e698
浏览文件 @
e266b465
56.8 KB
|
W:
|
H:
343.2 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/utils/areaData.ts
浏览文件 @
e266b465
...
...
@@ -54,8 +54,17 @@ export const convertToTree = (): AreaNode[] => {
return
tree
}
// 导出树形结构数据
export
const
areaTree
=
convertToTree
()
// 导出树形结构数据(懒加载)
let
areaTreeCache
:
AreaNode
[]
|
null
=
null
export
const
getAreaTree
=
():
AreaNode
[]
=>
{
if
(
!
areaTreeCache
)
{
areaTreeCache
=
convertToTree
()
}
return
areaTreeCache
}
// 向后兼容的导出
export
const
areaTree
=
getAreaTree
()
/**
* 根据地区代码获取完整的地区名称(如:广东省广州市天河区)
...
...
@@ -85,46 +94,28 @@ export const getFullAreaName = (code: string): string => {
// 根据编号获取文本
export
function
getTextByCode
(
code
)
{
// 遍历省份
for
(
const
provinceCode
in
areaList
.
province_list
)
{
if
(
provinceCode
===
code
)
{
return
areaList
.
province_list
[
provinceCode
]
}
// 遍历城市
for
(
const
cityCode
in
areaList
.
city_list
)
{
if
(
cityCode
===
code
)
{
return
areaList
.
city_list
[
cityCode
]
}
// 遍历区县
for
(
const
countyCode
in
areaList
.
county_list
)
{
if
(
countyCode
===
code
)
{
return
areaList
.
county_list
[
countyCode
]
}
// 直接查询,避免多层嵌套循环
if
(
areaList
.
province_list
[
code
])
{
return
areaList
.
province_list
[
code
]
}
if
(
areaList
.
city_list
[
code
])
{
return
areaList
.
city_list
[
code
]
}
if
(
areaList
.
county_list
[
code
])
{
return
areaList
.
county_list
[
code
]
}
return
null
}
// 根据文本获取编号
export
function
getCodeByText
(
text
)
{
// 遍历省份
for
(
const
provinceCode
in
areaList
.
province_list
)
{
if
(
areaList
.
province_list
[
provinceCode
]
===
text
)
{
return
provinceCode
}
// 使用Object.entries和find方法优化性能
const
findCode
=
(
obj
:
Record
<
string
,
string
>
)
=>
{
const
entry
=
Object
.
entries
(
obj
).
find
(([
_
,
value
])
=>
value
===
text
)
return
entry
?
entry
[
0
]
:
null
}
// 遍历城市
for
(
const
cityCode
in
areaList
.
city_list
)
{
if
(
areaList
.
city_list
[
cityCode
]
===
text
)
{
return
cityCode
}
}
// 遍历区县
for
(
const
countyCode
in
areaList
.
county_list
)
{
if
(
areaList
.
county_list
[
countyCode
]
===
text
)
{
return
countyCode
}
}
return
null
return
findCode
(
areaList
.
province_list
)
||
findCode
(
areaList
.
city_list
)
||
findCode
(
areaList
.
county_list
)
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论