hy-app 0.1.2 → 0.1.4

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.
Files changed (247) hide show
  1. package/README.md +1 -1
  2. package/api/http.ts +8 -8
  3. package/components/dialog/index.ts +2 -2
  4. package/components/hy-address-picker/hy-address-picker.vue +3 -29
  5. package/components/hy-address-picker/index.scss +27 -0
  6. package/components/hy-avatar/hy-avatar.vue +1 -45
  7. package/components/hy-avatar/index.scss +45 -0
  8. package/components/hy-avatar/typing.d.ts +1 -1
  9. package/components/hy-back-top/hy-back-top.vue +7 -22
  10. package/components/hy-back-top/index.scss +16 -0
  11. package/components/hy-back-top/props.ts +4 -4
  12. package/components/hy-back-top/typing.d.ts +2 -3
  13. package/components/hy-badge/hy-badge.vue +1 -72
  14. package/components/hy-badge/index.scss +72 -0
  15. package/components/hy-button/hy-button.vue +17 -128
  16. package/components/hy-button/index.scss +116 -0
  17. package/components/hy-button/typing.d.ts +1 -1
  18. package/components/hy-calendar/header.vue +76 -0
  19. package/components/hy-calendar/hy-calendar.vue +366 -0
  20. package/components/hy-calendar/index.scss +171 -0
  21. package/components/hy-calendar/month.vue +524 -0
  22. package/components/hy-calendar/props.ts +37 -0
  23. package/components/hy-calendar/typing.d.ts +126 -0
  24. package/components/hy-card/hy-card.vue +21 -84
  25. package/components/hy-card/index.scss +57 -0
  26. package/components/hy-card/props.ts +2 -2
  27. package/components/hy-card/typing.d.ts +1 -1
  28. package/components/hy-cell/hy-cell.vue +1 -137
  29. package/components/hy-cell/index.scss +137 -0
  30. package/components/hy-check-button/hy-check-button.vue +1 -0
  31. package/components/hy-check-button/index.scss +5 -0
  32. package/components/hy-checkbox/hy-checkbox.vue +2 -95
  33. package/components/hy-checkbox/index.scss +94 -0
  34. package/components/hy-checkbox/typing.d.ts +1 -2
  35. package/components/hy-count-down/hy-count-down.vue +150 -0
  36. package/components/hy-count-down/index.scss +6 -0
  37. package/components/hy-count-down/index.ts +52 -0
  38. package/components/hy-count-down/props.ts +10 -0
  39. package/components/hy-count-down/typing.d.ts +20 -0
  40. package/components/hy-count-to/hy-count-to.vue +213 -0
  41. package/components/hy-count-to/index.scss +6 -0
  42. package/components/hy-count-to/props.ts +17 -0
  43. package/components/hy-count-to/typing.d.ts +48 -0
  44. package/components/hy-datetime-picker/hy-datetime-picker.vue +2 -28
  45. package/components/hy-datetime-picker/index.scss +28 -0
  46. package/components/hy-divider/hy-divider.vue +24 -49
  47. package/components/hy-divider/index.scss +26 -0
  48. package/components/hy-divider/props.ts +2 -2
  49. package/components/hy-divider/typing.d.ts +1 -1
  50. package/components/hy-dropdown/hy-dropdown.vue +43 -0
  51. package/components/hy-dropdown/index.scss +17 -0
  52. package/components/hy-dropdown/props.ts +17 -0
  53. package/components/hy-dropdown/typing.d.ts +48 -0
  54. package/components/hy-dropdown-item/hy-dropdown-item.vue +194 -0
  55. package/components/hy-dropdown-item/index.scss +96 -0
  56. package/components/hy-dropdown-item/props.ts +10 -0
  57. package/components/hy-dropdown-item/typing.d.ts +31 -0
  58. package/components/hy-empty/hy-empty.vue +8 -26
  59. package/components/hy-empty/index.scss +19 -0
  60. package/components/hy-empty/props.ts +2 -2
  61. package/components/hy-empty/typing.d.ts +1 -1
  62. package/components/hy-float-button/hy-float-button.vue +217 -0
  63. package/components/hy-float-button/index.scss +67 -0
  64. package/components/hy-float-button/props.ts +25 -0
  65. package/components/hy-float-button/typing.d.ts +93 -0
  66. package/components/hy-folding-panel/hy-folding-panel.vue +9 -12
  67. package/components/hy-folding-panel/index.scss +6 -0
  68. package/components/hy-folding-panel/props.ts +2 -2
  69. package/components/hy-folding-panel/typing.d.ts +2 -2
  70. package/components/hy-form/hy-form.vue +17 -34
  71. package/components/hy-form/index.scss +30 -0
  72. package/components/hy-form/props.ts +2 -0
  73. package/components/hy-form/typing.d.ts +9 -1
  74. package/components/hy-grid/hy-grid.vue +1 -43
  75. package/components/hy-grid/index.scss +40 -0
  76. package/components/hy-icon/hy-icon.vue +1 -93
  77. package/components/hy-icon/index.scss +84 -0
  78. package/components/hy-image/hy-image.vue +216 -0
  79. package/components/hy-image/index.scss +26 -0
  80. package/components/hy-image/props.ts +24 -0
  81. package/components/hy-image/typing.d.ts +76 -0
  82. package/components/hy-input/hy-input.vue +2 -72
  83. package/components/hy-input/index.scss +65 -0
  84. package/components/hy-line/hy-line.vue +4 -8
  85. package/components/hy-line/index.scss +5 -0
  86. package/components/hy-line/props.ts +3 -3
  87. package/components/hy-line/typing.d.ts +2 -2
  88. package/components/hy-line-progress/hy-line-progress.vue +15 -44
  89. package/components/hy-line-progress/index.scss +38 -0
  90. package/components/hy-line-progress/props.ts +2 -2
  91. package/components/hy-line-progress/typing.d.ts +1 -1
  92. package/components/hy-list/hy-list.vue +11 -41
  93. package/components/hy-list/index.scss +32 -0
  94. package/components/hy-list/props.ts +2 -2
  95. package/components/hy-loading/hy-loading.vue +95 -0
  96. package/components/hy-loading/index.scss +103 -0
  97. package/components/hy-loading/props.ts +17 -0
  98. package/components/hy-loading/typing.d.ts +53 -0
  99. package/components/hy-login/TheUserLogin.vue +20 -88
  100. package/components/hy-login/hy-login.vue +9 -9
  101. package/components/hy-login/props.ts +4 -4
  102. package/components/hy-modal/hy-modal.vue +11 -89
  103. package/components/hy-modal/index.scss +77 -0
  104. package/components/hy-modal/props.ts +2 -2
  105. package/components/hy-modal/typing.d.ts +1 -1
  106. package/components/hy-navbar/hy-navbar.vue +20 -92
  107. package/components/hy-navbar/index.scss +67 -0
  108. package/components/hy-navbar/props.ts +2 -2
  109. package/components/hy-navbar/typing.d.ts +1 -1
  110. package/components/hy-notice-bar/hy-column-notice.vue +11 -39
  111. package/components/hy-notice-bar/hy-notice-bar.vue +10 -12
  112. package/components/hy-notice-bar/hy-row-notice.vue +16 -58
  113. package/components/hy-notice-bar/index.scss +93 -0
  114. package/components/hy-notice-bar/props.ts +4 -2
  115. package/components/hy-notice-bar/typing.d.ts +13 -3
  116. package/components/hy-number-step/hy-number-step.vue +1 -70
  117. package/components/hy-number-step/index.scss +71 -0
  118. package/components/hy-overlay/hy-overlay.vue +2 -14
  119. package/components/hy-overlay/index.scss +9 -0
  120. package/components/hy-parse/hy-parse.vue +499 -0
  121. package/components/hy-parse/index.scss +9 -0
  122. package/components/hy-parse/node/node.vue +584 -0
  123. package/components/hy-parse/parser.js +1337 -0
  124. package/components/hy-parse/props.ts +19 -0
  125. package/components/hy-parse/typing.d.ts +68 -0
  126. package/components/hy-picker/hy-picker.vue +1 -68
  127. package/components/hy-picker/index.scss +68 -0
  128. package/components/hy-popup/hy-popup.vue +1 -74
  129. package/components/hy-popup/index.scss +60 -0
  130. package/components/hy-price/hy-price.vue +7 -19
  131. package/components/hy-price/index.scss +11 -0
  132. package/components/hy-price/props.ts +4 -3
  133. package/components/hy-price/typing.d.ts +8 -4
  134. package/components/hy-qrcode/hy-qrcode.vue +15 -37
  135. package/components/hy-qrcode/index.scss +23 -0
  136. package/components/hy-qrcode/props.ts +2 -2
  137. package/components/hy-qrcode/typing.d.ts +2 -2
  138. package/components/hy-radio/hy-radio.vue +2 -101
  139. package/components/hy-radio/index.scss +93 -0
  140. package/components/hy-radio/typing.d.ts +1 -2
  141. package/components/hy-rate/hy-rate.vue +1 -33
  142. package/components/hy-rate/index.scss +33 -0
  143. package/components/hy-read-more/hy-read-more.vue +7 -30
  144. package/components/hy-read-more/index.scss +25 -0
  145. package/components/hy-read-more/props.ts +3 -3
  146. package/components/hy-read-more/typing.d.ts +1 -1
  147. package/components/hy-safe-bottom/hy-safe-bottom.vue +5 -9
  148. package/components/hy-safe-bottom/index.scss +5 -0
  149. package/components/hy-scroll-list/hy-scroll-list.vue +13 -43
  150. package/components/hy-scroll-list/index.scss +34 -0
  151. package/components/hy-scroll-list/props.ts +2 -2
  152. package/components/hy-scroll-list/typing.d.ts +1 -1
  153. package/components/hy-search/hy-search.vue +1 -83
  154. package/components/hy-search/index.scss +83 -0
  155. package/components/hy-slider/hy-slider.vue +18 -95
  156. package/components/hy-slider/index.scss +77 -0
  157. package/components/hy-status-bar/hy-status-bar.vue +41 -0
  158. package/components/hy-status-bar/index.scss +6 -0
  159. package/components/hy-status-bar/props.ts +8 -0
  160. package/components/hy-status-bar/typing.d.ts +12 -0
  161. package/components/hy-steps/hy-steps.vue +36 -163
  162. package/components/hy-steps/index.scss +131 -0
  163. package/components/hy-steps/props.ts +2 -2
  164. package/components/hy-steps/typing.d.ts +2 -2
  165. package/components/hy-submitBar/Index.vue +17 -0
  166. package/components/hy-submitBar/hy-submitBar.vue +216 -0
  167. package/components/hy-submitBar/index.scss +9 -0
  168. package/components/hy-submitBar/props.ts +22 -0
  169. package/components/hy-submitBar/typing.d.ts +88 -0
  170. package/components/hy-subsection/hy-subsection.vue +40 -132
  171. package/components/hy-subsection/index.scss +82 -0
  172. package/components/hy-subsection/props.ts +1 -0
  173. package/components/hy-subsection/typing.d.ts +13 -4
  174. package/components/hy-swipe-action/hy-swipe-action.vue +294 -0
  175. package/components/hy-swipe-action/index.scss +9 -0
  176. package/components/hy-swipe-action/index.wxs +235 -0
  177. package/components/hy-swipe-action/props.ts +16 -0
  178. package/components/hy-swipe-action/typing.d.ts +55 -0
  179. package/components/hy-swipe-action/wxs.js +15 -0
  180. package/components/hy-swiper/hy-swiper-indicator.vue +5 -35
  181. package/components/hy-swiper/hy-swiper.vue +1 -54
  182. package/components/hy-swiper/index.scss +82 -0
  183. package/components/hy-switch/hy-switch.vue +62 -72
  184. package/components/hy-switch/index.scss +46 -0
  185. package/components/hy-switch/props.ts +4 -1
  186. package/components/hy-switch/typing.d.ts +14 -1
  187. package/components/hy-tabs/hy-tabs.vue +22 -81
  188. package/components/hy-tabs/index.scss +63 -0
  189. package/components/hy-tabs/props.ts +5 -5
  190. package/components/hy-tabs/typing.d.ts +1 -1
  191. package/components/hy-tag/hy-tag.vue +25 -220
  192. package/components/hy-tag/index.scss +205 -0
  193. package/components/hy-text/hy-text.vue +238 -0
  194. package/components/hy-text/index.scss +70 -0
  195. package/components/hy-text/index.ts +0 -0
  196. package/components/hy-text/props.ts +30 -0
  197. package/components/hy-text/typing.d.ts +98 -0
  198. package/components/hy-textarea/hy-textarea.vue +1 -46
  199. package/components/hy-textarea/index.scss +40 -0
  200. package/components/hy-toast/hy-toast.vue +175 -0
  201. package/components/hy-toast/index.scss +77 -0
  202. package/components/hy-toast/props.ts +3 -0
  203. package/components/hy-toast/typing.d.ts +38 -0
  204. package/components/hy-tooltip/hy-tooltip.vue +42 -95
  205. package/components/hy-tooltip/index.scss +64 -0
  206. package/components/hy-tooltip/props.ts +2 -2
  207. package/components/hy-tooltip/typing.d.ts +1 -1
  208. package/components/hy-transition/hy-transition.vue +4 -2
  209. package/components/hy-transition/typing.d.ts +1 -13
  210. package/components/hy-upload/hy-upload.vue +37 -182
  211. package/components/hy-upload/index.scss +147 -0
  212. package/components/hy-upload/props.ts +2 -2
  213. package/components/hy-upload/typing.d.ts +11 -11
  214. package/components/hy-warn/hy-warn.vue +17 -144
  215. package/components/hy-warn/index.scss +109 -0
  216. package/components/hy-warn/props.ts +3 -3
  217. package/components/hy-warn/typing.d.ts +4 -3
  218. package/components/hy-waterfall/hy-waterfall.vue +168 -38
  219. package/components/hy-waterfall/index.scss +16 -0
  220. package/components/hy-waterfall/props.ts +4 -5
  221. package/components/hy-waterfall/typing.d.ts +5 -9
  222. package/components/index.ts +25 -1
  223. package/components/message/index.ts +54 -54
  224. package/composables/index.ts +1 -0
  225. package/composables/useShare.ts +27 -0
  226. package/config/color.ts +3 -2
  227. package/config/icon.ts +21 -1
  228. package/global/index.ts +6 -6
  229. package/global/register-properties.ts +2 -2
  230. package/index.scss +2 -1
  231. package/index.ts +9 -8
  232. package/libs/css/common.scss +14 -2
  233. package/package.json +3 -2
  234. package/{libs/css → public/font}/iconfont.css +4 -4
  235. package/theme.scss +6 -4
  236. package/typing/index.ts +1 -1
  237. package/typing/modules/common.d.ts +36 -1
  238. package/utils/calendar.js +1021 -0
  239. package/utils/colorGradient.ts +112 -0
  240. package/utils/index.ts +2 -0
  241. package/utils/inside.ts +80 -34
  242. package/utils/inspect.ts +115 -0
  243. package/utils/utils.ts +20 -19
  244. package/libs/css/download.zip +0 -0
  245. /package/{libs/css → public/font}/iconfont.ttf +0 -0
  246. /package/{libs/css → public/font}/iconfont.woff +0 -0
  247. /package/{libs/css → public/font}/iconfont.woff2 +0 -0
@@ -29,9 +29,9 @@
29
29
  </template>
30
30
 
31
31
  <script setup lang="ts">
32
- import { computed, CSSProperties, toRefs } from "vue";
32
+ import { computed, type CSSProperties, toRefs } from "vue";
33
33
  import defaultProps from "./props";
34
- import IProps from "./typing";
34
+ import type IProps from "./typing";
35
35
  import { addUnit } from "../../utils";
36
36
 
37
37
  // 组件
@@ -47,7 +47,7 @@ const {
47
47
  navigateUrl,
48
48
  desSize,
49
49
  desColor,
50
- customStyle
50
+ customStyle,
51
51
  } = toRefs(props);
52
52
  const emit = defineEmits(["click"]);
53
53
 
@@ -60,7 +60,7 @@ const emptyDescription = computed(() => {
60
60
  * */
61
61
  const emptyStyle = computed<CSSProperties>(() => {
62
62
  const style: CSSProperties = {
63
- zIndex: zIndex.value
63
+ zIndex: zIndex.value,
64
64
  };
65
65
  return Object.assign(style, customStyle.value);
66
66
  });
@@ -71,7 +71,7 @@ const emptyStyle = computed<CSSProperties>(() => {
71
71
  const descriptionStyle = computed<CSSProperties>(() => {
72
72
  const style: CSSProperties = {
73
73
  fontSize: addUnit(desSize.value),
74
- color: desColor.value
74
+ color: desColor.value,
75
75
  };
76
76
  return style;
77
77
  });
@@ -83,7 +83,7 @@ const imgStyle = computed<CSSProperties>(() => {
83
83
  return {
84
84
  width: addUnit(width.value),
85
85
  height: addUnit(height.value),
86
- margin: imgMargin.value
86
+ margin: imgMargin.value,
87
87
  };
88
88
  });
89
89
 
@@ -94,29 +94,11 @@ const handleClick = () => {
94
94
  emit("click");
95
95
  if (navigateUrl.value) {
96
96
  uni.navigateTo({
97
- url: navigateUrl.value
97
+ url: navigateUrl.value,
98
98
  });
99
99
  }
100
100
  };
101
101
  </script>
102
102
  <style scoped lang="scss">
103
- .hy-empty {
104
- top: 0;
105
- left: 0;
106
- width: 100%;
107
- height: 100%;
108
- display: flex;
109
- justify-content: center;
110
- align-items: center;
111
- flex-direction: column;
112
- background: rgb(255, 255, 255);
113
- &__description {
114
- width: 70%;
115
- text-align: center;
116
- }
117
-
118
- &__button {
119
- margin-top: 80rpx;
120
- }
121
- }
103
+ @import "./index.scss";
122
104
  </style>
@@ -0,0 +1,19 @@
1
+ .hy-empty {
2
+ top: 0;
3
+ left: 0;
4
+ width: 100%;
5
+ height: 100%;
6
+ display: flex;
7
+ justify-content: center;
8
+ align-items: center;
9
+ flex-direction: column;
10
+ background: rgb(255, 255, 255);
11
+ &__description {
12
+ width: 70%;
13
+ text-align: center;
14
+ }
15
+
16
+ &__button {
17
+ margin-top: 80rpx;
18
+ }
19
+ }
@@ -1,4 +1,4 @@
1
- import IProps from "./typing";
1
+ import type IProps from "./typing";
2
2
 
3
3
  const defaultProps: IProps = {
4
4
  show: true,
@@ -15,7 +15,7 @@ const defaultProps: IProps = {
15
15
  btnType: "primary",
16
16
  btnShape: "square",
17
17
  btnPlain: false,
18
- navigateUrl: ""
18
+ navigateUrl: "",
19
19
  };
20
20
 
21
21
  export default defaultProps;
@@ -1,4 +1,4 @@
1
- import { CSSProperties } from "vue";
1
+ import type { CSSProperties } from "vue";
2
2
 
3
3
  export default interface IProps {
4
4
  /**
@@ -0,0 +1,217 @@
1
+ <template>
2
+ <view
3
+ :style="FloatButtonStyle"
4
+ :id="soleId"
5
+ :class="[
6
+ 'hy-float-button',
7
+ {
8
+ 'hy-float-button__animation': float,
9
+ 'hy-float-button__shadow': shadow,
10
+ },
11
+ `hy-float-button__${shape}`,
12
+ ]"
13
+ >
14
+ <view
15
+ :class="['hy-float-button__container']"
16
+ @tap.stop="handleClick"
17
+ :style="{ backgroundColor: bgColor }"
18
+ >
19
+ <slot>
20
+ <HyIcon
21
+ :name="icon"
22
+ :color="iconColor"
23
+ :size="iconSize ? iconSize : addUnit(getPx(getFloatBtnSize) * 0.7)"
24
+ />
25
+ <text v-if="text" :style="{ color: textColor, fontSize: fontSize }">{{
26
+ text
27
+ }}</text>
28
+ </slot>
29
+ </view>
30
+
31
+ <!-- 菜单栏 -->
32
+ <view
33
+ :class="['hy-float-button__menus', `hy-float-button__menus--${shape}`]"
34
+ :style="menusStyle"
35
+ >
36
+ <template v-for="(item, i) in menus" :key="i">
37
+ <view
38
+ class="hy-float-button__menus--item"
39
+ :style="{
40
+ width: getFloatBtnSize,
41
+ height: getFloatBtnSize,
42
+ color: textColor,
43
+ }"
44
+ @click="handleMenuItemClick(item, i)"
45
+ >
46
+ {{ typeof item === "string" ? item : item.label }}
47
+ </view>
48
+ <HyLine
49
+ v-if="i !== menus.length - 1"
50
+ :length="addUnit(getPx(getFloatBtnSize) * 0.7)"
51
+ :direction="direction === 'row' ? 'column' : 'row'"
52
+ :custom-style="{ margin: 'auto' }"
53
+ ></HyLine>
54
+ </template>
55
+ </view>
56
+ <!-- 菜单栏 -->
57
+ </view>
58
+ </template>
59
+
60
+ <script lang="ts" setup>
61
+ import {
62
+ computed,
63
+ type CSSProperties,
64
+ getCurrentInstance,
65
+ onMounted,
66
+ ref,
67
+ toRefs,
68
+ } from "vue";
69
+ import type IProps from "./typing";
70
+ import type { MenusType } from "./typing";
71
+ import defaultProps from "./props";
72
+ import { addUnit, getPx, getRect, getWindowInfo, guid } from "../../utils";
73
+
74
+ // 组件
75
+ import HyIcon from "../hy-icon/hy-icon.vue";
76
+ import HyLine from "../hy-line/hy-line.vue";
77
+
78
+ const props = withDefaults(defineProps<IProps>(), defaultProps);
79
+ const {
80
+ menus,
81
+ customStyle,
82
+ left,
83
+ bottom,
84
+ zIndex,
85
+ bgColor,
86
+ text,
87
+ textColor,
88
+ size,
89
+ fixed,
90
+ direction,
91
+ } = toRefs(props);
92
+ const emit = defineEmits(["click", "clickItem"]);
93
+
94
+ const instance = getCurrentInstance();
95
+ const btnSize: AnyObject = {
96
+ small: "50px",
97
+ medium: "60px",
98
+ large: "70px",
99
+ };
100
+ const open = ref(false);
101
+ const rotate = computed(() => (open.value && !text.value ? "45deg" : "0deg"));
102
+ const soleId = `hy-float-button__${guid()}`;
103
+ const showLeft = ref(false);
104
+
105
+ /**
106
+ * @description 获取组件大小
107
+ * */
108
+ const getFloatBtnSize = computed(() => {
109
+ if (
110
+ typeof size.value === "string" &&
111
+ Object.keys(btnSize).includes(size.value)
112
+ ) {
113
+ return btnSize[size.value];
114
+ } else {
115
+ return addUnit(size.value);
116
+ }
117
+ });
118
+
119
+ /**
120
+ * @description 悬浮按钮样式
121
+ * */
122
+ const FloatButtonStyle = computed(() => {
123
+ const style: CSSProperties = {
124
+ bottom: addUnit(bottom.value),
125
+ left: addUnit(left.value),
126
+ backgroundColor: bgColor.value,
127
+ zIndex: zIndex.value,
128
+ color: textColor.value,
129
+ };
130
+ if (fixed.value) style.position = "fixed";
131
+
132
+ style.height = getFloatBtnSize.value;
133
+ style.width = getFloatBtnSize.value;
134
+ return Object.assign(style, customStyle.value);
135
+ });
136
+ const menusStyle = computed(() => {
137
+ const style: CSSProperties = {
138
+ backgroundColor: bgColor.value,
139
+ };
140
+
141
+ // 判断横向展示还是纵向展示
142
+ if (direction.value === "row") {
143
+ if (showLeft.value) {
144
+ style.transform = "translateX(-100%)";
145
+ style.left = "100%";
146
+ style.paddingRight = getFloatBtnSize.value;
147
+ style.flexDirection = "row-reverse";
148
+ } else {
149
+ style.paddingLeft = getFloatBtnSize.value;
150
+ }
151
+ style.bottom = 0;
152
+ style.transition = "width 0.5s ease";
153
+ style.height = getFloatBtnSize.value;
154
+ style.width = open.value
155
+ ? addUnit(
156
+ getPx(getFloatBtnSize.value) * menus.value.length +
157
+ getPx(getFloatBtnSize.value),
158
+ )
159
+ : 0;
160
+ } else {
161
+ style.bottom = 0;
162
+ style.left = 0;
163
+ style.transition = "height 0.5s ease";
164
+ style.width = getFloatBtnSize.value;
165
+ style.height = open.value
166
+ ? addUnit(
167
+ getPx(getFloatBtnSize.value) * menus.value.length +
168
+ getPx(getFloatBtnSize.value),
169
+ )
170
+ : 0;
171
+ style.paddingBottom = getFloatBtnSize.value;
172
+ }
173
+ return style;
174
+ });
175
+
176
+ onMounted(() => {
177
+ const { windowWidth } = getWindowInfo();
178
+ getRect(`#${soleId}`, false, instance).then((rect) => {
179
+ const { left } = rect as UniApp.NodeInfo;
180
+ if (left && left > windowWidth / 2) showLeft.value = true;
181
+ });
182
+ });
183
+
184
+ /**
185
+ * @description 点击悬浮按钮
186
+ * */
187
+ const handleClick = () => {
188
+ emit("click");
189
+ open.value = !open.value;
190
+ };
191
+
192
+ /**
193
+ * @description 点击单条菜单栏
194
+ * */
195
+ const handleMenuItemClick = (temp: MenusType, index: number) => {
196
+ emit("clickItem", temp, index);
197
+ open.value = false;
198
+ if (typeof temp !== "string" && temp?.url) {
199
+ uni.navigateTo({
200
+ url: temp.url,
201
+ });
202
+ }
203
+ };
204
+ </script>
205
+
206
+ <style scoped lang="scss">
207
+ @import "./index.scss";
208
+ .hy-float-button {
209
+ &__container {
210
+ rotate: v-bind(rotate);
211
+ }
212
+ &__menus {
213
+ display: flex;
214
+ flex-direction: v-bind(direction);
215
+ }
216
+ }
217
+ </style>
@@ -0,0 +1,67 @@
1
+ @use "../../theme.scss" as *;
2
+ @use "../../libs/css/mixin.scss" as *;
3
+
4
+
5
+ .hy-float-button {
6
+ position: relative;
7
+ opacity: v-bind(opacity);
8
+ &__circle {
9
+ border-radius: $hy-border-radius-semicircle;
10
+ }
11
+
12
+ &__square {
13
+ border-radius: $hy-border-radius-sm;
14
+ }
15
+
16
+ &__shadow {
17
+ box-shadow: $hy-box-shadow;
18
+ }
19
+
20
+ &__animation {
21
+ animation: floatAnimation 2s ease-in-out infinite;
22
+ @keyframes floatAnimation {
23
+ 0%,
24
+ 100% {
25
+ transform: translateY(0); /* 初始位置 */
26
+ }
27
+ 50% {
28
+ transform: translateY(-20px); /* 上浮20像素 */
29
+ }
30
+ }
31
+ }
32
+
33
+ &__container {
34
+ border-radius: 50%;
35
+ width: 100%;
36
+ height: 100%;
37
+ @include flex(column);
38
+ justify-content: center;
39
+ align-items: center;
40
+ transition: 0.4s ease;
41
+ }
42
+
43
+ &__menus {
44
+ position: absolute;
45
+ z-index: -1;
46
+ overflow: hidden;
47
+ max-height: 250px;
48
+ box-sizing: border-box;
49
+ &--item {
50
+ font-size: 28rpx;
51
+ box-sizing: border-box;
52
+ white-space: nowrap;
53
+ overflow: hidden;
54
+ display: flex;
55
+ justify-content: center;
56
+ align-items: center;
57
+ }
58
+
59
+ &--circle {
60
+ border-radius: $hy-border-radius-semicircle;
61
+ }
62
+
63
+ &--square {
64
+ border-radius: $hy-border-radius-sm;
65
+ }
66
+ }
67
+ }
@@ -0,0 +1,25 @@
1
+ import type IProps from "./typing";
2
+ import { IconConfig } from "../../config";
3
+
4
+ const defaultProps: IProps = {
5
+ menus: [],
6
+ direction: "column",
7
+ icon: IconConfig.PLUS,
8
+ iconSize: "",
9
+ iconColor: "#FFFFFF",
10
+ bottom: 80,
11
+ left: 20,
12
+ zIndex: 10086,
13
+ bgColor: "#3D7EFF",
14
+ text: "",
15
+ fontSize: "12px",
16
+ textColor: "#FFFFFF",
17
+ size: "medium",
18
+ shape: "circle",
19
+ opacity: 1,
20
+ shadow: true,
21
+ float: true,
22
+ fixed: true,
23
+ };
24
+
25
+ export default defaultProps;
@@ -0,0 +1,93 @@
1
+ import type { CSSProperties } from "vue";
2
+
3
+ interface MenusVo {
4
+ /**
5
+ * @description 显示菜单文本
6
+ * */
7
+ label?: string;
8
+ /**
9
+ * @description 跳转路径
10
+ * */
11
+ url?: string;
12
+ }
13
+
14
+ export type MenusType = MenusVo | string;
15
+
16
+ export default interface IProps {
17
+ /**
18
+ * @description 菜单栏集合
19
+ * */
20
+ menus?: MenusType[];
21
+ /**
22
+ * @description 打开方向,row-横向;column-纵向
23
+ * */
24
+ direction?: HyApp.DirectionType;
25
+ /**
26
+ * @description 按钮显示的图标
27
+ * */
28
+ icon?: string;
29
+ /**
30
+ * @description 按钮图标大小
31
+ * */
32
+ iconSize?: string | number;
33
+ /**
34
+ * @description 按钮图标颜色
35
+ * */
36
+ iconColor?: string;
37
+ /**
38
+ * @description 按钮距离底部的距离,默认单位为px
39
+ * */
40
+ bottom?: number | string;
41
+ /**
42
+ * @description 按钮距离左边的距离,默认单位为px
43
+ * */
44
+ left?: number | string;
45
+ /**
46
+ * @description 层级(默认:10086)
47
+ * */
48
+ zIndex?: number;
49
+ /**
50
+ * @description 按钮背景颜色
51
+ * */
52
+ bgColor?: string;
53
+ /**
54
+ * @description 按钮文字
55
+ * */
56
+ text?: string;
57
+ /**
58
+ * @description 按钮文字大小
59
+ * */
60
+ fontSize?: string | number;
61
+ /**
62
+ * @description 按钮文字的颜色
63
+ * */
64
+ textColor?: string;
65
+ /**
66
+ * @description 按钮的尺寸
67
+ * */
68
+ size?: HyApp.SizeType | string | number;
69
+ /**
70
+ * @description 按钮的形状
71
+ * */
72
+ shape?: HyApp.ShapeType;
73
+ /**
74
+ * @description 按钮的透明度
75
+ * */
76
+ opacity?: number;
77
+ /**
78
+ * @description 是否显示阴影(默认:true)
79
+ * */
80
+ shadow?: boolean;
81
+ /**
82
+ * @description 是否显示漂浮的动画(默认:true)
83
+ * */
84
+ float?: boolean;
85
+ /**
86
+ * @description 是否固定位置(默认:true)
87
+ * */
88
+ fixed?: boolean;
89
+ /**
90
+ * @description 定义需要用到的外部样式
91
+ * */
92
+ customStyle?: CSSProperties;
93
+ }
@@ -26,8 +26,8 @@
26
26
  :style="[
27
27
  customStyle,
28
28
  {
29
- height: record?.spread ? addUnit(contentHeight) : '0px'
30
- }
29
+ height: record?.spread ? addUnit(contentHeight) : '0px',
30
+ },
31
31
  ]"
32
32
  >
33
33
  <slot :record="record?.content" />
@@ -41,7 +41,8 @@
41
41
  <script setup lang="ts">
42
42
  import { toRefs, ref, watch } from "vue";
43
43
  import defaultProps from "./props";
44
- import IProps, { PanelVo } from "./typing";
44
+ import type IProps from "./typing";
45
+ import type { PanelVo } from "./typing";
45
46
 
46
47
  import HyCell from "../hy-cell/hy-cell.vue";
47
48
  import HyLine from "../hy-line/hy-line.vue";
@@ -59,17 +60,18 @@ watch(
59
60
  lists.value = newValue.map((item) => ({
60
61
  ...item,
61
62
  arrowDirection: "down",
62
- spread: false
63
+ spread: false,
63
64
  }));
64
65
  },
65
- { immediate: true }
66
+ { immediate: true },
66
67
  );
67
68
 
68
69
  const clickHandler = (temp: PanelVo, index: number) => {
69
70
  // if (temp?.disabled && temp?.animating) return;
70
71
  lists.value = list.value.map((item, i) => {
71
72
  if (accordion.value) {
72
- item.spread = i === index;
73
+ // 判断是否是收起来
74
+ item.spread = i === index ? !item.spread : false;
73
75
  } else {
74
76
  if (i === index) {
75
77
  item.spread = !item.spread;
@@ -85,10 +87,5 @@ const clickHandler = (temp: PanelVo, index: number) => {
85
87
  </script>
86
88
 
87
89
  <style lang="scss" scoped>
88
- .hy-folding-panel {
89
- &__main {
90
- overflow: auto;
91
- transition: height 0.5s ease;
92
- }
93
- }
90
+ @import "./index.scss";
94
91
  </style>
@@ -0,0 +1,6 @@
1
+ .hy-folding-panel {
2
+ &__main {
3
+ overflow: auto;
4
+ transition: height 0.5s ease;
5
+ }
6
+ }
@@ -1,4 +1,4 @@
1
- import IProps from "./typing";
1
+ import type IProps from "./typing";
2
2
  import { ColorConfig } from "../../config";
3
3
 
4
4
  const defaultProps: IProps = {
@@ -11,7 +11,7 @@ const defaultProps: IProps = {
11
11
  showVertical: true,
12
12
  disabled: false,
13
13
  size: "medium",
14
- contentHeight: 120
14
+ contentHeight: 120,
15
15
  };
16
16
 
17
17
  export default defaultProps;
@@ -1,5 +1,5 @@
1
- import { CSSProperties } from "vue";
2
- import { CellContentVo } from "../hy-cell/typing";
1
+ import type { CSSProperties } from "vue";
2
+ import type { CellContentVo } from "../hy-cell/typing";
3
3
 
4
4
  export interface PanelVo extends CellContentVo {
5
5
  /**
@@ -1,12 +1,16 @@
1
1
  <template>
2
2
  <view class="hy-form">
3
- <view class="hy-form--item" v-for="item in columns" :key="item.field">
3
+ <view
4
+ :class="['hy-form--item', borderBottom && 'hy-border__bottom']"
5
+ v-for="item in columns"
6
+ :key="item.field"
7
+ >
4
8
  <view v-if="item.label" class="hy-form--item__label" :style="labelStyle">
5
9
  <text
6
10
  v-if="isRequired(item.rules)"
7
11
  style="color: red; font-size: 20px; line-height: 10px"
8
12
  >*</text
9
- >{{ item.label }} <text>:</text>
13
+ >{{ item.label }} <text v-if="symbol">:</text>
10
14
  </view>
11
15
  <view class="hy-form--item__container">
12
16
  <view class="hy-form--item__container-content">
@@ -161,7 +165,8 @@ import { computed, type CSSProperties, reactive, toRefs } from "vue";
161
165
  import type IProps from "./typing";
162
166
  import defaultProps from "./props";
163
167
  import { addUnit, error } from "../../utils";
164
- import type { FormColumnsType, RulesVo, FormTypeEnum } from "../../typing";
168
+ import type { FormColumnsType, RulesVo } from "../../typing";
169
+ import { FormTypeEnum } from "../../typing";
165
170
 
166
171
  // 组件
167
172
  import HyInput from "../hy-input/hy-input.vue";
@@ -175,8 +180,14 @@ import HyAddressPicker from "../hy-address-picker/hy-address-picker.vue";
175
180
  import HyTransition from "../hy-transition/hy-transition.vue";
176
181
 
177
182
  const props = withDefaults(defineProps<IProps>(), defaultProps);
178
- const { formData, columns, labelWidth, labelAlign, labelPosition } =
179
- toRefs(props);
183
+ const {
184
+ formData,
185
+ columns,
186
+ labelWidth,
187
+ labelAlign,
188
+ labelPosition,
189
+ borderBottom,
190
+ } = toRefs(props);
180
191
  const emit = defineEmits(["click"]);
181
192
 
182
193
  const labelPos = labelPosition.value === "top" ? "column" : "row";
@@ -340,33 +351,5 @@ defineExpose({
340
351
  </script>
341
352
 
342
353
  <style lang="scss" scoped>
343
- @import "../../theme.scss";
344
- .hy-form {
345
- &--item {
346
- display: flex;
347
- flex-direction: v-bind(labelPos);
348
- //align-items: center;
349
- margin-bottom: $hy-border-margin-padding-lg;
350
- &__label {
351
- padding: $hy-border-margin-padding-base 0;
352
- }
353
- &__container {
354
- flex: 1;
355
- display: flex;
356
- flex-direction: column;
357
- &-content {
358
- flex: 1;
359
- display: flex;
360
- align-items: center;
361
- .flex {
362
- flex: 1;
363
- }
364
- }
365
- &-warning {
366
- color: $hy-error;
367
- font-size: $hy-font-size-hint;
368
- }
369
- }
370
- }
371
- }
354
+ @import "./index.scss";
372
355
  </style>