Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
basic-uniapp-v3
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-uniapp-v3
Commits
fb92718d
提交
fb92718d
authored
11月 06, 2025
作者:
宇宙超人
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
设备模块
上级
a5aa2470
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
1436 行增加
和
226 行删除
+1436
-226
nongchang.ts
src/api/model/nongchang.ts
+45
-1
manifest.json
src/manifest.json
+1
-1
pages.json
src/pages.json
+26
-1
save-dialog.vue
src/pages/device/components/save-dialog.vue
+355
-0
device.vue
src/pages/device/device.vue
+761
-0
jidiguanli.vue
src/pages/jidiguanli/jidiguanli.vue
+60
-87
wode.vue
src/pages/wode/wode.vue
+188
-136
没有找到文件。
src/api/model/nongchang.ts
浏览文件 @
fb92718d
...
...
@@ -10,6 +10,50 @@ enum Api {
getFarmBaseList
=
'/farmbase/getFarmBaseList'
,
}
/**
* 删除设备
* @param id
* @returns
*/
export
function
delDevice
(
id
)
{
return
otherHttp
.
post
({
url
:
'/device/delete?id='
+
id
,
})
}
/**
* 编辑设备
* @param params
* @returns
*/
export
function
editDevice
(
params
=
{})
{
return
otherHttp
.
post
({
url
:
'/device/edit'
,
params
,
})
}
/**
* 添加设备
* @param params
* @returns
*/
export
function
addDevice
(
params
=
{})
{
return
otherHttp
.
post
({
url
:
'/device/add'
,
params
,
})
}
/**
* 设备列表
* @param params
* @returns
*/
export
function
getDeviceList
(
params
:
any
=
{})
{
return
otherHttp
.
get
({
url
:
'/device/list'
,
params
,
})
}
/**
* 农场基地管理-通过id查询
* @param params
* @returns
...
...
@@ -27,7 +71,7 @@ export function getFarmbaseInfoById(params: any = {}) {
*/
export
function
delFarmbase
(
id
)
{
return
otherHttp
.
delete
({
url
:
'/farmbase/delete?id='
+
id
,
url
:
'/farmbase/delete?id='
+
id
,
})
}
/**
...
...
src/manifest.json
浏览文件 @
fb92718d
{
"name"
:
"数字农服"
,
"appid"
:
"__UNI__
FD09823
"
,
"appid"
:
"__UNI__
A9A0BAC
"
,
"description"
:
"数字农服 APP"
,
"versionName"
:
"1.0.9"
,
"versionCode"
:
10009
,
...
...
src/pages.json
浏览文件 @
fb92718d
...
...
@@ -276,7 +276,8 @@
"text"
:
"+ 添加基地"
,
"fontSrc"
:
"/static/uni.ttf"
,
"color"
:
"#fff"
,
"fontSize"
:
"28rpx"
"fontSize"
:
"28rpx"
,
"width"
:
"auto"
}
]
}
...
...
@@ -364,6 +365,30 @@
"style"
:
{
"navigationBarTitleText"
:
"添加基地"
}
},
{
"path"
:
"pages/device/device"
,
"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"
:
{
...
...
src/pages/device/components/save-dialog.vue
0 → 100644
浏览文件 @
fb92718d
<
template
>
<u-modal
:show=
"show"
:title=
"dialogTitle"
:showConfirmButton=
"false"
:showCancelButton=
"false"
@
close=
"handleClose"
:closeOnClickOverlay=
"false"
>
<view
class=
"dialog-content"
>
<u-form
:model=
"formData"
:rules=
"rules"
ref=
"formRef"
label-width=
"180rpx"
>
<!-- 设备基本信息 -->
<view
class=
"section-title"
>
设备基本信息
</view>
<u-form-item
label=
"设备名称"
prop=
"deviceName"
required
>
<u-input
v-model=
"formData.deviceName"
placeholder=
"请输入设备名称"
border=
"bottom"
/>
</u-form-item>
<u-form-item
label=
"设备类型"
prop=
"deviceType"
required
>
<u-input
v-model=
"formData.deviceTypeText"
placeholder=
"请选择设备类型"
border=
"bottom"
@
click=
"showDeviceTypePicker = true"
/>
</u-form-item>
<u-form-item
label=
"设备标识"
prop=
"deviceIdentifier"
required
>
<u-input
v-model=
"formData.deviceIdentifier"
placeholder=
"序列号/MAC地址等"
border=
"bottom"
/>
</u-form-item>
<!-- 操作按钮 -->
<view
class=
"dialog-buttons"
>
<u-button
type=
"primary"
@
click=
"handleSubmit"
:loading=
"loading"
size=
"normal"
class=
"submit-btn"
color=
"var(--fui-color-success)"
>
{{
submitButtonText
}}
</u-button>
<u-button
@
click=
"handleClose"
size=
"normal"
class=
"cancel-btn"
>
取消
</u-button>
</view>
</u-form>
<!-- 设备类型选择器 -->
<fui-picker
:show=
"showDeviceTypePicker"
:options=
"deviceTypeOptions"
:layer=
"1"
:linkage=
"true"
@
change=
"handleDeviceTypeConfirm"
@
cancel=
"showDeviceTypePicker = false"
></fui-picker>
</view>
</u-modal>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
ref
,
reactive
,
watch
,
computed
}
from
'vue'
import
{
useDictStore
}
from
'@/store/modules/dict'
import
*
as
NongchangAPI
from
'@/api/model/nongchang'
// 定义Props
interface
Props
{
show
:
boolean
editData
?:
any
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
show
:
false
,
editData
:
null
})
// 定义Emits
const
emit
=
defineEmits
<
{
'update:show'
:
[
value
:
boolean
]
'submit'
:
[
data
:
any
]
'close'
:
[]
}
>
()
// 表单引用
const
formRef
=
ref
()
const
loading
=
ref
(
false
)
const
showDeviceTypePicker
=
ref
(
false
)
// 字典存储
const
dictStore
=
useDictStore
()
// 表单数据
const
formData
=
reactive
({
deviceName
:
''
,
deviceType
:
''
,
deviceTypeText
:
''
,
deviceIdentifier
:
''
})
// 设备类型选项 - 使用字典数据
const
deviceTypeOptions
=
computed
(()
=>
{
return
dictStore
.
getDictList
[
'deviceType'
]?.
map
((
item
:
any
)
=>
({
value
:
item
.
value
,
text
:
item
.
text
}))
||
[]
})
// 设备类型选择器数据 (不再需要,因为fui-picker使用options属性)
// 计算属性
const
dialogTitle
=
computed
(()
=>
{
return
props
.
editData
?
'编辑设备'
:
'添加设备'
})
const
submitButtonText
=
computed
(()
=>
{
return
props
.
editData
?
'保存'
:
'确认'
})
// 表单验证规则
const
rules
=
{
deviceName
:
[
{
required
:
true
,
message
:
'请输入设备名称'
,
trigger
:
'blur'
},
{
min
:
2
,
max
:
50
,
message
:
'设备名称长度在2-50个字符之间'
,
trigger
:
'blur'
}
],
deviceType
:
[
{
required
:
true
,
message
:
'请选择设备类型'
,
type
:
'number'
,
trigger
:
'change'
}
],
deviceIdentifier
:
[
{
required
:
true
,
message
:
'请输入设备唯一标识'
,
trigger
:
'blur'
},
{
min
:
6
,
max
:
100
,
message
:
'设备标识长度在6-100个字符之间'
,
trigger
:
'blur'
},
{
validator
:
(
rule
:
any
,
value
:
any
,
callback
:
any
)
=>
{
if
(
!
/^
[
a-zA-Z0-9
\-
_:
]
+$/
.
test
(
value
))
{
callback
(
new
Error
(
'设备标识只能包含字母、数字、下划线、中划线和冒号'
))
}
else
{
callback
()
}
},
trigger
:
'blur'
}
]
}
// 监听显示状态
watch
(()
=>
props
.
show
,
(
newVal
)
=>
{
if
(
newVal
&&
props
.
editData
)
{
// 编辑模式,填充数据
resetFormData
()
loadEditData
()
}
else
if
(
newVal
)
{
// 添加模式,重置表单
resetFormData
()
}
})
// 重置表单数据
const
resetFormData
=
()
=>
{
formData
.
deviceName
=
''
formData
.
deviceType
=
''
formData
.
deviceTypeText
=
''
formData
.
deviceIdentifier
=
''
// 清除验证状态
if
(
formRef
.
value
)
{
formRef
.
value
.
resetFields
()
}
}
// 加载编辑数据
const
loadEditData
=
()
=>
{
if
(
!
props
.
editData
)
return
formData
.
deviceName
=
props
.
editData
.
deviceName
||
''
formData
.
deviceType
=
props
.
editData
.
deviceType
||
''
formData
.
deviceIdentifier
=
props
.
editData
.
deviceIdentifier
||
''
// 设置设备类型文本
if
(
props
.
editData
.
deviceType
)
{
const
typeOption
=
deviceTypeOptions
.
value
.
find
(
item
=>
item
.
value
===
props
.
editData
.
deviceType
)
if
(
typeOption
)
{
formData
.
deviceTypeText
=
typeOption
.
text
}
else
{
// 如果字典中没有找到对应的文本,使用原始数据中的文本
formData
.
deviceTypeText
=
props
.
editData
.
deviceType_dictText
||
''
}
}
else
{
formData
.
deviceTypeText
=
''
}
}
// 设备类型选择确认
const
handleDeviceTypeConfirm
=
(
e
:
any
)
=>
{
formData
.
deviceType
=
e
.
value
formData
.
deviceTypeText
=
e
.
text
showDeviceTypePicker
.
value
=
false
}
// 提交表单
const
handleSubmit
=
async
()
=>
{
try
{
console
.
log
(
formData
)
// 先进行表单验证
const
valid
=
await
formRef
.
value
.
validate
()
if
(
!
valid
)
{
return
}
loading
.
value
=
true
// 准备提交数据
const
submitData
=
{
...
formData
}
// 根据 editData 判断是新增还是修改
let
result
if
(
props
.
editData
&&
props
.
editData
.
id
)
{
// 编辑设备,需要传递设备ID
result
=
await
NongchangAPI
.
editDevice
({
...
submitData
,
id
:
props
.
editData
.
id
})
console
.
log
(
'修改设备数据:'
,
submitData
)
}
else
{
// 新增设备
result
=
await
NongchangAPI
.
addDevice
(
submitData
)
console
.
log
(
'新增设备数据:'
,
submitData
)
}
uni
.
showToast
({
title
:
'操作成功'
,
icon
:
'success'
})
emit
(
'update:show'
,
false
)
emit
(
'submitSuccess'
)
}
catch
(
error
)
{
console
.
log
(
'提交失败:'
,
error
)
uni
.
showToast
({
title
:
'操作失败'
,
icon
:
'none'
,
duration
:
2000
})
}
finally
{
loading
.
value
=
false
}
}
// 关闭弹窗
const
handleClose
=
()
=>
{
emit
(
'update:show'
,
false
)
emit
(
'close'
)
}
// 暴露方法给父组件
defineExpose
({
resetFormData
,
setLoading
:
(
value
:
boolean
)
=>
{
loading
.
value
=
value
}
})
</
script
>
<
style
lang=
"scss"
scoped
>
.dialog-content
{
padding
:
10
rpx
30
rpx
;
width
:
90%
;
max-height
:
80vh
;
overflow-y
:
auto
;
}
.section-title
{
font-size
:
32
rpx
;
font-weight
:
600
;
color
:
#333
;
margin
:
20
rpx
0
30
rpx
0
;
padding-left
:
20
rpx
;
border-left
:
6
rpx
solid
#5DB66F
;
}
.dialog-buttons
{
display
:
flex
;
gap
:
20
rpx
;
margin-top
:
40
rpx
;
.submit-btn
{
flex
:
1
;
::v-deep
.u-button
{
background-color
:
#5DB66F
;
border-color
:
#5DB66F
;
}
}
.cancel-btn
{
flex
:
1
;
::v-deep
.u-button
{
background-color
:
#fff
;
color
:
#666
;
border
:
2
rpx
solid
#dcdfe6
;
}
}
}
//
uview-plus
表单样式调整
::v-deep
.u-form-item
{
margin-bottom
:
40
rpx
;
.u-form-item__body
{
padding
:
0
;
align-items
:
flex-start
;
}
.u-form-item__body__left__content__label
{
font-size
:
28
rpx
;
color
:
#333
;
font-weight
:
500
;
width
:
180
rpx
;
flex-shrink
:
0
;
text-align
:
right
;
padding-right
:
20
rpx
;
line-height
:
80
rpx
;
}
.u-form-item__body__right
{
flex
:
1
;
min-width
:
0
;
}
}
::v-deep
.u-form-item__body__left__content__required
{
position
:
static
;
padding-right
:
10
rpx
;
}
//
输入框样式优化
::v-deep
.u-input
{
.u-input__content
{
padding
:
0
;
.u-input__content__field-wrapper
{
border
:
none
;
border-radius
:
0
;
.u-input__content__field-wrapper__field
{
font-size
:
28
rpx
;
height
:
auto
;
}
.u-input__content__field-wrapper__placeholder
{
color
:
#c0c4cc
;
font-size
:
28
rpx
;
}
}
&
.u-input--focus
{
.u-input__content__field-wrapper
{
border-bottom-color
:
#5DB66F
;
}
}
}
}
//
模态框样式调整
::v-deep
.u-modal
{
.u-modal__content
{
border-radius
:
20
rpx
;
padding
:
20
rpx
0
rpx
;
}
.u-modal__header
{
border-bottom
:
2
rpx
solid
#f0f0f0
;
padding
:
30
rpx
;
.u-modal__header__title
{
font-size
:
32
rpx
;
font-weight
:
600
;
color
:
#333
;
}
}
}
</
style
>
src/pages/device/device.vue
0 → 100644
浏览文件 @
fb92718d
<
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.deviceName"
placeholder=
"请输入设备名称搜索"
border=
"none"
class=
"codefun-ml-8"
@
confirm=
"handleSearch"
/>
</view>
<!-- 设备列表 -->
<view
class=
"device-list"
>
<uni-swipe-action>
<uni-swipe-action-item
v-for=
"(item, index) in pageData.list"
:key=
"index"
:right-options=
"swipeOptions"
@
click=
"(e) => handleSwipeAction(e, item)"
>
<view
class=
"device-item"
>
<view
class=
"device-info"
>
<view
class=
"device-name"
>
{{
item
.
deviceName
}}
</view>
<view
class=
"device-details"
>
<text
class=
"device-type"
>
类型:
{{
item
.
deviceType_dictText
||
'未知'
}}
</text>
<text
class=
"device-identifier"
>
标识:
{{
item
.
deviceIdentifier
}}
</text>
</view>
</view>
<view
class=
"device-status-time"
>
<text
class=
"device-status"
:class=
"getStatusClass(item.connectStatus)"
>
{{
item
.
connectStatus_dictText
||
'未知'
}}
</text>
<view
style=
"opacity: 0;"
>
1
</view>
<view
class=
"device-time"
>
添加日期:
{{
item
.
createTime
}}
</view>
</view>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
<!-- 空状态 -->
<view
class=
"empty-state"
v-if=
"pageData.list.length === 0"
>
<text>
暂无设备数据
</text>
</view>
</view>
</z-paging>
<!-- 弹窗组件 -->
<save-dialog
:show=
"showDialog"
:editData=
"currentEditData"
@
update:show=
"showDialog = $event"
@
submitSuccess=
"handleSubmitSuccess"
@
close=
"handleDialogClose"
/>
</view>
</
template
>
<
script
setup
>
import
{
nextTick
,
reactive
,
ref
}
from
'vue'
import
{
onLoad
,
onNavigationBarButtonTap
,
onShow
}
from
'@dcloudio/uni-app'
import
*
as
NongchangAPI
from
'@/api/model/nongchang'
import
SaveDialog
from
'./components/save-dialog.vue'
const
isOnePage
=
ref
(
true
)
const
paging
=
ref
(
null
)
const
pageData
=
reactive
({
param
:
{
pageNo
:
1
,
pageSize
:
10
,
deviceName
:
''
,
},
list
:
[],
})
// 滑动操作选项
const
swipeOptions
=
[
{
text
:
'编辑'
,
style
:
{
backgroundColor
:
'var(--fui-color-primary)'
}
},
{
text
:
'删除'
,
style
:
{
backgroundColor
:
'var(--fui-color-danger)'
}
}
]
function
getList
()
{
if
(
!
paging
.
value
)
return
NongchangAPI
.
getDeviceList
(
pageData
.
param
)
.
then
((
res
)
=>
{
pageData
.
total
=
res
.
total
paging
.
value
.
complete
(
res
.
records
)
})
.
catch
(()
=>
{
paging
.
value
.
complete
(
false
)
})
}
function
queryList
(
pageNo
,
pageSize
)
{
pageData
.
param
.
pageNo
=
pageNo
pageData
.
param
.
pageSize
=
pageSize
getList
()
}
function
handleSearch
()
{
// 重置页码为1,重新搜索
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
showEditDialog
=
(
device
)
=>
{
currentEditData
.
value
=
device
showDialog
.
value
=
true
}
const
handleSubmitSuccess
=
()
=>
{
// 提交成功后刷新列表
handleSearch
()
}
const
handleDialogClose
=
()
=>
{
// 弹窗关闭后的处理逻辑
}
// 删除设备
const
handleDelete
=
async
(
id
)
=>
{
try
{
await
uni
.
showModal
({
title
:
'确认删除'
,
content
:
'确定要删除这个设备吗?'
,
success
:
async
(
res
)
=>
{
if
(
res
.
confirm
)
{
await
NongchangAPI
.
delDevice
(
id
)
uni
.
showToast
({
title
:
'删除成功'
,
icon
:
'success'
})
handleSearch
()
}
}
})
}
catch
(
error
)
{
uni
.
showToast
({
title
:
'删除失败'
,
icon
:
'none'
})
}
}
// 获取状态样式类
const
getStatusClass
=
(
status
)
=>
{
if
(
status
===
'已连接'
)
return
'status-connected'
if
(
status
===
'未连接'
)
return
'status-disconnected'
return
'status-unknown'
}
// 处理滑动打开事件
const
handleSwipeOpen
=
(
index
)
=>
{
// 关闭其他已打开的滑动单元格,确保同时只有一个处于打开状态
pageData
.
list
.
forEach
((
item
,
i
)
=>
{
item
.
isShow
=
i
===
index
})
}
// 处理滑动操作
const
handleSwipeAction
=
(
e
,
device
)
=>
{
const
index
=
e
.
index
const
position
=
e
.
position
if
(
position
===
'right'
)
{
if
(
index
===
0
)
{
// 编辑操作
showEditDialog
(
device
)
}
else
if
(
index
===
1
)
{
// 删除操作
handleDelete
(
device
.
id
)
}
}
}
</
script
>
<
style
lang=
"scss"
>
body
{
background-color
:
#e6f5e8
;
}
.mt-5
{
margin-top
:
10
rpx
;
}
.mt-11
{
margin-top
:
22
rpx
;
}
.ml-5
{
margin-left
:
10
rpx
;
}
.ml-13
{
margin-left
:
26
rpx
;
}
.ml-9
{
margin-left
:
18
rpx
;
}
.page
{
background-color
:
#e6f5e8
;
mix-blend-mode
:
NOTTHROUGH
;
width
:
100%
;
overflow-y
:
auto
;
overflow-x
:
hidden
;
height
:
100%
;
.section
{
padding
:
32
rpx
24
rpx
32
rpx
36
rpx
;
background-color
:
#5db66f
;
mix-blend-mode
:
NOTTHROUGH
;
.image
{
border-radius
:
64
rpx
;
width
:
108
rpx
;
height
:
42
rpx
;
}
.group
{
margin-right
:
4
rpx
;
.image_2
{
mix-blend-mode
:
NOTTHROUGH
;
width
:
34
rpx
;
height
:
22
rpx
;
}
.image_3
{
mix-blend-mode
:
NOTTHROUGH
;
width
:
30
rpx
;
height
:
22
rpx
;
}
.image_4
{
width
:
48
rpx
;
height
:
22
rpx
;
}
}
.group_2
{
padding-left
:
6
rpx
;
.image_5
{
mix-blend-mode
:
NOTTHROUGH
;
width
:
14
rpx
;
height
:
26
rpx
;
}
.pos
{
position
:
absolute
;
left
:
6
rpx
;
top
:
50%
;
transform
:
translateY
(
-50%
);
}
.text
{
color
:
#ffffff
e6
;
line-height
:
29.6
rpx
;
}
.pos_2
{
position
:
absolute
;
right
:
0
;
top
:
50%
;
transform
:
translateY
(
-50%
);
.text_2
{
line-height
:
25.78
rpx
;
}
}
}
}
.group_3
{
padding
:
28
rpx
24
rpx
58
rpx
;
.section_2
{
padding
:
16
rpx
20
rpx
;
background-color
:
#ffffff
;
border-radius
:
1998
rpx
;
mix-blend-mode
:
NOTTHROUGH
;
.text_3
{
color
:
#cccccc
;
line-height
:
26.02
rpx
;
}
}
.section_3
{
padding
:
0
24
rpx
;
background-color
:
#ffffff
;
border-radius
:
18.46
rpx
;
mix-blend-mode
:
NOTTHROUGH
;
.group_4
{
padding
:
42
rpx
4
rpx
30
rpx
22
rpx
;
border-bottom
:
solid
2
rpx
#eeeeee
;
.image_7
{
width
:
100
rpx
;
height
:
86
rpx
;
}
.group_7
{
margin-left
:
32
rpx
;
.text_5
{
color
:
#5db66f
;
font-size
:
40
rpx
;
font-family
:
SourceHanSansCN
;
line-height
:
40
rpx
;
}
.text_7
{
line-height
:
22.18
rpx
;
}
}
.text_4
{
color
:
#333333
;
line-height
:
40
rpx
;
}
.group_5
{
width
:
219.94
rpx
;
.group_6
{
overflow
:
hidden
;
.text-wrapper_2
{
padding
:
8
rpx
0
4
rpx
;
overflow
:
hidden
;
width
:
60
rpx
;
height
:
40
rpx
;
}
}
.group_8
{
padding-top
:
16
rpx
;
.text-wrapper_3
{
padding
:
8
rpx
0
4
rpx
;
overflow
:
hidden
;
width
:
60
rpx
;
height
:
40
rpx
;
.text_8
{
color
:
#ff9800
;
}
}
}
.text-wrapper
{
padding
:
8
rpx
0
4
rpx
;
overflow
:
hidden
;
width
:
112
rpx
;
height
:
40
rpx
;
.text_6
{
line-height
:
25.74
rpx
;
}
}
}
}
.group_9
{
padding
:
12
rpx
4
rpx
;
.image_8
{
margin
:
4
rpx
0
;
width
:
40
rpx
;
height
:
40
rpx
;
}
.text-wrapper_4
{
padding
:
12
rpx
0
;
overflow
:
hidden
;
width
:
168
rpx
;
height
:
48
rpx
;
}
.image_9
{
margin-right
:
12
rpx
;
width
:
16
rpx
;
height
:
26
rpx
;
}
}
.font_5
{
font-size
:
28
rpx
;
font-family
:
SourceHanSansCN
;
line-height
:
25.76
rpx
;
color
:
#5db66f
;
}
}
.font_3
{
font-size
:
28
rpx
;
font-family
:
SourceHanSansCN
;
line-height
:
25.76
rpx
;
color
:
#1f2937
;
}
.section_4
{
padding-left
:
6
rpx
;
padding-bottom
:
26
rpx
;
background-color
:
#ffffff
;
border-radius
:
26.28
rpx
;
mix-blend-mode
:
NOTTHROUGH
;
.list
{
margin-left
:
18
rpx
;
margin-right
:
24
rpx
;
.list-item
{
padding
:
24
rpx
0
;
border-bottom
:
solid
2
rpx
#eeeeee
;
.section_5
{
padding
:
12
rpx
0
116
rpx
;
background-image
:
url('/static/images/codefun/4be80e2618f3c4b4aa1ce64fd9063abf.png')
;
background-size
:
100%
100%
;
background-repeat
:
no-repeat
;
width
:
160
rpx
;
height
:
160
rpx
;
.text-wrapper_5
{
padding
:
8
rpx
0
;
background-image
:
linear-gradient
(
90deg
,
#43cf7c
0%
,
#5db66f
100%
);
border-radius
:
0
rpx
8
rpx
8
rpx
0
rpx
;
mix-blend-mode
:
NOTTHROUGH
;
width
:
84
rpx
;
.font_6
{
font-size
:
20
rpx
;
font-family
:
SourceHanSansCN
;
line-height
:
18.38
rpx
;
color
:
#ffffff
;
}
}
}
.group_10
{
margin-right
:
40
rpx
;
.text_9
{
line-height
:
22.34
rpx
;
}
.text_10
{
line-height
:
22.22
rpx
;
}
.group_11
{
padding-left
:
64
rpx
;
.image_10
{
width
:
28
rpx
;
height
:
28
rpx
;
}
.text-wrapper_6
{
padding-top
:
8
rpx
;
overflow
:
hidden
;
width
:
48
rpx
;
height
:
32
rpx
;
.text_11
{
line-height
:
22.12
rpx
;
}
}
.font_8
{
font-size
:
24
rpx
;
font-family
:
SourceHanSansCN
;
line-height
:
22.28
rpx
;
color
:
#f44336
;
}
}
}
}
}
.group_14
{
margin
:
18
rpx
24
rpx
0
;
.text_14
{
line-height
:
26.12
rpx
;
}
.text-wrapper_8
{
padding
:
4
rpx
0
;
overflow
:
hidden
;
width
:
48
rpx
;
height
:
32
rpx
;
.text_15
{
line-height
:
22.2
rpx
;
}
}
}
.font_7
{
font-size
:
24
rpx
;
font-family
:
SourceHanSansCN
;
line-height
:
22.28
rpx
;
color
:
#5db66f
;
}
.group_15
{
margin-left
:
24
rpx
;
margin-top
:
28
rpx
;
width
:
528.18
rpx
;
.text_16
{
line-height
:
25.12
rpx
;
}
.text_17
{
line-height
:
26.26
rpx
;
}
}
.group_16
{
margin-left
:
24
rpx
;
margin-top
:
28
rpx
;
width
:
216.94
rpx
;
.text_18
{
line-height
:
25.82
rpx
;
}
.text_19
{
line-height
:
25.34
rpx
;
}
}
.font_9
{
font-size
:
28
rpx
;
font-family
:
SourceHanSansCN
;
line-height
:
25.76
rpx
;
color
:
#6b7280
;
}
.group_17
{
margin-left
:
24
rpx
;
margin-top
:
28
rpx
;
.text_20
{
line-height
:
26.16
rpx
;
}
.text_21
{
line-height
:
22.66
rpx
;
}
}
.divider
{
margin
:
28
rpx
18
rpx
0
24
rpx
;
background-color
:
#f3f4f6
;
height
:
2
rpx
;
}
.text_22
{
margin-left
:
24
rpx
;
margin-top
:
32
rpx
;
line-height
:
26.12
rpx
;
}
.group_18
{
margin-left
:
24
rpx
;
margin-top
:
32
rpx
;
.text_23
{
line-height
:
26.06
rpx
;
}
.text_24
{
line-height
:
22.66
rpx
;
}
}
.font_10
{
font-size
:
28
rpx
;
font-family
:
SourceHanSansCN
;
line-height
:
22.28
rpx
;
color
:
#1f2937
;
}
.group_19
{
margin-left
:
24
rpx
;
margin-top
:
28
rpx
;
.text_25
{
line-height
:
25.9
rpx
;
}
.text_26
{
line-height
:
25.78
rpx
;
}
}
.group_20
{
margin-left
:
24
rpx
;
margin-top
:
32
rpx
;
.text_27
{
line-height
:
25.96
rpx
;
}
.text_28
{
line-height
:
25.88
rpx
;
}
}
.divider_2
{
margin-top
:
28
rpx
;
background-color
:
#f3f4f6
;
width
:
716
rpx
;
height
:
2
rpx
;
}
.text-wrapper_9
{
margin-left
:
24
rpx
;
margin-top
:
32
rpx
;
padding
:
24
rpx
0
;
background-color
:
#5db66f
;
border-radius
:
400
rpx
;
mix-blend-mode
:
NOTTHROUGH
;
.text_29
{
line-height
:
25.9
rpx
;
}
}
}
.font_4
{
font-size
:
24
rpx
;
font-family
:
SourceHanSansCN
;
line-height
:
22.28
rpx
;
color
:
#555555
;
}
}
.image_6
{
width
:
32
rpx
;
height
:
32
rpx
;
}
.font
{
font-size
:
32
rpx
;
font-family
:
SourceHanSansCN
;
line-height
:
29.88
rpx
;
color
:
#333333
;
}
.font_2
{
font-size
:
28
rpx
;
font-family
:
SourceHanSansCN
;
line-height
:
25.76
rpx
;
color
:
#ffffff
;
}
}
/* 设备列表样式 */
.device-list
{
margin-top
:
20
rpx
;
}
.device-item
{
background-color
:
#ffffff
;
border-radius
:
16
rpx
;
padding
:
24
rpx
;
display
:
flex
;
//
justify-content
:
space-between
;
align-items
:
center
;
box-shadow
:
0
2
rpx
12
rpx
rgba
(
0
,
0
,
0
,
0.1
);
}
::v-deep
.uni-swipe_box
{
border-radius
:
16
rpx
;
margin-bottom
:
20
rpx
;
}
.device-info
{
flex
:
1
;
}
.device-name
{
font-size
:
32
rpx
;
font-weight
:
bold
;
color
:
#333333
;
margin-bottom
:
8
rpx
;
border-left
:
6
rpx
solid
#5DB66F
;
padding-left
:
6
rpx
;
}
.device-details
{
display
:
flex
;
flex-direction
:
column
;
gap
:
6
rpx
;
margin-bottom
:
8
rpx
;
}
.device-type
,
.device-identifier
{
font-size
:
24
rpx
;
color
:
#666666
;
}
.device-status-time
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
flex-end
;
gap
:
6
rpx
;
min-width
:
180
rpx
;
}
.device-status
{
font-size
:
24
rpx
;
font-weight
:
bold
;
}
.device-time
{
font-size
:
22
rpx
;
color
:
#999999
;
}
.device-actions
{
display
:
flex
;
flex-direction
:
column
;
gap
:
12
rpx
;
}
.status-connected
{
color
:
#5db66f
!important
;
font-weight
:
bold
;
}
.status-disconnected
{
color
:
#f44336
!important
;
font-weight
:
bold
;
}
.status-unknown
{
color
:
#ff9800
!important
;
font-weight
:
bold
;
}
.empty-state
{
text-align
:
center
;
padding
:
100
rpx
0
;
color
:
#999999
;
font-size
:
28
rpx
;
}
</
style
>
src/pages/jidiguanli/jidiguanli.vue
浏览文件 @
fb92718d
<
script
setup
lang=
"ts"
>
import
{
nextTick
,
reactive
,
ref
}
from
'vue'
import
{
onLoad
,
onNavigationBarButtonTap
,
onShow
}
from
'@dcloudio/uni-app'
import
*
as
NongchangAPI
from
'@/api/model/nongchang'
import
{
nextTick
,
reactive
,
ref
}
from
'vue'
import
{
onLoad
,
onNavigationBarButtonTap
,
onShow
}
from
'@dcloudio/uni-app'
import
*
as
NongchangAPI
from
'@/api/model/nongchang'
const
isOnePage
=
ref
(
true
)
const
paging
=
ref
(
null
)
const
pageData
=
reactive
({
const
isOnePage
=
ref
(
true
)
const
paging
=
ref
(
null
)
const
pageData
=
reactive
({
param
:
{
pageNo
:
1
,
pageSize
:
10
,
...
...
@@ -15,12 +15,12 @@
total
:
0
,
// 基地总数
type_success_total
:
0
,
// 已认证
type_unverified_total
:
0
,
// 未认证
})
onNavigationBarButtonTap
((
e
)
=>
{
})
onNavigationBarButtonTap
((
e
)
=>
{
console
.
log
(
'onNavigationBarButtonTap'
,
e
)
})
onLoad
(()
=>
{
})
onShow
(()
=>
{
})
onLoad
(()
=>
{
})
onShow
(()
=>
{
nextTick
(()
=>
{
if
(
!
isOnePage
.
value
&&
paging
.
value
)
{
paging
.
value
.
reload
()
...
...
@@ -28,7 +28,7 @@
isOnePage
.
value
=
false
})
})
})
function
getList
()
{
if
(
!
paging
.
value
)
return
NongchangAPI
.
getFarmbaseList
(
pageData
.
param
)
...
...
@@ -40,30 +40,30 @@ function getList() {
paging
.
value
.
complete
(
false
)
})
}
onNavigationBarButtonTap
((
_
)
=>
{
onNavigationBarButtonTap
((
_
)
=>
{
uni
.
navigateTo
({
url
:
'./add'
,
})
})
function
queryList
(
pageNo
,
pageSize
)
{
})
function
queryList
(
pageNo
,
pageSize
)
{
pageData
.
param
.
pageNo
=
pageNo
pageData
.
param
.
pageSize
=
pageSize
getList
()
}
}
function
handleSearch
()
{
function
handleSearch
()
{
// 重置页码为1,重新搜索
pageData
.
param
.
pageNo
=
1
if
(
paging
.
value
)
{
paging
.
value
.
reload
()
}
}
const
goDetail
=
(
id
)
=>
{
}
const
goDetail
=
(
id
)
=>
{
uni
.
navigateTo
({
url
:
'./add?id='
+
id
,
url
:
'./add?id='
+
id
,
})
}
function
del
(
id
)
{
}
function
del
(
id
)
{
uni
.
showModal
({
title
:
'提示'
,
content
:
'确定删除吗?'
,
...
...
@@ -81,7 +81,7 @@ function getList() {
}
},
})
}
}
</
script
>
<
template
>
...
...
@@ -90,24 +90,16 @@ function getList() {
<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.baseName"
placeholder=
"请输入搜索内容"
border=
"none"
class=
"codefun-ml-8"
@
confirm=
"handleSearch"
/>
<u-input
v-model=
"pageData.param.baseName"
placeholder=
"请输入搜索内容"
border=
"none"
class=
"codefun-ml-8"
@
confirm=
"handleSearch"
/>
</view>
<view
class=
"codefun-mt-12 codefun-flex-col section_3"
>
<view
class=
"codefun-flex-row codefun-justify-between group_4"
>
<view
class=
"codefun-flex-row codefun-self-start"
>
<image
class=
"codefun-shrink-0 image_7"
src=
"/static/images/codefun/db26a8ae3f4d5f1e0a3f11d8fb5bc491.png"
/>
<image
class=
"codefun-shrink-0 image_7"
src=
"/static/images/codefun/db26a8ae3f4d5f1e0a3f11d8fb5bc491.png"
/>
<view
class=
"codefun-flex-col codefun-items-start codefun-shrink-0 codefun-self-center group_7"
>
class=
"codefun-flex-col codefun-items-start codefun-shrink-0 codefun-self-center group_7"
>
<text
class=
"text_5"
>
{{
pageData
.
total
}}
</text>
<text
class=
"font_4 text_7 mt-5"
>
总基地数
</text>
</view>
...
...
@@ -115,34 +107,26 @@ function getList() {
</view>
<view
class=
"codefun-flex-col codefun-self-center group_5"
>
<view
class=
"codefun-flex-row codefun-items-center group_6"
>
<image
class=
"image_6"
src=
"/static/images/codefun/118c884c539aaba710313f0682db00e1.png"
/>
<image
class=
"image_6"
src=
"/static/images/codefun/118c884c539aaba710313f0682db00e1.png"
/>
<view
class=
"codefun-ml-4 codefun-flex-col codefun-justify-start codefun-items-center text-wrapper"
>
class=
"codefun-ml-4 codefun-flex-col codefun-justify-start codefun-items-center text-wrapper"
>
<text
class=
"font_3 text_6"
>
已认证:
</text>
</view>
<view
class=
"codefun-ml-4 codefun-flex-col codefun-justify-start codefun-items-center text-wrapper_2"
>
class=
"codefun-ml-4 codefun-flex-col codefun-justify-start codefun-items-center text-wrapper_2"
>
<text
class=
"font_5"
>
{{
pageData
.
type_success_total
}}
个
</text>
</view>
</view>
<view
class=
"codefun-flex-row codefun-items-center group_8"
>
<image
class=
"image_6"
src=
"/static/images/codefun/27ef797870c2085d1a14446c50cf53e0.png"
/>
<image
class=
"image_6"
src=
"/static/images/codefun/27ef797870c2085d1a14446c50cf53e0.png"
/>
<view
class=
"codefun-ml-4 codefun-flex-col codefun-justify-start codefun-items-center text-wrapper"
>
class=
"codefun-ml-4 codefun-flex-col codefun-justify-start codefun-items-center text-wrapper"
>
<text
class=
"font_3 text_6"
>
待认证:
</text>
</view>
<view
class=
"codefun-ml-4 codefun-flex-col codefun-justify-start codefun-items-center text-wrapper_3"
>
class=
"codefun-ml-4 codefun-flex-col codefun-justify-start codefun-items-center text-wrapper_3"
>
<text
class=
"font_3 text_8"
>
{{
pageData
.
type_unverified_total
}}
个
</text>
</view>
</view>
...
...
@@ -152,8 +136,7 @@ function getList() {
<view
class=
"codefun-flex-row"
>
<image
class=
"image_8"
src=
"/static/images/codefun/c24e87154a833caadfcb70fb24ae52dc.png"
/>
<view
class=
"codefun-ml-4 codefun-flex-col codefun-justify-start codefun-items-start text-wrapper_4"
>
class=
"codefun-ml-4 codefun-flex-col codefun-justify-start codefun-items-start text-wrapper_4"
>
<text
class=
"font_5"
>
基地认证指南
</text>
</view>
</view>
...
...
@@ -162,15 +145,11 @@ function getList() {
</view>
<view
class=
"codefun-mt-12 codefun-flex-col section_4"
v-if=
"pageData.list.length"
>
<view
class=
"codefun-flex-col codefun-self-stretch list"
>
<view
class=
"codefun-flex-row codefun-items-center list-item"
v-for=
"(item, index) in pageData.list"
:key=
"index"
>
<view
class=
"codefun-flex-row codefun-items-center list-item"
v-for=
"(item, index) in pageData.list"
:key=
"index"
>
<view
class=
"codefun-flex-col codefun-justify-start codefun-items-start section_5"
>
<view
class=
"codefun-flex-col codefun-justify-start codefun-items-center text-wrapper_5"
>
class=
"codefun-flex-col codefun-justify-start codefun-items-center text-wrapper_5"
>
<text
class=
"font_6"
>
{{
item
.
auditStatus_dictText
}}
</text>
</view>
</view>
...
...
@@ -183,24 +162,18 @@ function getList() {
</view>
</view>
<view
class=
"codefun-mt-18 codefun-flex-row codefun-justify-between codefun-items-center group_11"
>
class=
"codefun-mt-18 codefun-flex-row codefun-justify-between codefun-items-center group_11"
>
<view
class=
"codefun-flex-row"
@
click=
"goDetail(item.id)"
>
<image
class=
"image_10"
src=
"/static/images/codefun/3566724e23f8a91e60ae87c2744e4090.png"
/>
<image
class=
"image_10"
src=
"/static/images/codefun/3566724e23f8a91e60ae87c2744e4090.png"
/>
<view
class=
"codefun-ml-4 codefun-flex-col codefun-justify-start codefun-items-center text-wrapper_6"
>
class=
"codefun-ml-4 codefun-flex-col codefun-justify-start codefun-items-center text-wrapper_6"
>
<text
class=
"font_7 text_11"
>
详情
</text>
</view>
</view>
<view
class=
"codefun-flex-row codefun-items-center"
@
click=
"del(item.id)"
>
<image
class=
"codefun-shrink-0 image_10"
src=
"/static/images/codefun/8630d19ebb6334e2028daa7d7b8b5983.png"
/>
<image
class=
"codefun-shrink-0 image_10"
src=
"/static/images/codefun/8630d19ebb6334e2028daa7d7b8b5983.png"
/>
<text
class=
"font_8 ml-5"
>
删除
</text>
</view>
</view>
...
...
@@ -214,31 +187,31 @@ function getList() {
</
template
>
<
style
scoped
lang=
"scss"
>
body
{
body
{
background-color
:
#e6f5e8
;
}
}
.mt-5
{
.mt-5
{
margin-top
:
10
rpx
;
}
}
.mt-11
{
.mt-11
{
margin-top
:
22
rpx
;
}
}
.ml-5
{
.ml-5
{
margin-left
:
10
rpx
;
}
}
.ml-13
{
.ml-13
{
margin-left
:
26
rpx
;
}
}
.ml-9
{
.ml-9
{
margin-left
:
18
rpx
;
}
}
.page
{
.page
{
background-color
:
#e6f5e8
;
mix-blend-mode
:
NOTTHROUGH
;
width
:
100%
;
...
...
@@ -701,5 +674,5 @@ function getList() {
line-height
:
25.76
rpx
;
color
:
#ffffff
;
}
}
}
</
style
>
src/pages/wode/wode.vue
浏览文件 @
fb92718d
<
script
setup
lang=
"ts"
>
import
{
reactive
}
from
'vue'
import
{
onLoad
,
onPullDownRefresh
}
from
'@dcloudio/uni-app'
import
*
as
WodeAPI
from
'@/api/model/wode'
import
*
as
NongchangAPI
from
'@/api/model/nongchang'
// 下拉刷新
onPullDownRefresh
(()
=>
{
import
{
reactive
}
from
'vue'
import
{
onLoad
,
onPullDownRefresh
}
from
'@dcloudio/uni-app'
import
*
as
WodeAPI
from
'@/api/model/wode'
import
*
as
NongchangAPI
from
'@/api/model/nongchang'
import
SaveDialog
from
'../device/components/save-dialog.vue'
// 下拉刷新
onPullDownRefresh
(()
=>
{
setTimeout
(
function
()
{
uni
.
stopPullDownRefresh
()
Message
.
toast
(
'刷新成功'
)
},
1000
)
})
})
onLoad
(()
=>
{
onLoad
(()
=>
{
getBizCommonFileList
()
getFarmsList
()
})
})
// 页面数据
const
pageData
=
reactive
({
// 页面数据
const
pageData
=
reactive
({
// 用户信息
userInfo
:
{
avatar
:
'/static/images/codefun/8653455b786fbf94ae1c3946f11e7d40.png'
,
...
...
@@ -59,6 +59,7 @@
status
:
'离线可用'
,
statusClass
:
'text_14'
,
arrowIcon
:
'/static/images/codefun/f29a8c39eb37da965d0a764a567a1c77.png'
,
url
:
''
},
{
id
:
2
,
...
...
@@ -69,6 +70,7 @@
actionText
:
'添加设备'
,
arrowIcon
:
'/static/images/codefun/f29a8c39eb37da965d0a764a567a1c77.png'
,
addIcon
:
'/static/images/codefun/2ff61f748e26b18760ca166aa8cfa15a.png'
,
url
:
'/pages/device/device'
},
],
...
...
@@ -165,9 +167,9 @@
},
],
},
})
})
function
getBizCommonFileList
()
{
function
getBizCommonFileList
()
{
WodeAPI
.
bizCommonFileList
({
pageNo
:
1
,
pageSize
:
4
,
...
...
@@ -175,13 +177,13 @@
const
{
records
}
=
res
pageData
.
commonResources
.
resources
=
records
})
}
function
getFarmBaseList
(
id
)
{
}
function
getFarmBaseList
(
id
)
{
NongchangAPI
.
getFarmBaseList
({
id
}).
then
((
res
)
=>
{
pageData
.
statistics
[
0
].
value
=
res
.
length
})
}
function
getFarmsList
()
{
}
function
getFarmsList
()
{
NongchangAPI
.
farmsList
({
pageNo
:
1
,
pageSize
:
10
,
...
...
@@ -198,34 +200,51 @@
getFarmBaseList
(
pageData
.
userInfo
.
ncId
)
})
}
}
// 用户信息设置点击事件
function
onSettingsClick
()
{
// 用户信息设置点击事件
function
onSettingsClick
()
{
console
.
log
(
'点击设置'
)
// 在这里添加具体的设置点击逻辑
}
}
// 消息中心点击事件
function
onMessageCenterClick
()
{
// 消息中心点击事件
function
onMessageCenterClick
()
{
console
.
log
(
'点击消息中心'
)
// 在这里添加具体的消息中心点击逻辑
}
}
// 功能模块点击事件
function
onFeatureClick
(
feature
:
any
)
{
// 功能模块点击事件
function
onFeatureClick
(
feature
:
any
)
{
console
.
log
(
'点击功能模块:'
,
feature
)
// 在这里添加具体的功能模块点击逻辑
}
uni
.
navigateTo
({
url
:
feature
.
url
,
})
}
const
showDialog
=
ref
(
false
)
const
currentEditData
=
ref
(
null
)
onNavigationBarButtonTap
((
_
)
=>
{
showAddDialog
()
})
const
showAddDialog
=
()
=>
{
currentEditData
.
value
=
null
showDialog
.
value
=
true
}
const
onAddClick
=
(
feature
:
any
)
=>
{
console
.
log
(
'点击功能模块:'
,
feature
)
if
(
feature
.
id
===
2
)
showAddDialog
()
// 常用资源点击事件
function
onResourceClick
(
resource
:
any
)
{
}
// 常用资源点击事件
function
onResourceClick
(
resource
:
any
)
{
console
.
log
(
'点击资源:'
,
resource
)
// 在这里添加具体的资源点击逻辑
}
}
// 资源下载点击事件
function
onDownloadClick
(
resource
:
any
)
{
// 资源下载点击事件
function
onDownloadClick
(
resource
:
any
)
{
// 阻止事件冒泡
event
?.
stopPropagation
()
...
...
@@ -243,10 +262,10 @@
/* #ifndef H5 */
downloadFileForNative
(
resource
)
/* #endif */
}
}
// H5平台下载文件函数
function
downloadFileForWeb
(
resource
:
any
)
{
// H5平台下载文件函数
function
downloadFileForWeb
(
resource
:
any
)
{
const
url
=
resource
.
fileSrc
// 创建一个临时的a标签用于下载
...
...
@@ -263,10 +282,10 @@
document
.
body
.
removeChild
(
link
)
uni
.
hideLoading
()
Message
.
toast
(
'开始下载'
)
}
}
// 原生平台下载文件函数
function
downloadFileForNative
(
resource
:
any
)
{
// 原生平台下载文件函数
function
downloadFileForNative
(
resource
:
any
)
{
uni
.
downloadFile
({
url
:
resource
.
fileSrc
,
success
:
(
res
)
=>
{
...
...
@@ -312,37 +331,37 @@
Message
.
toast
(
'网络错误,下载失败'
)
},
})
}
}
// 查看所有资源
function
onViewAllResources
()
{
// 查看所有资源
function
onViewAllResources
()
{
console
.
log
(
'查看所有资源'
)
// 在这里添加具体的查看所有资源逻辑
}
}
// 我的设备标题点击事件
function
onMyDevicesTitleClick
()
{
// 我的设备标题点击事件
function
onMyDevicesTitleClick
()
{
console
.
log
(
'点击我的设备标题'
)
// 在这里添加具体的设备标题点击逻辑
}
}
// 设备点击事件
function
onDeviceClick
(
device
:
any
)
{
// 设备点击事件
function
onDeviceClick
(
device
:
any
)
{
console
.
log
(
'点击设备:'
,
device
)
// 在这里添加具体的设备点击逻辑
}
}
// 客服点击事件
function
onServiceClick
(
service
:
any
)
{
// 客服点击事件
function
onServiceClick
(
service
:
any
)
{
console
.
log
(
'点击客服:'
,
service
)
// 在这里添加具体的客服点击逻辑
}
}
// 帮助点击事件
function
onHelpClick
(
help
:
any
)
{
// 帮助点击事件
function
onHelpClick
(
help
:
any
)
{
console
.
log
(
'点击帮助:'
,
help
)
// 在这里添加具体的帮助点击逻辑
}
}
</
script
>
<
template
>
...
...
@@ -356,18 +375,13 @@
<view
class=
"codefun-flex-row codefun-items-center codefun-self-stretch"
>
<text
class=
"font_2 text_2"
>
{{
pageData
.
userInfo
.
farmName
}}
</text>
<view
class=
"codefun-flex-row codefun-items-center codefun-shrink-0 section_2 codefun-ml-6"
>
<image
v-show=
"pageData.userInfo.certification.icon"
class=
"codefun-flex-row codefun-items-center codefun-shrink-0 section_2 codefun-ml-6"
>
<image
v-show=
"pageData.userInfo.certification.icon"
class=
"codefun-shrink-0 image_7 mr-1"
:src=
"pageData.userInfo.certification.icon"
/>
<text
class=
"font_3 text_3"
:style=
"
{ color: pageData.userInfo.certification.icon ? '' : '#fbc428' }"
>
{{
pageData
.
userInfo
.
certification
.
text
}}
</text
>
:src=
"pageData.userInfo.certification.icon"
/>
<text
class=
"font_3 text_3"
:style=
"
{ color: pageData.userInfo.certification.icon ? '' : '#fbc428' }">
{{
pageData
.
userInfo
.
certification
.
text
}}
</text>
</view>
</view>
<text
class=
"codefun-self-start font_1 codefun-mt-10"
>
{{
...
...
@@ -379,15 +393,9 @@
</view>
<view
class=
"codefun-flex-col codefun-justify-start section_3"
>
<view
class=
"codefun-flex-row"
>
<navigator
v-for=
"stat in pageData.statistics"
:url=
"stat.url"
:key=
"stat.id"
class=
"codefun-flex-col codefun-items-center group_6 equal-division-item"
hover-class=
"none"
:render-link=
"false"
:class=
"
{ 'codefun-ml-32': stat.id > 1 }"
>
<navigator
v-for=
"stat in pageData.statistics"
:url=
"stat.url"
:key=
"stat.id"
class=
"codefun-flex-col codefun-items-center group_6 equal-division-item"
hover-class=
"none"
:render-link=
"false"
:class=
"
{ 'codefun-ml-32': stat.id > 1 }">
<text
class=
"font_4"
>
{{
stat
.
value
}}
</text>
<text
class=
"font_5 codefun-mt-16"
>
{{
stat
.
label
}}
</text>
</navigator>
...
...
@@ -396,17 +404,15 @@
</view>
<view
class=
"codefun-flex-col codefun-relative group_7"
>
<view
class=
"codefun-flex-col"
>
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center section_12"
@
click=
"onMessageCenterClick"
>
<!-- 消息中心 -->
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center section_12"
@
click=
"onMessageCenterClick"
>
<view
class=
"codefun-flex-row group_8"
>
<image
class=
"image_10"
:src=
"pageData.messageCenter.icon"
/>
<view
class=
"codefun-flex-col group_9 codefun-ml-12"
>
<text
class=
"codefun-self-start font"
>
{{
pageData
.
messageCenter
.
title
}}
</text>
<view
class=
"codefun-flex-col codefun-justify-start codefun-items-start codefun-self-stretch text-wrapper_2 codefun-mt-4"
>
class=
"codefun-flex-col codefun-justify-start codefun-items-start codefun-self-stretch text-wrapper_2 codefun-mt-4"
>
<text
class=
"font_7"
>
{{
pageData
.
messageCenter
.
description
}}
</text>
</view>
</view>
...
...
@@ -418,14 +424,11 @@
<image
class=
"image_11 codefun-ml-12"
:src=
"pageData.messageCenter.arrowIcon"
/>
</view>
</view>
<!-- 资源/设备 -->
<view
class=
"codefun-flex-row equal-division codefun-mt-12"
>
<view
v-for=
"(feature, index) in pageData.features"
:key=
"feature.id"
class=
"codefun-flex-col section_5 section_11"
:class=
"
{ 'codefun-ml-12': index > 0 }"
@click="onFeatureClick(feature)"
>
<view
v-for=
"(feature, index) in pageData.features"
:key=
"feature.id"
class=
"codefun-flex-col section_5 section_11"
:class=
"
{ 'codefun-ml-12': index > 0 }"
@click="onFeatureClick(feature)">
<view
class=
"codefun-flex-row codefun-self-stretch"
>
<view
class=
"codefun-flex-row codefun-items-center codefun-flex-1"
>
<image
class=
"codefun-shrink-0 image_10"
:src=
"feature.icon"
/>
...
...
@@ -434,33 +437,27 @@
<text
class=
"font_8 codefun-mt-8"
>
{{
feature
.
count
}}
</text>
</view>
</view>
<image
class=
"codefun-shrink-0 codefun-self-start image_11"
:class=
"
{
<image
class=
"codefun-shrink-0 codefun-self-start image_11"
:class=
"
{
image_12: feature.id === 1,
image_13: feature.id === 2,
'codefun-ml-8': feature.id === 1,
}"
:src="feature.arrowIcon"
/>
}" :src="feature.arrowIcon" />
</view>
<text
class=
"codefun-self-stretch font_7 codefun-mt-10"
>
{{
feature
.
description
}}
</text>
<view
v-if=
"feature.status"
class=
"codefun-flex-col codefun-justify-start codefun-items-center codefun-self-start view mt-2"
>
<view
v-if=
"feature.status"
class=
"codefun-flex-col codefun-justify-start codefun-items-center codefun-self-start view mt-2"
>
<text
class=
"font_6"
:class=
"feature.statusClass"
>
{{
feature
.
status
}}
</text>
</view>
<view
v-if=
"feature.actionText && feature.addIcon"
<view
v-if=
"feature.actionText && feature.addIcon"
class=
"codefun-flex-row codefun-justify-evenly codefun-items-center codefun-self-start view_2 mt-2"
>
@
click
.
stop=
"onAddClick(feature)"
>
<image
class=
"image_14"
:src=
"feature.addIcon"
/>
<text
class=
"font_3"
>
{{
feature
.
actionText
}}
</text>
</view>
</view>
</view>
</view>
<view
class=
"codefun-flex-col codefun-mt-24"
>
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center group_13"
>
<text
class=
"font_2"
>
{{
pageData
.
commonResources
.
title
}}
</text>
...
...
@@ -471,10 +468,8 @@
<view
class=
"codefun-flex-col list"
>
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center list-item codefun-mt-24"
v-for=
"resource in pageData.commonResources.resources"
:key=
"resource.id"
@
click=
"onResourceClick(resource)"
>
v-for=
"resource in pageData.commonResources.resources"
:key=
"resource.id"
@
click=
"onResourceClick(resource)"
>
<view
class=
"codefun-flex-row"
>
<image
class=
"image_15"
:src=
"pageData.commonResources.icon[resource.fileType]?.icon"
/>
<view
class=
"codefun-flex-col codefun-items-start group_14 codefun-ml-12"
>
...
...
@@ -482,10 +477,8 @@
<text
class=
"font_6 codefun-mt-12"
>
{{
resource
.
fileSize
}}
</text>
</view>
</view>
<view
class=
"codefun-flex-col codefun-justify-start codefun-items-center text-wrapper_4"
@
click
.
stop=
"onDownloadClick(resource)"
>
<view
class=
"codefun-flex-col codefun-justify-start codefun-items-center text-wrapper_4"
@
click
.
stop=
"onDownloadClick(resource)"
>
<text
class=
"font_10"
>
下载
</text>
</view>
</view>
...
...
@@ -500,13 +493,9 @@
</view>
<view
class=
"codefun-flex-col codefun-mt-16"
>
<view
class=
"codefun-flex-col section_12"
>
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center"
v-for=
"(device, index) in pageData.myDevices.devices"
:key=
"device.id"
:class=
"
{ 'codefun-mt-16': index > 0 }"
@click="onDeviceClick(device)"
>
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center"
v-for=
"(device, index) in pageData.myDevices.devices"
:key=
"device.id"
:class=
"
{ 'codefun-mt-16': index > 0 }" @click="onDeviceClick(device)">
<view
class=
"codefun-flex-row codefun-items-center"
>
<image
class=
"image_17"
:src=
"device.image"
/>
<view
class=
"codefun-flex-col codefun-items-start codefun-ml-8"
>
...
...
@@ -516,23 +505,17 @@
</view>
<view
class=
"codefun-flex-row codefun-items-center"
>
<image
class=
"codefun-shrink-0 image_18"
:src=
"device.statusIcon"
/>
<text
class=
"font_6"
:class=
"device.statusClass || ''"
:style=
"
{ color: device.status === '正常' ? '#13e000' : '#999999' }"
>
<text
class=
"font_6"
:class=
"device.statusClass || ''"
:style=
"
{ color: device.status === '正常' ? '#13e000' : '#999999' }">
{{
device
.
status
}}
</text>
</view>
</view>
</view>
<view
class=
"codefun-flex-col section_9 codefun-mt-12"
>
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center"
v-for=
"service in pageData.support.services"
:key=
"service.id"
@
click=
"onServiceClick(service)"
>
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center"
v-for=
"service in pageData.support.services"
:key=
"service.id"
@
click=
"onServiceClick(service)"
>
<view
class=
"codefun-flex-row codefun-items-center"
>
<image
class=
"codefun-shrink-0 image_19"
:src=
"service.icon"
/>
<text
class=
"font_13 codefun-ml-8"
>
{{
service
.
title
}}
</text>
...
...
@@ -540,13 +523,9 @@
<image
class=
"image_20"
:src=
"service.arrowIcon"
/>
</view>
<view
class=
"codefun-flex-col codefun-mt-20"
>
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center"
v-for=
"help in pageData.support.helps"
:key=
"help.id"
:class=
"
{ 'codefun-mt-20': help.id > 1 }"
@click="onHelpClick(help)"
>
<view
class=
"codefun-flex-row codefun-justify-between codefun-items-center"
v-for=
"help in pageData.support.helps"
:key=
"help.id"
:class=
"
{ 'codefun-mt-20': help.id > 1 }" @click="onHelpClick(help)">
<view
class=
"codefun-flex-row codefun-items-center"
>
<image
class=
"codefun-shrink-0 image_21"
:src=
"help.icon"
/>
<text
class=
"font_13 codefun-ml-8"
>
{{
help
.
title
}}
</text>
...
...
@@ -559,11 +538,13 @@
</view>
</view>
</view>
<!-- 弹窗组件 -->
<save-dialog
:show=
"showDialog"
:editData=
"currentEditData"
@
update:show=
"showDialog = $event"
/>
</view>
</
template
>
<
style
scoped
lang=
"scss"
>
.page
{
.page
{
background-color
:
#e6f5e8
;
mix-blend-mode
:
NOTTHROUGH
;
width
:
100%
;
...
...
@@ -578,41 +559,50 @@
background-image
:
url('/static/images/codefun/7a5dc4ee864fe55da98b41c14ee3b931.png')
;
background-size
:
100%
100%
;
background-repeat
:
no-repeat
;
.group_2
{
margin-right
:
8
rpx
;
padding
:
0
12
rpx
;
.image
{
border-radius
:
64
rpx
;
width
:
108
rpx
;
height
:
42
rpx
;
}
.image_2
{
mix-blend-mode
:
NOTTHROUGH
;
width
:
34
rpx
;
height
:
22
rpx
;
}
.image_3
{
mix-blend-mode
:
NOTTHROUGH
;
width
:
30
rpx
;
height
:
22
rpx
;
}
.image_4
{
width
:
48
rpx
;
height
:
22
rpx
;
}
}
.group_3
{
margin-right
:
8
rpx
;
margin-top
:
42
rpx
;
padding
:
16
rpx
8
rpx
0
;
.text
{
color
:
#ffffff
e6
;
}
.image_5
{
mix-blend-mode
:
NOTTHROUGH
;
width
:
44
rpx
;
height
:
42
rpx
;
}
.pos
{
position
:
absolute
;
right
:
8
rpx
;
...
...
@@ -620,6 +610,7 @@
transform
:
translateY
(
-50%
);
}
}
.group_4
{
.image_6
{
mix-blend-mode
:
NOTTHROUGH
;
...
...
@@ -627,33 +618,40 @@
width
:
96
rpx
;
height
:
96
rpx
;
}
.group_5
{
margin-top
:
8
rpx
;
margin-bottom
:
8
rpx
;
.text_2
{
color
:
#ffffff
;
}
.section_2
{
padding
:
8
rpx
;
background-color
:
#ffffff
;
border-radius
:
400
rpx
;
mix-blend-mode
:
NOTTHROUGH
;
height
:
42
rpx
;
.image_7
{
mix-blend-mode
:
NOTTHROUGH
;
width
:
18
rpx
;
height
:
12
rpx
;
}
.text_3
{
font-size
:
22
rpx
;
line-height
:
22
rpx
;
}
}
}
.image_9
{
margin-right
:
8
rpx
;
}
}
.section_3
{
margin-right
:
16
rpx
;
margin-top
:
24
rpx
;
...
...
@@ -661,14 +659,17 @@
background-color
:
#ffffff
;
border-radius
:
16
rpx
;
mix-blend-mode
:
NOTTHROUGH
;
.group_6
{
flex
:
1
1
186.88
rpx
;
.font_4
{
font-size
:
36
rpx
;
line-height
:
36
rpx
;
font-weight
:
600
;
color
:
#20602d
;
}
.font_5
{
font-size
:
28
rpx
;
line-height
:
28
rpx
;
...
...
@@ -677,24 +678,29 @@
}
}
}
.group_7
{
margin-top
:
-64
rpx
;
padding
:
0
20
rpx
;
.section_12
{
margin-right
:
16
rpx
;
padding
:
24
rpx
;
background-color
:
#ffffff
;
border-radius
:
16
rpx
;
mix-blend-mode
:
NOTTHROUGH
;
.group_8
{
overflow
:
hidden
;
width
:
411.4
rpx
;
height
:
80
rpx
;
.group_9
{
padding-top
:
8
rpx
;
overflow
:
hidden
;
width
:
307.4
rpx
;
height
:
80
rpx
;
.text-wrapper_2
{
padding
:
8
rpx
0
;
overflow
:
hidden
;
...
...
@@ -702,8 +708,10 @@
}
}
}
.group_10
{
margin-right
:
8
rpx
;
.text-wrapper
{
padding
:
8
rpx
0
;
background-color
:
#ff5454
;
...
...
@@ -713,53 +721,66 @@
height
:
40
rpx
;
}
}
.image_17
{
border-radius
:
24
rpx
;
width
:
92
rpx
;
height
:
92
rpx
;
}
.font_11
{
font-size
:
28
rpx
;
line-height
:
28
rpx
;
color
:
#15161a
;
}
.image_18
{
width
:
72
rpx
;
height
:
12
rpx
;
}
.text_24
{
color
:
#13e000
;
}
}
.equal-division
{
margin-right
:
16
rpx
;
.section_5
{
flex
:
1
1
336
rpx
;
.font_8
{
font-size
:
24
rpx
;
line-height
:
24
rpx
;
color
:
#4cd964
;
}
.image_12
{
margin-right
:
8
rpx
;
margin-top
:
8
rpx
;
}
.view
{
padding
:
12
rpx
16
rpx
;
border-radius
:
12
rpx
;
overflow
:
hidden
;
background-color
:
#4fc5fd33
;
mix-blend-mode
:
NOTTHROUGH
;
.text_14
{
color
:
#4fbdfb
;
}
}
.group_12
{
margin-left
:
16
rpx
;
}
.image_13
{
margin
:
8
rpx
8
rpx
0
40
rpx
;
}
.view_2
{
padding
:
12
rpx
16
rpx
;
border-radius
:
12
rpx
;
...
...
@@ -767,12 +788,14 @@
background-color
:
rgba
(
93
,
182
,
111
,
0.2
);
mix-blend-mode
:
NOTTHROUGH
;
width
:
152
rpx
;
.image_14
{
width
:
20
rpx
;
height
:
20
rpx
;
}
}
}
.section_11
{
padding
:
20
rpx
24
rpx
;
background-color
:
#ffffff
;
...
...
@@ -781,55 +804,67 @@
height
:
220
rpx
;
}
}
.image_10
{
border-radius
:
16
rpx
;
width
:
80
rpx
;
height
:
80
rpx
;
}
.image_11
{
mix-blend-mode
:
NOTTHROUGH
;
width
:
12
rpx
;
height
:
22
rpx
;
}
.font_7
{
font-size
:
22
rpx
;
line-height
:
22
rpx
;
color
:
#6b7280
;
}
.group_13
{
padding-bottom
:
32
rpx
;
.text_16
{
margin-right
:
8
rpx
;
}
}
.list
{
margin-right
:
16
rpx
;
padding
:
32
rpx
24
rpx
;
background-color
:
#ffffff
;
border-radius
:
16
rpx
;
mix-blend-mode
:
NOTTHROUGH
;
.list-item
{
&:first-child
{
margin-top
:
0
;
}
.image_15
{
width
:
54
rpx
;
height
:
72
rpx
;
}
.group_14
{
margin-top
:
8
rpx
;
.font_9
{
font-size
:
28
rpx
;
line-height
:
28
rpx
;
color
:
#333333
;
}
}
.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
;
...
...
@@ -838,65 +873,79 @@
}
}
}
.font_6
{
font-size
:
24
rpx
;
line-height
:
24
rpx
;
color
:
#999999
;
}
.text_22
{
margin-right
:
16
rpx
;
}
.section_9
{
margin-right
:
16
rpx
;
padding
:
28
rpx
24
rpx
;
background-color
:
#ffffff
;
border-radius
:
16
rpx
;
mix-blend-mode
:
NOTTHROUGH
;
.image_19
{
width
:
40
rpx
;
height
:
40
rpx
;
}
.font_13
{
font-size
:
28
rpx
;
line-height
:
28
rpx
;
color
:
#1d2129
;
}
.image_21
{
width
:
38
rpx
;
height
:
38
rpx
;
}
}
}
.font
{
font-size
:
32
rpx
;
line-height
:
32
rpx
;
color
:
#000000
;
}
.font_1
{
font-size
:
24
rpx
;
line-height
:
24
rpx
;
color
:
#ffffff
;
}
.font_3
{
font-size
:
24
rpx
;
line-height
:
24
rpx
;
color
:
#5db66f
;
}
.font_2
{
font-size
:
32
rpx
;
line-height
:
32
rpx
;
font-weight
:
600
;
color
:
#333333
;
}
.image_8
{
width
:
36
rpx
;
height
:
36
rpx
;
}
}
.equal-division_2
{
margin-right
:
8
rpx
;
.group_15
{
flex
:
1
1
148.4
rpx
;
.font_14
{
font-size
:
20
rpx
;
line-height
:
20
rpx
;
...
...
@@ -904,18 +953,21 @@
}
}
}
.section_6
{
padding
:
16
rpx
0
;
background-color
:
#ffffff
;
mix-blend-mode
:
NOTTHROUGH
;
border-top
:
solid
1
rpx
#e7e7e7
;
}
.equal-division-item
{
padding
:
8
rpx
0
;
}
.image_20
{
width
:
32
rpx
;
height
:
32
rpx
;
}
}
}
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论