@uxda/appkit 1.2.36 → 1.2.38
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 +144 -0
- package/dist/index.js +641 -212
- package/package.json +1 -1
- package/src/components/dd-notice-bar/index.vue +78 -76
- package/src/components/dd-search/doc.md +34 -0
- package/src/components/dd-search/index.vue +172 -0
- package/src/index.ts +14 -14
- package/src/notice/api/endpoints.ts +17 -0
- package/src/notice/api/index.ts +82 -0
- package/src/notice/components/LoginSetting.vue +116 -0
- package/src/notice/components/NoticeBanner.vue +290 -0
- package/src/notice/components/NoticePopup.vue +156 -0
- package/src/notice/components/NoticeView.vue +134 -0
- package/src/notice/components/index.ts +4 -0
- package/src/notice/components/useNotice.ts +35 -0
- package/src/notice/index.ts +1 -0
- package/src/shared/components/DeviceVersion.vue +67 -67
- package/src/shared/composables/useSafeArea.ts +8 -6
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<DdNoticeBar
|
|
3
|
-
v-if="showAlert"
|
|
4
|
-
showClose
|
|
5
|
-
:style="topStype"
|
|
6
|
-
@close="showAlert = !showAlert"
|
|
7
|
-
text="您当前使用的微信客户端版本较低,可能不支持全部功能或体验效果可能不佳,建议至应用商店或App Store升级至最新版本。"
|
|
8
|
-
/>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script setup lang="ts">
|
|
12
|
-
import { ref, onMounted, computed } from 'vue'
|
|
13
|
-
import DdNoticeBar from '../../components/dd-notice-bar/index.vue'
|
|
14
|
-
import { useSafeArea } from '../composables'
|
|
15
|
-
import Taro from '@tarojs/taro'
|
|
16
|
-
import { useHttp } from '../../balance/api'
|
|
17
|
-
|
|
18
|
-
const showAlert = ref(false)
|
|
19
|
-
const safeArea = useSafeArea()
|
|
20
|
-
|
|
21
|
-
const topStype = computed(() => {
|
|
22
|
-
return `top: ${safeArea.nav + safeArea.status}px;`
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
const recommendVersions = ref()
|
|
26
|
-
// 获取系统配置 - 小程序推荐版本
|
|
27
|
-
async function getPropertieByCode() {
|
|
28
|
-
if (recommendVersions.value) return
|
|
29
|
-
|
|
30
|
-
const $http = useHttp()
|
|
31
|
-
await $http
|
|
32
|
-
.get('/cas/properties/getPropertie', {
|
|
33
|
-
code: 'pcRecommendVersion',
|
|
34
|
-
})
|
|
35
|
-
.then((res: any) => {
|
|
36
|
-
recommendVersions.value = JSON.parse(res.value || '{}')
|
|
37
|
-
})
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
onMounted(async () => {
|
|
41
|
-
await getPropertieByCode()
|
|
42
|
-
|
|
43
|
-
const systemInfo = Taro.getSystemInfoSync()
|
|
44
|
-
const version = systemInfo.SDKVersion
|
|
45
|
-
|
|
46
|
-
// 版本号比较函数
|
|
47
|
-
function compareVersion(v1, v2) {
|
|
48
|
-
const v1Arr = v1.split('.').map(Number)
|
|
49
|
-
const v2Arr = v2.split('.').map(Number)
|
|
50
|
-
|
|
51
|
-
for (let i = 0; i < v1Arr.length || i < v2Arr.length; i++) {
|
|
52
|
-
if ((v1Arr[i] || 0) > (v2Arr[i] || 0)) {
|
|
53
|
-
return true
|
|
54
|
-
} else if ((v1Arr[i] || 0) < (v2Arr[i] || 0)) {
|
|
55
|
-
return false
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return false
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (!compareVersion(version, recommendVersions.value?.Mini || '2.24.0')) {
|
|
62
|
-
showAlert.value = true
|
|
63
|
-
}
|
|
64
|
-
})
|
|
65
|
-
</script>
|
|
66
|
-
|
|
67
|
-
<style lang="less"></style>
|
|
1
|
+
<template>
|
|
2
|
+
<DdNoticeBar
|
|
3
|
+
v-if="showAlert"
|
|
4
|
+
showClose
|
|
5
|
+
:style="topStype"
|
|
6
|
+
@close="showAlert = !showAlert"
|
|
7
|
+
text="您当前使用的微信客户端版本较低,可能不支持全部功能或体验效果可能不佳,建议至应用商店或App Store升级至最新版本。"
|
|
8
|
+
/>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
import { ref, onMounted, computed } from 'vue'
|
|
13
|
+
import DdNoticeBar from '../../components/dd-notice-bar/index.vue'
|
|
14
|
+
import { useSafeArea } from '../composables'
|
|
15
|
+
import Taro from '@tarojs/taro'
|
|
16
|
+
import { useHttp } from '../../balance/api'
|
|
17
|
+
|
|
18
|
+
const showAlert = ref(false)
|
|
19
|
+
const safeArea = useSafeArea()
|
|
20
|
+
|
|
21
|
+
const topStype = computed(() => {
|
|
22
|
+
return `top: ${safeArea.nav + safeArea.status}px;`
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const recommendVersions = ref()
|
|
26
|
+
// 获取系统配置 - 小程序推荐版本
|
|
27
|
+
async function getPropertieByCode() {
|
|
28
|
+
if (recommendVersions.value) return
|
|
29
|
+
|
|
30
|
+
const $http = useHttp()
|
|
31
|
+
await $http
|
|
32
|
+
.get('/cas/properties/getPropertie', {
|
|
33
|
+
code: 'pcRecommendVersion',
|
|
34
|
+
})
|
|
35
|
+
.then((res: any) => {
|
|
36
|
+
recommendVersions.value = JSON.parse(res.value || '{}')
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
onMounted(async () => {
|
|
41
|
+
await getPropertieByCode()
|
|
42
|
+
|
|
43
|
+
const systemInfo = Taro.getSystemInfoSync()
|
|
44
|
+
const version = systemInfo.SDKVersion
|
|
45
|
+
|
|
46
|
+
// 版本号比较函数
|
|
47
|
+
function compareVersion(v1, v2) {
|
|
48
|
+
const v1Arr = v1.split('.').map(Number)
|
|
49
|
+
const v2Arr = v2.split('.').map(Number)
|
|
50
|
+
|
|
51
|
+
for (let i = 0; i < v1Arr.length || i < v2Arr.length; i++) {
|
|
52
|
+
if ((v1Arr[i] || 0) > (v2Arr[i] || 0)) {
|
|
53
|
+
return true
|
|
54
|
+
} else if ((v1Arr[i] || 0) < (v2Arr[i] || 0)) {
|
|
55
|
+
return false
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return false
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (!compareVersion(version, recommendVersions.value?.Mini || '2.24.0')) {
|
|
62
|
+
showAlert.value = true
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<style lang="less"></style>
|
|
@@ -6,23 +6,24 @@ export type SafeArea = {
|
|
|
6
6
|
/**
|
|
7
7
|
* 状态条高度
|
|
8
8
|
*/
|
|
9
|
-
status: number
|
|
9
|
+
status: number
|
|
10
10
|
/**
|
|
11
11
|
* 导航条区域(胶囊)
|
|
12
12
|
*/
|
|
13
|
-
nav: number
|
|
13
|
+
nav: number
|
|
14
14
|
/**
|
|
15
15
|
* 屏幕底部范围
|
|
16
16
|
*/
|
|
17
17
|
bottom: number
|
|
18
|
+
menuRect: any
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* 获取屏幕安全区域
|
|
22
23
|
* 从系统 API 获取
|
|
23
|
-
* @returns
|
|
24
|
+
* @returns
|
|
24
25
|
*/
|
|
25
|
-
export function useSafeArea
|
|
26
|
+
export function useSafeArea(): SafeArea {
|
|
26
27
|
const systemInfo = Taro.getSystemInfoSync(),
|
|
27
28
|
capsule = Taro.getMenuButtonBoundingClientRect()
|
|
28
29
|
/**
|
|
@@ -39,6 +40,7 @@ export function useSafeArea (): SafeArea {
|
|
|
39
40
|
return {
|
|
40
41
|
status,
|
|
41
42
|
nav,
|
|
42
|
-
bottom
|
|
43
|
+
bottom,
|
|
44
|
+
menuRect: capsule,
|
|
43
45
|
}
|
|
44
|
-
}
|
|
46
|
+
}
|