@uxda/appkit 1.2.77 → 1.2.80

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.80",
4
4
  "description": "小程序应用开发包",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.ts",
@@ -44,60 +44,61 @@
44
44
  </template>
45
45
 
46
46
  <script setup lang="ts">
47
- import { ref } from "vue";
48
- import { endpoints, useHttp } from "../api";
49
- import { Balance } from "../types";
50
- import { useDidShow } from "@tarojs/taro";
47
+ import { ref } from 'vue'
48
+ import { endpoints, useHttp } from '../api'
49
+ import { Balance } from '../types'
50
+ import { useDidShow } from '@tarojs/taro'
51
51
 
52
52
  type BalanceCardProps = {
53
- app: string;
54
- };
53
+ app: string
54
+ }
55
55
  const props = withDefaults(defineProps<BalanceCardProps>(), {
56
- app: "",
57
- });
56
+ app: '',
57
+ })
58
58
 
59
59
  const balance = ref<Balance>({
60
60
  total: 0,
61
61
  privileges: [],
62
- });
62
+ })
63
63
 
64
64
  const gotoRecharge = () => {
65
- emit("recharge");
66
- };
65
+ emit('recharge')
66
+ }
67
67
 
68
68
  async function loadBalance() {
69
- const $http = useHttp();
69
+ const $http = useHttp()
70
70
  $http
71
71
  .get<Balance>(endpoints.获取余额明细, {
72
72
  app: props.app,
73
73
  })
74
74
  .then((data) => {
75
- balance.value = data;
76
- });
75
+ // balance.value = data
76
+ balance.value.total = data.total || (data.commonAccount as number)
77
+ })
77
78
  }
78
79
 
79
80
  const emit = defineEmits([
80
81
  /**
81
82
  * 跳账户详情
82
83
  */
83
- "drill",
84
+ 'drill',
84
85
  /**
85
86
  * 跳充值页
86
87
  */
87
- "recharge",
88
- ]);
88
+ 'recharge',
89
+ ])
89
90
 
90
91
  function gotoDetail() {
91
- emit("drill");
92
+ emit('drill')
92
93
  }
93
94
 
94
95
  useDidShow(() => {
95
- loadBalance();
96
- });
96
+ loadBalance()
97
+ })
97
98
 
98
99
  defineExpose({
99
100
  reload: loadBalance,
100
- });
101
+ })
101
102
  </script>
102
103
 
103
104
  <style lang="scss">
@@ -179,12 +180,7 @@ defineExpose({
179
180
  height: 28px;
180
181
  line-height: 28px;
181
182
  border-radius: 14px;
182
- background: linear-gradient(
183
- 90deg,
184
- #ffebc1 0%,
185
- #ffd7a7 52.29%,
186
- #ffb875 100%
187
- );
183
+ background: linear-gradient(90deg, #ffebc1 0%, #ffd7a7 52.29%, #ffb875 100%);
188
184
  .account-info-name {
189
185
  color: #975213;
190
186
  font-size: 13px;
@@ -82,6 +82,7 @@ export type Privilege = {
82
82
  export type Balance = {
83
83
  total: number
84
84
  privileges: any
85
+ commonAccount?: number
85
86
  }
86
87
 
87
88
  export type 权益类目 = {
@@ -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,