@uxda/appkit 1.2.77 → 1.2.78

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/index.js CHANGED
@@ -4445,7 +4445,7 @@ var script$a = /* @__PURE__ */ defineComponent({
4445
4445
  emits("jump");
4446
4446
  }
4447
4447
  function toUser1() {
4448
- props?.mobile && toUser();
4448
+ props.mobile && toUser();
4449
4449
  }
4450
4450
  function toLogin() {
4451
4451
  emits("login");
@@ -6695,11 +6695,11 @@ function useDragBox() {
6695
6695
  dragData.left = data.left * scale || 0;
6696
6696
  dragData.top = data.top * scale || 0;
6697
6697
  dragData.oldLeft = data.left * scale || 0;
6698
- if (data?.limitHorizontal?.length) {
6699
- dragData.limitHorizontal = data?.limitHorizontal;
6698
+ if (data.limitHorizontal && data.limitHorizontal.length) {
6699
+ dragData.limitHorizontal = data.limitHorizontal;
6700
6700
  }
6701
- if (data?.limitVertical?.length) {
6702
- dragData.limitVertical = data?.limitVertical;
6701
+ if (data.limitVertical && data.limitVertical.length) {
6702
+ dragData.limitVertical = data.limitVertical;
6703
6703
  }
6704
6704
  }
6705
6705
  function onDragStart(event) {
@@ -6824,12 +6824,15 @@ var script$2 = /* @__PURE__ */ defineComponent({
6824
6824
  onDragEnd1();
6825
6825
  }
6826
6826
  onMounted(async () => {
6827
+ const systemInfo = Taro.getSystemInfoSync();
6828
+ const safeHeight = (systemInfo.safeArea || {}).height || systemInfo.screenHeight;
6829
+ const height = safeHeight > 620 ? 620 : safeHeight - 80;
6827
6830
  const navbarHeight = safeArea.nav + safeArea.status;
6828
6831
  initDragData({
6829
6832
  width: 40,
6830
6833
  height: 40,
6831
6834
  left: 324,
6832
- top: props.withNavbar ? 620 - navbarHeight : 620,
6835
+ top: props.withNavbar ? height - navbarHeight : height,
6833
6836
  limitVertical: [
6834
6837
  !props.withNavbar ? navbarHeight : 0,
6835
6838
  props.withTabbar ? safeArea.menuRect.bottom : 0
@@ -6839,7 +6842,7 @@ var script$2 = /* @__PURE__ */ defineComponent({
6839
6842
  width: 92,
6840
6843
  height: 43,
6841
6844
  left: 272,
6842
- top: props.withNavbar ? 620 - navbarHeight : 620,
6845
+ top: props.withNavbar ? height - navbarHeight : height,
6843
6846
  limitVertical: [
6844
6847
  !props.withNavbar ? navbarHeight : 0,
6845
6848
  props.withTabbar ? safeArea.menuRect.bottom : 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxda/appkit",
3
- "version": "1.2.77",
3
+ "version": "1.2.78",
4
4
  "description": "小程序应用开发包",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.ts",
@@ -35,11 +35,11 @@ export function useDragBox() {
35
35
  dragData.top = data.top * scale || 0
36
36
  dragData.oldLeft = data.left * scale || 0
37
37
 
38
- if (data?.limitHorizontal?.length) {
39
- dragData.limitHorizontal = data?.limitHorizontal
38
+ if (data.limitHorizontal && data.limitHorizontal.length) {
39
+ dragData.limitHorizontal = data.limitHorizontal
40
40
  }
41
- if (data?.limitVertical?.length) {
42
- dragData.limitVertical = data?.limitVertical
41
+ if (data.limitVertical && data.limitVertical.length) {
42
+ dragData.limitVertical = data.limitVertical
43
43
  }
44
44
  }
45
45
 
@@ -67,7 +67,7 @@ function toUser() {
67
67
  }
68
68
 
69
69
  function toUser1() {
70
- props?.mobile && toUser()
70
+ props.mobile && toUser()
71
71
  }
72
72
 
73
73
  // 未登录时,点击前往登录
@@ -42,6 +42,7 @@
42
42
  import { computed, onMounted } from 'vue'
43
43
  import { useDragBox } from '../../shared/composables/useDragBox'
44
44
  import { useSafeArea } from '../../shared/composables'
45
+ import Taro from '@tarojs/taro'
45
46
 
46
47
  const props = withDefaults(
47
48
  defineProps<{
@@ -101,13 +102,17 @@ function onDragEndHandler1() {
101
102
  }
102
103
 
103
104
  onMounted(async () => {
105
+ const systemInfo = Taro.getSystemInfoSync()
106
+ const safeHeight = (systemInfo.safeArea || {}).height || systemInfo.screenHeight
107
+ const height = safeHeight > 620 ? 620 : safeHeight - 80
108
+
104
109
  const navbarHeight = safeArea.nav + safeArea.status
105
110
  // 初始化拖拽元素
106
111
  initDragData({
107
112
  width: 40,
108
113
  height: 40,
109
114
  left: 324,
110
- top: props.withNavbar ? 620 - navbarHeight : 620,
115
+ top: props.withNavbar ? height - navbarHeight : height,
111
116
  limitVertical: [
112
117
  !props.withNavbar ? navbarHeight : 0,
113
118
  props.withTabbar ? safeArea.menuRect.bottom : 0,
@@ -117,7 +122,7 @@ onMounted(async () => {
117
122
  width: 92,
118
123
  height: 43,
119
124
  left: 272,
120
- top: props.withNavbar ? 620 - navbarHeight : 620,
125
+ top: props.withNavbar ? height - navbarHeight : height,
121
126
  limitVertical: [
122
127
  !props.withNavbar ? navbarHeight : 0,
123
128
  props.withTabbar ? safeArea.menuRect.bottom : 0,