Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
basic-uniapp-v3
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-uniapp-v3
Commits
7ef27b6c
提交
7ef27b6c
authored
11月 06, 2025
作者:
宇宙超人
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改首页和农场
上级
fb92718d
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
434 行增加
和
27 行删除
+434
-27
wode.ts
src/api/model/wode.ts
+11
-0
pages.json
src/pages.json
+46
-22
device.vue
src/pages/device/device.vue
+1
-1
nongchang.vue
src/pages/nongchang/nongchang.vue
+3
-3
save-dialog.vue
src/pages/resource/components/save-dialog.vue
+0
-0
resource.vue
src/pages/resource/resource.vue
+372
-0
shouye.vue
src/pages/shouye/shouye.vue
+0
-0
wode.vue
src/pages/wode/wode.vue
+1
-1
没有找到文件。
src/api/model/wode.ts
浏览文件 @
7ef27b6c
...
@@ -14,3 +14,14 @@ export function bizCommonFileList(params = {}) {
...
@@ -14,3 +14,14 @@ export function bizCommonFileList(params = {}) {
params
,
params
,
})
})
}
}
/**
* 添加资源
* @param params
* @returns
*/
export
function
addResource
(
params
=
{})
{
return
otherHttp
.
post
({
url
:
'/resource/add'
,
params
,
})
}
src/pages.json
浏览文件 @
7ef27b6c
...
@@ -367,29 +367,53 @@
...
@@ -367,29 +367,53 @@
}
}
},
},
{
{
"path"
:
"pages/device/device"
,
"path"
:
"pages/device/device"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"物联设备"
,
"navigationBarTitleText"
:
"物联设备"
,
"enablePullDownRefresh"
:
false
,
"enablePullDownRefresh"
:
false
,
"navigationBarBackgroundColor"
:
"#5DB66F"
,
"navigationBarBackgroundColor"
:
"#5DB66F"
,
"navigationBarTextStyle"
:
"white"
,
"navigationBarTextStyle"
:
"white"
,
"backgroundColorBottom"
:
"#F2F2F2"
,
"backgroundColorBottom"
:
"#F2F2F2"
,
"app-plus"
:
{
"app-plus"
:
{
"titleNView"
:
{
"titleNView"
:
{
"titleSize"
:
"20"
,
"titleSize"
:
"20"
,
"buttons"
:
[
"buttons"
:
[
{
{
"text"
:
"+ 添加设备"
,
"text"
:
"+ 添加设备"
,
"fontSrc"
:
"/static/uni.ttf"
,
"fontSrc"
:
"/static/uni.ttf"
,
"color"
:
"#fff"
,
"color"
:
"#fff"
,
"fontSize"
:
"28rpx"
,
"fontSize"
:
"28rpx"
,
"width"
:
"auto"
"width"
:
"auto"
}
}
]
]
}
}
}
}
}
}
}
},
{
"path"
:
"pages/resource/resource"
,
"style"
:
{
"navigationBarTitleText"
:
"资源库管理"
,
"enablePullDownRefresh"
:
false
,
"navigationBarBackgroundColor"
:
"#5DB66F"
,
"navigationBarTextStyle"
:
"white"
,
"backgroundColorBottom"
:
"#F2F2F2"
,
"app-plus"
:
{
"titleNView"
:
{
"titleSize"
:
"20"
,
"buttons"
:
[
{
"text"
:
"+ 添加资源"
,
"fontSrc"
:
"/static/uni.ttf"
,
"color"
:
"#fff"
,
"fontSize"
:
"28rpx"
,
"width"
:
"auto"
}
]
}
}
}
}
],
],
"easycom"
:
{
"easycom"
:
{
"autoscan"
:
true
,
"autoscan"
:
true
,
...
...
src/pages/device/device.vue
浏览文件 @
7ef27b6c
...
@@ -682,7 +682,7 @@ body {
...
@@ -682,7 +682,7 @@ body {
box-shadow
:
0
2
rpx
12
rpx
rgba
(
0
,
0
,
0
,
0.1
);
box-shadow
:
0
2
rpx
12
rpx
rgba
(
0
,
0
,
0
,
0.1
);
}
}
::v-deep
.uni-swipe
_box
{
::v-deep
.uni-swipe
{
border-radius
:
16
rpx
;
border-radius
:
16
rpx
;
margin-bottom
:
20
rpx
;
margin-bottom
:
20
rpx
;
}
}
...
...
src/pages/nongchang/nongchang.vue
浏览文件 @
7ef27b6c
...
@@ -365,7 +365,7 @@
...
@@ -365,7 +365,7 @@
<view
class=
"codefun-flex-col section"
>
<view
class=
"codefun-flex-col section"
>
<view
class=
"codefun-flex-col mt-52rpx"
>
<view
class=
"codefun-flex-col mt-52rpx"
>
<text
class=
"codefun-self-center font text"
>
{{
pageData
.
header
.
title
}}
</text>
<text
class=
"codefun-self-center font text"
>
{{
pageData
.
header
.
title
}}
</text>
<view
class=
"codefun-flex-col codefun-self-stretch mt-19"
>
<
!--
<
view
class=
"codefun-flex-col codefun-self-stretch mt-19"
>
<view
class=
"codefun-flex-row codefun-items-center section_2"
>
<view
class=
"codefun-flex-row codefun-items-center section_2"
>
<image
class=
"image_5"
src=
"/static/images/codefun/b8d30fcc0b08b881a41c8b3e35b7f8ac.png"
/>
<image
class=
"image_5"
src=
"/static/images/codefun/b8d30fcc0b08b881a41c8b3e35b7f8ac.png"
/>
<text
class=
"codefun-ml-8 font_2 text_2"
>
{{
pageData
.
header
.
searchPlaceholder
}}
</text>
<text
class=
"codefun-ml-8 font_2 text_2"
>
{{
pageData
.
header
.
searchPlaceholder
}}
</text>
...
@@ -381,7 +381,7 @@
...
@@ -381,7 +381,7 @@
<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>
</view>
</view>
-->
</view>
</view>
</view>
</view>
<view
class=
"codefun-flex-col codefun-relative group_6"
>
<view
class=
"codefun-flex-col codefun-relative group_6"
>
...
@@ -420,7 +420,7 @@
...
@@ -420,7 +420,7 @@
<view
class=
"codefun-flex-col group_10"
>
<view
class=
"codefun-flex-col group_10"
>
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center"
>
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center"
>
<text
class=
"font"
>
农业大模型
</text>
<text
class=
"font"
>
农业大模型
</text>
<
text
class=
"font_6 text_17"
>
全部
</text
>
<
!--
<text
class=
"font_6 text_17"
>
全部
</text>
--
>
</view>
</view>
<view
class=
"codefun-flex-col mt-17"
>
<view
class=
"codefun-flex-col mt-17"
>
<view
class=
"codefun-flex-col codefun-justify-start section_6"
>
<view
class=
"codefun-flex-col codefun-justify-start section_6"
>
...
...
src/pages/resource/components/save-dialog.vue
0 → 100644
浏览文件 @
7ef27b6c
差异被折叠。
点击展开。
src/pages/resource/resource.vue
0 → 100644
浏览文件 @
7ef27b6c
<
template
>
<view
class=
"codefun-flex-col page"
>
<z-paging
ref=
"paging"
v-model=
"pageData.list"
@
query=
"queryList"
>
<view
class=
"codefun-flex-col group_3"
>
<view
class=
"codefun-flex-row codefun-items-center section_2"
>
<image
class=
"image_6"
src=
"/static/images/codefun/6c5c5a3c082b8c60a307d3a7caee623c.png"
/>
<u-input
v-model=
"pageData.param.fileName"
placeholder=
"请输入文件名称搜索"
border=
"none"
class=
"codefun-ml-8"
@
confirm=
"handleSearch"
/>
</view>
<!-- 资源列表 - 根据图片样式修改 -->
<view
class=
"resource-list"
>
<view
v-for=
"(item, index) in pageData.list"
:key=
"index"
class=
"resource-item"
>
<view
class=
"resource-content"
>
<view
class=
"resource-main"
>
<view
class=
"resource-name"
>
{{
item
.
fileName
}}
</view>
<view
class=
"resource-meta"
>
<text
class=
"resource-size"
>
{{
formatFileSize
(
item
.
fileSize
)
}}
</text>
<text
class=
"separator"
>
|
</text>
<text
class=
"download-count"
>
已下载
{{
item
.
downloadCount
||
25
}}
次
</text>
<text
class=
"separator"
>
|
</text>
<text
class=
"upload-time"
>
{{
formatTime
(
item
.
createTime
)
}}
</text>
</view>
</view>
<view
class=
"codefun-flex-col codefun-justify-start codefun-items-center text-wrapper_4"
@
click
.
stop=
"handleDownload(item)"
>
<text
class=
"font_10"
>
下载
</text>
</view>
<!--
<view
class=
"download-section"
>
<view
class=
"download-btn"
@
click=
"handleDownload(item)"
>
<text
class=
"btn-text"
>
下载
</text>
</view>
</view>
-->
</view>
</view>
</view>
<!-- 空状态 -->
<view
class=
"empty-state"
v-if=
"pageData.list.length === 0"
>
<image
class=
"empty-icon"
src=
"/static/images/empty-file.png"
mode=
"aspectFit"
></image>
<text
class=
"empty-text"
>
暂无资源文件
</text>
</view>
</view>
</z-paging>
<!-- 弹窗组件 -->
<save-dialog
:show=
"showDialog"
:editData=
"currentEditData"
@
update:show=
"showDialog = $event"
@
submitSuccess=
"handleSubmitSuccess"
/>
</view>
</
template
>
<
script
setup
>
import
{
nextTick
,
reactive
,
ref
}
from
'vue'
import
{
onLoad
,
onNavigationBarButtonTap
,
onShow
}
from
'@dcloudio/uni-app'
// import * as ResourceAPI from '@/api/model/resource' // API留空
import
SaveDialog
from
'./components/save-dialog.vue'
const
isOnePage
=
ref
(
true
)
const
paging
=
ref
(
null
)
const
pageData
=
reactive
({
param
:
{
pageNo
:
1
,
pageSize
:
10
,
fileName
:
''
,
},
list
:
[],
})
function
getList
()
{
if
(
!
paging
.
value
)
return
// API留空,使用模拟数据 - 根据图片内容调整
setTimeout
(()
=>
{
const
mockData
=
[
{
id
:
1
,
fileName
:
'水稻种植合同模版'
,
fileType
:
'PDF'
,
fileSize
:
128000
,
// 125kb
downloadCount
:
25
,
createTime
:
'2025-11-02 14:00'
},
{
id
:
2
,
fileName
:
'农药使用指南'
,
fileType
:
'PDF'
,
fileSize
:
128000
,
downloadCount
:
25
,
createTime
:
'2025-11-02 14:00'
},
{
id
:
3
,
fileName
:
'农业补贴列表说明'
,
fileType
:
'PDF'
,
fileSize
:
128000
,
downloadCount
:
25
,
createTime
:
'2025-11-02 14:00'
},
{
id
:
4
,
fileName
:
'小麦种植合同模版'
,
fileType
:
'PDF'
,
fileSize
:
128000
,
downloadCount
:
25
,
createTime
:
'2025-11-02 14:00'
},
{
id
:
5
,
fileName
:
'化肥使用指南'
,
fileType
:
'PDF'
,
fileSize
:
128000
,
downloadCount
:
25
,
createTime
:
'2025-11-02 14:00'
},
{
id
:
6
,
fileName
:
'油茶种植补贴列表说明'
,
fileType
:
'PDF'
,
fileSize
:
128000
,
downloadCount
:
25
,
createTime
:
'2025-11-02 14:00'
}
]
pageData
.
total
=
mockData
.
length
paging
.
value
.
complete
(
mockData
)
},
500
)
}
function
queryList
(
pageNo
,
pageSize
)
{
pageData
.
param
.
pageNo
=
pageNo
pageData
.
param
.
pageSize
=
pageSize
getList
()
}
function
handleSearch
()
{
pageData
.
param
.
pageNo
=
1
if
(
paging
.
value
)
{
paging
.
value
.
reload
()
}
}
const
showDialog
=
ref
(
false
)
const
currentEditData
=
ref
(
null
)
onNavigationBarButtonTap
((
_
)
=>
{
showAddDialog
()
})
const
showAddDialog
=
()
=>
{
currentEditData
.
value
=
null
showDialog
.
value
=
true
}
// 格式化时间显示
const
formatTime
=
(
time
)
=>
{
if
(
!
time
)
return
''
// 如果是完整的时间字符串,可以格式化为图片中的样式
return
time
.
includes
(
' '
)
?
time
:
`
${
time
}
14:00`
}
// 下载资源
const
handleDownload
=
(
resource
)
=>
{
console
.
log
(
'下载资源:'
,
resource
)
uni
.
showToast
({
title
:
'开始下载'
,
icon
:
'success'
,
duration
:
2000
})
// 模拟下载逻辑
setTimeout
(()
=>
{
// 更新下载次数
const
index
=
pageData
.
list
.
findIndex
(
item
=>
item
.
id
===
resource
.
id
)
if
(
index
!==
-
1
)
{
pageData
.
list
[
index
].
downloadCount
=
(
pageData
.
list
[
index
].
downloadCount
||
0
)
+
1
}
},
1000
)
}
// 格式化文件大小
const
formatFileSize
=
(
bytes
)
=>
{
if
(
!
bytes
)
return
'125kb'
const
k
=
1024
const
sizes
=
[
'B'
,
'KB'
,
'MB'
,
'GB'
]
const
i
=
Math
.
floor
(
Math
.
log
(
bytes
)
/
Math
.
log
(
k
))
return
parseFloat
((
bytes
/
Math
.
pow
(
k
,
i
)).
toFixed
(
0
))
+
sizes
[
i
].
toLowerCase
()
}
const
handleSubmitSuccess
=
()
=>
{
handleSearch
()
}
</
script
>
<
style
lang=
"scss"
>
body
{
background-color
:
#f8f9fa
;
}
.page
{
background-color
:
#f8f9fa
;
width
:
100%
;
overflow-y
:
auto
;
overflow-x
:
hidden
;
height
:
100%
;
}
.group_3
{
padding
:
28
rpx
24
rpx
;
}
.section_2
{
padding
:
16
rpx
20
rpx
;
background-color
:
#ffffff
;
border-radius
:
1998
rpx
;
margin-bottom
:
30
rpx
;
box-shadow
:
0
2
rpx
12
rpx
rgba
(
0
,
0
,
0
,
0.06
);
}
.image_6
{
width
:
32
rpx
;
height
:
32
rpx
;
}
/* 资源列表样式 - 根据图片样式重写 */
.resource-list
{
margin-top
:
0
;
}
.resource-item
{
background-color
:
#ffffff
;
border-radius
:
16
rpx
;
margin-bottom
:
20
rpx
;
box-shadow
:
0
2
rpx
12
rpx
rgba
(
0
,
0
,
0
,
0.08
);
overflow
:
hidden
;
transition
:
all
0.3s
ease
;
&:active
{
transform
:
translateY
(
2
rpx
);
box-shadow
:
0
1
rpx
6
rpx
rgba
(
0
,
0
,
0
,
0.1
);
}
}
.resource-content
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
padding
:
30
rpx
24
rpx
;
}
.resource-main
{
flex
:
1
;
min-width
:
0
;
}
.resource-name
{
font-size
:
32
rpx
;
font-weight
:
500
;
color
:
#333333
;
line-height
:
1.4
;
margin-bottom
:
12
rpx
;
display
:
-webkit-box
;
-webkit-box-orient
:
vertical
;
-webkit-line-clamp
:
1
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
.resource-meta
{
display
:
flex
;
align-items
:
center
;
font-size
:
24
rpx
;
color
:
#999999
;
gap
:
12
rpx
;
flex-wrap
:
wrap
;
}
.separator
{
color
:
#dddddd
;
font-size
:
20
rpx
;
}
.resource-size
,
.download-count
,
.upload-time
{
color
:
#666666
;
}
.download-section
{
margin-left
:
30
rpx
;
flex-shrink
:
0
;
}
.download-btn
{
background-color
:
#5DB66F
;
border
:
none
;
border-radius
:
20
rpx
;
padding
:
12
rpx
30
rpx
;
min-width
:
120
rpx
;
transition
:
all
0.3s
ease
;
&::after
{
border
:
none
;
}
&
:active
{
background-color
:
#4ca85c
;
transform
:
scale
(
0.95
);
}
}
.text-wrapper_4
{
padding
:
16
rpx
0
;
background-color
:
#5db66f26
;
border-radius
:
400
rpx
;
mix-blend-mode
:
NOTTHROUGH
;
width
:
136
rpx
;
.font_10
{
font-size
:
24
rpx
;
line-height
:
24
rpx
;
color
:
#16a34a
;
}
}
.btn-text
{
color
:
#ffffff
;
font-size
:
28
rpx
;
font-weight
:
500
;
}
.empty-state
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
padding
:
120
rpx
0
;
color
:
#999999
;
}
.empty-icon
{
width
:
160
rpx
;
height
:
160
rpx
;
margin-bottom
:
30
rpx
;
opacity
:
0.6
;
}
.empty-text
{
font-size
:
28
rpx
;
color
:
#999999
;
}
/* 响应式调整 */
@media
(
max-width
:
375px
)
{
.resource-content
{
padding
:
24
rpx
20
rpx
;
}
.resource-name
{
font-size
:
30
rpx
;
}
.resource-meta
{
font-size
:
22
rpx
;
}
.download-btn
{
padding
:
10
rpx
24
rpx
;
min-width
:
100
rpx
;
}
.btn-text
{
font-size
:
26
rpx
;
}
}
</
style
>
src/pages/shouye/shouye.vue
浏览文件 @
7ef27b6c
差异被折叠。
点击展开。
src/pages/wode/wode.vue
浏览文件 @
7ef27b6c
...
@@ -59,7 +59,7 @@ const pageData = reactive({
...
@@ -59,7 +59,7 @@ const pageData = reactive({
status
:
'离线可用'
,
status
:
'离线可用'
,
statusClass
:
'text_14'
,
statusClass
:
'text_14'
,
arrowIcon
:
'/static/images/codefun/f29a8c39eb37da965d0a764a567a1c77.png'
,
arrowIcon
:
'/static/images/codefun/f29a8c39eb37da965d0a764a567a1c77.png'
,
url
:
''
url
:
'
/pages/resource/resource
'
},
},
{
{
id
:
2
,
id
:
2
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论