提交 3600aab8 作者: 吴佳伟

fix: 智能设备对接接口

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