feat(rtos): 首次发布手机真机调试桥与S2探针
这个提交包含在:
当前提交
2f0f4b9702
59 个文件已更改
+4303
没有与搜索条件相匹配的文件
@@ -0,0 +1,6 @@
|
||||
export default {
|
||||
onCreate() { console.log('RTOS_DEVICE_PROBE_APP_CREATE_V1'); },
|
||||
onShow() { console.log('RTOS_DEVICE_PROBE_APP_SHOW_V1'); },
|
||||
onHide() { console.log('RTOS_DEVICE_PROBE_APP_HIDE_V1'); },
|
||||
onDestroy() { console.log('RTOS_DEVICE_PROBE_APP_DESTROY_V1'); }
|
||||
};
|
||||
二进制文件未显示。
|
之后 宽度: | 高度: | 大小: 2.1 KiB |
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<p class="title">真机链路验证</p>
|
||||
<p class="status">手机桥接 · S2 · 1.0.4</p>
|
||||
<p class="body">{{ screenStatus }}</p>
|
||||
<p class="body">点击次数:{{ count }}</p>
|
||||
<button on:click="tap">点击验证</button>
|
||||
</div>
|
||||
</template>
|
||||
<style>
|
||||
.page { width: 100%; height: 100%; background-color: #102338; align-items: center; justify-content: center; flex-direction: column; padding: 48px 42px; }
|
||||
.title { color: #ffffff; font-size: 1.15rem; margin-bottom: 12px; }
|
||||
.status { color: #83ddd4; font-size: 0.8rem; margin-bottom: 20px; }
|
||||
.body { color: #e1e9f2; font-size: 0.8rem; margin-bottom: 12px; }
|
||||
button { width: 220px; height: 60px; margin-top: 12px; font-size: 0.8rem; }
|
||||
</style>
|
||||
<script>
|
||||
export default {
|
||||
data: { count: 0, screenStatus: '页面已就绪' },
|
||||
screenEpoch: 0,
|
||||
screenActive: false,
|
||||
wakeTimer: null,
|
||||
onReady() { console.log('RTOS_DEVICE_PROBE_READY_V1'); },
|
||||
onShow() { this.keepScreen(true); },
|
||||
onHide() { this.keepScreen(false); },
|
||||
onDestroy() { this.keepScreen(false); },
|
||||
keepScreen(on) {
|
||||
if (on && this.screenActive) return;
|
||||
this.screenActive = on;
|
||||
const epoch = ++this.screenEpoch;
|
||||
if (this.wakeTimer !== null) { clearInterval(this.wakeTimer); this.wakeTimer = null; }
|
||||
try {
|
||||
const brightness = require('@system.brightness').default;
|
||||
const result = brightness.setKeepScreenOn(on);
|
||||
this.screenStatus = on ? '常亮待实测' : '已释放常亮';
|
||||
Promise.resolve(result).catch(() => {
|
||||
if (epoch === this.screenEpoch) this.screenStatus = '当前固件未接受常亮';
|
||||
});
|
||||
if (on) {
|
||||
if (typeof brightness.wakeScreenOn !== 'function') {
|
||||
this.screenStatus = '固件缺少亮屏接口';
|
||||
return;
|
||||
}
|
||||
if (!this.wakeScreen(brightness, epoch)) return;
|
||||
this.wakeTimer = setInterval(() => this.wakeScreen(brightness, epoch), 15000);
|
||||
}
|
||||
} catch (error) { this.screenStatus = '当前固件不支持常亮'; }
|
||||
},
|
||||
wakeScreen(brightness, epoch) {
|
||||
if (!this.screenActive || epoch !== this.screenEpoch) return false;
|
||||
try {
|
||||
// The official API documents an omitted timeout as unlimited.
|
||||
const result = brightness.wakeScreenOn({ screenOn: true });
|
||||
this.screenStatus = '常亮续期中 · 待实测';
|
||||
Promise.resolve(result).catch(() => {
|
||||
if (this.screenActive && epoch === this.screenEpoch) {
|
||||
if (this.wakeTimer !== null) { clearInterval(this.wakeTimer); this.wakeTimer = null; }
|
||||
this.screenStatus = '固件未接受亮屏';
|
||||
}
|
||||
});
|
||||
return true;
|
||||
} catch (error) {
|
||||
if (this.wakeTimer !== null) { clearInterval(this.wakeTimer); this.wakeTimer = null; }
|
||||
this.screenStatus = '亮屏调用失败';
|
||||
return false;
|
||||
}
|
||||
},
|
||||
tap() { this.count += 1; console.log('RTOS_DEVICE_PROBE_TAP_V1=' + this.count); }
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"package": "com.sydxky.rtos.deviceprobe",
|
||||
"name": "真机链路验证",
|
||||
"icon": "/assets/icon.png",
|
||||
"versionName": "1.0.4",
|
||||
"versionCode": 10004,
|
||||
"features": [],
|
||||
"router": { "entry": "main", "pages": { "main": { "component": "index" } } },
|
||||
"config": { "designWidth": 410 }
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户