Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
basic-uniapp-v3
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-uniapp-v3
Commits
4ffeb10f
提交
4ffeb10f
authored
11月 11, 2025
作者:
方治民
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 首页、农场、服务页面金刚区菜单支持页面跳转,页面滚动到指定位置
上级
3239e7e2
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
142 行增加
和
28 行删除
+142
-28
fuwu.vue
src/pages/fuwu/fuwu.vue
+92
-12
nongchang.vue
src/pages/nongchang/nongchang.vue
+38
-11
shouye.vue
src/pages/shouye/shouye.vue
+12
-5
没有找到文件。
src/pages/fuwu/fuwu.vue
浏览文件 @
4ffeb10f
...
@@ -2,11 +2,13 @@
...
@@ -2,11 +2,13 @@
import
{
reactive
}
from
'vue'
import
{
reactive
}
from
'vue'
import
{
onLoad
,
onPullDownRefresh
}
from
'@dcloudio/uni-app'
import
{
onLoad
,
onPullDownRefresh
}
from
'@dcloudio/uni-app'
import
*
as
NongzhiAPI
from
'@/api/model/nongzhi'
import
*
as
NongzhiAPI
from
'@/api/model/nongzhi'
import
*
as
HomeAPI
from
'@/api/model/home'
import
Navigate
from
'@/utils/page/navigate'
import
Navigate
from
'@/utils/page/navigate'
// 下拉刷新
// 下拉刷新
onPullDownRefresh
(()
=>
{
onPullDownRefresh
(()
=>
{
getGoodsList
()
getGoodsList
()
getServiceItems
()
setTimeout
(
function
()
{
setTimeout
(
function
()
{
uni
.
stopPullDownRefresh
()
uni
.
stopPullDownRefresh
()
Message
.
toast
(
'刷新成功'
)
Message
.
toast
(
'刷新成功'
)
...
@@ -14,6 +16,7 @@
...
@@ -14,6 +16,7 @@
})
})
onLoad
(()
=>
{
onLoad
(()
=>
{
getGoodsList
()
getGoodsList
()
getServiceItems
()
})
})
// 页面数据
// 页面数据
...
@@ -32,11 +35,36 @@
...
@@ -32,11 +35,36 @@
// 功能菜单
// 功能菜单
menuItems
:
[
menuItems
:
[
{
id
:
1
,
name
:
'灵活用工'
,
icon
:
'/static/images/codefun/8193a279dfd933588d29a34aa2aeefe7.png'
},
{
{
id
:
2
,
name
:
'助农金融'
,
icon
:
'/static/images/codefun/b4ac84c6c037b7ab92fa371141ad88e0.png'
},
id
:
1
,
{
id
:
3
,
name
:
'农资交易'
,
icon
:
'/static/images/codefun/1ec00e65ad474de76b9efc3691acbbd1.png'
},
name
:
'灵活用工'
,
{
id
:
4
,
name
:
'农机服务'
,
icon
:
'/static/images/codefun/d6d66fa5331d2be60c7b0b66de6477e5.png'
},
icon_url
:
'/static/images/codefun/8193a279dfd933588d29a34aa2aeefe7.png'
,
{
id
:
5
,
name
:
'更多'
,
icon
:
'/static/images/codefun/aeaf23bed23b217a39c0c82cffb1bfb5.png'
},
jump_target
:
''
,
},
{
id
:
2
,
name
:
'助农金融'
,
icon_url
:
'/static/images/codefun/b4ac84c6c037b7ab92fa371141ad88e0.png'
,
jump_target
:
''
,
},
{
id
:
3
,
name
:
'农资交易'
,
icon_url
:
'/static/images/codefun/1ec00e65ad474de76b9efc3691acbbd1.png'
,
jump_target
:
''
,
},
{
id
:
4
,
name
:
'农机服务'
,
icon_url
:
'/static/images/codefun/d6d66fa5331d2be60c7b0b66de6477e5.png'
,
jump_target
:
''
,
},
{
id
:
5
,
name
:
'更多'
,
icon_url
:
'/static/images/codefun/aeaf23bed23b217a39c0c82cffb1bfb5.png'
,
jump_target
:
''
,
},
],
],
// 灵活用工业务
// 灵活用工业务
...
@@ -231,10 +259,62 @@
...
@@ -231,10 +259,62 @@
})
})
}
}
// 查询服务列表
function
getServiceItems
()
{
HomeAPI
.
zoneList
({
pageNo
:
1
,
pageSize
:
4
,
status
:
1
,
type
:
3
,
}).
then
((
res
)
=>
{
const
{
records
}
=
res
pageData
.
menuItems
=
[...
records
].
concat
([
{
id
:
5
,
name
:
'更多'
,
icon_url
:
'/static/images/codefun/aeaf23bed23b217a39c0c82cffb1bfb5.png'
,
jump_target
:
''
,
},
])
})
}
// 菜单点击事件
// 菜单点击事件
function
onMenuItemClick
(
item
:
any
)
{
function
onMenuItemClick
(
item
:
any
)
{
console
.
log
(
'点击菜单项:'
,
item
)
console
.
log
(
'点击菜单项:'
,
item
)
// 在这里添加具体的菜单点击逻辑
// 在这里添加具体的菜单点击逻辑
if
(
item
.
jump_target
?.
startsWith
(
'/'
))
{
const
tabbarKeyWords
=
[
'/pages/shouye/shouye'
,
'/pages/nongchang/nongchang'
,
'/pages/fuwu/fuwu'
,
'/pages/chanxiao/chanxiao'
,
]
if
(
tabbarKeyWords
.
includes
(
item
.
jump_target
))
{
uni
.
switchTab
({
url
:
item
.
jump_target
,
})
}
else
{
Navigate
.
to
(
item
.
jump_target
).
catch
(()
=>
{
Message
.
alert
(
`
${
item
.
jump_target
}
页面打开失败`
,
item
.
name
)
})
}
}
else
if
(
item
.
jump_target
?.
startsWith
(
'http'
))
{
Navigate
.
webview
(
item
.
jump_target
,
item
.
name
)
}
else
{
if
(
item
.
jump_target
?.
startsWith
(
'#'
))
{
uni
.
pageScrollTo
({
scrollTop
:
Number
(
item
.
jump_target
?.
substring
(
1
)
||
0
),
duration
:
300
,
})
}
else
{
uni
.
showModal
({
title
:
item
.
name
,
content
:
'功能暂未开放'
,
})
}
}
}
}
// 查看更多灵活用工业务
// 查看更多灵活用工业务
...
@@ -330,19 +410,19 @@
...
@@ -330,19 +410,19 @@
</view>
</view>
<view
class=
"codefun-flex-row equal-division section_3 codefun-mt-12"
>
<view
class=
"codefun-flex-row equal-division section_3 codefun-mt-12"
>
<view
<view
v-for=
"
item
in pageData.menuItems"
v-for=
"
(item, index)
in pageData.menuItems"
:key=
"item.id"
:key=
"item.id"
class=
"codefun-flex-col codefun-items-center"
class=
"codefun-flex-col codefun-items-center"
:class=
"
{
:class=
"
{
'equal-division-item_1': i
tem.id === 1
,
'equal-division-item_1': i
ndex === 0
,
'equal-division-item_2 equal-division-item': i
tem.id === 2
,
'equal-division-item_2 equal-division-item': i
ndex === 1
,
'equal-division-item_2 group_34': i
tem.id === 3
,
'equal-division-item_2 group_34': i
ndex === 2
,
'equal-division-item_9 group_35': i
tem.id === 4
,
'equal-division-item_9 group_35': i
ndex === 3
,
'equal-division-item_10 group_1': i
tem.id === 5
,
'equal-division-item_10 group_1': i
ndex === 4
,
}"
}"
@click="onMenuItemClick(item)"
@click="onMenuItemClick(item)"
>
>
<image
class=
"image_7"
:src=
"item.icon"
/>
<image
class=
"image_7"
:src=
"item.icon
_url
"
/>
<text
class=
"font_4"
:class=
"`text_$
{item.id + 2} mt-13`">
{{
item
.
name
}}
</text>
<text
class=
"font_4"
:class=
"`text_$
{item.id + 2} mt-13`">
{{
item
.
name
}}
</text>
</view>
</view>
</view>
</view>
...
...
src/pages/nongchang/nongchang.vue
浏览文件 @
4ffeb10f
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
getCommonToolsList
()
getCommonToolsList
()
// 农技课堂
// 农技课堂
getAgricultureClassList
()
getAgricultureClassList
()
pageData
.
userInfo
=
userStore
.
getUserInfo
})
})
// 下拉刷新
// 下拉刷新
...
@@ -40,11 +39,11 @@
...
@@ -40,11 +39,11 @@
// 功能菜单
// 功能菜单
menuItems
:
[
menuItems
:
[
// { id: 1, name: '监测预警', icon
: '/static/images/codefun/e683f9d10dc21da45abffbfa4c56fffb.png' },
{
id
:
1
,
name
:
'监测预警'
,
icon_url
:
'/static/images/codefun/e683f9d10dc21da45abffbfa4c56fffb.png'
},
// { id: 2, name: '农业模型', icon
: '/static/images/codefun/afdf5cf91bb1832ec12b89ba1f8a4a22.png' },
{
id
:
2
,
name
:
'农业模型'
,
icon_url
:
'/static/images/codefun/afdf5cf91bb1832ec12b89ba1f8a4a22.png'
},
// { id: 3, name: '基地管理', icon
: '/static/images/codefun/8ce0f7de048a5d10fd901fa4caee40fd.png' },
{
id
:
3
,
name
:
'基地管理'
,
icon_url
:
'/static/images/codefun/8ce0f7de048a5d10fd901fa4caee40fd.png'
},
// { id: 4, name: '信用中心', icon
: '/static/images/codefun/bc6853d7f464c445f1d6cc5f3b37103d.png' },
{
id
:
4
,
name
:
'信用中心'
,
icon_url
:
'/static/images/codefun/bc6853d7f464c445f1d6cc5f3b37103d.png'
},
// { id: 5, name: '灵活用工', icon
: '/static/images/codefun/104cbc5dca418b07e6933d2e953db1d8.png' },
{
id
:
5
,
name
:
'灵活用工'
,
icon_url
:
'/static/images/codefun/104cbc5dca418b07e6933d2e953db1d8.png'
},
],
],
// 农场信息
// 农场信息
...
@@ -231,7 +230,6 @@
...
@@ -231,7 +230,6 @@
type
:
2
,
type
:
2
,
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
const
{
records
}
=
res
const
{
records
}
=
res
pageData
.
menuItems
=
[]
pageData
.
menuItems
=
records
pageData
.
menuItems
=
records
})
})
}
}
...
@@ -278,9 +276,38 @@
...
@@ -278,9 +276,38 @@
function
onMenuItemClick
(
item
:
any
)
{
function
onMenuItemClick
(
item
:
any
)
{
console
.
log
(
'点击菜单项:'
,
item
)
console
.
log
(
'点击菜单项:'
,
item
)
// 在这里添加具体的菜单点击逻辑+
// 在这里添加具体的菜单点击逻辑+
uni
.
reLaunch
({
url
:
item
.
jump_target
,
if
(
item
.
jump_target
?.
startsWith
(
'/'
))
{
})
const
tabbarKeyWords
=
[
'/pages/shouye/shouye'
,
'/pages/nongchang/nongchang'
,
'/pages/fuwu/fuwu'
,
'/pages/chanxiao/chanxiao'
,
]
if
(
tabbarKeyWords
.
includes
(
item
.
jump_target
))
{
uni
.
switchTab
({
url
:
item
.
jump_target
,
})
}
else
{
Navigate
.
to
(
item
.
jump_target
).
catch
(()
=>
{
Message
.
alert
(
`
${
item
.
jump_target
}
页面打开失败`
,
item
.
name
)
})
}
}
else
if
(
item
.
jump_target
?.
startsWith
(
'http'
))
{
Navigate
.
webview
(
item
.
jump_target
,
item
.
name
)
}
else
{
if
(
item
.
jump_target
?.
startsWith
(
'#'
))
{
uni
.
pageScrollTo
({
scrollTop
:
Number
(
item
.
jump_target
?.
substring
(
1
)
||
0
),
duration
:
300
,
})
}
else
{
uni
.
showModal
({
title
:
item
.
name
,
content
:
'功能暂未开放'
,
})
}
}
}
}
// 农业模型点击事件
// 农业模型点击事件
...
@@ -730,7 +757,7 @@
...
@@ -730,7 +757,7 @@
>
>
<image
class=
"image_15"
:src=
"pageData.creditCenter.image"
/>
<image
class=
"image_15"
:src=
"pageData.creditCenter.image"
/>
<view
class=
"codefun-flex-col codefun-items-start group_29"
>
<view
class=
"codefun-flex-col codefun-items-start group_29"
>
<text
class=
"text_62"
>
{{
pageData.userInfo.creditScore
}}
</text>
<text
class=
"text_62"
>
{{
userStore.getUserInfo?.creditScore || 600
}}
</text>
<text
class=
"font_5 text_63 mt-13"
>
{{ pageData.creditCenter.rating }}
</text>
<text
class=
"font_5 text_63 mt-13"
>
{{ pageData.creditCenter.rating }}
</text>
<text
class=
"font_10 text_64 mt-13"
>
{{ pageData.creditCenter.tips }}
</text>
<text
class=
"font_10 text_64 mt-13"
>
{{ pageData.creditCenter.tips }}
</text>
<view
<view
...
...
src/pages/shouye/shouye.vue
浏览文件 @
4ffeb10f
...
@@ -382,10 +382,17 @@
...
@@ -382,10 +382,17 @@
}
else
if
(
item
.
jump_target
?.
startsWith
(
'http'
))
{
}
else
if
(
item
.
jump_target
?.
startsWith
(
'http'
))
{
Navigate
.
webview
(
item
.
jump_target
,
item
.
name
)
Navigate
.
webview
(
item
.
jump_target
,
item
.
name
)
}
else
{
}
else
{
uni
.
showModal
({
if
(
item
.
jump_target
?.
startsWith
(
'#'
))
{
title
:
item
.
name
,
uni
.
pageScrollTo
({
content
:
'功能开发中...'
,
scrollTop
:
Number
(
item
.
jump_target
?.
substring
(
1
)
||
0
),
})
duration
:
300
,
})
}
else
{
uni
.
showModal
({
title
:
item
.
name
,
content
:
'功能暂未开放'
,
})
}
}
}
}
}
...
@@ -778,7 +785,7 @@
...
@@ -778,7 +785,7 @@
<
/view
>
<
/view
>
<
view
class
=
"codefun-flex-row codefun-justify-between codefun-items-center group_19"
>
<
view
class
=
"codefun-flex-row codefun-justify-between codefun-items-center group_19"
>
<
text
class
=
"font_6 text_32"
>
农技课堂
<
/text
>
<
text
class
=
"font_6 text_32"
>
农技课堂
<
/text
>
<
!--
<
text
class
=
"font_7 text_33"
@
click
=
"onViewMoreClass"
>
查看全部
<
/text> --
>
<
text
class
=
"font_7 text_33"
@
click
=
"onViewMoreClass"
>
查看全部
<
/text
>
<
/view
>
<
/view
>
<
view
class
=
"codefun-flex-col section_13 !relative"
>
<
view
class
=
"codefun-flex-col section_13 !relative"
>
<
fui
-
swiper
-
dot
<
fui
-
swiper
-
dot
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论