refactor: 确立独立子工程架构 (backend, admin, mpuniapp) 并同步更新 AGENTS.md 规范

这个提交包含在:
wikiboss
2026-09-20 17:05:22 +08:00
父节点 de3cf8b870
当前提交 9fa1d1fbd0
共有 1679 个文件被更改,包括 204798 次插入 和 16817 次删除

查看文件

@@ -0,0 +1,42 @@
const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
const isWeb = platformInfo.startsWith('web')
const isAppWebView = process.env.UNI_AUTOMATOR_APP_WEBVIEW == 'true'
const isMP = platformInfo.startsWith('mp')
describe('ExtApi-GetSystemSetting', () => {
if (isWeb || isAppWebView || isMP) {
it('web', () => {
expect(1).toBe(1)
})
return
}
const PAGE_PATH = '/pages/API/get-system-setting/get-system-setting'
let page;
let res;
beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor(600);
res = await uni.getSystemSetting()
});
it('Check GetSystemSetting', async () => {
for (const key in res) {
const value = res[key];
if (res['bluetoothEnabled'] == undefined || res['bluetoothEnabled'] === false) {
expect(res['bluetoothError']).not.toBe("")
} else {
expect(res['bluetoothError'] == undefined).toBe(true)
}
if (res['wifiEnabled'] == undefined) {
expect(res['wifiError']).not.toBe("")
} else {
expect(res['wifiError'] == undefined).toBe(true)
}
if (key == 'deviceOrientation') {
expect(['portrait', 'landscape']).toContain(value);
}
}
});
});

查看文件

@@ -0,0 +1,84 @@
<template>
<page-head :title="title"></page-head>
<view class="uni-common-mt">
<view class="uni-list">
<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 type="text" :disabled="true" placeholder="未获取" :value="data.bluetoothEnabled" />
</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 type="text" :disabled="true" placeholder="未获取" :value="data.locationEnabled" />
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">Wi-Fi 的系统开关</view>
</view>
<view class="uni-list-cell-db">
<input type="text" :disabled="true" placeholder="未获取" :value="data.wifiEnabled" />
</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 type="text" :disabled="true" placeholder="未获取" :value="data.deviceOrientation" />
</view>
</view>
</view>
<view class="uni-padding-wrap">
<view class="uni-btn-v">
<button type="primary" @tap="getSystemSetting">获取系统设置</button>
</view>
</view>
</view>
</template>
<script setup lang="uts">
type DataType = {
bluetoothEnabled: string;
locationEnabled: string;
wifiEnabled: string;
deviceOrientation: string;
}
const title = ref('getSystemSetting')
const data = reactive({
bluetoothEnabled: "",
locationEnabled: "",
wifiEnabled: "",
deviceOrientation: ""
} as DataType)
const getSystemSetting = () => {
const res = uni.getSystemSetting();
data.bluetoothEnabled = (res.bluetoothEnabled ?? false) ? "开启" : "关闭";
data.locationEnabled = res.locationEnabled ? "开启" : "关闭";
data.wifiEnabled = (res.wifiEnabled ?? false) ? "开启" : "关闭";
data.deviceOrientation = res.deviceOrientation
if (res.bluetoothError != null) {
data.bluetoothEnabled = "无蓝牙权限"
}
if (res.wifiError != null) {
data.wifiEnabled = "无WiFi权限"
}
}
</script>
<style>
.uni-pd {
padding-left: 15px;
}
</style>