<template>
	<view class="option_list">
		<view class="option_item" @click="handleCircumstances">
			<view class="item_left" >
				<image src="@/static/parson/hjjc.png" mode=""></image>
				<text class="label">环境监测</text>
			</view>
			<view class="item-right">
				<u-icon name="arrow-right" color="#aaa"></u-icon>
			</view>
		</view>
		<view class="option_item" @click="handleFeedback">
			<view class="item_left">
				<image src="@/static/parson/icon-yj.png" mode=""></image>
				<text class="label">意见反馈</text>
			</view>
			<view class="item-right">
				<u-icon name="arrow-right" color="#aaa"></u-icon>
			</view>
		</view>
		<view class="option_item"  @click="handleCheckVersion">
			<view class="item_left">
				<image src="@/static/parson/icon-about.png" mode=""></image>
				<text class="label">关于应用</text>
			</view>
			<view class="item-right">
				<text>版本号 v{{version}}</text>
				<u-icon name="arrow-right" color="#aaa"></u-icon>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				uuid : this.$store.state.user.uuid,
				// version : this.$store.state.app.currentVersion
			}
		},
		computed : {
			version(){
				return this.$store.state.app.currentVersion;
			}
		},
		methods : {
			handleCircumstances(){
				uni.navigateTo({
					url: "/pages/circumstances/index" 
				})
			},
			handleFeedback(){
				uni.navigateTo({
					url: "/pages/feedback/index"
				})
			},
			// 检查版本更新
			handleCheckVersion(){
				uni.navigateTo({
					url: "/pages/about/index"
				})
				// uni.$u.toast("已经是最新版");
			},
			handleCopyMac(){
				uni.setClipboardData({
					data: this.uuid,
					success:()=> {
						uni.showToast({
							title: '复制成功',
						})
					},
					fail: () => {
						uni.showToast({
							icon:"error",
							title: '复制失败'
						})
					}
				});
			}
		},
	}
</script>

<style lang="scss" scoped>
	.option_list {
		.option_item {
			display: flex;
			justify-content: space-between;
			align-items: center;
			height: 100rpx;
			border-bottom: 2rpx solid #dfdfdf;
			background-color: #fff;
			padding: 0 30rpx;
			.item_left {
				display: flex;
				align-items: center;
				image {
					width: 32rpx;
					height: 32rpx;
					margin-right: 20rpx;
				}

				.label {
					font-size: 28rpx;
					color: #202020;
				}
			}

			.item-right {
				display: flex;
				justify-content: space-between;
				align-items: center;
				::v-deep .u-icon__icon {
					font-size: 30rpx !important;
				}
				text{
					font-size: 24rpx;
					color: #999999;
					margin-right: 20rpx;
				}
				.copy_btn{
					display: flex;
					font-size: 24rpx;
					color: #108CFF;
					margin-right: 30rpx;
				}
			}
		}
	}
</style>
