<template>
	<view class="head">
		<!-- <u-navbar :border-bottom="false"></u-navbar> -->
		<view class="content">
			<view style="text-align: center;">
				<image src="../../static/192x192.png" mode=""
					style="width: 200rpx;height: 200rpx;border-radius: 25rpx;"></image>
				<h3>{{name}}</h3>
				<view>version：{{version}}</view>
			</view>
			<view class="u-m-t-20">
				<uni-list>
					<uni-list-item title="检查更新" clickable @click="checkVersion" />
				</uni-list>
			</view>
		</view>

		<view style="width: 100%;position:fixed; bottom:200rpx;padding: 0;">
			<view style="width: 92%;margin: 0 auto;">
				<button type="primary" @click="logOut">退出登录</button>
			</view>
		</view>
		<!-- 更新组件 force 是否强制更新    tabbar：页面是否有原生tabbar组件-->
		<app-update ref="app_update" :force="false" :tabbar="false"></app-update>
	</view>
</template>

<script>
	import appUpdate from "@/components/yzhua006-update/app-update.vue"
	export default {
		data() {
			return {
				name: '获取失败',
				version: '获取失败'
			}
		},
		components: {
			appUpdate
		},
		onLoad() {

		},
		created() {
			// #ifdef APP-PLUS
			plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
				this.version = wgtinfo.version
				this.name = wgtinfo.name
			})
			//#endif
		},
		onBackPress(e) {
			console.log(e.from)
			if (e.from == 'backbutton') {
				return true
			}
		},
		methods: {
			logOut() {
				uni.clearStorageSync();
				uni.redirectTo({
					url: '../login/index'
				});
			},
			checkVersion() {
				// console.log(11)
				this.$refs.app_update.update(); //调用子组件 检查更新
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 96%;
		margin: 140rpx auto;
	}

	.head ::v-deep.u-navbar-inner {
		z-index: -99999;
	}
</style>
