vite-uni-dev-tool 0.0.48 → 1.0.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 +20 -0
- package/dist/const.cjs +1 -0
- package/dist/const.d.ts +78 -161
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +1 -47
- package/dist/core-shared.d.ts +44 -0
- package/dist/core-shared.d.ts.map +1 -0
- package/dist/core-shared.js +1 -0
- package/dist/core.d.ts +2 -40
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +4 -159
- package/dist/i18n/index.cjs +1 -0
- package/dist/i18n/index.d.ts +9 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/instance.cjs +1 -0
- package/dist/i18n/instance.d.ts +15 -0
- package/dist/i18n/instance.d.ts.map +1 -0
- package/dist/i18n/instance.js +1 -0
- package/dist/i18n/locales/en.cjs +1 -0
- package/dist/i18n/locales/en.d.ts +470 -0
- package/dist/i18n/locales/en.d.ts.map +1 -0
- package/dist/i18n/locales/en.js +1 -0
- package/dist/i18n/locales/zh-Hans.cjs +1 -0
- package/dist/i18n/locales/zh-Hans.d.ts +476 -0
- package/dist/i18n/locales/zh-Hans.d.ts.map +1 -0
- package/dist/i18n/locales/zh-Hans.js +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/modules/devConsole/index.cjs +4 -0
- package/dist/{devConsole → modules/devConsole}/index.d.ts +1 -1
- package/dist/modules/devConsole/index.d.ts.map +1 -0
- package/dist/modules/devConsole/index.js +4 -0
- package/dist/modules/devEvent/index.cjs +5 -0
- package/dist/modules/devEvent/index.d.ts +115 -0
- package/dist/modules/devEvent/index.d.ts.map +1 -0
- package/dist/modules/devEvent/index.js +5 -0
- package/dist/modules/devIntercept/index.cjs +13 -0
- package/dist/modules/devIntercept/index.d.ts +71 -0
- package/dist/modules/devIntercept/index.d.ts.map +1 -0
- package/dist/modules/devIntercept/index.js +13 -0
- package/dist/modules/devStore/index.cjs +1 -0
- package/dist/modules/devStore/index.d.ts +159 -0
- package/dist/modules/devStore/index.d.ts.map +1 -0
- package/dist/modules/devStore/index.js +1 -0
- package/dist/modules/devToolInfo/index.cjs +1 -0
- package/dist/modules/devToolInfo/index.d.ts +27 -0
- package/dist/modules/devToolInfo/index.d.ts.map +1 -0
- package/dist/modules/devToolInfo/index.js +1 -0
- package/dist/plugins/uniDevTool/transform/transformApp.cjs +44 -0
- package/dist/plugins/uniDevTool/transform/transformApp.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformApp.js +17 -17
- package/dist/plugins/uniDevTool/transform/transformMain.cjs +3 -0
- 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 +41 -0
- package/dist/plugins/uniDevTool/transform/transformVue.d.ts +1 -2
- package/dist/plugins/uniDevTool/transform/transformVue.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformVue.js +32 -19
- package/dist/plugins/uniDevTool/uniDevTool.cjs +5 -0
- package/dist/plugins/uniDevTool/uniDevTool.d.ts +3 -11
- package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/uniDevTool.js +3 -3
- package/dist/plugins/uniGlobalComponents/uniGlobalComponents.cjs +19 -0
- package/dist/plugins/uniGlobalComponents/uniGlobalComponents.d.ts.map +1 -1
- package/dist/plugins/uniGlobalComponents/uniGlobalComponents.js +11 -19
- package/dist/plugins/uniParseStock/index.d.ts +10 -0
- package/dist/plugins/uniParseStock/index.d.ts.map +1 -0
- package/dist/plugins/utils/index.cjs +2 -0
- package/dist/plugins/utils/index.d.ts +1 -3
- package/dist/plugins/utils/index.d.ts.map +1 -1
- package/dist/plugins/utils/index.js +2 -2
- package/dist/shims-uni.d.ts +140 -0
- package/dist/type.d.ts +174 -16
- package/dist/type.d.ts.map +1 -1
- package/dist/utils/array.cjs +1 -0
- package/dist/utils/array.d.ts.map +1 -1
- package/dist/utils/array.js +1 -12
- package/dist/utils/date.cjs +1 -0
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/date.js +1 -59
- package/dist/utils/file.cjs +1 -0
- package/dist/utils/file.d.ts.map +1 -1
- package/dist/utils/file.js +1 -85
- package/dist/utils/function.cjs +1 -0
- package/dist/utils/function.d.ts +13 -0
- package/dist/utils/function.d.ts.map +1 -1
- package/dist/utils/function.js +1 -68
- package/dist/utils/index.cjs +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -63
- package/dist/utils/ip.cjs +1 -0
- package/dist/utils/ip.d.ts +1 -1
- package/dist/utils/ip.d.ts.map +1 -1
- package/dist/utils/ip.js +1 -45
- package/dist/utils/language.cjs +1 -0
- package/dist/utils/language.d.ts +2 -1
- package/dist/utils/language.d.ts.map +1 -1
- package/dist/utils/language.js +1 -63
- package/dist/utils/object.cjs +1 -0
- package/dist/utils/object.d.ts +4 -5
- package/dist/utils/object.d.ts.map +1 -1
- package/dist/utils/object.js +1 -136
- package/dist/utils/openLink.cjs +1 -0
- package/dist/utils/openLink.d.ts.map +1 -1
- package/dist/utils/openLink.js +1 -28
- package/dist/utils/page.cjs +1 -0
- package/dist/utils/page.d.ts.map +1 -1
- package/dist/utils/page.js +1 -7
- package/dist/utils/platform.cjs +1 -0
- package/dist/utils/platform.d.ts.map +1 -1
- package/dist/utils/platform.js +1 -17
- package/dist/utils/string.cjs +1 -0
- package/dist/utils/string.d.ts.map +1 -1
- package/dist/utils/string.js +1 -114
- package/dist/utils/utils.cjs +1 -0
- package/dist/utils/utils.d.ts +1 -1
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +1 -126
- package/dist/v3/AppTransition/index.vue +170 -0
- package/dist/v3/AutoSizer/index.vue +4 -5
- package/dist/v3/AutoSizer/index1.vue +4 -6
- package/dist/v3/AutoSizer/utils.ts +1 -1
- package/dist/v3/CaptureScreen/index.vue +19 -8
- package/dist/v3/CircularButton/index.vue +64 -13
- package/dist/v3/ConsoleList/ConsoleItem.vue +56 -5
- package/dist/v3/ConsoleList/RunJSInput.vue +10 -6
- package/dist/v3/ConsoleList/index.vue +51 -35
- package/dist/v3/CustomSwiper/CustomSwiperItem.vue +49 -0
- package/dist/v3/CustomSwiper/index.vue +104 -0
- package/dist/v3/DevTool/fps-collector.render.ts +148 -0
- package/dist/v3/DevTool/index.vue +209 -102
- package/dist/v3/DevToolButton/index.vue +40 -59
- package/dist/v3/DevToolTitle/index.vue +4 -1
- package/dist/v3/DevToolWindow/DevToolOverlay.vue +182 -0
- package/dist/v3/DevToolWindow/const.ts +47 -69
- package/dist/v3/DevToolWindow/hooks/dataUtils.ts +48 -0
- package/dist/v3/DevToolWindow/hooks/useDevToolData.ts +338 -0
- package/dist/v3/DevToolWindow/hooks/useDevToolHandlers.ts +549 -0
- package/dist/v3/DevToolWindow/hooks/useDevToolOverlay.ts +184 -0
- package/dist/v3/DevToolWindow/index.css +89 -0
- package/dist/v3/DevToolWindow/index.vue +800 -1450
- package/dist/v3/DraggableContainer/index.vue +456 -0
- package/dist/v3/ElEvent/ElEventItem.vue +4 -3
- package/dist/v3/ElEvent/index.vue +26 -9
- package/dist/v3/Empty/index.vue +1 -0
- package/dist/v3/FilterInput/index.vue +8 -22
- package/dist/v3/FilterSelect/index.vue +37 -24
- package/dist/v3/Instance/components/InstanceTreeNode.vue +265 -0
- package/dist/v3/Instance/flatten.ts +226 -0
- package/dist/v3/Instance/index.vue +94 -0
- package/dist/v3/Instance/registry.ts +49 -0
- package/dist/v3/Instance/transformTree.ts +375 -0
- package/dist/v3/Instance/transformTreeCtx.ts +268 -0
- package/dist/v3/{InstanceTree → Instance}/typing.d.ts +15 -2
- package/dist/v3/InstanceDetail/index.vue +433 -44
- package/dist/v3/JsonDetail/index.vue +12 -8
- package/dist/v3/JsonPretty/components/Brackets/index.vue +1 -0
- package/dist/v3/JsonPretty/components/Carets/index.vue +2 -1
- package/dist/v3/JsonPretty/components/CheckController/index.vue +26 -15
- package/dist/v3/JsonPretty/components/TreeNode/index.vue +42 -20
- package/dist/v3/JsonPretty/index.vue +60 -37
- package/dist/v3/JsonPretty/utils/index.ts +41 -44
- package/dist/v3/MovableContainer/index.vue +89 -0
- package/dist/v3/NFCList/NFCItem.vue +14 -14
- package/dist/v3/NFCList/NFCTool.vue +99 -81
- package/dist/v3/NFCList/index.vue +14 -10
- package/dist/v3/NetworkList/InterceptConfig.vue +154 -364
- package/dist/v3/NetworkList/InterceptItem.vue +14 -6
- package/dist/v3/NetworkList/NetworkDetail.vue +34 -29
- package/dist/v3/NetworkList/NetworkIntercept.vue +11 -8
- package/dist/v3/NetworkList/NetworkItem.vue +27 -11
- package/dist/v3/NetworkList/NetworkSend.vue +132 -290
- package/dist/v3/NetworkList/hooks/useNetworkForm.ts +86 -0
- package/dist/v3/NetworkList/index.vue +32 -24
- package/dist/v3/NetworkList/utils.ts +101 -0
- package/dist/v3/Performance/index.vue +495 -0
- package/dist/v3/Performance/modules/PerformanceMetrics.vue +153 -0
- package/dist/v3/Performance/modules/PerformanceWidget.vue +249 -0
- package/dist/v3/Performance/modules/usePerformanceChart.ts +460 -0
- package/dist/v3/Performance/modules/usePerformanceData.ts +258 -0
- package/dist/v3/Pick/index.vue +322 -0
- package/dist/v3/PiniaList/index.vue +38 -17
- package/dist/v3/RouteList/index.vue +32 -15
- package/dist/v3/RunJS/index.vue +30 -10
- package/dist/v3/ScanCodeList/ScanCodeItem.vue +2 -9
- package/dist/v3/ScanCodeList/index.vue +12 -9
- package/dist/v3/SettingButton/index.vue +45 -0
- package/dist/v3/SettingList/index.css +120 -0
- package/dist/v3/SettingList/index.vue +96 -537
- package/dist/v3/SettingList/modules/SettingDevTool.vue +208 -0
- package/dist/v3/SettingList/modules/SettingInfo.vue +119 -0
- package/dist/v3/SettingList/modules/SettingLanguage.vue +74 -0
- package/dist/v3/SettingList/modules/SettingLog.vue +230 -0
- package/dist/v3/SettingList/modules/SettingNetwork.vue +120 -0
- package/dist/v3/SettingList/modules/SettingTheme.vue +312 -0
- package/dist/v3/SourceCode/Line.vue +15 -2
- package/dist/v3/SourceCode/index.vue +25 -24
- package/dist/v3/SourceCode/parseCode.ts +114 -56
- package/dist/v3/StorageList/index.vue +33 -33
- package/dist/v3/Tabs/index.vue +31 -28
- package/dist/v3/Tag/index.vue +39 -20
- package/dist/v3/TransferList/TransferDetail.vue +268 -0
- package/dist/v3/TransferList/TransferItem.vue +125 -0
- package/dist/v3/TransferList/index.vue +181 -0
- package/dist/v3/UniEvent/UniEventItem.vue +1 -0
- package/dist/v3/UniEvent/index.vue +28 -29
- package/dist/v3/{VirtualListPro → VirtualList}/AutoSize.vue +1 -1
- package/dist/v3/VirtualList/index.vue +382 -82
- package/dist/v3/VuexList/index.vue +38 -17
- package/dist/v3/WebSocket/WebSocketDetail.vue +142 -80
- package/dist/v3/WebSocket/WebSocketItem.vue +10 -4
- package/dist/v3/WebSocket/index.vue +44 -30
- package/dist/v3/hooks/useNFC/index.ts +6 -6
- package/dist/v3/hooks/useNFC/typing.d.ts +2 -2
- package/dist/v3/hooks/useNFC/useNFCAndroid.ts +215 -626
- package/dist/v3/hooks/useNFC/useNFCMpWeiXin.ts +54 -85
- package/dist/v3/hooks/useNFC/utils.ts +3 -3
- package/dist/v3/hooks/useRequest/index.ts +2 -2
- package/dist/v3/hooks/useScanCode/index.ts +10 -8
- package/dist/v3/styles/theme.css +290 -0
- package/dist/v3/styles/theme.ts +12 -0
- package/package.json +25 -5
- package/dist/devConsole/index.d.ts.map +0 -1
- package/dist/devConsole/index.js +0 -273
- package/dist/devEvent/index.d.ts +0 -328
- package/dist/devEvent/index.d.ts.map +0 -1
- package/dist/devEvent/index.js +0 -697
- package/dist/devEventBus/index.d.ts +0 -42
- package/dist/devEventBus/index.d.ts.map +0 -1
- package/dist/devEventBus/index.js +0 -70
- package/dist/devIntercept/index.d.ts +0 -281
- package/dist/devIntercept/index.d.ts.map +0 -1
- package/dist/devIntercept/index.js +0 -949
- package/dist/devRunJS/index.d.ts +0 -67
- package/dist/devRunJS/index.d.ts.map +0 -1
- package/dist/devStore/index.d.ts +0 -199
- package/dist/devStore/index.d.ts.map +0 -1
- package/dist/devStore/index.js +0 -562
- package/dist/devToolInfo/index.d.ts +0 -17
- package/dist/devToolInfo/index.d.ts.map +0 -1
- package/dist/devToolInfo/index.js +0 -15
- package/dist/v3/AutoSizer/utils.d.ts +0 -5
- package/dist/v3/AutoSizer/utils.d.ts.map +0 -1
- package/dist/v3/ConsoleList/staticTips.d.ts +0 -13
- package/dist/v3/ConsoleList/staticTips.d.ts.map +0 -1
- package/dist/v3/DevToolWindow/const.d.ts +0 -46
- package/dist/v3/DevToolWindow/const.d.ts.map +0 -1
- package/dist/v3/InstanceTree/components/InstanceTreeNode.vue +0 -81
- package/dist/v3/InstanceTree/flatten.d.ts +0 -10
- package/dist/v3/InstanceTree/flatten.d.ts.map +0 -1
- package/dist/v3/InstanceTree/flatten.ts +0 -75
- package/dist/v3/InstanceTree/index.vue +0 -51
- package/dist/v3/InstanceTree/transformTree.d.ts +0 -17
- package/dist/v3/InstanceTree/transformTree.d.ts.map +0 -1
- package/dist/v3/InstanceTree/transformTree.ts +0 -237
- package/dist/v3/JsonPretty/hooks/useClipboard.d.ts +0 -4
- package/dist/v3/JsonPretty/hooks/useClipboard.d.ts.map +0 -1
- package/dist/v3/JsonPretty/hooks/useError.d.ts +0 -8
- package/dist/v3/JsonPretty/hooks/useError.d.ts.map +0 -1
- package/dist/v3/JsonPretty/type.d.ts +0 -94
- package/dist/v3/JsonPretty/type.d.ts.map +0 -1
- package/dist/v3/JsonPretty/utils/index.d.ts +0 -10
- package/dist/v3/JsonPretty/utils/index.d.ts.map +0 -1
- package/dist/v3/NFCList/const.d.ts +0 -13
- package/dist/v3/NFCList/const.d.ts.map +0 -1
- package/dist/v3/NetworkList/const.d.ts +0 -5
- package/dist/v3/NetworkList/const.d.ts.map +0 -1
- package/dist/v3/SourceCode/parseCode.d.ts +0 -27
- package/dist/v3/SourceCode/parseCode.d.ts.map +0 -1
- package/dist/v3/UploadList/UploadDetail.vue +0 -255
- package/dist/v3/UploadList/UploadItem.vue +0 -122
- package/dist/v3/UploadList/index.vue +0 -125
- package/dist/v3/VirtualListPro/index.vue +0 -229
- package/dist/v3/hooks/useContainerStyle.d.ts +0 -15
- package/dist/v3/hooks/useContainerStyle.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/index.d.ts +0 -5
- package/dist/v3/hooks/useNFC/index.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/useNFCAndroid.d.ts +0 -2
- package/dist/v3/hooks/useNFC/useNFCAndroid.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/useNFCMpWeiXin.d.ts +0 -2
- package/dist/v3/hooks/useNFC/useNFCMpWeiXin.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/utils.d.ts +0 -95
- package/dist/v3/hooks/useNFC/utils.d.ts.map +0 -1
- package/dist/v3/hooks/useRequest/index.d.ts +0 -126
- package/dist/v3/hooks/useRequest/index.d.ts.map +0 -1
- package/dist/v3/hooks/useRequest/utils.d.ts +0 -35
- package/dist/v3/hooks/useRequest/utils.d.ts.map +0 -1
- package/dist/v3/hooks/useScanCode/index.d.ts +0 -36
- package/dist/v3/hooks/useScanCode/index.d.ts.map +0 -1
- /package/dist/v3/{VirtualListPro → VirtualList}/readme.md +0 -0
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="nfc-item">
|
|
3
3
|
<view @click.stop="onOpenJson">
|
|
4
|
-
<view class="nfc-item-row">
|
|
4
|
+
<view class="nfc-item-row">
|
|
5
|
+
{{ t('nfc.tagId') }}: {{ nfcItem?.hexString }}
|
|
6
|
+
</view>
|
|
5
7
|
|
|
6
8
|
<view class="nfc-item-row">
|
|
7
|
-
|
|
9
|
+
{{ t('nfc.tagType') }}: {{ nfcItem?.techs?.join(',') }}
|
|
8
10
|
</view>
|
|
9
11
|
|
|
10
12
|
<view class="nfc-item-row">
|
|
11
|
-
|
|
13
|
+
{{ t('nfc.standard') }}:{{ nfcItem?.readWriteStandard?.join(',') }}
|
|
12
14
|
</view>
|
|
13
15
|
|
|
14
16
|
<view class="nfc-item-row">
|
|
15
|
-
|
|
17
|
+
{{ t('nfc.maxTransceiveLength') }}:{{
|
|
18
|
+
nfcItem?.maxTransceiveLength ?? 0
|
|
19
|
+
}}{{ t('nfc.unitByte') }}
|
|
16
20
|
</view>
|
|
17
21
|
</view>
|
|
18
22
|
<!-- <view class="nfc-item-row"> {{ scanCodeItem.eventName }} </view> -->
|
|
@@ -37,6 +41,9 @@
|
|
|
37
41
|
import { computed } from 'vue';
|
|
38
42
|
import type { DevTool } from '../../type';
|
|
39
43
|
import { formatDate, isMockWX } from '../../utils';
|
|
44
|
+
import { useI18n } from '../../i18n';
|
|
45
|
+
|
|
46
|
+
const { t } = useI18n();
|
|
40
47
|
|
|
41
48
|
const props = defineProps<{
|
|
42
49
|
nfcItem: DevTool.NFCItem;
|
|
@@ -59,7 +66,7 @@ const isUseDevSource = computed(() => {
|
|
|
59
66
|
|
|
60
67
|
function onOpenJson() {
|
|
61
68
|
emit('openJson', {
|
|
62
|
-
title: '
|
|
69
|
+
title: t('nfc.detail'),
|
|
63
70
|
data: props.nfcItem,
|
|
64
71
|
});
|
|
65
72
|
}
|
|
@@ -84,6 +91,7 @@ function onOpenJson() {
|
|
|
84
91
|
text-align: right;
|
|
85
92
|
word-break: break-all;
|
|
86
93
|
}
|
|
94
|
+
|
|
87
95
|
.link {
|
|
88
96
|
cursor: pointer;
|
|
89
97
|
text-decoration: underline;
|
|
@@ -98,16 +106,8 @@ function onOpenJson() {
|
|
|
98
106
|
align-items: center;
|
|
99
107
|
min-height: 24px;
|
|
100
108
|
}
|
|
109
|
+
|
|
101
110
|
.nfc-item-position > view {
|
|
102
111
|
width: 25%;
|
|
103
112
|
}
|
|
104
|
-
|
|
105
|
-
.nfc-item-right {
|
|
106
|
-
text-align: right;
|
|
107
|
-
word-break: break-all;
|
|
108
|
-
}
|
|
109
|
-
.link {
|
|
110
|
-
cursor: pointer;
|
|
111
|
-
text-decoration: underline;
|
|
112
|
-
}
|
|
113
113
|
</style>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="nfc-tool" :style="customStyle">
|
|
3
3
|
<view class="nfc-tool-control">
|
|
4
|
-
<DevToolTitle>
|
|
4
|
+
<DevToolTitle>{{ t('nfc.toolTitle') }}</DevToolTitle>
|
|
5
5
|
|
|
6
6
|
<Tag
|
|
7
7
|
mode="info"
|
|
8
|
-
v-for="item in
|
|
8
|
+
v-for="item in translatedSelectItems"
|
|
9
9
|
:active="item.value === currentSelect"
|
|
10
10
|
:key="item.value"
|
|
11
11
|
customStyle="margin-left: 16px"
|
|
@@ -23,32 +23,36 @@
|
|
|
23
23
|
<scroll-view scroll-y style="height: calc(100% - 32px)">
|
|
24
24
|
<view class="nfc-tool-base">
|
|
25
25
|
<view class="nfc-tool-tips">
|
|
26
|
-
|
|
26
|
+
{{ t('nfc.tipsTool') }}
|
|
27
27
|
</view>
|
|
28
|
-
<DevToolTitle
|
|
28
|
+
<DevToolTitle>{{ t('nfc.status') }}</DevToolTitle>
|
|
29
29
|
<view class="nfc-tool-status">
|
|
30
|
-
<view class="nfc-tool-status-key"
|
|
31
|
-
<Tag mode="success" v-if="isSupportNFC"
|
|
32
|
-
<Tag mode="error" v-else
|
|
30
|
+
<view class="nfc-tool-status-key">{{ t('nfc.deviceSupport') }}</view>
|
|
31
|
+
<Tag mode="success" v-if="isSupportNFC">{{ t('nfc.support') }}</Tag>
|
|
32
|
+
<Tag mode="error" v-else>{{ t('nfc.notSupport') }}</Tag>
|
|
33
33
|
</view>
|
|
34
34
|
<view class="nfc-tool-status">
|
|
35
|
-
<view class="nfc-tool-status-key">
|
|
36
|
-
<Tag mode="success" v-if="isListening"
|
|
37
|
-
<Tag mode="error" v-else
|
|
35
|
+
<view class="nfc-tool-status-key">{{ t('nfc.enabledStatus') }}</view>
|
|
36
|
+
<Tag mode="success" v-if="isListening">{{ t('nfc.enabled') }}</Tag>
|
|
37
|
+
<Tag mode="error" v-else>{{ t('nfc.disabled') }}</Tag>
|
|
38
38
|
</view>
|
|
39
39
|
<view class="nfc-tool-status">
|
|
40
|
-
<view class="nfc-tool-status-key">
|
|
41
|
-
<Tag mode="success" v-if="isConnected"
|
|
42
|
-
<Tag mode="error" v-else
|
|
40
|
+
<view class="nfc-tool-status-key">{{ t('nfc.connectStatus') }}</view>
|
|
41
|
+
<Tag mode="success" v-if="isConnected">{{ t('nfc.connected') }}</Tag>
|
|
42
|
+
<Tag mode="error" v-else>{{ t('nfc.disconnected') }}</Tag>
|
|
43
43
|
</view>
|
|
44
44
|
|
|
45
|
-
<DevToolTitle>
|
|
46
|
-
<
|
|
47
|
-
|
|
45
|
+
<DevToolTitle>{{ t('nfc.operation') }}</DevToolTitle>
|
|
46
|
+
<SettingButton class="nfc-tool-button" @click="startHCE">
|
|
47
|
+
{{ t('nfc.startScan') }}
|
|
48
|
+
</SettingButton>
|
|
49
|
+
<SettingButton class="nfc-tool-button" @click="stopHCE">
|
|
50
|
+
{{ t('nfc.stopScan') }}
|
|
51
|
+
</SettingButton>
|
|
48
52
|
</view>
|
|
49
53
|
|
|
50
54
|
<view class="nfc-tool-read" v-if="currentSelect === 'read'">
|
|
51
|
-
<DevToolTitle
|
|
55
|
+
<DevToolTitle>{{ t('nfc.result') }}</DevToolTitle>
|
|
52
56
|
<JsonPretty
|
|
53
57
|
virtual
|
|
54
58
|
v-if="showJson"
|
|
@@ -58,17 +62,17 @@
|
|
|
58
62
|
:pathCollapsible="() => false"
|
|
59
63
|
:height="contentHeight - 32 * 5 - 28 * 3 - 16 - 20"
|
|
60
64
|
/>
|
|
61
|
-
<Empty v-else text="
|
|
65
|
+
<Empty v-else :text="t('nfc.noResult')" />
|
|
62
66
|
</view>
|
|
63
67
|
<view class="nfc-tool-write" v-if="currentSelect === 'write'">
|
|
64
|
-
<DevToolTitle>
|
|
68
|
+
<DevToolTitle>{{ t('nfc.write') }}</DevToolTitle>
|
|
65
69
|
<radio-group
|
|
66
70
|
class="radio-group"
|
|
67
71
|
@change="onChangeFormData('writeMethod', $event)"
|
|
68
72
|
>
|
|
69
73
|
<label
|
|
70
74
|
class="radio-group-item"
|
|
71
|
-
v-for="item in
|
|
75
|
+
v-for="item in translatedWriteMethods"
|
|
72
76
|
:key="item.value"
|
|
73
77
|
>
|
|
74
78
|
<radio
|
|
@@ -87,20 +91,20 @@
|
|
|
87
91
|
class="nfc-tool-write-form"
|
|
88
92
|
v-if="formData.writeMethod === 'text'"
|
|
89
93
|
>
|
|
90
|
-
<DevToolTitle
|
|
94
|
+
<DevToolTitle>{{ t('nfc.textContent') }}</DevToolTitle>
|
|
91
95
|
<textarea
|
|
92
96
|
class="textarea"
|
|
93
97
|
:value="formData.text"
|
|
94
|
-
placeholder="
|
|
98
|
+
:placeholder="t('nfc.placeholderText')"
|
|
95
99
|
@input="onChangeFormData('text', $event)"
|
|
96
100
|
/>
|
|
97
101
|
</view>
|
|
98
102
|
|
|
99
103
|
<view class="nfc-tool-write-form" v-if="formData.writeMethod === 'uri'">
|
|
100
|
-
<DevToolTitle
|
|
104
|
+
<DevToolTitle>{{ t('nfc.link') }}</DevToolTitle>
|
|
101
105
|
<textarea
|
|
102
106
|
class="textarea"
|
|
103
|
-
placeholder="
|
|
107
|
+
:placeholder="t('nfc.placeholderLink')"
|
|
104
108
|
:value="formData.uri"
|
|
105
109
|
@input="onChangeFormData('uri', $event)"
|
|
106
110
|
/>
|
|
@@ -110,28 +114,28 @@
|
|
|
110
114
|
class="nfc-tool-write-form"
|
|
111
115
|
v-if="formData.writeMethod === 'wifi'"
|
|
112
116
|
>
|
|
113
|
-
<DevToolTitle>
|
|
117
|
+
<DevToolTitle>{{ t('nfc.wifiConfig') }}</DevToolTitle>
|
|
114
118
|
<input
|
|
115
119
|
class="input"
|
|
116
|
-
placeholder="
|
|
120
|
+
:placeholder="t('nfc.placeholderSsid')"
|
|
117
121
|
:value="formData.ssid"
|
|
118
122
|
@input="onChangeFormData('ssid', $event)"
|
|
119
123
|
/>
|
|
120
124
|
<input
|
|
121
125
|
class="input"
|
|
122
|
-
placeholder="
|
|
126
|
+
:placeholder="t('nfc.placeholderPassword')"
|
|
123
127
|
type="password"
|
|
124
128
|
:value="formData.password"
|
|
125
129
|
@input="onChangeFormData('password', $event)"
|
|
126
130
|
/>
|
|
127
|
-
<view class="sub-title"
|
|
131
|
+
<view class="sub-title">{{ t('nfc.encryption') }}</view>
|
|
128
132
|
<radio-group
|
|
129
133
|
class="radio-group"
|
|
130
134
|
@change="onChangeFormData('authType', $event)"
|
|
131
135
|
>
|
|
132
136
|
<label
|
|
133
137
|
class="radio-group-item"
|
|
134
|
-
v-for="item in
|
|
138
|
+
v-for="item in translatedEncryptionMethods"
|
|
135
139
|
:key="item.value"
|
|
136
140
|
>
|
|
137
141
|
<radio
|
|
@@ -150,43 +154,43 @@
|
|
|
150
154
|
class="nfc-tool-write-form"
|
|
151
155
|
v-if="formData.writeMethod === 'card'"
|
|
152
156
|
>
|
|
153
|
-
<DevToolTitle
|
|
157
|
+
<DevToolTitle>{{ t('nfc.cardInfo') }}</DevToolTitle>
|
|
154
158
|
<input
|
|
155
159
|
class="input"
|
|
156
|
-
placeholder="
|
|
160
|
+
:placeholder="t('nfc.placeholderName')"
|
|
157
161
|
:value="formData.name"
|
|
158
162
|
@input="onChangeFormData('name', $event)"
|
|
159
163
|
/>
|
|
160
164
|
<input
|
|
161
165
|
class="input"
|
|
162
|
-
placeholder="
|
|
166
|
+
:placeholder="t('nfc.placeholderOrg')"
|
|
163
167
|
:value="formData.organization"
|
|
164
168
|
@input="onChangeFormData('organization', $event)"
|
|
165
169
|
/>
|
|
166
170
|
<input
|
|
167
171
|
class="input"
|
|
168
|
-
placeholder="
|
|
172
|
+
:placeholder="t('nfc.placeholderTel')"
|
|
169
173
|
:value="formData.tel"
|
|
170
174
|
@input="onChangeFormData('tel', $event)"
|
|
171
175
|
/>
|
|
172
176
|
<input
|
|
173
177
|
class="input"
|
|
174
|
-
placeholder="
|
|
178
|
+
:placeholder="t('nfc.placeholderAddress')"
|
|
175
179
|
:value="formData.address"
|
|
176
180
|
@input="onChangeFormData('address', $event)"
|
|
177
181
|
/>
|
|
178
182
|
<input
|
|
179
183
|
class="input"
|
|
180
|
-
placeholder="
|
|
184
|
+
:placeholder="t('nfc.placeholderWeb')"
|
|
181
185
|
:value="formData.uri"
|
|
182
186
|
@input="onChangeFormData('uri', $event)"
|
|
183
187
|
/>
|
|
184
188
|
</view>
|
|
185
189
|
<view class="nfc-tool-write-form" v-if="formData.writeMethod === 'tel'">
|
|
186
|
-
<DevToolTitle
|
|
190
|
+
<DevToolTitle>{{ t('nfc.tel') }}</DevToolTitle>
|
|
187
191
|
<input
|
|
188
192
|
class="input"
|
|
189
|
-
placeholder="
|
|
193
|
+
:placeholder="t('nfc.placeholderTelInput')"
|
|
190
194
|
:value="formData.tel"
|
|
191
195
|
@input="onChangeFormData('tel', $event)"
|
|
192
196
|
/>
|
|
@@ -195,31 +199,31 @@
|
|
|
195
199
|
class="nfc-tool-write-form"
|
|
196
200
|
v-if="formData.writeMethod === 'packageName'"
|
|
197
201
|
>
|
|
198
|
-
<DevToolTitle>
|
|
202
|
+
<DevToolTitle>{{ t('nfc.appLaunch') }}</DevToolTitle>
|
|
199
203
|
<input
|
|
200
204
|
class="input"
|
|
201
|
-
placeholder="
|
|
205
|
+
:placeholder="t('nfc.placeholderPkg')"
|
|
202
206
|
:value="formData.packageName"
|
|
203
207
|
@input="onChangeFormData('packageName', $event)"
|
|
204
208
|
/>
|
|
205
209
|
</view>
|
|
206
|
-
<
|
|
210
|
+
<SettingButton @click="onWrite">{{
|
|
211
|
+
t('nfc.startWrite')
|
|
212
|
+
}}</SettingButton>
|
|
207
213
|
<view class="nfc-tool-tips">
|
|
208
|
-
|
|
214
|
+
{{ t('nfc.tipsWriting') }}
|
|
209
215
|
</view>
|
|
210
216
|
</view>
|
|
211
217
|
<view class="nfc-tool-copy" v-if="currentSelect === 'copy'">
|
|
212
|
-
<DevToolTitle>
|
|
213
|
-
<DevToolTitle
|
|
214
|
-
<DevToolTitle>
|
|
215
|
-
|
|
216
|
-
</DevToolTitle>
|
|
217
|
-
<button class="nfc-tool-button" @click="onCopy">复制</button>
|
|
218
|
+
<DevToolTitle>{{ t('nfc.copy') }}</DevToolTitle>
|
|
219
|
+
<DevToolTitle>{{ t('nfc.step1') }}</DevToolTitle>
|
|
220
|
+
<DevToolTitle>{{ t('nfc.step2') }}</DevToolTitle>
|
|
221
|
+
<SettingButton @click="onCopy">{{ t('nfc.toCopy') }}</SettingButton>
|
|
218
222
|
<view class="nfc-tool-tips">
|
|
219
|
-
|
|
223
|
+
{{ t('nfc.tipsCopying') }}
|
|
220
224
|
</view>
|
|
221
|
-
<DevToolTitle
|
|
222
|
-
<
|
|
225
|
+
<DevToolTitle>{{ t('nfc.step3') }}</DevToolTitle>
|
|
226
|
+
<SettingButton @click="stopHCE">{{ t('nfc.stopScan') }}</SettingButton>
|
|
223
227
|
</view>
|
|
224
228
|
</scroll-view>
|
|
225
229
|
</view>
|
|
@@ -232,8 +236,36 @@ import DevToolTitle from '../DevToolTitle/index.vue';
|
|
|
232
236
|
import JsonPretty from '../JsonPretty/index.vue';
|
|
233
237
|
import Empty from '../Empty/index.vue';
|
|
234
238
|
import useNFC from '../hooks/useNFC';
|
|
239
|
+
import SettingButton from '../SettingButton/index.vue';
|
|
235
240
|
import { selectItems, writeMethods, encryptionMethods } from './const';
|
|
236
|
-
|
|
241
|
+
import { useI18n } from '../../i18n';
|
|
242
|
+
|
|
243
|
+
const { t } = useI18n();
|
|
244
|
+
|
|
245
|
+
const translatedSelectItems = computed(() => {
|
|
246
|
+
return selectItems.map((item) => ({
|
|
247
|
+
...item,
|
|
248
|
+
label: item.value === 'read' ? t('nfc.read') : t('nfc.writeLabel'),
|
|
249
|
+
}));
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
const translatedWriteMethods = computed(() => {
|
|
253
|
+
return writeMethods.map((item) => ({
|
|
254
|
+
...item,
|
|
255
|
+
label: t(`nfc.writeMethods.${item.value}`),
|
|
256
|
+
}));
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
const translatedEncryptionMethods = computed(() => {
|
|
260
|
+
return encryptionMethods.map((item) => ({
|
|
261
|
+
...item,
|
|
262
|
+
label:
|
|
263
|
+
t(`nfc.authTypes.${item.value}`) !== `nfc.authTypes.${item.value}`
|
|
264
|
+
? t(`nfc.authTypes.${item.value}`)
|
|
265
|
+
: item.label,
|
|
266
|
+
}));
|
|
267
|
+
});
|
|
268
|
+
const _props = defineProps<{
|
|
237
269
|
contentHeight: number;
|
|
238
270
|
customStyle?: Record<string, any>;
|
|
239
271
|
}>();
|
|
@@ -270,7 +302,7 @@ const {
|
|
|
270
302
|
isListening,
|
|
271
303
|
startHCE,
|
|
272
304
|
stopHCE,
|
|
273
|
-
|
|
305
|
+
writeNdefText,
|
|
274
306
|
writeNdefUri,
|
|
275
307
|
writeNdefAndroidApp,
|
|
276
308
|
writeNdefWifi,
|
|
@@ -293,7 +325,7 @@ function onChangeFormData(key: keyof typeof formData, e: any) {
|
|
|
293
325
|
function onWrite() {
|
|
294
326
|
switch (formData.writeMethod) {
|
|
295
327
|
case 'text':
|
|
296
|
-
|
|
328
|
+
writeNdefText(formData.text);
|
|
297
329
|
break;
|
|
298
330
|
case 'uri':
|
|
299
331
|
writeNdefUri(formData.uri);
|
|
@@ -314,15 +346,14 @@ function onWrite() {
|
|
|
314
346
|
case 'card':
|
|
315
347
|
if (!formData.name) {
|
|
316
348
|
uni.showToast({
|
|
317
|
-
title: '
|
|
349
|
+
title: t('nfc.toast.enterName'),
|
|
318
350
|
icon: 'none',
|
|
319
351
|
});
|
|
320
|
-
|
|
321
352
|
return;
|
|
322
353
|
}
|
|
323
354
|
if (!formData.tel) {
|
|
324
355
|
uni.showToast({
|
|
325
|
-
title: '
|
|
356
|
+
title: t('nfc.toast.enterTel'),
|
|
326
357
|
icon: 'none',
|
|
327
358
|
});
|
|
328
359
|
return;
|
|
@@ -335,6 +366,7 @@ function onWrite() {
|
|
|
335
366
|
version: 'V3.0',
|
|
336
367
|
organization: formData.organization,
|
|
337
368
|
});
|
|
369
|
+
break;
|
|
338
370
|
default:
|
|
339
371
|
break;
|
|
340
372
|
}
|
|
@@ -345,7 +377,7 @@ function onCopy() {
|
|
|
345
377
|
// 复制到目标标签
|
|
346
378
|
// 断开连接
|
|
347
379
|
uni.showToast({
|
|
348
|
-
title: '
|
|
380
|
+
title: t('nfc.copying'),
|
|
349
381
|
icon: 'none',
|
|
350
382
|
});
|
|
351
383
|
}
|
|
@@ -355,38 +387,41 @@ function onCopy() {
|
|
|
355
387
|
position: fixed;
|
|
356
388
|
width: 100vw;
|
|
357
389
|
height: 100%;
|
|
358
|
-
|
|
359
390
|
top: 0;
|
|
360
391
|
left: 0;
|
|
361
|
-
|
|
362
392
|
background-color: var(--dev-tool-bg3-color);
|
|
363
393
|
box-sizing: border-box;
|
|
364
394
|
}
|
|
395
|
+
|
|
365
396
|
.nfc-tool-control {
|
|
366
397
|
padding: 0 16px;
|
|
367
398
|
display: flex;
|
|
368
399
|
align-items: center;
|
|
400
|
+
|
|
369
401
|
/* gap: 12px; */
|
|
370
402
|
height: 32px;
|
|
371
403
|
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
372
404
|
box-sizing: border-box;
|
|
373
405
|
}
|
|
406
|
+
|
|
374
407
|
.nfc-tool-tips {
|
|
375
|
-
font-size:
|
|
408
|
+
font-size: var(--dev-tool-tips-font-size);
|
|
376
409
|
line-height: 20px;
|
|
377
410
|
color: #616161;
|
|
378
411
|
}
|
|
412
|
+
|
|
379
413
|
.nfc-tool-base {
|
|
380
414
|
padding: 0 16px;
|
|
381
415
|
}
|
|
416
|
+
|
|
382
417
|
.nfc-tool-status {
|
|
383
418
|
display: flex;
|
|
384
419
|
align-items: center;
|
|
385
420
|
justify-content: space-between;
|
|
386
421
|
min-height: 28px;
|
|
387
422
|
word-break: break-all;
|
|
388
|
-
font-size: 12px;
|
|
389
423
|
}
|
|
424
|
+
|
|
390
425
|
.nfc-tool-status-key {
|
|
391
426
|
white-space: nowrap;
|
|
392
427
|
margin-right: 8px;
|
|
@@ -398,22 +433,7 @@ function onCopy() {
|
|
|
398
433
|
.nfc-tool-copy {
|
|
399
434
|
padding: 0 16px;
|
|
400
435
|
}
|
|
401
|
-
|
|
402
|
-
display: flex;
|
|
403
|
-
align-items: center;
|
|
404
|
-
justify-content: center;
|
|
405
|
-
width: 100%;
|
|
406
|
-
height: 32px;
|
|
407
|
-
border-radius: 4px;
|
|
408
|
-
color: #fff;
|
|
409
|
-
outline: none;
|
|
410
|
-
border: 1px solid transparent;
|
|
411
|
-
background-color: var(--dev-tool-main-color);
|
|
412
|
-
transform: all 0.3s;
|
|
413
|
-
font-size: var(--dev-tool-base-font-size);
|
|
414
|
-
padding: 0;
|
|
415
|
-
cursor: pointer;
|
|
416
|
-
}
|
|
436
|
+
|
|
417
437
|
.nfc-tool-button + .nfc-tool-button {
|
|
418
438
|
margin-top: 8px;
|
|
419
439
|
}
|
|
@@ -422,35 +442,33 @@ function onCopy() {
|
|
|
422
442
|
display: flex;
|
|
423
443
|
flex-wrap: wrap;
|
|
424
444
|
}
|
|
445
|
+
|
|
425
446
|
.radio-group-item {
|
|
426
447
|
display: flex;
|
|
427
448
|
align-items: center;
|
|
428
449
|
justify-content: center;
|
|
429
450
|
width: 33.33%;
|
|
430
451
|
margin-bottom: 6px;
|
|
431
|
-
font-size: 12px;
|
|
432
452
|
}
|
|
433
453
|
|
|
434
454
|
.textarea {
|
|
435
455
|
padding: 6px;
|
|
436
456
|
width: 100%;
|
|
437
457
|
box-sizing: border-box;
|
|
438
|
-
font-size: 12px;
|
|
439
458
|
border: 1px solid var(--dev-tool-border-color);
|
|
440
459
|
}
|
|
441
460
|
|
|
442
461
|
.input {
|
|
443
462
|
padding: 0 6px;
|
|
444
463
|
height: 24px;
|
|
445
|
-
font-size: 12px;
|
|
446
464
|
border: 1px solid var(--dev-tool-border-color);
|
|
447
465
|
}
|
|
466
|
+
|
|
448
467
|
.input + .input {
|
|
449
468
|
margin-top: 8px;
|
|
450
469
|
}
|
|
451
470
|
|
|
452
471
|
.sub-title {
|
|
453
|
-
font-size: 12px;
|
|
454
472
|
line-height: 20px;
|
|
455
473
|
}
|
|
456
474
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="nfc-content">
|
|
3
3
|
<view class="nfc-control">
|
|
4
|
-
<DevToolTitle>
|
|
4
|
+
<DevToolTitle> {{ t('nfc.title') }} </DevToolTitle>
|
|
5
5
|
|
|
6
6
|
<Tag
|
|
7
7
|
mode="clear"
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
customStyle="margin:0 16px 0 auto"
|
|
10
10
|
@click="emit('openTool')"
|
|
11
11
|
>
|
|
12
|
-
|
|
12
|
+
{{ t('common.tool') }}
|
|
13
13
|
</Tag>
|
|
14
|
-
<Tag mode="clear" @click="emit('clear')">
|
|
14
|
+
<Tag mode="clear" @click="emit('clear')"> {{ t('common.clear') }} </Tag>
|
|
15
15
|
</view>
|
|
16
16
|
|
|
17
|
-
<
|
|
17
|
+
<VirtualList
|
|
18
18
|
v-if="nfcList && nfcList?.length > 0"
|
|
19
19
|
class="nfc-list"
|
|
20
20
|
:pageSize="20"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
/>
|
|
41
41
|
</AutoSize>
|
|
42
42
|
</template>
|
|
43
|
-
</
|
|
43
|
+
</VirtualList>
|
|
44
44
|
|
|
45
45
|
<Empty v-else />
|
|
46
46
|
</view>
|
|
@@ -50,11 +50,14 @@ import DevToolTitle from '../DevToolTitle/index.vue';
|
|
|
50
50
|
import NFCItem from './NFCItem.vue';
|
|
51
51
|
import Tag from '../Tag/index.vue';
|
|
52
52
|
import Empty from '../Empty/index.vue';
|
|
53
|
-
import
|
|
54
|
-
import AutoSize from '../
|
|
53
|
+
import VirtualList from '../VirtualList/index.vue';
|
|
54
|
+
import AutoSize from '../VirtualList/AutoSize.vue';
|
|
55
55
|
import type { DevTool } from '../../type';
|
|
56
|
+
import { useI18n } from '../../i18n';
|
|
56
57
|
|
|
57
|
-
const
|
|
58
|
+
const { t } = useI18n();
|
|
59
|
+
|
|
60
|
+
const _props = defineProps<{
|
|
58
61
|
nfcList?: DevTool.NFCItem[];
|
|
59
62
|
zIndex?: number;
|
|
60
63
|
contentHeight: number;
|
|
@@ -65,8 +68,8 @@ const props = defineProps<{
|
|
|
65
68
|
const emit = defineEmits<{
|
|
66
69
|
(e: 'clear'): void;
|
|
67
70
|
(e: 'openTool'): void;
|
|
68
|
-
(e: 'openJson', value?:
|
|
69
|
-
(e: 'openCode', value
|
|
71
|
+
(e: 'openJson', value?: { title?: string; data: Record<string, any> }): void;
|
|
72
|
+
(e: 'openCode', value?: string): void;
|
|
70
73
|
}>();
|
|
71
74
|
</script>
|
|
72
75
|
<style scoped>
|
|
@@ -80,6 +83,7 @@ const emit = defineEmits<{
|
|
|
80
83
|
display: flex;
|
|
81
84
|
align-items: center;
|
|
82
85
|
justify-content: space-between;
|
|
86
|
+
|
|
83
87
|
/* gap: 8px; */
|
|
84
88
|
padding: 0 16px;
|
|
85
89
|
height: 32px;
|