Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
basic-uniapp-v3
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-uniapp-v3
Commits
14005f92
提交
14005f92
authored
11月 10, 2025
作者:
吴佳伟
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 预警消息接口对接
上级
c98e4a98
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
73 行增加
和
30 行删除
+73
-30
home.ts
src/api/model/home.ts
+12
-0
shouye.vue
src/pages/shouye/shouye.vue
+61
-30
没有找到文件。
src/api/model/home.ts
浏览文件 @
14005f92
...
@@ -6,6 +6,7 @@ enum Api {
...
@@ -6,6 +6,7 @@ enum Api {
productMarketList
=
'/online/cgform/api/getData/5b71e11020d44366b2d130e200c7a640'
,
// 热门产地行情
productMarketList
=
'/online/cgform/api/getData/5b71e11020d44366b2d130e200c7a640'
,
// 热门产地行情
serviceStatsList
=
'/online/cgform/api/getData/491863dde351404da63a1a6e8c699c4c'
,
// 服务展示窗
serviceStatsList
=
'/online/cgform/api/getData/491863dde351404da63a1a6e8c699c4c'
,
// 服务展示窗
agricultureClassList
=
'/online/cgform/api/getData/311c300e05694ba69a063d04c8572e9e'
,
// 农技课堂
agricultureClassList
=
'/online/cgform/api/getData/311c300e05694ba69a063d04c8572e9e'
,
// 农技课堂
warning
=
'/warningInfo/list'
}
}
/**
/**
...
@@ -65,3 +66,14 @@ export function agricultureClassList(params = {}) {
...
@@ -65,3 +66,14 @@ export function agricultureClassList(params = {}) {
params
,
params
,
})
})
}
}
/**
* @param params 请求参数
* @returns 获取预警数据
*/
export
function
warning
(
params
=
{})
{
return
otherHttp
.
get
({
url
:
Api
.
warning
,
params
,
})
}
src/pages/shouye/shouye.vue
浏览文件 @
14005f92
...
@@ -137,6 +137,8 @@
...
@@ -137,6 +137,8 @@
getServiceStatsList
()
getServiceStatsList
()
// 农技课堂
// 农技课堂
getAgricultureClassList
()
getAgricultureClassList
()
// 预警信息
getWarning
()
})
})
// 下拉刷新
// 下拉刷新
...
@@ -218,14 +220,7 @@
...
@@ -218,14 +220,7 @@
serviceItems
:
[],
serviceItems
:
[],
// 新闻资讯
// 新闻资讯
newsItems
:
[
newsItems
:
[],
{
id
:
1
,
type
:
'最新预警'
,
title
:
'积极防范持续高温对农作物的影响'
,
date
:
dayjs
().
format
(
'YYYY-MM-DD'
),
},
],
// 农产品行情
// 农产品行情
productMarket
:
{
productMarket
:
{
...
@@ -355,6 +350,13 @@
...
@@ -355,6 +350,13 @@
})
})
}
}
function
getWarning
()
{
HomeAPI
.
warning
().
then
((
res
)
=>
{
const
{
records
}
=
res
pageData
.
newsItems
=
records
})
}
// 菜单点击事件
// 菜单点击事件
function
onMenuItemClick
(
item
:
any
)
{
function
onMenuItemClick
(
item
:
any
)
{
console
.
log
(
'点击菜单项:'
,
item
)
console
.
log
(
'点击菜单项:'
,
item
)
...
@@ -559,34 +561,52 @@
...
@@ -559,34 +561,52 @@
</view>
</view>
</view>
</view>
<view
class=
"codefun-flex-row section_5"
>
<view
class=
"codefun-flex-row section_5"
>
<view
<view
v-show=
"item.status"
v-show=
"item.status"
v-for=
"item in pageData.serviceItems"
v-for=
"item in pageData.serviceItems"
:key=
"item.id"
:key=
"item.id"
class=
"codefun-flex-col codefun-items-center group_10"
class=
"codefun-flex-col codefun-items-center group_10"
@
click=
"onMenuItemClick(item)"
@
click=
"onMenuItemClick(item)"
>
>
<image
class=
"image_11"
:src=
"item.icon_url"
/>
<image
class=
"image_11"
:src=
"item.icon_url"
/>
<text
class=
"font_2 mt-11"
>
{{
item
.
name
}}
</text>
<text
class=
"font_2 mt-11"
>
{{
item
.
name
}}
</text>
</view>
</view>
</view>
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center section_6"
>
</view>
<view
class=
"codefun-flex-col"
>
<swiper
:autoplay=
"true"
:interval=
"3000"
:duration=
"500"
:circular=
"true"
:vertical=
"true"
:indicator-dots=
"false"
class=
"codefun-flex-row codefun-justify-between codefun-items-center section_6 warn-scroll"
>
<swiper-item
id=
"scroll-view-content"
v-for=
"item of pageData.newsItems"
:key=
"item.id"
class=
"codefun-flex-col"
>
<view
class=
"codefun-flex-row codefun-items-baseline"
style=
"align-items: center"
>
<view
class=
"codefun-flex-row codefun-items-baseline"
style=
"align-items: center"
>
<view
class=
"font_5 text_17"
>
{{
pageData
.
newsItems
[
0
].
type
}}
</view>
<view
class=
"font_5 text_17"
>
最新预警
</view>
<view
<view
class=
"codefun-flex-row"
class=
"codefun-flex-row"
style=
"flex-flow: column; justify-content: space-around; height: 90rpx"
style=
"flex-flow: column; justify-content: space-around; height: 90rpx
; width: calc(100% - 110rpx)
"
>
>
<view
class=
"font_2 text_18 ml-11"
>
{{
pageData
.
newsItems
[
0
].
title
}}
</view>
<view
<text
class=
"text-26 text_20 text_21 ml-11"
>
{{
class=
"font_2 text_18 ml-11"
pageData
.
newsItems
[
0
].
date
style=
"white-space: nowrap; overflow: hidden; text-overflow: ellipsis"
}}
</text>
>
{{
item
.
title
}}
</view
>
<text
class=
"text-26 text_20 text_21 ml-11"
>
{{
item
.
warningDate
}}
</text>
</view>
</view>
<image
class=
"warn-image"
src=
"/static/images/codefun/64d85a99ca3de5fab9ce0e8dc71aa791.png"
/>
</view>
</view>
</view>
</swiper-item>
<image
class=
"image_13"
src=
"/static/images/codefun/64d85a99ca3de5fab9ce0e8dc71aa791.png"
/>
</swiper>
</view>
</view>
</view>
<view
class=
"codefun-self-end section_7"
/>
<view
class=
"codefun-self-end section_7"
/>
</view>
</view>
...
@@ -636,7 +656,7 @@
...
@@ -636,7 +656,7 @@
text_26: !product.isUp,
text_26: !product.isUp,
}"
}"
>
>
{{
`${product.
isUp ? '' : '-'
}
${product.
percent
}
%`
}}
{{
`${product.percent
}
%`
}}
<
/text
>
<
/text
>
<
/view
>
<
/view
>
<!--
<
view
<!--
<
view
...
@@ -1154,6 +1174,17 @@
...
@@ -1154,6 +1174,17 @@
line
-
height
:
17.18
rpx
;
line
-
height
:
17.18
rpx
;
}
}
}
}
.
warn
-
scroll
{
width
:
655
rpx
;
height
:
90
rpx
;
.
warn
-
image
{
border
-
radius
:
16
rpx
;
mix
-
blend
-
mode
:
NOTTHROUGH
;
width
:
32
rpx
;
height
:
32
rpx
;
}
}
.
image_13
{
.
image_13
{
border
-
radius
:
16
rpx
;
border
-
radius
:
16
rpx
;
mix
-
blend
-
mode
:
NOTTHROUGH
;
mix
-
blend
-
mode
:
NOTTHROUGH
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论