<template>
	<view class="device-info-main">
		<navBar left="0" bgColor="transparent"></navBar>
		<view class="device-name">{{list.car_name}}</view>
		<view class="block-card">
			<view class="info-view">
				<view class="info-title">车架号</view>
				<view class="info-value">{{list.frame_no}}</view>
			</view>
			<view class="info-view">
				<view class="info-title">设备编号</view>
				<view class="info-value">{{car_sn}}</view>
			</view>
			<view class="info-view">
				<view class="info-title">车辆总里程</view>
				<view class="info-value">{{(list.total_mil / 1000).toFixed(0)}}km</view>
			</view>
		</view>
		<view class="flex-row">
			<view class="block-card-1" style="margin-right: 18rpx;">
				<img class="info-icon" src="https://qiniu.bms16.com/FoyFReERWQ5jmqQIk0Aj9V7SWGR2" alt="">
				<view class="info-text">中控硬件</view>
				<view class="info-vosion">{{list.control_hardware}}</view>
			</view>
			<view class="block-card-1">
				<img class="info-icon" src="https://qiniu.bms16.com/Fvf3btY0699U2P65cRxYGDBADNHr" alt="">
				<view class="info-text">中控软件</view>
				<view class="info-vosion">{{list.control_software}}</view>
			</view>
		</view>
	</view>
</template>
<script>
	var config = require('../../common/config.js');
	var common = require('../../common/common.js');
	var request = require('../../common/request');
	export default {
		data() {
			return {
				car_sn:"",
				list:{}
			};
		}
		/**
		 * 生命周期函数--监听页面加载
		 */
		,
		onLoad: function(options) {
			this.car_sn = uni.getStorageSync('car_info').car_sn || ''
			this.loadCarDetailFn()
		},
		methods: {
			async loadCarDetailFn() {
				let {
					data
				} = await request.postApi(config.API_FLK_CAR_DETAIL, {
					car_sn:this.car_sn
				})
				if(data.code == 200){
					this.list = data.data
				}
			}
		}
	};
</script>
<style>
	@import './deviceInfo.css';
</style>