vite-uni-dev-tool 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/const.cjs +1 -1
- package/dist/const.d.ts +1 -0
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +1 -1
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +2 -2
- package/dist/i18n/locales/en.cjs +1 -1
- package/dist/i18n/locales/en.d.ts +5 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +1 -1
- package/dist/i18n/locales/zh-Hans.cjs +1 -1
- package/dist/i18n/locales/zh-Hans.d.ts +5 -0
- package/dist/i18n/locales/zh-Hans.d.ts.map +1 -1
- package/dist/i18n/locales/zh-Hans.js +1 -1
- package/dist/modules/devIntercept/index.cjs +9 -9
- package/dist/modules/devIntercept/index.d.ts +1 -1
- package/dist/modules/devIntercept/index.d.ts.map +1 -1
- package/dist/modules/devIntercept/index.js +9 -9
- package/dist/modules/devStore/index.cjs +1 -1
- package/dist/modules/devStore/index.d.ts.map +1 -1
- package/dist/modules/devStore/index.js +1 -1
- package/dist/plugins/uniDevTool/transform/transformMain.cjs +3 -3
- package/dist/plugins/uniDevTool/transform/transformMain.d.ts +2 -1
- package/dist/plugins/uniDevTool/transform/transformMain.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformMain.js +3 -3
- package/dist/plugins/uniDevTool/transform/transformVue.cjs +31 -25
- package/dist/plugins/uniDevTool/transform/transformVue.d.ts +2 -1
- package/dist/plugins/uniDevTool/transform/transformVue.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformVue.js +30 -24
- package/dist/plugins/uniDevTool/uniDevTool.cjs +3 -3
- package/dist/plugins/uniDevTool/uniDevTool.d.ts +3 -1
- package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/uniDevTool.js +3 -3
- package/dist/type.d.ts +3 -0
- package/dist/type.d.ts.map +1 -1
- package/dist/v3/DevTool/components/BluetoothList/BluetoothItem.vue +199 -199
- package/dist/v3/DevTool/components/BluetoothList/BluetoothTool.vue +730 -730
- package/dist/v3/DevTool/components/BluetoothList/index.vue +167 -167
- package/dist/v3/DevTool/components/CaptureScreen/index.vue +109 -109
- package/dist/v3/DevTool/components/ConsoleList/ConsoleItem.vue +230 -225
- package/dist/v3/DevTool/components/ConsoleList/RunJSInput.vue +247 -247
- package/dist/v3/DevTool/components/ConsoleList/index.vue +171 -171
- package/dist/v3/DevTool/components/ConsoleList/staticTips.ts +1145 -1145
- package/dist/v3/DevTool/components/DevToolTitle/index.vue +24 -24
- package/dist/v3/DevTool/components/DevToolWindow/DevToolOverlay.vue +197 -197
- package/dist/v3/DevTool/components/DevToolWindow/hooks/dataUtils.ts +48 -48
- package/dist/v3/DevTool/components/DevToolWindow/hooks/useDevToolData.ts +387 -387
- package/dist/v3/DevTool/components/DevToolWindow/hooks/useDevToolHandlers.ts +629 -629
- package/dist/v3/DevTool/components/DevToolWindow/hooks/useDevToolOverlay.ts +201 -197
- package/dist/v3/DevTool/components/ElEvent/ElEventItem.vue +105 -105
- package/dist/v3/DevTool/components/ElEvent/index.vue +106 -106
- package/dist/v3/DevTool/components/Instance/components/InstanceTreeNode.vue +265 -265
- package/dist/v3/DevTool/components/Instance/flatten.ts +226 -226
- package/dist/v3/DevTool/components/Instance/index.vue +94 -94
- package/dist/v3/DevTool/components/Instance/registry.ts +49 -49
- package/dist/v3/DevTool/components/Instance/transformTree.ts +375 -375
- package/dist/v3/DevTool/components/Instance/transformTreeCtx.ts +268 -268
- package/dist/v3/DevTool/components/Instance/typing.d.ts +43 -43
- package/dist/v3/DevTool/components/InstanceDetail/index.vue +485 -485
- package/dist/v3/DevTool/components/JsonDetail/index.vue +70 -70
- package/dist/v3/DevTool/components/NFCList/NFCItem.vue +112 -112
- package/dist/v3/DevTool/components/NFCList/NFCTool.vue +454 -454
- package/dist/v3/DevTool/components/NFCList/const.ts +56 -56
- package/dist/v3/DevTool/components/NFCList/index.vue +94 -94
- package/dist/v3/DevTool/components/NetworkList/InterceptConfig.vue +624 -624
- package/dist/v3/DevTool/components/NetworkList/InterceptItem.vue +140 -140
- package/dist/v3/DevTool/components/NetworkList/NetworkDetail.vue +287 -287
- package/dist/v3/DevTool/components/NetworkList/NetworkIntercept.vue +88 -88
- package/dist/v3/DevTool/components/NetworkList/NetworkItem.vue +163 -163
- package/dist/v3/DevTool/components/NetworkList/NetworkSend.vue +589 -589
- package/dist/v3/DevTool/components/NetworkList/const.ts +4 -4
- package/dist/v3/DevTool/components/NetworkList/hooks/useNetworkForm.ts +86 -86
- package/dist/v3/DevTool/components/NetworkList/index.vue +160 -160
- package/dist/v3/DevTool/components/NetworkList/utils.ts +101 -101
- package/dist/v3/DevTool/components/Performance/index.vue +498 -498
- package/dist/v3/DevTool/components/Performance/modules/PerformanceMetrics.vue +153 -153
- package/dist/v3/DevTool/components/Performance/modules/usePerformanceChart.ts +460 -460
- package/dist/v3/DevTool/components/Performance/modules/usePerformanceData.ts +258 -258
- package/dist/v3/DevTool/components/PiniaList/index.vue +93 -93
- package/dist/v3/DevTool/components/RunJS/index.vue +148 -148
- package/dist/v3/DevTool/components/ScanCodeList/ScanCodeItem.vue +97 -97
- package/dist/v3/DevTool/components/ScanCodeList/index.vue +100 -100
- package/dist/v3/DevTool/components/SettingButton/index.vue +45 -45
- package/dist/v3/DevTool/components/SettingList/index.vue +218 -218
- package/dist/v3/DevTool/components/SettingList/modules/SettingBarrage.vue +304 -304
- package/dist/v3/DevTool/components/SettingList/modules/SettingDevTool.vue +212 -212
- package/dist/v3/DevTool/components/SettingList/modules/SettingInfo.vue +157 -157
- package/dist/v3/DevTool/components/SettingList/modules/SettingLanguage.vue +74 -74
- package/dist/v3/DevTool/components/SettingList/modules/SettingLog.vue +230 -230
- package/dist/v3/DevTool/components/SettingList/typing.d.ts +2 -2
- package/dist/v3/DevTool/components/SourceCode/Line.vue +127 -127
- package/dist/v3/DevTool/components/SourceCode/parseCode.ts +609 -609
- package/dist/v3/DevTool/components/StorageList/index.vue +174 -174
- package/dist/v3/DevTool/components/TransferList/TransferDetail.vue +268 -268
- package/dist/v3/DevTool/components/VuexList/index.vue +84 -84
- package/dist/v3/DevTool/index.vue +1 -0
- package/dist/v3/components/AppTransition/index.vue +176 -176
- package/dist/v3/components/AutoSizer/index.vue +192 -192
- package/dist/v3/components/AutoSizer/index1.vue +184 -184
- package/dist/v3/components/AutoSizer/utils.ts +49 -49
- package/dist/v3/components/Barrage/BarrageItem.vue +137 -137
- package/dist/v3/components/Barrage/index.vue +202 -202
- package/dist/v3/components/CircularButton/index.vue +84 -84
- package/dist/v3/components/CustomSwiper/CustomSwiperItem.vue +49 -49
- package/dist/v3/components/CustomSwiper/index.vue +104 -104
- package/dist/v3/components/DevErrorBoundary/index.vue +380 -0
- package/dist/v3/components/Empty/index.vue +29 -29
- package/dist/v3/components/FilterSelect/index.vue +179 -179
- package/dist/v3/components/JsonPretty/components/Brackets/index.vue +27 -27
- package/dist/v3/components/JsonPretty/components/Carets/index.vue +59 -59
- package/dist/v3/components/JsonPretty/components/CheckController/index.vue +136 -136
- package/dist/v3/components/JsonPretty/components/TreeNode/index.vue +387 -387
- package/dist/v3/components/JsonPretty/hooks/useClipboard.ts +21 -21
- package/dist/v3/components/JsonPretty/hooks/useError.ts +21 -21
- package/dist/v3/components/JsonPretty/type.ts +127 -127
- package/dist/v3/components/JsonPretty/utils/index.ts +169 -169
- package/dist/v3/components/MovableContainer/index.vue +8 -4
- package/dist/v3/components/Pick/index.vue +322 -322
- package/dist/v3/components/Tag/index.vue +113 -113
- package/dist/v3/components/VirtualList/AutoSize.vue +40 -40
- package/dist/v3/components/VirtualList/index.vue +416 -416
- package/dist/v3/hooks/useBluetooth/index.ts +561 -561
- package/dist/v3/hooks/useContainerStyle.ts +153 -153
- package/dist/v3/hooks/useNFC/index.ts +107 -107
- package/dist/v3/hooks/useNFC/typing.d.ts +396 -396
- package/dist/v3/hooks/useNFC/useNFCAndroid.ts +966 -966
- package/dist/v3/hooks/useNFC/useNFCMpWeiXin.ts +812 -812
- package/dist/v3/hooks/useNFC/utils.ts +754 -754
- package/dist/v3/hooks/useRequest/index.ts +586 -586
- package/dist/v3/hooks/useRequest/utils.ts +267 -267
- package/dist/v3/hooks/useScanCode/index.ts +206 -206
- package/dist/v3/hooks/useWebsocket/index.ts +253 -253
- package/dist/v3/styles/theme.ts +12 -12
- package/package.json +9 -1
|
@@ -1,157 +1,157 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="setting-item">
|
|
3
|
-
<DevToolTitle>{{ t('setting.info.title') }}</DevToolTitle>
|
|
4
|
-
<view class="setting-item-content">
|
|
5
|
-
<template v-if="systemInfoBase">
|
|
6
|
-
<view class="setting-row">
|
|
7
|
-
<view>{{ t('setting.info.systemEnv') }}:</view>
|
|
8
|
-
<view>
|
|
9
|
-
{{ systemInfoBase.osName }} {{ systemInfoBase.osVersion }}
|
|
10
|
-
</view>
|
|
11
|
-
</view>
|
|
12
|
-
<view class="setting-row">
|
|
13
|
-
<view>{{ t('setting.info.deviceBrand') }}:</view>
|
|
14
|
-
<view>
|
|
15
|
-
{{ systemInfoBase.deviceBrand }} {{ systemInfoBase.deviceModel }}
|
|
16
|
-
</view>
|
|
17
|
-
</view>
|
|
18
|
-
<view class="setting-row">
|
|
19
|
-
<view>{{ t('setting.info.hostVersion') }}:</view>
|
|
20
|
-
<view>
|
|
21
|
-
{{ systemInfoBase.hostName }} {{ systemInfoBase.hostVersion }}
|
|
22
|
-
</view>
|
|
23
|
-
</view>
|
|
24
|
-
<view class="setting-row">
|
|
25
|
-
<view>{{ t('setting.info.sdkVersion') }}:</view>
|
|
26
|
-
<view>{{ systemInfoBase.hostSDKVersion || 'N/A' }}</view>
|
|
27
|
-
</view>
|
|
28
|
-
<view class="setting-row">
|
|
29
|
-
<view>{{ t('setting.info.platform') }}:</view>
|
|
30
|
-
<view>{{ systemInfoBase.uniPlatform }}</view>
|
|
31
|
-
</view>
|
|
32
|
-
<view class="setting-row">
|
|
33
|
-
<SettingButton @click="onLookSystemInfo">
|
|
34
|
-
{{ t('setting.info.viewSystem') }}
|
|
35
|
-
</SettingButton>
|
|
36
|
-
</view>
|
|
37
|
-
</template>
|
|
38
|
-
|
|
39
|
-
<view class="setting-row">{{ t('setting.info.viewWindow') }}:</view>
|
|
40
|
-
<view class="setting-tips">
|
|
41
|
-
{{ t('setting.info.viewWindowTip') }}
|
|
42
|
-
</view>
|
|
43
|
-
<SettingButton @click="onLookWindowInfo">
|
|
44
|
-
{{ t('setting.info.viewWindow') }}
|
|
45
|
-
</SettingButton>
|
|
46
|
-
|
|
47
|
-
<view class="setting-row">{{ t('setting.info.viewDevice') }}:</view>
|
|
48
|
-
<view class="setting-tips">
|
|
49
|
-
{{ t('setting.info.viewDeviceTip') }}
|
|
50
|
-
</view>
|
|
51
|
-
<SettingButton @click="onLookDeviceInfo">
|
|
52
|
-
{{ t('setting.info.viewDevice') }}
|
|
53
|
-
</SettingButton>
|
|
54
|
-
|
|
55
|
-
<view class="setting-row">{{ t('setting.info.viewAppInfo') }}:</view>
|
|
56
|
-
<view class="setting-tips">
|
|
57
|
-
{{ t('setting.info.viewAppInfoTip') }}
|
|
58
|
-
</view>
|
|
59
|
-
<SettingButton @click="onLookAppInfo">
|
|
60
|
-
{{ t('setting.info.viewAppInfo') }}
|
|
61
|
-
</SettingButton>
|
|
62
|
-
</view>
|
|
63
|
-
</view>
|
|
64
|
-
</template>
|
|
65
|
-
|
|
66
|
-
<script setup lang="ts">
|
|
67
|
-
import DevToolTitle from '../../DevToolTitle/index.vue';
|
|
68
|
-
import SettingButton from '../../SettingButton/index.vue';
|
|
69
|
-
import { useI18n } from '../../../../../i18n';
|
|
70
|
-
import { onMounted, ref } from 'vue';
|
|
71
|
-
|
|
72
|
-
const { t } = useI18n();
|
|
73
|
-
const systemInfoBase = ref<any>(null);
|
|
74
|
-
|
|
75
|
-
onMounted(() => {
|
|
76
|
-
if (uni.getSystemInfoSync) {
|
|
77
|
-
try {
|
|
78
|
-
systemInfoBase.value = uni.getSystemInfoSync();
|
|
79
|
-
} catch (_e) {
|
|
80
|
-
// ignore
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
defineProps<{
|
|
86
|
-
theme?: string;
|
|
87
|
-
}>();
|
|
88
|
-
|
|
89
|
-
const emit = defineEmits<{
|
|
90
|
-
(e: 'openJson', data: { title: string; data: any }): void;
|
|
91
|
-
}>();
|
|
92
|
-
|
|
93
|
-
function onLookWindowInfo() {
|
|
94
|
-
if (uni.getWindowInfo) {
|
|
95
|
-
const windowInfo = uni.getWindowInfo();
|
|
96
|
-
emit('openJson', {
|
|
97
|
-
title: 'windowInfo',
|
|
98
|
-
data: windowInfo,
|
|
99
|
-
});
|
|
100
|
-
} else {
|
|
101
|
-
uni.showToast({
|
|
102
|
-
title: `${t('setting.info.notSupported')} uni.getWindowInfo`,
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
function onLookDeviceInfo() {
|
|
107
|
-
if (uni.getDeviceInfo) {
|
|
108
|
-
const deviceInfo = uni.getDeviceInfo();
|
|
109
|
-
emit('openJson', {
|
|
110
|
-
title: 'deviceInfo',
|
|
111
|
-
data: deviceInfo,
|
|
112
|
-
});
|
|
113
|
-
} else {
|
|
114
|
-
uni.showToast({
|
|
115
|
-
title: `${t('setting.info.notSupported')} uni.getDeviceInfo`,
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
async function onLookSystemInfo() {
|
|
120
|
-
if (uni.getSystemInfo) {
|
|
121
|
-
const systemInfo = await uni.getSystemInfo();
|
|
122
|
-
emit('openJson', {
|
|
123
|
-
title: 'systemInfo',
|
|
124
|
-
data: systemInfo,
|
|
125
|
-
});
|
|
126
|
-
} else {
|
|
127
|
-
uni.showToast({
|
|
128
|
-
title: `${t('setting.info.notSupported')} uni.getSystemInfo`,
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
function onLookAppInfo() {
|
|
133
|
-
if (uni.getAppBaseInfo) {
|
|
134
|
-
let appInfo = uni.getAppBaseInfo();
|
|
135
|
-
|
|
136
|
-
if (uni.getAppAuthorizeSetting) {
|
|
137
|
-
appInfo = {
|
|
138
|
-
...appInfo,
|
|
139
|
-
...uni.getAppAuthorizeSetting(),
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
emit('openJson', {
|
|
144
|
-
title: 'appInfo',
|
|
145
|
-
data: appInfo,
|
|
146
|
-
});
|
|
147
|
-
} else {
|
|
148
|
-
uni.showToast({
|
|
149
|
-
title: `${t('setting.info.notSupported')} uni.getAppInfo`,
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
</script>
|
|
154
|
-
|
|
155
|
-
<style scoped>
|
|
156
|
-
@import '../index.css';
|
|
157
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<view class="setting-item">
|
|
3
|
+
<DevToolTitle>{{ t('setting.info.title') }}</DevToolTitle>
|
|
4
|
+
<view class="setting-item-content">
|
|
5
|
+
<template v-if="systemInfoBase">
|
|
6
|
+
<view class="setting-row">
|
|
7
|
+
<view>{{ t('setting.info.systemEnv') }}:</view>
|
|
8
|
+
<view>
|
|
9
|
+
{{ systemInfoBase.osName }} {{ systemInfoBase.osVersion }}
|
|
10
|
+
</view>
|
|
11
|
+
</view>
|
|
12
|
+
<view class="setting-row">
|
|
13
|
+
<view>{{ t('setting.info.deviceBrand') }}:</view>
|
|
14
|
+
<view>
|
|
15
|
+
{{ systemInfoBase.deviceBrand }} {{ systemInfoBase.deviceModel }}
|
|
16
|
+
</view>
|
|
17
|
+
</view>
|
|
18
|
+
<view class="setting-row">
|
|
19
|
+
<view>{{ t('setting.info.hostVersion') }}:</view>
|
|
20
|
+
<view>
|
|
21
|
+
{{ systemInfoBase.hostName }} {{ systemInfoBase.hostVersion }}
|
|
22
|
+
</view>
|
|
23
|
+
</view>
|
|
24
|
+
<view class="setting-row">
|
|
25
|
+
<view>{{ t('setting.info.sdkVersion') }}:</view>
|
|
26
|
+
<view>{{ systemInfoBase.hostSDKVersion || 'N/A' }}</view>
|
|
27
|
+
</view>
|
|
28
|
+
<view class="setting-row">
|
|
29
|
+
<view>{{ t('setting.info.platform') }}:</view>
|
|
30
|
+
<view>{{ systemInfoBase.uniPlatform }}</view>
|
|
31
|
+
</view>
|
|
32
|
+
<view class="setting-row">
|
|
33
|
+
<SettingButton @click="onLookSystemInfo">
|
|
34
|
+
{{ t('setting.info.viewSystem') }}
|
|
35
|
+
</SettingButton>
|
|
36
|
+
</view>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<view class="setting-row">{{ t('setting.info.viewWindow') }}:</view>
|
|
40
|
+
<view class="setting-tips">
|
|
41
|
+
{{ t('setting.info.viewWindowTip') }}
|
|
42
|
+
</view>
|
|
43
|
+
<SettingButton @click="onLookWindowInfo">
|
|
44
|
+
{{ t('setting.info.viewWindow') }}
|
|
45
|
+
</SettingButton>
|
|
46
|
+
|
|
47
|
+
<view class="setting-row">{{ t('setting.info.viewDevice') }}:</view>
|
|
48
|
+
<view class="setting-tips">
|
|
49
|
+
{{ t('setting.info.viewDeviceTip') }}
|
|
50
|
+
</view>
|
|
51
|
+
<SettingButton @click="onLookDeviceInfo">
|
|
52
|
+
{{ t('setting.info.viewDevice') }}
|
|
53
|
+
</SettingButton>
|
|
54
|
+
|
|
55
|
+
<view class="setting-row">{{ t('setting.info.viewAppInfo') }}:</view>
|
|
56
|
+
<view class="setting-tips">
|
|
57
|
+
{{ t('setting.info.viewAppInfoTip') }}
|
|
58
|
+
</view>
|
|
59
|
+
<SettingButton @click="onLookAppInfo">
|
|
60
|
+
{{ t('setting.info.viewAppInfo') }}
|
|
61
|
+
</SettingButton>
|
|
62
|
+
</view>
|
|
63
|
+
</view>
|
|
64
|
+
</template>
|
|
65
|
+
|
|
66
|
+
<script setup lang="ts">
|
|
67
|
+
import DevToolTitle from '../../DevToolTitle/index.vue';
|
|
68
|
+
import SettingButton from '../../SettingButton/index.vue';
|
|
69
|
+
import { useI18n } from '../../../../../i18n';
|
|
70
|
+
import { onMounted, ref } from 'vue';
|
|
71
|
+
|
|
72
|
+
const { t } = useI18n();
|
|
73
|
+
const systemInfoBase = ref<any>(null);
|
|
74
|
+
|
|
75
|
+
onMounted(() => {
|
|
76
|
+
if (uni.getSystemInfoSync) {
|
|
77
|
+
try {
|
|
78
|
+
systemInfoBase.value = uni.getSystemInfoSync();
|
|
79
|
+
} catch (_e) {
|
|
80
|
+
// ignore
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
defineProps<{
|
|
86
|
+
theme?: string;
|
|
87
|
+
}>();
|
|
88
|
+
|
|
89
|
+
const emit = defineEmits<{
|
|
90
|
+
(e: 'openJson', data: { title: string; data: any }): void;
|
|
91
|
+
}>();
|
|
92
|
+
|
|
93
|
+
function onLookWindowInfo() {
|
|
94
|
+
if (uni.getWindowInfo) {
|
|
95
|
+
const windowInfo = uni.getWindowInfo();
|
|
96
|
+
emit('openJson', {
|
|
97
|
+
title: 'windowInfo',
|
|
98
|
+
data: windowInfo,
|
|
99
|
+
});
|
|
100
|
+
} else {
|
|
101
|
+
uni.showToast({
|
|
102
|
+
title: `${t('setting.info.notSupported')} uni.getWindowInfo`,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function onLookDeviceInfo() {
|
|
107
|
+
if (uni.getDeviceInfo) {
|
|
108
|
+
const deviceInfo = uni.getDeviceInfo();
|
|
109
|
+
emit('openJson', {
|
|
110
|
+
title: 'deviceInfo',
|
|
111
|
+
data: deviceInfo,
|
|
112
|
+
});
|
|
113
|
+
} else {
|
|
114
|
+
uni.showToast({
|
|
115
|
+
title: `${t('setting.info.notSupported')} uni.getDeviceInfo`,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
async function onLookSystemInfo() {
|
|
120
|
+
if (uni.getSystemInfo) {
|
|
121
|
+
const systemInfo = await uni.getSystemInfo();
|
|
122
|
+
emit('openJson', {
|
|
123
|
+
title: 'systemInfo',
|
|
124
|
+
data: systemInfo,
|
|
125
|
+
});
|
|
126
|
+
} else {
|
|
127
|
+
uni.showToast({
|
|
128
|
+
title: `${t('setting.info.notSupported')} uni.getSystemInfo`,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
function onLookAppInfo() {
|
|
133
|
+
if (uni.getAppBaseInfo) {
|
|
134
|
+
let appInfo = uni.getAppBaseInfo();
|
|
135
|
+
|
|
136
|
+
if (uni.getAppAuthorizeSetting) {
|
|
137
|
+
appInfo = {
|
|
138
|
+
...appInfo,
|
|
139
|
+
...uni.getAppAuthorizeSetting(),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
emit('openJson', {
|
|
144
|
+
title: 'appInfo',
|
|
145
|
+
data: appInfo,
|
|
146
|
+
});
|
|
147
|
+
} else {
|
|
148
|
+
uni.showToast({
|
|
149
|
+
title: `${t('setting.info.notSupported')} uni.getAppInfo`,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
</script>
|
|
154
|
+
|
|
155
|
+
<style scoped>
|
|
156
|
+
@import '../index.css';
|
|
157
|
+
</style>
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view class="setting-item">
|
|
3
|
-
<DevToolTitle>{{ t('setting.devTool.language') }}</DevToolTitle>
|
|
4
|
-
<view class="setting-item-content">
|
|
5
|
-
<view class="setting-row">
|
|
6
|
-
<view>{{ t('setting.devTool.languageTip') }}:</view>
|
|
7
|
-
<Pick
|
|
8
|
-
:modelValue="selectedLanguage"
|
|
9
|
-
:options="languageOptions"
|
|
10
|
-
:readonly="true"
|
|
11
|
-
customStyle="width: 100px; flex: none;"
|
|
12
|
-
@change="onLanguageChange" />
|
|
13
|
-
</view>
|
|
14
|
-
<SettingButton @click="onConfirm" style="margin-top: 10px">
|
|
15
|
-
{{ t('setting.devTool.confirmLanguage') }}
|
|
16
|
-
</SettingButton>
|
|
17
|
-
</view>
|
|
18
|
-
</view>
|
|
19
|
-
</template>
|
|
20
|
-
|
|
21
|
-
<script setup lang="ts">
|
|
22
|
-
import { computed, ref } from 'vue';
|
|
23
|
-
import DevToolTitle from '../../DevToolTitle/index.vue';
|
|
24
|
-
import Pick from '../../../../components/Pick/index.vue';
|
|
25
|
-
import SettingButton from '../../SettingButton/index.vue';
|
|
26
|
-
import { useI18n } from '../../../../../i18n';
|
|
27
|
-
|
|
28
|
-
const { t, locale, setLocale } = useI18n();
|
|
29
|
-
|
|
30
|
-
defineProps<{
|
|
31
|
-
theme?: string;
|
|
32
|
-
}>();
|
|
33
|
-
|
|
34
|
-
const emit = defineEmits<{
|
|
35
|
-
(e: 'restartApp'): void;
|
|
36
|
-
}>();
|
|
37
|
-
|
|
38
|
-
const selectedLanguage = ref(locale.value);
|
|
39
|
-
|
|
40
|
-
const languageOptions = computed(() => [
|
|
41
|
-
{
|
|
42
|
-
label: '中文',
|
|
43
|
-
value: 'zh-Hans',
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
label: 'English',
|
|
47
|
-
value: 'en',
|
|
48
|
-
},
|
|
49
|
-
]);
|
|
50
|
-
|
|
51
|
-
function onLanguageChange(item: { label: string; value: any }) {
|
|
52
|
-
selectedLanguage.value = item.value;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function onConfirm() {
|
|
56
|
-
if (selectedLanguage.value === locale.value) return;
|
|
57
|
-
|
|
58
|
-
setLocale(selectedLanguage.value);
|
|
59
|
-
|
|
60
|
-
uni.showToast({
|
|
61
|
-
title: t('setting.devTool.confirmLanguageTip'),
|
|
62
|
-
icon: 'none',
|
|
63
|
-
duration: 1500,
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
setTimeout(() => {
|
|
67
|
-
emit('restartApp');
|
|
68
|
-
}, 1500);
|
|
69
|
-
}
|
|
70
|
-
</script>
|
|
71
|
-
|
|
72
|
-
<style scoped>
|
|
73
|
-
@import '../index.css';
|
|
74
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<view class="setting-item">
|
|
3
|
+
<DevToolTitle>{{ t('setting.devTool.language') }}</DevToolTitle>
|
|
4
|
+
<view class="setting-item-content">
|
|
5
|
+
<view class="setting-row">
|
|
6
|
+
<view>{{ t('setting.devTool.languageTip') }}:</view>
|
|
7
|
+
<Pick
|
|
8
|
+
:modelValue="selectedLanguage"
|
|
9
|
+
:options="languageOptions"
|
|
10
|
+
:readonly="true"
|
|
11
|
+
customStyle="width: 100px; flex: none;"
|
|
12
|
+
@change="onLanguageChange" />
|
|
13
|
+
</view>
|
|
14
|
+
<SettingButton @click="onConfirm" style="margin-top: 10px">
|
|
15
|
+
{{ t('setting.devTool.confirmLanguage') }}
|
|
16
|
+
</SettingButton>
|
|
17
|
+
</view>
|
|
18
|
+
</view>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
import { computed, ref } from 'vue';
|
|
23
|
+
import DevToolTitle from '../../DevToolTitle/index.vue';
|
|
24
|
+
import Pick from '../../../../components/Pick/index.vue';
|
|
25
|
+
import SettingButton from '../../SettingButton/index.vue';
|
|
26
|
+
import { useI18n } from '../../../../../i18n';
|
|
27
|
+
|
|
28
|
+
const { t, locale, setLocale } = useI18n();
|
|
29
|
+
|
|
30
|
+
defineProps<{
|
|
31
|
+
theme?: string;
|
|
32
|
+
}>();
|
|
33
|
+
|
|
34
|
+
const emit = defineEmits<{
|
|
35
|
+
(e: 'restartApp'): void;
|
|
36
|
+
}>();
|
|
37
|
+
|
|
38
|
+
const selectedLanguage = ref(locale.value);
|
|
39
|
+
|
|
40
|
+
const languageOptions = computed(() => [
|
|
41
|
+
{
|
|
42
|
+
label: '中文',
|
|
43
|
+
value: 'zh-Hans',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: 'English',
|
|
47
|
+
value: 'en',
|
|
48
|
+
},
|
|
49
|
+
]);
|
|
50
|
+
|
|
51
|
+
function onLanguageChange(item: { label: string; value: any }) {
|
|
52
|
+
selectedLanguage.value = item.value;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function onConfirm() {
|
|
56
|
+
if (selectedLanguage.value === locale.value) return;
|
|
57
|
+
|
|
58
|
+
setLocale(selectedLanguage.value);
|
|
59
|
+
|
|
60
|
+
uni.showToast({
|
|
61
|
+
title: t('setting.devTool.confirmLanguageTip'),
|
|
62
|
+
icon: 'none',
|
|
63
|
+
duration: 1500,
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
setTimeout(() => {
|
|
67
|
+
emit('restartApp');
|
|
68
|
+
}, 1500);
|
|
69
|
+
}
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<style scoped>
|
|
73
|
+
@import '../index.css';
|
|
74
|
+
</style>
|