StoreItemVideo.vue
1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<template>
<view class="area-list">
<view v-for="mItem in list" class="area-item" :key="mItem.id" span="6"
@click="handleInspection(mItem)">
<view class="monitor-status">
<uv-image v-if="mItem.status === 1" src="/static/inspection/online-2x.png" width="40rpx"
height="40rpx"></uv-image>
<uv-image v-else src="/static/inspection/offline-2x.png" width="40rpx" height="40rpx"></uv-image>
</view>
<view class="monitor-name">
<uv-text :lines="1" :text="mItem.name" size="26rpx" color="#656A72 ">
</uv-text>
</view>
</view>
</view>
</template>
<script setup>
const props = defineProps({
list:{
type:Array,
default:()=>[]
}
})
function handleInspection(data) {
const strData = JSON.stringify(data)
// 存储数据到localstorage中
uni.setStorage({
key: 'inspectionCurrentMonitor',
data: strData,
success() {
// 成功后,跳转页面
uni.navigateTo({
url: `/subPackages/accountGroup/pages/inspection/inspectionPlayer`,
})
}
});
}
</script>
<style lang="scss" scoped>
.area-list {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
.area-item {
width: 322rpx;
height: 60rpx;
padding-right: 10rpx;
background-color: #f2f3f6;
border-radius: 8rpx;
margin-bottom: 16rpx;
display: flex;
flex-direction: row;
align-items: center;
.monitor-status{
margin: 0 8rpx 0 10rpx;
}
.monitor-name{
flex: 1;
}
}
}
</style>