提交 09731260 编写于 作者: taohebin@dcloud.io's avatar taohebin@dcloud.io

feat: get-window-info页面

上级 260a9443
......@@ -699,6 +699,13 @@
"navigationBarTitleText": "自定义下拉刷新",
"enablePullDownRefresh": false
}
},
{
"path": "pages/API/get-window-info/get-window-info",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
......
<template>
<view>
<page-head :title="title"></page-head>
<view class="uni-common-mt">
<view class="uni-list">
<view class="uni-list-cell" v-for="(item,_) in items" style="align-items: center;">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">{{item.label}}</view>
</view>
<view class="uni-list-cell-db">
<textarea :auto-height="true" :disabled="true" placeholder="未获取" :value="item.value" />
</view>
</view>
</view>
<view class="uni-padding-wrap">
<view class="uni-btn-v">
<button type="primary" @tap="getWindowInfo">获取窗口信息</button>
</view>
</view>
</view>
</view>
</template>
<script>
type Item = {
label : string,
value : string,
}
export default {
data() {
return {
title: 'getWindowInfo',
items: [] as Item[],
}
},
onUnload: function () {
},
methods: {
getWindowInfo: function () {
const res = uni.getWindowInfo();
const json = JSON.stringify(res);
const result = JSON.parse<Map<string, any>>(json);
result.forEach((value, key) => {
const item = {
label: key,
value: "" + value
} as Item;
this.items.push(item);
})
}
}
}
</script>
<style>
.uni-pd {
padding-left: 30rpx;
}
</style>
\ No newline at end of file
......@@ -180,6 +180,10 @@
name: "获取APP授权设置",
url: "get-app-authorize-setting",
},
{
name: "获取窗口信息",
url: "get-window-info",
},
{
name: "电量",
url: "get-battery-info",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册