分享设备相关的功能

This commit is contained in:
fengerli
2025-07-22 17:47:38 +08:00
parent 1663ae75e4
commit 864f7f58a0
19 changed files with 1360 additions and 307 deletions

View File

@ -0,0 +1,95 @@
<template>
<view class="alltype">
<!-- 车辆列表 -->
<view class="vehicle-list">
<view v-for="(item, index) in vehicles" :key="index">
<view class="vehicle-item" @click="alltypeInfo(item)">
<image src="/static/images/bip.6.png" mode="" class="IMG"></image>
</view>
<view class="plate-number">{{ item.typeName }}</view>
</view>
</view>
</view>
</template>
<script>
import {
deviceTypeList,
} from '@/api/common/index.js'
export default {
data() {
return {
vehicles: [],
}
},
methods: {
getTab() {
deviceTypeList({}).then((res) => {
if (res.code == 200) {
this.vehicles = res.data
}
})
},
alltypeInfo(item){
uni.switchTab({
url: '/pages/common/index/index',
success: (res) => {
res.eventChannel.emit('index', {
data: item
});
}
})
}
},
onLoad() {
this.getTab()
}
}
</script>
<style scoped>
.alltype {
padding: 30rpx;
background: rgba(18, 18, 18, 1);
min-height: 100vh;
color: #FFFFFF;
font-family: PingFang SC, sans-serif;
}
.vehicle-list {
display: flex;
flex-wrap: wrap;
align-items: center;
text-align: center;
}
.list-header {
display: flex;
align-items: baseline;
margin-bottom: 32rpx;
}
.vehicle-item {
padding: 24rpx 0;
background: rgba(26, 26, 26, 1);
border-radius: 16rpx;
width: 156rpx;
height: 156rpx;
margin-right: 16rpx;
margin-bottom: 16rpx;
line-height: 156rpx;
}
.IMG {
width: 100rpx;
height: 72rpx;
cursor: pointer;
}
.plate-number {
color: rgba(255, 255, 255, 0.87);
}
</style>