Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
basic-uniapp-v3
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-uniapp-v3
Commits
ca190da0
提交
ca190da0
authored
10月 30, 2025
作者:
guolinhua
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(api): 对接首页和农场数据接口
上级
bc9ae4d8
全部展开
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
148 行增加
和
15 行删除
+148
-15
pont-template.ts
pont-template.ts
+1
-1
home.ts
src/api/model/home.ts
+36
-0
nongchang.ts
src/api/model/nongchang.ts
+52
-0
nongchang.vue
src/pages/nongchang/nongchang.vue
+59
-14
shouye.vue
src/pages/shouye/shouye.vue
+0
-0
没有找到文件。
pont-template.ts
浏览文件 @
ca190da0
...
@@ -4,7 +4,7 @@ import { CodeGenerator, Property } from 'pont-engine'
...
@@ -4,7 +4,7 @@ import { CodeGenerator, Property } from 'pont-engine'
// 接口 API 前缀
// 接口 API 前缀
// 通常与项目的 env 配置中的 VITE_GLOB_API_URL_PREFIX 相同
// 通常与项目的 env 配置中的 VITE_GLOB_API_URL_PREFIX 相同
const
API_URL_PREFIX
=
'/
api
'
const
API_URL_PREFIX
=
'/
jeecgboot
'
export
default
class
BasicGenerator
extends
CodeGenerator
{
export
default
class
BasicGenerator
extends
CodeGenerator
{
checkJsonParam
(
inter
:
Interface
,
paramsCode
:
string
):
boolean
{
checkJsonParam
(
inter
:
Interface
,
paramsCode
:
string
):
boolean
{
...
...
src/api/model/home.ts
浏览文件 @
ca190da0
...
@@ -2,6 +2,9 @@ import { otherHttp } from '/@/utils/http/axios'
...
@@ -2,6 +2,9 @@ import { otherHttp } from '/@/utils/http/axios'
enum
Api
{
enum
Api
{
zoneList
=
'/online/cgform/api/getData/01fd687ecb164aea914e92047e144d66'
,
// 金刚区菜单数据
zoneList
=
'/online/cgform/api/getData/01fd687ecb164aea914e92047e144d66'
,
// 金刚区菜单数据
productMarketList
=
'/online/cgform/api/getData/5b71e11020d44366b2d130e200c7a640'
,
// 热门产地行情
serviceStatsList
=
'/online/cgform/api/getData/491863dde351404da63a1a6e8c699c4c'
,
// 服务展示窗
agricultureClassList
=
'/online/cgform/api/getData/311c300e05694ba69a063d04c8572e9e'
,
// 农技课堂
}
}
/**
/**
...
@@ -14,3 +17,36 @@ export function zoneList(params = {}) {
...
@@ -14,3 +17,36 @@ export function zoneList(params = {}) {
params
,
params
,
})
})
}
}
/**
* @param params 请求参数
* @description: 热门产地行情数据
*/
export
function
productMarketList
(
params
=
{})
{
return
otherHttp
.
get
({
url
:
Api
.
productMarketList
,
params
,
})
}
/**
* @param params 请求参数
* @description: 服务展示窗数据
*/
export
function
serviceStatsList
(
params
=
{})
{
return
otherHttp
.
get
({
url
:
Api
.
serviceStatsList
,
params
,
})
}
/**
* @param params 请求参数
* @description: 农技课堂数据
*/
export
function
agricultureClassList
(
params
=
{})
{
return
otherHttp
.
get
({
url
:
Api
.
agricultureClassList
,
params
,
})
}
src/api/model/nongchang.ts
0 → 100644
浏览文件 @
ca190da0
import
{
otherHttp
}
from
'/@/utils/http/axios'
enum
Api
{
zoneList
=
'/online/cgform/api/getData/01fd687ecb164aea914e92047e144d66'
,
// 功能菜单数据
agricultureModelsList
=
'/online/cgform/api/getData/7b2983df6ddf416aba68db8b0ab234ab'
,
// 农业模型数据
baseManagementList
=
'/online/cgform/api/getData/3a7fbb877f304b7d83935caa454859c4'
,
// 基地管理数据
commonToolsList
=
'/online/cgform/api/getData/e4e4e6c901254b60b1e7a005097999ec'
,
// 常用工具数据
}
/**
* @param params 请求参数
* @description: 金刚区菜单数据
*/
export
function
zoneList
(
params
=
{})
{
return
otherHttp
.
get
({
url
:
Api
.
zoneList
,
params
,
})
}
/**
* @param params 请求参数
* @description: 农业模型数据
*/
export
function
agricultureModelsList
(
params
=
{})
{
return
otherHttp
.
get
({
url
:
Api
.
agricultureModelsList
,
params
,
})
}
/**
* @param params 请求参数
* @description: 基地管理数据
*/
export
function
baseManagementList
(
params
=
{})
{
return
otherHttp
.
get
({
url
:
Api
.
baseManagementList
,
params
,
})
}
/**
* @param params 请求参数
* @description: 常用工具数据
*/
export
function
commonToolsList
(
params
=
{})
{
return
otherHttp
.
get
({
url
:
Api
.
commonToolsList
,
params
,
})
}
src/pages/nongchang/nongchang.vue
浏览文件 @
ca190da0
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
reactive
}
from
'vue'
import
{
reactive
}
from
'vue'
import
{
onPullDownRefresh
}
from
'@dcloudio/uni-app'
import
{
onPullDownRefresh
,
onShow
}
from
'@dcloudio/uni-app'
import
*
as
NongChangAPI
from
'@/api/model/nongchang'
onShow
(()
=>
{
// 获取金刚区菜单数据
getZoomList
()
// 获取农业模型数据
getAgricultureModelsList
()
// 获取基地管理数据
getBaseManagementList
()
// 获取常用工具数据
getCommonToolsList
()
})
// 下拉刷新
// 下拉刷新
onPullDownRefresh
(()
=>
{
onPullDownRefresh
(()
=>
{
...
@@ -20,11 +33,11 @@
...
@@ -20,11 +33,11 @@
// 功能菜单
// 功能菜单
menuItems
:
[
menuItems
:
[
{
id
:
1
,
name
:
'监测预警'
,
icon
:
'/static/images/codefun/e683f9d10dc21da45abffbfa4c56fffb.png'
},
//
{ id: 1, name: '监测预警', icon: '/static/images/codefun/e683f9d10dc21da45abffbfa4c56fffb.png' },
{
id
:
2
,
name
:
'农业模型'
,
icon
:
'/static/images/codefun/afdf5cf91bb1832ec12b89ba1f8a4a22.png'
},
//
{ id: 2, name: '农业模型', icon: '/static/images/codefun/afdf5cf91bb1832ec12b89ba1f8a4a22.png' },
{
id
:
3
,
name
:
'基地管理'
,
icon
:
'/static/images/codefun/8ce0f7de048a5d10fd901fa4caee40fd.png'
},
//
{ id: 3, name: '基地管理', icon: '/static/images/codefun/8ce0f7de048a5d10fd901fa4caee40fd.png' },
{
id
:
4
,
name
:
'信用中心'
,
icon
:
'/static/images/codefun/bc6853d7f464c445f1d6cc5f3b37103d.png'
},
//
{ id: 4, name: '信用中心', icon: '/static/images/codefun/bc6853d7f464c445f1d6cc5f3b37103d.png' },
{
id
:
5
,
name
:
'灵活用工'
,
icon
:
'/static/images/codefun/104cbc5dca418b07e6933d2e953db1d8.png'
},
//
{ id: 5, name: '灵活用工', icon: '/static/images/codefun/104cbc5dca418b07e6933d2e953db1d8.png' },
],
],
// 农场信息
// 农场信息
...
@@ -195,6 +208,40 @@
...
@@ -195,6 +208,40 @@
},
},
})
})
function
getZoomList
()
{
NongChangAPI
.
zoneList
({
pageNo
:
1
,
pageSize
:
5
,
status
:
1
,
type
:
2
,
}).
then
((
res
)
=>
{
const
{
records
}
=
res
pageData
.
menuItems
=
[]
pageData
.
menuItems
=
records
})
}
function
getAgricultureModelsList
()
{
NongChangAPI
.
agricultureModelsList
().
then
((
res
)
=>
{
const
{
records
}
=
res
pageData
.
agricultureModels
=
[]
pageData
.
agricultureModels
=
records
})
}
function
getBaseManagementList
()
{
NongChangAPI
.
baseManagementList
().
then
((
res
)
=>
{
const
{
records
}
=
res
pageData
.
baseManagement
=
[]
pageData
.
baseManagement
=
records
})
}
function
getCommonToolsList
()
{
NongChangAPI
.
commonToolsList
().
then
((
res
)
=>
{
const
{
records
}
=
res
pageData
.
commonTools
=
[]
pageData
.
commonTools
=
records
})
}
// 菜单点击事件
// 菜单点击事件
function
onMenuItemClick
(
item
:
any
)
{
function
onMenuItemClick
(
item
:
any
)
{
console
.
log
(
'点击菜单项:'
,
item
)
console
.
log
(
'点击菜单项:'
,
item
)
...
@@ -266,15 +313,9 @@
...
@@ -266,15 +313,9 @@
v-for=
"item in pageData.menuItems"
v-for=
"item in pageData.menuItems"
:key=
"item.id"
:key=
"item.id"
class=
"codefun-flex-col codefun-items-center"
class=
"codefun-flex-col codefun-items-center"
:class=
"
{
'equal-division-item': item.id === 1,
'group_3 equal-division-item': item.id === 2 || item.id === 3,
'group_4 equal-division-item_2': item.id === 4,
'equal-division-item_3 group_5': item.id === 5,
}"
@
click=
"onMenuItemClick(item)"
@
click=
"onMenuItemClick(item)"
>
>
<image
class=
"image_6"
:src=
"item.icon"
/>
<image
class=
"image_6"
:src=
"item.icon
_url
"
/>
<text
class=
"font_3 mt-13"
:class=
"`text_$
{item.id + 2}`">
{{
item
.
name
}}
</text>
<text
class=
"font_3 mt-13"
:class=
"`text_$
{item.id + 2}`">
{{
item
.
name
}}
</text>
</view>
</view>
</view>
</view>
...
@@ -742,7 +783,10 @@
...
@@ -742,7 +783,10 @@
}
}
}
}
.section_3
{
.section_3
{
padding
:
16
rpx
12
rpx
16
rpx
;
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
padding
:
16
rpx
24
rpx
16
rpx
;
background-color
:
#ffffff
;
background-color
:
#ffffff
;
border-radius
:
16
rpx
;
border-radius
:
16
rpx
;
mix-blend-mode
:
NOTTHROUGH
;
mix-blend-mode
:
NOTTHROUGH
;
...
@@ -878,6 +922,7 @@
...
@@ -878,6 +922,7 @@
margin-top
:
16
rpx
;
margin-top
:
16
rpx
;
text-align
:
center
;
text-align
:
center
;
width
:
160
rpx
;
width
:
160
rpx
;
height
:
60
rpx
;
}
}
.text-wrapper_3
{
.text-wrapper_3
{
margin-top
:
36
rpx
;
margin-top
:
36
rpx
;
...
...
src/pages/shouye/shouye.vue
浏览文件 @
ca190da0
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论