Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
ce6c6e9e
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5995
Star
90
Fork
162
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
ce6c6e9e
编写于
8月 02, 2023
作者:
taohebin@dcloud.io
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 修改ext-api的测试页面
上级
23f789b1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
62 addition
and
272 deletion
+62
-272
pages/API/get-app-base-info/get-app-base-info.uvue
pages/API/get-app-base-info/get-app-base-info.uvue
+18
-66
pages/API/get-device-info/get-device-info.uvue
pages/API/get-device-info/get-device-info.uvue
+22
-78
pages/API/get-system-info/get-system-info.uvue
pages/API/get-system-info/get-system-info.uvue
+22
-128
未找到文件。
pages/API/get-app-base-info/get-app-base-info.uvue
浏览文件 @
ce6c6e9e
...
@@ -2,61 +2,13 @@
...
@@ -2,61 +2,13 @@
<view>
<view>
<page-head :title="title"></page-head>
<page-head :title="title"></page-head>
<view class="uni-common-mt">
<view class="uni-common-mt">
<view class="uni-list">
<view class="uni-list">
<view class="uni-list-cell">
<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;">AppId</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="appId"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">
AppName
</view>
<view class="uni-label" style="width:180px;">
{{item.label}}
</view>
</view>
</view>
<view class="uni-list-cell-db">
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="appName"/>
<textarea :auto-height="true" :disabled="true" placeholder="未获取" :value="item.value" />
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">App版本名</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="appVersion"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">App版本号VersionCode</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="appVersionCode"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">引擎版本号</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="version"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">应用设置的语言</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="appLanguage"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">是否uni-app x</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="isUniAppX"/>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -69,17 +21,15 @@
...
@@ -69,17 +21,15 @@
</view>
</view>
</template>
</template>
<script>
<script>
type Item = {
label : string,
value : string,
}
export default {
export default {
data() {
data() {
return {
return {
title: 'getAppBaseInfo',
title: 'getAppBaseInfo',
appId:"",
items: [] as Item[],
appName:"",
appVersion:"",
appVersionCode:"",
appLanguage:"",
isUniAppX:"",
version:"",
}
}
},
},
onUnload:function(){
onUnload:function(){
...
@@ -87,13 +37,15 @@
...
@@ -87,13 +37,15 @@
methods: {
methods: {
getAppBaseInfo: function () {
getAppBaseInfo: function () {
const res = uni.getAppBaseInfo();
const res = uni.getAppBaseInfo();
this.appId = res.appId ?? "";
const json = JSON.stringify(res);
this.appName = res.appName ?? "";
const result = JSON.parse<Map<string, any>>(json);
this.appVersion = res.appVersion ?? "";
result.forEach((value, key) => {
this.appVersionCode = res.appVersionCode ?? "";
const item = {
this.appLanguage = res.appLanguage ?? "";
label: key,
this.isUniAppX = res.isUniAppX ? "是": "否";
value: "" + value
this.version = res.version ?? "";
} as Item;
this.items.push(item);
})
}
}
}
}
}
}
...
...
pages/API/get-device-info/get-device-info.uvue
浏览文件 @
ce6c6e9e
...
@@ -3,68 +3,14 @@
...
@@ -3,68 +3,14 @@
<page-head :title="title"></page-head>
<page-head :title="title"></page-head>
<view class="uni-common-mt">
<view class="uni-common-mt">
<view class="uni-list">
<view class="uni-list">
<view class="uni-list-cell">
<view class="uni-list">
<view class="uni-pd">
<view class="uni-list-cell" v-for="(item,_) in items" style="align-items: center;">
<view class="uni-label" style="width:180px;">设备品牌</view>
<view class="uni-pd">
</view>
<view class="uni-label" style="width:180px;">{{item.label}}</view>
<view class="uni-list-cell-db">
</view>
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="deviceBrand"/>
<view class="uni-list-cell-db">
</view>
<textarea :auto-height="true" :disabled="true" placeholder="未获取" :value="item.value" />
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">设备 id </view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="deviceId"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">设备型号</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="deviceModel"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">设备类型</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="deviceType"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">设备方向</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="deviceOrientation"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">设备像素比</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="devicePixelRatio"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">操作系统及版本</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="system"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">客户端平台</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="platform"/>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -77,18 +23,15 @@
...
@@ -77,18 +23,15 @@
</view>
</view>
</template>
</template>
<script>
<script>
type Item = {
label : string,
value : string,
}
export default {
export default {
data() {
data() {
return {
return {
title: 'getDeviceInfo',
title: 'getDeviceInfo',
deviceBrand:"",
items: [] as Item[],
deviceId:"",
deviceModel:"",
deviceType:"",
deviceOrientation:"",
devicePixelRatio:"",
system:"",
platform:""
}
}
},
},
onUnload:function(){
onUnload:function(){
...
@@ -96,14 +39,15 @@
...
@@ -96,14 +39,15 @@
methods: {
methods: {
getDeviceInfo: function () {
getDeviceInfo: function () {
const res = uni.getDeviceInfo();
const res = uni.getDeviceInfo();
this.deviceBrand = res.deviceBrand ?? "";
const json = JSON.stringify(res);
this.deviceId = res.deviceId ?? "";
const result = JSON.parse<Map<string, any>>(json);
this.deviceModel = res.deviceModel ?? "";
result.forEach((value, key) => {
this.deviceType = res.deviceType ?? "";
const item = {
this.deviceOrientation = res.deviceOrientation ?? "";
label: key,
this.devicePixelRatio = res.devicePixelRatio + "";
value: "" + value
this.system = res.system ?? "";
} as Item;
this.platform = res.platform ?? "";
this.items.push(item);
})
}
}
}
}
}
}
...
...
pages/API/get-system-info/get-system-info.uvue
浏览文件 @
ce6c6e9e
...
@@ -3,100 +3,12 @@
...
@@ -3,100 +3,12 @@
<page-head :title="title"></page-head>
<page-head :title="title"></page-head>
<view class="uni-common-mt">
<view class="uni-common-mt">
<view class="uni-list">
<view class="uni-list">
<view class="uni-list-cell">
<view class="uni-list-cell"
v-for="(item,_) in items" style="align-items: center;"
>
<view class="uni-pd">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">
设备型号
</view>
<view class="uni-label" style="width:180px;">
{{item.label}}
</view>
</view>
</view>
<view class="uni-list-cell-db">
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="model"/>
<textarea :auto-height="true" :disabled="true" placeholder="未获取" :value="item.value" />
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">客户端平台</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="platform"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">操作系统版本</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="system"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">语言</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="language"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">版本</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="version"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">屏幕宽度</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="screenWidth"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">屏幕高度</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="screenHeight"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">可使用窗口高度</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="windowHeight"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">可使用窗口的顶部位置</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="windowTop"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">可使用窗口的底部位置</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="windowBottom"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">状态栏的高度</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="statusBarHeight"/>
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">DPI</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="pixelRatio"/>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -108,52 +20,34 @@
...
@@ -108,52 +20,34 @@
</view>
</view>
</view>
</view>
</template>
</template>
<script>
<script>
type Item = {
label : string,
value : string,
}
export default {
export default {
data() {
data() {
return {
return {
title: 'getSystemInfo',
title: 'getSystemInfo',
model:"",
items: [] as Item[],
platform:"",
system:"",
language:"",
version:"",
screenWidth:"",
screenHeight:"",
windowHeight:"",
windowTop:"",
windowBottom:"",
statusBarHeight:"",
pixelRatio:"",
SDKVersion:""
}
}
},
},
onUnload:
function()
{
onUnload:
function ()
{
},
},
methods: {
methods: {
getSystemInfo: function () {
getSystemInfo: function () {
uni.getSystemInfo({
uni.getSystemInfo({
success: (res) => {
success: (res) => {
console.log('SystemInfo: ',res);
const json = JSON.stringify(res);
this.model = res.model;
const result = JSON.parse<Map<string, any>>(json);
this.platform = res.platform;
result.forEach((value, key) => {
this.system = res.system;
const item = {
this.language = res.language ?? "";
label: key,
this.version = res.version;
value: "" + value
this.screenWidth = res.screenWidth + "";
} as Item;
this.screenHeight = res.screenHeight + "";
this.items.push(item);
this.windowHeight = res.windowHeight + "";
})
this.windowTop = res.windowTop + "";
},
this.windowBottom = res.windowBottom + "";
const statusBarHeight = res.statusBarHeight;
if (statusBarHeight == null){
this.statusBarHeight = "";
}else{
this.statusBarHeight = statusBarHeight + "";
}
this.pixelRatio = res.pixelRatio + "";
this.SDKVersion = res.SDKVersion;
}
})
})
}
}
}
}
...
@@ -164,4 +58,4 @@
...
@@ -164,4 +58,4 @@
.uni-pd {
.uni-pd {
padding-left: 30rpx;
padding-left: 30rpx;
}
}
</style>
</style>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录