<template>
	<view>
		<view style="padding:0 30rpx;" class="ddflex">
			<view class="cell-item" v-for="item,index in 9">
				<view class="cell-item-num">{{index}}</view>
				<view class="ddflex">
					<view style="margin-right: 13rpx;">
						<cell :soc="index*10"></cell>
					</view>
					<view class="cell-item-info fflex">
						<view class="cell-item-info-item ddflex">
							<view>型号</view>
							<view>60V 30Ah</view>
						</view>
						<view class="cell-item-info-item ddflex">
							<view>电量</view>
							<view>80%</view>
						</view>
						<view class="cell-item-info-item ddflex">
							<view>电压</view>
							<view>66.85V</view>
						</view>
					</view>
				</view>
				<view class="cell-item-option" @click="jumpUrl('/machineAndCell/machineItemManage/machineItemManage')">仓位管理</view>
			</view>
		</view>
		
		<view style="height: 165rpx;" class="savepadding"></view>
		<view class="bottom-btns savepadding">
			<view class="ddflex" style="margin: 30rpx;justify-content: space-between;">
				<view class="btn1" @click="jumpUrl('/warning/machineAlarm/machineAlarm')">故障告警</view>
				<view class="btn1" @click="jumpUrl('/machineAndCell/machineDetail/machineDetail')">柜体信息</view>
				<view class="btn2">刷新</view>
			</view>
		</view>
	</view>
</template>

<script>
	const app = getApp();
	const req = require("../../utils/request.js");
	import cell from "../../components/cell/index";

	export default {
		components: {
			cell
		},
		props: {},
		data() {
			return {
				systems: {},
				isTop:0,
			}
		},
		onLoad(options) {

		},
		onShow() {
			
		},
		methods: {
			jumpUrl(url) {
				if (req.isLogins(true)) {
					uni.navigateTo({
						url: url
					})
				}
			},
		},
		mounted() {
			const systemInfo = uni.getSystemInfoSync();
			// px转换到rpx的比例
			let pxToRpxScale = 750 / systemInfo.windowWidth;
			let systems = {
				ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
				navigationHeight: 44 * pxToRpxScale // 导航栏的高度
			};
			systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
			this.systems = systems;
		},
		onPageScroll: function(e) {
			if (e.scrollTop > this.systems.barHeight) {
				this.isTop = 1;
			} else {
				this.isTop = 0;
			}
		}
	}
</script>

<style>
	@import "./machineInfo.css";
</style>