<template>
	<!-- 首页 -->
	<view>
		<view class="card_gas_cylinder">气瓶安全追溯管理系统</view>
		<!-- <view class="card_port center_in">{{genreTitle}}</view> -->
		<view class="card_cylinder">
			<view class="card_bottle" v-for="(item,index) in stationList" :key="index" @click="scanCodes(item)">
				<view class="card_fiche" :style="{backgroundColor:item.color}">
					<span class="iconfont icon_image" :class="item.icon"></span>
					<view class="title_hint">{{item.title}}</view>
				</view>
			</view>
			<view class="card_bottle" @click="scanning">
				<view class="card_fiche" :style="{backgroundColor:'#67C23A'}">
					<span class="iconfont icon_image icon-saomachaxun"></span>
					<view class="title_hint">扫码查询气瓶流转信息</view>
				</view>
			</view>
			<view style="width: 40%;margin: 30rpx 0rpx;"></view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList: [],
				stationList: [{
					id: 'inspect',
					title: '订气',
					icon: 'icon-lpg',
					color: '#f4b237',
				}],
			}
		},
		mounted() {
			var userInfo = this.$cache.getCache('userInfo')
			console.log(userInfo,25)
		},
		methods: {
			scanCodes(value) {
				if (value.id == '25' || value.id == '27') {
					uni.navigateTo({
						url: '/pages/home/selectStore?id=' + value.id + '&title=' + value.title
					});
				} else {
					uni.navigateTo({
						url: '/pages/order/delivery?id=' + value.id + '&title=' + value.title
					});
				}
			},
			// 扫码溯源
			scanning() {
				uni.navigateTo({
					url: '/pages/index/codeTracing'
				});
			}
		}
	}
</script>

<style lang="scss">
	.card_gas_cylinder {
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 46rpx;
		font-weight: bold;
		color: #027DB4;
		padding: 50rpx 20rpx 0rpx 20rpx;
	}

	.card_port {
		font-size: 40rpx;
		font-weight: bold;
		color: #027DB4;
		padding-bottom: 20rpx;
	}

	.card_cylinder {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: space-evenly;
	}

	.card_bottle {
		margin: 30rpx 0rpx;
		width: 40%;
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.card_fiche {
		display: flex;
		align-items: center;
		flex-direction: column;
		justify-content: center;
		width: 100%;
		height: 240rpx;
		background-color: #027DB4;
		border-radius: 26rpx;
	}

	.icon_image {
		color: #fff;
		font-size: 80rpx;
	}

	.title_hint {
		margin-top: 20rpx;
		color: #fff;
		width: 80%;
		text-align: center;
		font-size: 32rpx;
	}
</style>