oxy-uni-ui 1.1.0 → 1.2.3

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 (123) hide show
  1. package/attributes.json +1 -1
  2. package/components/common/abstracts/variable.scss +59 -1
  3. package/components/common/path.ts +9 -0
  4. package/components/common/util.ts +42 -0
  5. package/components/composables/index.ts +1 -0
  6. package/components/composables/useGlobalLoading.ts +42 -0
  7. package/components/composables/useGlobalMessage.ts +48 -0
  8. package/components/composables/useGlobalToast.ts +84 -0
  9. package/components/composables/useVirtualScroll.ts +173 -0
  10. package/components/oxy-cell/oxy-cell.vue +15 -2
  11. package/components/oxy-cell/types.ts +4 -0
  12. package/components/oxy-checkbox/index.scss +1 -1
  13. package/components/oxy-checkbox/oxy-checkbox.vue +2 -2
  14. package/components/oxy-col-picker/oxy-col-picker.vue +3 -0
  15. package/components/oxy-col-picker/types.ts +5 -1
  16. package/components/oxy-corner/index.scss +121 -1
  17. package/components/oxy-corner/oxy-corner.vue +18 -5
  18. package/components/oxy-corner/types.ts +24 -3
  19. package/components/oxy-date-strip/index.scss +10 -0
  20. package/components/oxy-date-strip/oxy-date-strip.vue +198 -0
  21. package/components/oxy-date-strip/types.ts +98 -0
  22. package/components/oxy-date-strip/utils.ts +67 -0
  23. package/components/oxy-date-strip-item/index.scss +94 -0
  24. package/components/oxy-date-strip-item/oxy-date-strip-item.vue +102 -0
  25. package/components/oxy-date-strip-item/types.ts +53 -0
  26. package/components/oxy-datetime-picker/oxy-datetime-picker.vue +3 -1
  27. package/components/oxy-datetime-picker/types.ts +5 -1
  28. package/components/oxy-echarts/index.scss +17 -0
  29. package/components/oxy-echarts/index.ts +1 -0
  30. package/components/oxy-echarts/oxy-echarts.vue +32 -0
  31. package/components/oxy-echarts/types.ts +12 -0
  32. package/components/oxy-file-list/index.scss +26 -0
  33. package/components/oxy-file-list/oxy-file-list.vue +208 -34
  34. package/components/oxy-file-list/types.ts +58 -2
  35. package/components/oxy-global-loading/oxy-global-loading.vue +53 -0
  36. package/components/oxy-global-message/oxy-global-message.vue +64 -0
  37. package/components/oxy-global-toast/oxy-global-toast.vue +53 -0
  38. package/components/oxy-img-lazy/index.scss +17 -0
  39. package/components/oxy-img-lazy/oxy-img-lazy.vue +332 -0
  40. package/components/oxy-img-lazy/types.ts +69 -0
  41. package/components/oxy-link/index.scss +57 -0
  42. package/components/oxy-link/oxy-link.vue +130 -0
  43. package/components/oxy-link/types.ts +81 -0
  44. package/components/oxy-list/index.scss +8 -1
  45. package/components/oxy-list/oxy-list.vue +121 -40
  46. package/components/oxy-list/types.ts +3 -15
  47. package/components/oxy-picker/oxy-picker.vue +3 -0
  48. package/components/oxy-picker/types.ts +5 -1
  49. package/components/oxy-radio/index.scss +3 -3
  50. package/components/oxy-radio/oxy-radio.vue +1 -1
  51. package/components/oxy-rich-text/icon/emjio.svg +1 -0
  52. package/components/oxy-rich-text/icon/quote.svg +1 -0
  53. package/components/oxy-rich-text/icon/text.svg +1 -0
  54. package/components/oxy-rich-text/icon/title.svg +1 -0
  55. package/components/oxy-rich-text/index.scss +159 -0
  56. package/components/oxy-rich-text/mp-html/card/card.vue +122 -0
  57. package/components/oxy-rich-text/mp-html/card/index.js +7 -0
  58. package/components/oxy-rich-text/mp-html/editable/config.js +15 -0
  59. package/components/oxy-rich-text/mp-html/editable/index.js +553 -0
  60. package/components/oxy-rich-text/mp-html/emoji/index.js +203 -0
  61. package/components/oxy-rich-text/mp-html/highlight/config.js +5 -0
  62. package/components/oxy-rich-text/mp-html/highlight/index.js +96 -0
  63. package/components/oxy-rich-text/mp-html/highlight/prism.css +1 -0
  64. package/components/oxy-rich-text/mp-html/highlight/prism.min.js +7 -0
  65. package/components/oxy-rich-text/mp-html/img-cache/index.js +138 -0
  66. package/components/oxy-rich-text/mp-html/latex/index.js +80 -0
  67. package/components/oxy-rich-text/mp-html/latex/katex.css +1 -0
  68. package/components/oxy-rich-text/mp-html/latex/katex.min.js +1 -0
  69. package/components/oxy-rich-text/mp-html/markdown/index.js +50 -0
  70. package/components/oxy-rich-text/mp-html/markdown/marked.min.js +71 -0
  71. package/components/oxy-rich-text/mp-html/mp-html.d.ts +184 -0
  72. package/components/oxy-rich-text/mp-html/mp-html.vue +675 -0
  73. package/components/oxy-rich-text/mp-html/node/node.vue +1161 -0
  74. package/components/oxy-rich-text/mp-html/parser.js +1428 -0
  75. package/components/oxy-rich-text/mp-html/search/index.js +132 -0
  76. package/components/oxy-rich-text/mp-html/style/index.js +129 -0
  77. package/components/oxy-rich-text/mp-html/style/parser.js +175 -0
  78. package/components/oxy-rich-text/mp-html/template/index.js +67 -0
  79. package/components/oxy-rich-text/mp-html/txv-video/index.js +46 -0
  80. package/components/oxy-rich-text/oxy-rich-text.vue +642 -0
  81. package/components/oxy-rich-text/types.ts +71 -0
  82. package/components/oxy-select/index.scss +255 -0
  83. package/components/oxy-select/oxy-select.vue +421 -0
  84. package/components/oxy-select/types.ts +71 -0
  85. package/components/oxy-select-picker/oxy-select-picker.vue +3 -0
  86. package/components/oxy-select-picker/types.ts +5 -1
  87. package/components/oxy-stream-render/index.scss +6 -0
  88. package/components/oxy-stream-render/oxy-stream-render.vue +204 -0
  89. package/components/oxy-stream-render/types.ts +5 -0
  90. package/components/oxy-tree/index.scss +43 -5
  91. package/components/oxy-tree/oxy-tree.vue +233 -35
  92. package/components/oxy-tree/types.ts +54 -7
  93. package/components/oxy-tree/utils.ts +51 -0
  94. package/components/oxy-virtual-scroll/index.scss +1 -1
  95. package/components/oxy-virtual-scroll/oxy-virtual-scroll.vue +69 -110
  96. package/components/oxy-virtual-scroll/types.ts +95 -5
  97. package/components/oxy-waterfall/index.scss +18 -0
  98. package/components/oxy-waterfall/oxy-waterfall.vue +218 -0
  99. package/components/oxy-waterfall/types.ts +90 -0
  100. package/components/oxy-waterfall-item/index.scss +8 -0
  101. package/components/oxy-waterfall-item/oxy-waterfall-item.vue +89 -0
  102. package/components/oxy-waterfall-item/types.ts +16 -0
  103. package/global.d.ts +7 -0
  104. package/index.ts +3 -0
  105. package/locale/lang/en-US.ts +35 -9
  106. package/locale/lang/zh-CN.ts +31 -5
  107. package/oxy-uni-ui.zip +0 -0
  108. package/package.json +1 -1
  109. package/tags.json +1 -1
  110. package/uni-echarts/changelog.md +2 -0
  111. package/uni-echarts/components/index.js +1 -0
  112. package/uni-echarts/components/uni-echarts/events.js +95 -0
  113. package/uni-echarts/components/uni-echarts/types.d.ts +183 -0
  114. package/uni-echarts/components/uni-echarts/types.js +1 -0
  115. package/uni-echarts/components/uni-echarts/uni-echarts.vue +530 -0
  116. package/uni-echarts/components/uni-echarts/uni-echarts.vue.d.ts +19 -0
  117. package/uni-echarts/global.d.ts +7 -0
  118. package/uni-echarts/index.d.ts +440 -0
  119. package/uni-echarts/index.js +2 -0
  120. package/uni-echarts/package.json +105 -0
  121. package/uni-echarts/shared-core.d.ts +269 -0
  122. package/uni-echarts/shared-core.js +900 -0
  123. package/web-types.json +1 -1
@@ -1,38 +1,61 @@
1
1
  <template>
2
- <view :class="['oxy-list', customClass]" :style="customStyle">
3
- <oxy-virtual-scroll
4
- ref="virtualScrollRef"
5
- :is-virtual="virtual"
6
- :data="data"
7
- :height="height"
8
- :item-height="itemHeight"
9
- :id-key="idKey"
10
- :show-back-to-top="showBackToTop"
11
- :back-to-top-threshold="backToTopThreshold"
2
+ <view :class="['oxy-list', 'oxy-virtual-scroll', customClass]" :style="customStyle">
3
+ <!-- 滚动内容区域 -->
4
+ <scroll-view
5
+ v-if="data.length"
6
+ :style="{ height: height }"
7
+ class="oxy-virtual-scroll__view"
8
+ :scroll-y="true"
9
+ :scroll-x="scrollX"
10
+ :upper-threshold="upperThreshold"
11
+ :lower-threshold="lowerThreshold"
12
+ :scroll-top="scrollTop"
13
+ :scroll-left="scrollLeft"
14
+ :scroll-with-animation="scrollWithAnimation"
15
+ :enable-back-to-top="enableBackToTop"
16
+ :show-scrollbar="showScrollbar"
17
+ :refresher-enabled="refresherEnabled"
18
+ :refresher-threshold="refresherThreshold"
19
+ :refresher-default-style="refresherDefaultStyle"
20
+ :refresher-background="refresherBackground"
12
21
  :refresher-triggered="triggered"
13
- v-bind="{ ...defaultscrollConfig, ...scrollConfig }"
14
- @scroll-to-upper="onScrollToUpper"
15
- @scroll-to-lower="onScrollToLower"
16
- @scroll="onScroll"
22
+ :enable-flex="enableFlex"
23
+ :scroll-anchoring="scrollAnchoring"
24
+ @scroll="handleScroll"
25
+ @scrolltoupper="onScrollToUpper"
26
+ @scrolltolower="onScrollToLower"
17
27
  @refresherrefresh="onRefresh"
18
28
  @refresherrestore="onRestore"
19
29
  @refresherabort="onAbort"
20
30
  >
21
- <template #item="{ item }">
22
- <slot name="item" :item="item"></slot>
23
- </template>
24
- <template #bottom>
25
- <oxy-loadmore
26
- v-if="loadmoreState"
27
- :state="loadmoreState"
28
- :loading-text="loadingText"
29
- :finished-text="finishedText"
30
- :error-text="errorText"
31
- :loading-props="loadingProps"
32
- @reload="onReload"
33
- />
34
- </template>
35
- </oxy-virtual-scroll>
31
+ <view class="oxy-virtual-scroll__container" :style="{ height: totalHeight + 'px' }">
32
+ <view class="oxy-virtual-scroll__items" :style="{ transform: `translateY(${virtualOffsetY}px)` }">
33
+ <view v-for="(item, index) in virtualData" :key="index">
34
+ <slot name="item" :item="item" :index="startIndex + index"></slot>
35
+ </view>
36
+ <slot name="bottom">
37
+ <oxy-loadmore
38
+ v-if="loadmoreState"
39
+ :state="loadmoreState"
40
+ :loading-text="loadingText"
41
+ :finished-text="finishedText"
42
+ :error-text="errorText"
43
+ :loading-props="loadingProps"
44
+ @reload="onReload"
45
+ />
46
+ </slot>
47
+ </view>
48
+ </view>
49
+ </scroll-view>
50
+
51
+ <view v-else>
52
+ <oxy-status-tip image="content" :tip="emptyText" />
53
+ </view>
54
+
55
+ <!-- 回到顶部按钮 -->
56
+ <view v-if="showBackToTop && showBackTopBtn" class="oxy-virtual-scroll__back-top" @click="scrollToTop">
57
+ <oxy-icon name="backtop" color="#fff" size="20px"></oxy-icon>
58
+ </view>
36
59
  </view>
37
60
  </template>
38
61
 
@@ -48,7 +71,7 @@ export default {
48
71
  </script>
49
72
 
50
73
  <script lang="ts" setup>
51
- import { computed, ref } from 'vue'
74
+ import { computed, toRefs } from 'vue'
52
75
  import { type ListExpose, listProps } from './types'
53
76
  import type {
54
77
  ScrollViewOnRefresherabortEvent,
@@ -56,18 +79,70 @@ import type {
56
79
  ScrollViewOnRefresherrestoreEvent,
57
80
  ScrollViewOnScrollEvent
58
81
  } from '@uni-helper/uni-app-types/index'
59
- import type { VirtualScrollInstance } from '../oxy-virtual-scroll/types'
82
+ import { useVirtualScroll } from '../composables/useVirtualScroll'
60
83
 
61
84
  const props = defineProps(listProps)
62
85
 
63
86
  const emit = defineEmits(['scroll-to-lower', 'reload', 'scroll-to-upper', 'scroll', 'refresh', 'restore', 'abort'])
64
- const virtualScrollRef = ref<VirtualScrollInstance | null>(null)
65
87
 
66
88
  const defaultscrollConfig = {
67
- refresherEnabled: true,
89
+ refresherEnabled: false,
68
90
  refresherThreshold: 60,
69
91
  scrollWithAnimation: false
70
- }
92
+ } as const
93
+
94
+ // 解构props用于组合式函数
95
+ const {
96
+ data,
97
+ virtual,
98
+ height,
99
+ itemHeight,
100
+ idKey,
101
+ showBackToTop,
102
+ backToTopThreshold,
103
+ scrollY,
104
+ scrollX,
105
+ upperThreshold,
106
+ lowerThreshold,
107
+ scrollLeft,
108
+ scrollWithAnimation,
109
+ enableBackToTop,
110
+ showScrollbar,
111
+ refresherEnabled,
112
+ refresherThreshold,
113
+ refresherDefaultStyle,
114
+ refresherBackground,
115
+ triggered,
116
+ enableFlex,
117
+ scrollAnchoring
118
+ } = toRefs(props)
119
+
120
+ // 使用虚拟滚动组合式函数
121
+ const {
122
+ scrollTop,
123
+ showBackTopBtn,
124
+ virtualData,
125
+ startIndex,
126
+ virtualOffsetY,
127
+ totalHeight,
128
+ displayData,
129
+ initScrollData,
130
+ initScrollEngine,
131
+ updateVisibleData,
132
+ scrollToTop: virtualScrollToTop,
133
+ scrollToBottom: virtualScrollToBottom,
134
+ scrollToPosition: virtualScrollToPosition,
135
+ scrollToElement: virtualScrollToElement,
136
+ scrollToElementById: virtualScrollToElementById,
137
+ onScroll: handleVirtualScroll
138
+ } = useVirtualScroll({
139
+ data,
140
+ virtual,
141
+ height,
142
+ itemHeight,
143
+ idKey,
144
+ backToTopThreshold
145
+ })
71
146
 
72
147
  const onScrollToLower = async () => {
73
148
  emit('scroll-to-lower')
@@ -78,7 +153,10 @@ const onScrollToUpper = async () => {
78
153
  const onReload = async () => {
79
154
  emit('reload')
80
155
  }
81
- const onScroll = async (event: ScrollViewOnScrollEvent) => {
156
+
157
+ // 滚动事件处理
158
+ const handleScroll = async (event: ScrollViewOnScrollEvent) => {
159
+ handleVirtualScroll(event.detail.scrollTop)
82
160
  emit('scroll', event)
83
161
  }
84
162
 
@@ -96,21 +174,24 @@ const onRestore = (e: ScrollViewOnRefresherrestoreEvent) => {
96
174
  const onAbort = (e: ScrollViewOnRefresherabortEvent) => {
97
175
  emit('abort', e)
98
176
  }
177
+
178
+ // 滚动方法
99
179
  const scrollToTop = () => {
100
- virtualScrollRef.value?.scrollToTop()
180
+ virtualScrollToTop()
101
181
  }
102
182
  const scrollToBottom = () => {
103
- virtualScrollRef.value?.scrollToBottom()
183
+ virtualScrollToBottom()
104
184
  }
105
185
  const scrollToPosition = (position: number | string) => {
106
- virtualScrollRef.value?.scrollToPosition(position)
186
+ virtualScrollToPosition(position)
107
187
  }
108
188
  const scrollToElement = (item: any) => {
109
- virtualScrollRef.value?.scrollToElement(item)
189
+ virtualScrollToElement(item)
110
190
  }
111
191
  const scrollToElementById = (id: string | number) => {
112
- virtualScrollRef.value?.scrollToElementById(id)
192
+ virtualScrollToElementById(id)
113
193
  }
194
+
114
195
  defineExpose<ListExpose>({
115
196
  scrollToTop,
116
197
  scrollToBottom,
@@ -1,5 +1,5 @@
1
1
  import type { ComponentPublicInstance, ExtractPropTypes, PropType } from 'vue'
2
- import { makeBooleanProp } from '../common/props'
2
+ import { makeBooleanProp, makeNumberProp, makeStringProp } from '../common/props'
3
3
  import { type LoadMoreState } from '../oxy-loadmore/types'
4
4
  import { type LoadingProps } from '../oxy-loading/types'
5
5
  import { virtualScrollProps } from '../oxy-virtual-scroll/types'
@@ -7,7 +7,7 @@ import { virtualScrollProps } from '../oxy-virtual-scroll/types'
7
7
  export const listProps = {
8
8
  ...virtualScrollProps,
9
9
 
10
- loadmoreState: String as PropType<LoadMoreState>,
10
+ loadmoreState: String as PropType<LoadMoreState | ''>,
11
11
 
12
12
  /**
13
13
  * 加载提示文案
@@ -25,19 +25,7 @@ export const listProps = {
25
25
  * 加载中loading组件的属性
26
26
  * 参考loading组件
27
27
  */
28
- loadingProps: Object as PropType<Partial<LoadingProps>>,
29
- triggered: makeBooleanProp(false),
30
- scrollConfig: {
31
- type: Object as PropType<ScrollConfig>,
32
- default: () => ({})
33
- }
34
- }
35
- export type ScrollConfig = {
36
- refresherEnabled: boolean
37
- refresherThreshold: number
38
- refresherBackground: string
39
- animation: boolean
40
- [key: string]: any
28
+ loadingProps: Object as PropType<Partial<LoadingProps>>
41
29
  }
42
30
  export type ListExpose = {
43
31
  scrollToTop: () => void
@@ -293,6 +293,9 @@ function close() {
293
293
  */
294
294
  function showPopup() {
295
295
  if (props.disabled || props.readonly) return
296
+ if (isFunction(props.beforeOpen) && !props.beforeOpen()) {
297
+ return
298
+ }
296
299
 
297
300
  emit('open')
298
301
  popupShow.value = true
@@ -161,7 +161,11 @@ export const pickerProps = {
161
161
  /**
162
162
  * 必填标记位置,可选值:before、after
163
163
  */
164
- markerSide: makeStringProp<'before' | 'after'>('before')
164
+ markerSide: makeStringProp<'before' | 'after'>('before'),
165
+ /**
166
+ * 打开pop之前的校验
167
+ */
168
+ beforeOpen: Function as PropType<() => boolean>
165
169
  }
166
170
 
167
171
  export type PickerProps = ExtractPropTypes<typeof pickerProps>
@@ -29,7 +29,7 @@
29
29
  color: $-dark-color-gray;
30
30
  }
31
31
  }
32
-
32
+
33
33
  @include when(button) {
34
34
  .oxy-radio__label {
35
35
  border-color: #c8c9cc;
@@ -44,7 +44,7 @@
44
44
  }
45
45
  }
46
46
  }
47
-
47
+
48
48
  @include when(dot) {
49
49
  .oxy-radio__shape {
50
50
  border-color: #c8c9cc;
@@ -64,7 +64,7 @@
64
64
  justify-content: space-between;
65
65
  align-items: center;
66
66
  text-align: center;
67
- line-height: 1.2;
67
+ // line-height: 1.2;
68
68
 
69
69
  @include when(first) {
70
70
  margin-top: 0;
@@ -16,7 +16,7 @@
16
16
  >
17
17
  <slot></slot>
18
18
  </view>
19
- <view class="oxy-radio__shape" :style="isChecked && !disabledValue ? 'color: ' + checkedColorValue : ''">
19
+ <view v-if="shapeValue !== 'button'" class="oxy-radio__shape" :style="isChecked && !disabledValue ? 'color: ' + checkedColorValue : ''">
20
20
  <oxy-icon v-if="shapeValue === 'check'" :style="isChecked && !disabledValue ? 'color: ' + checkedColorValue : ''" name="check"></oxy-icon>
21
21
  </view>
22
22
  </view>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1766975046008" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1819" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M508.544 66.88A448 448 0 0 0 60.992 514.432a448 448 0 0 0 447.552 447.552 448 448 0 0 0 447.552-447.552 448 448 0 0 0-447.552-447.552z m0 831.104a384 384 0 0 1-383.552-383.552 384 384 0 0 1 383.552-383.552 384 384 0 0 1 383.552 383.552 384 384 0 0 1-383.552 383.552z" fill="#666666" p-id="1820"></path><path d="M367.488 404.48m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z" fill="#666666" p-id="1821"></path><path d="M635.52 404.48m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z" p-id="1822" fill="#666666"></path><path d="M669.248 613.056a31.936 31.936 0 0 0-44.16 9.664c-20.8 32.448-67.968 53.44-120.064 53.44-52.096 0-99.2-20.928-120-53.376a32 32 0 1 0-53.888 34.496c32.768 51.136 99.392 82.88 173.888 82.88 74.56 0 141.184-31.744 173.952-82.944a32 32 0 0 0-9.728-44.16z" fill="#666666" p-id="1823"></path></svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1766975139977" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4924" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M156.09136 606.57001a457.596822 457.596822 0 0 1 221.680239-392.516385 50.844091 50.844091 0 1 1 50.844091 86.943396 355.90864 355.90864 0 0 0-138.804369 152.532274h16.77855a152.532274 152.532274 0 1 1-152.532274 152.532274z m406.752731 0a457.596822 457.596822 0 0 1 221.680239-392.007944 50.844091 50.844091 0 1 1 50.844091 86.943396 355.90864 355.90864 0 0 0-138.804369 152.532274h16.77855a152.532274 152.532274 0 1 1-152.532274 152.532274z" fill="#666666" p-id="4925"></path></svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1766975077860" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2823" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M859.428571 256a18.285714 18.285714 0 0 1-18.285714-18.285714V146.285714H182.857143v91.428572a18.285714 18.285714 0 0 1-36.571429 0v-109.714286a18.285714 18.285714 0 0 1 18.285715-18.285714h694.857142a18.285714 18.285714 0 0 1 18.285715 18.285714v109.714286a18.285714 18.285714 0 0 1-18.285715 18.285714z" p-id="2824"></path><path d="M512 932.571429a18.285714 18.285714 0 0 1-18.285714-18.285715V128a18.285714 18.285714 0 0 1 36.571428 0V914.285714a18.285714 18.285714 0 0 1-18.285714 18.285715z" p-id="2825"></path><path d="M694.857143 932.571429H329.142857a18.285714 18.285714 0 0 1 0-36.571429h365.714286a18.285714 18.285714 0 0 1 0 36.571429z" fill="#666666" p-id="2826"></path></svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1766975122092" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3948" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M308.623635 461.155909h406.75273v-355.90864a50.844091 50.844091 0 1 1 101.688183 0v813.505462a50.844091 50.844091 0 0 1-101.688183 0v-355.90864h-406.75273v355.90864a50.844091 50.844091 0 0 1-101.688183 0v-813.505462a50.844091 50.844091 0 0 1 101.688183 0z" fill="#666666" p-id="3949"></path></svg>
@@ -0,0 +1,159 @@
1
+ @import '../common/abstracts/variable';
2
+ @import '../common/abstracts/mixin';
3
+
4
+ .oxy-rich-text {
5
+ display: flex;
6
+ flex-direction: column;
7
+ overflow: hidden;
8
+ height: 100%;
9
+
10
+ &.editable {
11
+ border: 1px solid $-rich-text-editable-border-color;
12
+
13
+ }
14
+
15
+ .rich-text-main {
16
+ flex: 1;
17
+ overflow-y: auto;
18
+ padding: 8px;
19
+ position: relative;
20
+
21
+ }
22
+
23
+ :deep(.mp-html) {
24
+ // Styles are now handled via tagStyle prop
25
+ }
26
+
27
+ .editor_toolbox {
28
+ width: 100%;
29
+ background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
30
+ padding: 4px 8px;
31
+ box-sizing: border-box;
32
+ flex-wrap: wrap;
33
+ gap: 4px;
34
+ display: flex;
35
+ align-items: center;
36
+ border-bottom: 1px solid $-color-border-light;
37
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
38
+
39
+ .oxy-icon {
40
+ cursor: pointer;
41
+ width: 32px;
42
+ height: 32px;
43
+ display: inline-flex;
44
+ align-items: center;
45
+ justify-content: center;
46
+ border-radius: 6px;
47
+ transition: all 0.2s ease;
48
+ color: $-color-secondary;
49
+ font-size: 18px;
50
+
51
+ &:hover {
52
+ background-color: rgba(0, 0, 0, 0.05);
53
+ color: $-color-theme;
54
+ }
55
+
56
+ &:active {
57
+ background-color: rgba(0, 0, 0, 0.08);
58
+ }
59
+ }
60
+
61
+ image {
62
+ width: 16px;
63
+ height: 16px;
64
+ cursor: pointer;
65
+ padding: 8px;
66
+ border-radius: 6px;
67
+ transition: all 0.2s ease;
68
+ box-sizing: content-box;
69
+ display: inline-block;
70
+ vertical-align: middle;
71
+
72
+ &:hover {
73
+ background-color: rgba(0, 0, 0, 0.05);
74
+ }
75
+
76
+ &:active {
77
+ background-color: rgba(0, 0, 0, 0.08);
78
+ }
79
+ }
80
+
81
+ svg {
82
+ cursor: pointer;
83
+ width: 16px;
84
+ height: 16px;
85
+ padding: 8px;
86
+ border-radius: 6px;
87
+ transition: all 0.2s ease;
88
+ box-sizing: content-box;
89
+ display: inline-block;
90
+ vertical-align: middle;
91
+
92
+ &:hover {
93
+ background-color: rgba(0, 0, 0, 0.05);
94
+ transform: translateY(-1px);
95
+ }
96
+
97
+ &:active {
98
+ background-color: rgba(0, 0, 0, 0.08);
99
+ transform: translateY(0);
100
+ }
101
+ }
102
+ }
103
+
104
+ .reverse {
105
+ transform: scaleX(-1);
106
+ }
107
+
108
+ .dialog-title {
109
+ font-size: 16px;
110
+ line-height: 46px;
111
+ text-align: center;
112
+ height: 46px;
113
+ font-weight: $-fw-semibold;
114
+ color: $-color-black;
115
+
116
+ }
117
+
118
+ .oxy-rich-text__popup {
119
+ padding: 0 12px 12px 12px;
120
+
121
+ .oxy-rich-text__emoji-content {
122
+ display: flex;
123
+ font-size: 20px;
124
+ line-height: 35px;
125
+ text-align: center;
126
+
127
+ .oxy-rich-text__emoji-block {
128
+ flex: 1;
129
+ }
130
+ }
131
+
132
+ .oxy-rich-text__popup-divider {
133
+ border-top: 1px dashed $-rich-text-popup-divider-color;
134
+ width: 80%;
135
+ height: 0;
136
+ margin: 20px auto;
137
+ }
138
+
139
+ .oxy-rich-text__link-input {
140
+ margin-bottom: 16px;
141
+
142
+ .oxy-rich-text__link-label {
143
+ font-size: 14px;
144
+ color: $-color-secondary;
145
+ margin-bottom: 8px;
146
+ }
147
+ }
148
+
149
+ .oxy-rich-text__link-buttons {
150
+ display: flex;
151
+ gap: 12px;
152
+ margin-top: 20px;
153
+
154
+ .oxy-button {
155
+ flex: 1;
156
+ }
157
+ }
158
+ }
159
+ }
@@ -0,0 +1,122 @@
1
+ <template>
2
+ <view class="card" @click="onClick" :style="[customStyle]" :data-i="$attrs['data-i']">
3
+ <image class="card-img" mode="aspectFill" :src="src" />
4
+ <view class="text-wrap text-wrap-width" v-if="!!desc">
5
+ <view class="title one-t">{{title}}</view>
6
+ <view class="desc one-t">{{desc}}</view>
7
+ </view>
8
+ <view v-else class="text-wrap-width title more-t">{{title}}</view>
9
+ <image class="card-icon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAABCFBMVEUAAAC/v7+qqqqZmZmLi6KJnZ2ImZmHlpaGlKGMjJmSkp6Li5eQkJuKlZ+Pj5mOjpeJkpuNjZ6IkJmHj5eLi5uKkpmGjZqJj5uLi5eIjpmIjZiKj5qKj5mJjpiHjJqJjZaGj5iKj5eIjJmKjpqHi5eGjZeIi5eHjZiIi5eHjJiIjpaHjJeIjZiGjJeIjZiGjJaGjJeIi5aGjJeHi5eHi5aHjJeHjJaHjJeGi5eHjJaHjJeGi5aGi5aHjJeHjJaGjJeGjJeHjJaHi5eGi5eHjJaHjJeGjJaGjJeHi5aHjJeHjJeHi5aGjJeHi5aGjJaHi5eGjJaHi5eHjJaGi5eGi5aHjJeGi5aGi5apAvjmAAAAV3RSTlMABAYKCw0PERMUFRYXGBkbHB0eICEjJiksLS8wMjQ1ODk7PD9ATFZXWFlaW1xdXl+Hi6msu7/Dx8vMzs/R0tTV19na3N3f4uTn6evs7e7v8PHy9PX7/P18cCTXAAABEklEQVRo3u2YWU5CQRQFn4qCM4LzhIoDAorzrIgCigiCimf/O/Gj3UIlmJxaQFXSea/T90aRMcYYY4zpG0ZPu9cZMnAi6SsLBjqS9LnJBcqSpC53Sjs/kqSPNaxwGAqtFbrQXKILjQW68DpPF17m6EI9TRdqM3TheZouVCbpQnkcK5RC4T5BF27jdOFqhC5cDtOFixhdOB+iC2cDdOEoggttLrDbk6QW5/+WJB1T/r1e+FAHWT/2q/35scsiF/w3cdZ/R13Y+8H/MMb6Hycgfz74n6ZYfzXJ+mspyF8I/vos68cep0X4eV2EB4SD4H9bZP3vy+yTtL3KjrGddXgQ34BXCVvwMmT7P69zjDHGGGP6gF83lHISOctsKQAAAABJRU5ErkJggg=="></image>
10
+ </view>
11
+ </template>
12
+
13
+ <script>
14
+ export default {
15
+ props: {
16
+ mode: {
17
+ type: Boolean,
18
+ default: false
19
+ },
20
+ src: String,
21
+ title: String,
22
+ desc: String,
23
+ url: String,
24
+ color: String,
25
+ bgcolor: String,
26
+ border: String
27
+ },
28
+ data () {
29
+ return {
30
+
31
+ }
32
+ },
33
+ computed: {
34
+ customStyle () {
35
+ return {
36
+ 'background-color': this.bgColor || '#a4d0ff',
37
+ border: this.border || '1px solid #FFF',
38
+ color: this.color || '#000'
39
+ }
40
+ }
41
+ },
42
+ methods: {
43
+ onClick (e) {
44
+ if (this.url && this.url.trim().length > 6 && !this.mode) {
45
+ uni.navigateTo({ url: this.url })
46
+ }
47
+ this.$emit('click', e)
48
+ }
49
+ }
50
+ }
51
+ </script>
52
+
53
+ <style lang="scss">
54
+ .one-t {
55
+ overflow: hidden;
56
+ white-space: nowrap;
57
+ text-overflow: ellipsis;
58
+ transition: all linear 0.2s;
59
+ }
60
+
61
+ .more-t {
62
+ overflow: hidden;
63
+ text-overflow: ellipsis;
64
+ word-break:break-all;
65
+ display: -webkit-box;
66
+ -webkit-line-clamp: 2;
67
+ -webkit-box-orient: vertical;
68
+ transition: all linear 0.2s;
69
+ }
70
+
71
+ .card {
72
+
73
+ width: 80%;
74
+ margin: 10rpx auto;
75
+ max-width: 700rpx;
76
+ max-height: 140rpx;
77
+
78
+ box-sizing: border-box;
79
+ overflow: hidden;
80
+
81
+ display: flex;
82
+ justify-content: space-between;
83
+ align-items: center;
84
+
85
+ padding: 20rpx 0 20rpx 10rpx;
86
+ border-radius: 12rpx;
87
+
88
+ &-img {
89
+ width: 96rpx;
90
+ height: 96rpx;
91
+ border-radius: 12rpx;
92
+ flex: 0 0 96rpx;
93
+ }
94
+
95
+ &-icon {
96
+ width: 30rpx;
97
+ height: 96rpx;
98
+ }
99
+
100
+ .text-wrap {
101
+
102
+ display: flex;
103
+ flex-direction: column;
104
+ justify-content: space-between;
105
+
106
+ &-width {
107
+ width: 72%;
108
+ }
109
+ }
110
+
111
+ .title {
112
+ font-weight: bold;
113
+ font-size: 34rpx;
114
+ line-height: 48rpx;
115
+ }
116
+
117
+ .desc {
118
+ font-size: 27rpx;
119
+ line-height: 37rpx;
120
+ }
121
+ }
122
+ </style>
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @fileoverview Card 插件
3
+ */
4
+ function Card (vm) {
5
+ }
6
+
7
+ export default Card
@@ -0,0 +1,15 @@
1
+ // 以下项目可以删减或更换顺序,但不能添加或更改名字
2
+ export default {
3
+ // 普通标签的菜单项
4
+ node: ['大小', '颜色', '斜体', '粗体', '下划线', '居中', '缩进', '上移', '下移', '删除'],
5
+ // 可以设置的文字颜色,此项可以添加 css 颜色
6
+ color: ['red', 'yellow', 'blue', 'green', 'gray', 'white', 'black'],
7
+ // 图片的菜单项
8
+ img: ['换图', '宽度', '超链接', '预览图', '禁用预览', '上移', '下移', '删除'],
9
+ // 链接的菜单项
10
+ link: ['更换链接', '上移', '下移', '删除'],
11
+ // 音视频的菜单项
12
+ media: ['封面', '循环', '自动播放', '上移', '下移', '删除'],
13
+ // 卡片的菜单项
14
+ card: ['上移', '下移', '删除']
15
+ }