<template>
	<ciy-header :title="lang('apptitle')"></ciy-header>
	<view>
		<view class="ciy-card">
			<view class="title">页面传参</view>
			<view class="right">this.opn</view>
			<view class="content">
				<view v-for="(item,index) in opn" :key="index">
					<view style="margin-bottom:1em"><text style="color:var(--man6);">{{index}}:</text> {{item}}</view>
				</view>
				通用this.pagepost:<br />
				{{this.pagepost}}
			</view>
		</view>
		<view class="ciy-card">
			<view class="title">页面数据</view>
			<view class="right">this.*</view>
			<view class="content">
				<view v-for="(item,index) in thisarr" :key="index">
					<view style="margin-bottom:1em"><text style="color:var(--man6);">{{index}}:</text> {{item}}</view>
				</view>
			</view>
		</view>
		<view class="ciy-card">
			<view class="title">全局数据</view>
			<view class="right">app.globalData</view>
			<view class="content">
				<view v-for="(item,index) in glbdata" :key="index">
					<view style="margin-bottom:1em"><text style="color:var(--man6);">{{index}}:</text> {{item}}</view>
				</view>
			</view>
		</view>
		<view class="ciy-card">
			<view class="title">系统参数</view>
			<view class="right">app.globalData._sysinfo</view>
			<view class="content">
				<view v-for="(item,index) in _sysinfo" :key="index">
					<view v-if="index == 'safeArea' || index == 'safeAreaInsets'">
						<view style="margin-bottom:1em"><text style="color:var(--man5);">{{index}}:</text></view>
						<view v-for="(itm,idx) in item" :key="idx">
							<view style="margin:1em 2em"><text style="color:var(--man4);">{{idx}}:</text> {{itm}}</view>
						</view>
					</view>
					<view style="margin-bottom:1em" v-else><text style="color:var(--man6);">{{index}}:</text> {{item}}</view>
				</view>
			</view>
		</view>
	</view>
	<ciy-tabbar ref="tabbar"></ciy-tabbar>
</template>

<style>
</style>

<script>
	export default {
		data() {
			return {
				thisarr: {},
				glbdata: {},
				_sysinfo: {}
			}
		},
		onLoad() {
			var app = getApp();
			this.glbdata = {};
			for (var i in app.globalData) {
				this.glbdata[i] = app.json_string(app.globalData[i]);
			}
			this._sysinfo = {};
			for (var i in app.globalData._sysinfo) {
				this._sysinfo[i] = app.json_string(this.sysinfo[i]);
			}
			
			for (var i in this) {
				if (i == 'sysinfo' || i == '_sysinfo' || i == 'glbdata' || i == '$i18n' || i == 'thisarr')
					continue;
				if (typeof(this[i]) == 'function')
					continue;
				this.thisarr[i] = app.json_string(this[i]);
			}

		},
		methods: {}
	}
</script>