提交 b30bf170 作者: 廖在望

Merge branch 'dev' of https://gitlab.yiring.com/digital-agri/agri-app into dev

......@@ -19,6 +19,8 @@
getCommonToolsList()
// 农技课堂
getAgricultureClassList()
// 智能设备
getDeviceList()
pageData.userInfo = userStore.getUserInfo
})
......@@ -177,29 +179,9 @@
],
// 智能设备
smartDevices: [
{
id: 1,
name: '土壤监测仪',
image: '/static/images/codefun/8bd62352939b47e71f09a93a6ab344b2.png',
status: '在线',
statusColor: '#13e000',
},
{
id: 2,
name: '监测仪A',
image: '/static/images/codefun/81937c2666c800cf5966c29c2891b7c4.png',
status: '掉线',
statusColor: '#75777c',
},
{
id: 3,
name: '监测仪B',
image: '/static/images/codefun/8bd62352939b47e71f09a93a6ab344b2.png',
status: '在线',
statusColor: '#13e000',
},
],
smartDevices: [],
smartDeviceIcon: ['/static/images/codefun/8bd62352939b47e71f09a93a6ab344b2.png', '/static/images/codefun/81937c2666c800cf5966c29c2891b7c4.png'],
// 信用中心
creditCenter: {
......@@ -274,6 +256,12 @@
})
}
function getDeviceList() {
NongChangAPI.getDeviceList({}).then((res) => {
pageData.smartDevices = res.records
})
}
// 菜单点击事件
function onMenuItemClick(item: any) {
console.log('点击菜单项:', item)
......@@ -705,9 +693,9 @@
:key="device.id"
class="section_16 codefun-flex-row codefun-justify-center codefun-items-center codefun-shrink-0 codefun-relative"
>
<image class="image_13" :src="device.image" />
<image class="image_13" :src="device.isOnline === 1 ? pageData.smartDeviceIcon[0] : pageData.smartDeviceIcon[1]" />
<view class="codefun-ml-8 codefun-flex-col">
<text class="font_14" :class="`text_${58 + index}`">{{ device.name }}</text>
<text class="font_10">{{ device.deviceName }}</text>
<view class="codefun-mt-10 codefun-flex-row codefun-items-center">
<view class="section_17" v-if="index !== 1" />
<view class="section_18" v-if="index === 1" />
......@@ -716,7 +704,7 @@
:class="index !== 1 ? 'text_59' : 'text_60'"
:style="{ color: device.statusColor }"
>
{{ device.status }}
{{ device.isOnline_dictText }}
</text>
</view>
</view>
......@@ -1740,8 +1728,8 @@
.image_13 {
border-radius: 24rpx;
width: 92rpx;
height: 92rpx;
width: 75rpx;
height: 75rpx;
}
.font_14 {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论