Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
basic-uniapp-v3
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-uniapp-v3
Commits
50ba3d74
提交
50ba3d74
authored
11月 10, 2025
作者:
方治民
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://gitlab.yiring.com/digital-agri/agri-app
上级
baeb2a89
78020c8b
全部展开
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
110 行增加
和
5 行删除
+110
-5
home.ts
src/api/model/home.ts
+12
-0
nongjifuwu.ts
src/api/model/nongjifuwu.ts
+12
-0
pages.json
src/pages.json
+10
-0
nongchang.vue
src/pages/nongchang/nongchang.vue
+3
-0
nongjifuwu.vue
src/pages/nongjifuwu/nongjifuwu.vue
+43
-4
nongmaojiaoyi.vue
src/pages/nongmaojiaoyi/nongmaojiaoyi.vue
+3
-1
shouye.vue
src/pages/shouye/shouye.vue
+0
-0
webview.vue
src/pages/webview/webview.vue
+27
-0
没有找到文件。
src/api/model/home.ts
浏览文件 @
50ba3d74
...
...
@@ -6,6 +6,7 @@ enum Api {
productMarketList
=
'/online/cgform/api/getData/5b71e11020d44366b2d130e200c7a640'
,
// 热门产地行情
serviceStatsList
=
'/online/cgform/api/getData/491863dde351404da63a1a6e8c699c4c'
,
// 服务展示窗
agricultureClassList
=
'/online/cgform/api/getData/311c300e05694ba69a063d04c8572e9e'
,
// 农技课堂
warning
=
'/warningInfo/list'
}
/**
...
...
@@ -65,3 +66,14 @@ export function agricultureClassList(params = {}) {
params
,
})
}
/**
* @param params 请求参数
* @returns 获取预警数据
*/
export
function
warning
(
params
=
{})
{
return
otherHttp
.
get
({
url
:
Api
.
warning
,
params
,
})
}
src/api/model/nongjifuwu.ts
浏览文件 @
50ba3d74
...
...
@@ -8,6 +8,7 @@ enum Api {
farmMachineAddFarm
=
'/farmMachine/machineWork/app/addFarm'
,
// 发布农活服务
farmMachineEdit
=
'/farmMachine/machineWork/edit'
,
// 编辑农机服务
farmMachineRegister
=
'/farmMachine/machineWork/app/register'
,
// 参与服务
cascaderHn
=
'/region/cascader/hn'
,
}
/**
...
...
@@ -80,3 +81,13 @@ export function farmMachineRegister(params = {}) {
params
,
})
}
/**
* 查询湖南省 市/区县/乡镇
* @returns 市/区县/乡镇
*/
export
function
cascaderHn
()
{
return
otherHttp
.
get
({
url
:
Api
.
cascaderHn
,
})
}
\ No newline at end of file
src/pages.json
浏览文件 @
50ba3d74
...
...
@@ -295,6 +295,16 @@
}
},
{
"path"
:
"pages/webview/webview"
,
"style"
:
{
"navigationBarTitleText"
:
"常用工具"
,
"enablePullDownRefresh"
:
false
,
"navigationBarBackgroundColor"
:
"#5DB66F"
,
"navigationBarTextStyle"
:
"white"
,
"backgroundColorBottom"
:
"#F2F2F2"
}
},
{
"path"
:
"pages/index/index"
,
"style"
:
{
"navigationBarTitleText"
:
"Basic APP"
...
...
src/pages/nongchang/nongchang.vue
浏览文件 @
50ba3d74
...
...
@@ -347,6 +347,9 @@
function
onClickTool
(
tool
:
any
)
{
console
.
log
(
'点击常用工具:'
,
tool
)
// 在这里添加具体的常用工具点击逻辑
uni
.
navigateTo
({
url
:
`/pages/webview/webview?url=
${
encodeURIComponent
(
tool
.
addr
)}
`
,
})
}
// 轮播视频切换的时候触发
...
...
src/pages/nongjifuwu/nongjifuwu.vue
浏览文件 @
50ba3d74
<
script
setup
lang=
"ts"
>
import
{
reactive
}
from
'vue'
import
{
reactive
,
ref
}
from
'vue'
import
{
onLoad
,
onReachBottom
,
onShow
}
from
'@dcloudio/uni-app'
import
ApplyDialog
from
'./components/apply-dialog.vue'
...
...
@@ -14,8 +14,10 @@
pageData
.
search
.
pageNo
=
1
pageData
.
farmMachineList
=
[]
getFarmMachineList
()
getCascader
()
})
const
options
=
ref
([])
const
pageData
=
reactive
({
loading
:
false
,
// 分类标签
...
...
@@ -45,6 +47,12 @@
})
}
function
getCascader
()
{
NongjifuwuAPI
.
cascaderHn
().
then
((
res
)
=>
{
options
.
value
=
res
[
0
].
children
;
})
}
// 分类标签点击事件
function
onCategoryTabClick
(
tab
:
any
)
{
console
.
log
(
'点击分类标签:'
,
tab
)
...
...
@@ -78,10 +86,41 @@
applyDialogRef
.
value
.
open
(
item
)
}
function
getScope
(
scope
:
any
)
{
if
(
!
scope
||
!
options
.
value
||
options
.
value
.
length
===
0
)
{
return
[]
}
const
values
=
scope
.
split
(
','
)
const
labels
=
[]
// 递归查找label
const
findLabel
=
(
nodes
,
value
)
=>
{
for
(
const
node
of
nodes
)
{
if
(
node
.
value
===
value
)
{
return
node
.
label
}
if
(
node
.
children
&&
node
.
children
.
length
>
0
)
{
const
found
=
findLabel
(
node
.
children
,
value
)
if
(
found
)
{
return
found
}
}
}
return
null
// 如果没找到,返回原始value
}
for
(
const
value
of
values
)
{
const
label
=
findLabel
(
options
.
value
,
value
.
trim
())
labels
.
push
(
label
)
}
return
labels
.
join
(
' / '
)
}
onReachBottom
(()
=>
{
console
.
log
(
'触底了'
)
if
(
pageData
.
total
<=
pageData
.
farmMachineList
.
length
)
return
if
(
pageData
.
total
<=
pageData
.
farmMachineList
.
length
)
return
pageData
.
search
.
pageNo
++
getFarmMachineList
()
})
...
...
@@ -134,7 +173,7 @@ return
>
<text
class=
"font text_6"
>
{{
item
.
name
}}
</text>
<text
class=
"font_3 text_7 ellipsis"
style=
"width: 100%; margin: 26rpx 0"
>
服务范围:
{{
item
.
scope
}}
</text
>
服务范围:
{{
getScope
(
item
.
scope
)
}}
</text
>
</view>
<view
class=
"flex justify-between"
style=
"width: 100%"
>
...
...
src/pages/nongmaojiaoyi/nongmaojiaoyi.vue
浏览文件 @
50ba3d74
...
...
@@ -251,6 +251,9 @@ return
>
<view
class=
"codefun-flex-col codefun-justify-start codefun-items-start codefun-self-center section_3"
:style=
"
{
'background-image': `url(${product.image})`,
}"
>
<view
v-if=
"product.labels_dictText.split(',').length > 0"
...
...
@@ -418,7 +421,6 @@ return
border-bottom
:
solid
2
rpx
#eeeeee
;
.section_3
{
padding
:
12
rpx
0
116
rpx
;
background-image
:
url('/static/images/codefun/00db5a56fec86b1852516ae34b6d443a.png')
;
background-size
:
100%
100%
;
background-repeat
:
no-repeat
;
width
:
160
rpx
;
...
...
src/pages/shouye/shouye.vue
浏览文件 @
50ba3d74
差异被折叠。
点击展开。
src/pages/webview/webview.vue
0 → 100644
浏览文件 @
50ba3d74
<
template
>
<view
class=
"webview-container"
>
<web-view
:src=
"url"
></web-view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
url
:
''
}
},
onLoad
(
options
)
{
if
(
options
.
url
)
{
this
.
url
=
decodeURIComponent
(
options
.
url
)
}
else
{
uni
.
showToast
({
title
:
'网址不存在'
,
icon
:
'none'
})
uni
.
navigateBack
()
}
}
}
</
script
>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论