@uxda/appkit 4.2.18 → 4.2.22
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/dist/appkit.css +1 -1
- package/dist/index.js +7 -6
- package/package.json +1 -1
- package/src/balance/api/endpoints.ts +1 -1
- package/src/shared/components/DeviceVersion.vue +3 -8
- package/src/shared/components/PageHeader.vue +1 -1
- package/src/shared/composables/useLogger.ts +6 -3
- package/src/shared/composables/useSafeArea.ts +6 -2
package/dist/appkit.css
CHANGED
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
align-items: center;
|
|
38
38
|
padding-top: var(--top);
|
|
39
39
|
min-height: var(--height);
|
|
40
|
-
margin: 0;
|
|
41
40
|
}
|
|
42
41
|
.page-header .page-title {
|
|
43
42
|
position: absolute;
|
|
@@ -47,6 +46,7 @@
|
|
|
47
46
|
top: var(--top);
|
|
48
47
|
width: 100%;
|
|
49
48
|
text-align: center;
|
|
49
|
+
margin: 0;
|
|
50
50
|
}
|
|
51
51
|
.page-header .back-button {
|
|
52
52
|
position: absolute;
|
package/dist/index.js
CHANGED
|
@@ -117,7 +117,7 @@ function requestPayment$2(json) {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
function useSafeArea() {
|
|
120
|
-
const systemInfo = Taro.getSystemInfoSync(), capsule = Taro.getMenuButtonBoundingClientRect();
|
|
120
|
+
const systemInfo = Taro.getEnv() === "WEAPP" ? Taro.getSystemInfoSync() : { statusBarHeight: 0, safeArea: { bottom: 0 }, screenHeight: 0 }, capsule = Taro.getEnv() === "WEAPP" ? Taro.getMenuButtonBoundingClientRect() : { top: 0, height: 0 };
|
|
121
121
|
const status = systemInfo.statusBarHeight || 0, gap = capsule.top - status, nav = capsule.height + gap * 2, safeAreaBottom = (systemInfo.safeArea || {}).bottom || 0, bottom = systemInfo.screenHeight - safeAreaBottom;
|
|
122
122
|
return {
|
|
123
123
|
status,
|
|
@@ -344,6 +344,7 @@ const defaultLogOptions = {
|
|
|
344
344
|
topic: "appkit",
|
|
345
345
|
enable: true
|
|
346
346
|
};
|
|
347
|
+
console.log(Taro.getEnv(), "Taro.getEnv");
|
|
347
348
|
function generateUniqueId(pre) {
|
|
348
349
|
return `${pre ? pre + "-" : ""}${Date.now().toString(16)}-${Math.random().toString(36).substr(2)}`;
|
|
349
350
|
}
|
|
@@ -365,10 +366,10 @@ function useLogger(options) {
|
|
|
365
366
|
const baseUrl = `https://${projectName}.cn-shenzhen.log.aliyuncs.com/logstores/${logStore}/track?APIVersion=${APIVersion}`;
|
|
366
367
|
const alislsURL = topic ? `${baseUrl}&__topic__=${topic}` : baseUrl;
|
|
367
368
|
const enable = options.enable === void 0 ? true : options.enable;
|
|
368
|
-
const { miniProgram } = Taro.getAccountInfoSync();
|
|
369
|
+
const { miniProgram } = Taro.getEnv() === "WEAPP" ? Taro.getAccountInfoSync() : { miniProgram: { version: "" } };
|
|
369
370
|
const systemInfo = JSON.stringify({
|
|
370
|
-
...Taro.getSystemInfoSync(),
|
|
371
|
-
appVersion: miniProgram
|
|
371
|
+
...Taro.getEnv() === "WEAPP" ? Taro.getSystemInfoSync() : {},
|
|
372
|
+
appVersion: miniProgram?.version
|
|
372
373
|
}) || "\u672A\u77E5";
|
|
373
374
|
function send(params) {
|
|
374
375
|
if (!enable) return;
|
|
@@ -783,7 +784,7 @@ const endpointsList$3 = {
|
|
|
783
784
|
operateTimeEnd: data.dateTo || "",
|
|
784
785
|
rightsCode: data.\u6743\u76CA\u7C7B\u76EE,
|
|
785
786
|
pageNum: data.page,
|
|
786
|
-
pageSize:
|
|
787
|
+
pageSize: 15
|
|
787
788
|
};
|
|
788
789
|
},
|
|
789
790
|
transform(response) {
|
|
@@ -936,7 +937,7 @@ var script$E = /* @__PURE__ */ defineComponent({
|
|
|
936
937
|
}, 100);
|
|
937
938
|
onMounted(async () => {
|
|
938
939
|
await getPropertieByCode();
|
|
939
|
-
const systemInfo = Taro.getSystemInfoSync();
|
|
940
|
+
const systemInfo = Taro.getEnv() === "WEAPP" ? Taro.getSystemInfoSync() : { SDKVersion: "2.24.0" };
|
|
940
941
|
const version = systemInfo.SDKVersion;
|
|
941
942
|
function compareVersion(v1, v2) {
|
|
942
943
|
const v1Arr = v1.split(".").map(Number);
|
package/package.json
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<DdNoticeBar
|
|
3
|
-
|
|
4
|
-
showClose
|
|
5
|
-
:style="topStype"
|
|
6
|
-
@close="showAlert = !showAlert"
|
|
7
|
-
text="您当前使用的微信客户端版本较低,可能不支持全部功能或体验效果可能不佳,建议至应用商店或App Store升级至最新版本。"
|
|
8
|
-
/>
|
|
2
|
+
<DdNoticeBar v-if="showAlert" showClose :style="topStype" @close="showAlert = !showAlert"
|
|
3
|
+
text="您当前使用的微信客户端版本较低,可能不支持全部功能或体验效果可能不佳,建议至应用商店或App Store升级至最新版本。" />
|
|
9
4
|
</template>
|
|
10
5
|
|
|
11
6
|
<script setup lang="ts">
|
|
@@ -41,7 +36,7 @@ const getPropertieByCode = debounce(async () => {
|
|
|
41
36
|
onMounted(async () => {
|
|
42
37
|
await getPropertieByCode()
|
|
43
38
|
|
|
44
|
-
const systemInfo = Taro.getSystemInfoSync()
|
|
39
|
+
const systemInfo = Taro.getEnv() === 'WEAPP' ? Taro.getSystemInfoSync() : { SDKVersion: '2.24.0' }
|
|
45
40
|
const version = systemInfo.SDKVersion
|
|
46
41
|
|
|
47
42
|
// 版本号比较函数
|
|
@@ -50,7 +50,6 @@ const onBackButtonClick = () => {
|
|
|
50
50
|
align-items: center;
|
|
51
51
|
padding-top: var(--top);
|
|
52
52
|
min-height: var(--height);
|
|
53
|
-
margin: 0;
|
|
54
53
|
|
|
55
54
|
.page-title {
|
|
56
55
|
position: absolute;
|
|
@@ -60,6 +59,7 @@ const onBackButtonClick = () => {
|
|
|
60
59
|
top: var(--top);
|
|
61
60
|
width: 100%;
|
|
62
61
|
text-align: center;
|
|
62
|
+
margin: 0;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
.back-button {
|
|
@@ -23,6 +23,8 @@ const defaultLogOptions: LogType = {
|
|
|
23
23
|
enable: true,
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
console.log(Taro.getEnv(), 'Taro.getEnv')
|
|
27
|
+
|
|
26
28
|
// 使用时间戳生成唯一标识
|
|
27
29
|
export function generateUniqueId(pre?: string) {
|
|
28
30
|
return `${pre ? pre + '-' : ''}${Date.now().toString(16)}-${Math.random().toString(36).substr(2)}`
|
|
@@ -49,11 +51,12 @@ export function useLogger(options?: LogType) {
|
|
|
49
51
|
const alislsURL = topic ? `${baseUrl}&__topic__=${topic}` : baseUrl
|
|
50
52
|
const enable = options.enable === undefined ? true : options.enable
|
|
51
53
|
|
|
52
|
-
const { miniProgram } =
|
|
54
|
+
const { miniProgram } =
|
|
55
|
+
Taro.getEnv() === 'WEAPP' ? Taro.getAccountInfoSync() : { miniProgram: { version: '' } }
|
|
53
56
|
const systemInfo =
|
|
54
57
|
JSON.stringify({
|
|
55
|
-
...Taro.getSystemInfoSync(),
|
|
56
|
-
appVersion: miniProgram
|
|
58
|
+
...(Taro.getEnv() === 'WEAPP' ? Taro.getSystemInfoSync() : {}),
|
|
59
|
+
appVersion: miniProgram?.version,
|
|
57
60
|
}) || '未知'
|
|
58
61
|
|
|
59
62
|
function send(params: Record<string, any>) {
|
|
@@ -24,8 +24,12 @@ export type SafeArea = {
|
|
|
24
24
|
* @returns
|
|
25
25
|
*/
|
|
26
26
|
export function useSafeArea(): SafeArea {
|
|
27
|
-
const systemInfo =
|
|
28
|
-
|
|
27
|
+
const systemInfo =
|
|
28
|
+
Taro.getEnv() === 'WEAPP'
|
|
29
|
+
? Taro.getSystemInfoSync()
|
|
30
|
+
: { statusBarHeight: 0, safeArea: { bottom: 0 }, screenHeight: 0 },
|
|
31
|
+
capsule =
|
|
32
|
+
Taro.getEnv() === 'WEAPP' ? Taro.getMenuButtonBoundingClientRect() : { top: 0, height: 0 }
|
|
29
33
|
/**
|
|
30
34
|
* 状态条高度
|
|
31
35
|
*/
|