@10yun/cv-mobile-ui 0.4.2 → 0.4.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 (168) hide show
  1. package/package.json +1 -1
  2. package/ui-cv/cv-form-item/cv-form-item.vue +1 -1
  3. package/ui-cv/cv-input-password/cv-input-password.vue +2 -2
  4. package/ui-uni/amap-wx/js/util.js +166 -158
  5. package/ui-uni/page-foot/page-foot.vue +38 -0
  6. package/ui-uni/page-head/page-head.vue +16 -0
  7. package/ui-uni/product.vue +52 -52
  8. package/ui-uni/u-charts/u-charts.js +743 -1092
  9. package/ui-uni/u-link/u-link.vue +59 -0
  10. package/ui-uni/uni-badge/uni-badge.vue +250 -0
  11. package/ui-uni/uni-calendar/calendar.js +546 -0
  12. package/ui-uni/uni-calendar/uni-calendar-item.vue +171 -0
  13. package/ui-uni/uni-calendar/uni-calendar.vue +504 -0
  14. package/{ui-cv/cv-calendar → ui-uni/uni-calendar}/util.js +0 -0
  15. package/ui-uni/uni-card/uni-card.vue +420 -0
  16. package/ui-uni/uni-col/uni-col.vue +2968 -0
  17. package/ui-uni/uni-collapse/uni-collapse.vue +146 -0
  18. package/ui-uni/uni-collapse-item/uni-collapse-item.vue +378 -0
  19. package/ui-uni/uni-combox/uni-combox.vue +237 -0
  20. package/ui-uni/uni-countdown/uni-countdown.vue +234 -0
  21. package/ui-uni/uni-data-checkbox/uni-data-checkbox.vue +792 -0
  22. package/{ui-cv/cv-data-indexed-list → ui-uni/uni-data-indexed-list}/clientdb.js +0 -0
  23. package/ui-uni/uni-data-indexed-list/uni-data-indexed-list-item.vue +142 -0
  24. package/ui-uni/uni-data-indexed-list/uni-data-indexed-list.vue +364 -0
  25. package/{ui-cv/cv-data-picker → ui-uni/uni-data-picker}/keypress.js +0 -0
  26. package/ui-uni/uni-data-picker/uni-data-picker.vue +468 -0
  27. package/{ui-cv/cv-data-pickerview/cv-data-picker.js → ui-uni/uni-data-pickerview/uni-data-picker.js} +0 -0
  28. package/ui-uni/uni-data-pickerview/uni-data-pickerview.vue +298 -0
  29. package/{ui-cv/cv-dateformat → ui-uni/uni-dateformat}/date-format.js +0 -0
  30. package/ui-uni/uni-dateformat/uni-dateformat.vue +88 -0
  31. package/{ui-cv/cv-datetime-picker → ui-uni/uni-datetime-picker}/calendar-item.vue +0 -0
  32. package/{ui-cv/cv-datetime-picker → ui-uni/uni-datetime-picker}/calendar.js +0 -0
  33. package/ui-uni/uni-datetime-picker/calendar.vue +747 -0
  34. package/{ui-cv/cv-datetime-picker → ui-uni/uni-datetime-picker}/keypress.js +0 -0
  35. package/ui-uni/uni-datetime-picker/time-picker.vue +899 -0
  36. package/ui-uni/uni-datetime-picker/uni-datetime-picker.vue +874 -0
  37. package/{ui-cv/cv-datetime-picker → ui-uni/uni-datetime-picker}/util.js +0 -0
  38. package/ui-uni/uni-drawer/keypress.js +45 -0
  39. package/ui-uni/uni-drawer/uni-drawer.vue +178 -0
  40. package/{ui-cv/cv-easyinput → ui-uni/uni-easyinput}/common.js +0 -0
  41. package/ui-uni/uni-easyinput/uni-easyinput.vue +438 -0
  42. package/ui-uni/uni-fab/uni-fab.vue +443 -0
  43. package/{ui-cv/cv-fab/cv-fab.vue.bak → ui-uni/uni-fab/uni-fab.vue.bak} +2 -2
  44. package/ui-uni/uni-fav/uni-fav.vue +136 -0
  45. package/{ui-cv/cv-file-picker → ui-uni/uni-file-picker}/choose-and-upload-file.js +0 -0
  46. package/ui-uni/uni-file-picker/uni-file-picker.vue +614 -0
  47. package/{ui-cv/cv-file-picker → ui-uni/uni-file-picker}/upload-file.vue +0 -0
  48. package/{ui-cv/cv-file-picker → ui-uni/uni-file-picker}/upload-image.vue +0 -0
  49. package/{ui-cv/cv-file-picker → ui-uni/uni-file-picker}/utils.js +0 -0
  50. package/ui-uni/uni-forms/uni-forms.vue +467 -0
  51. package/ui-uni/uni-forms/validate.js +486 -0
  52. package/ui-uni/uni-forms-item/uni-forms-item.vue +500 -0
  53. package/{ui-cv/cv-goods-nav/cv-goods-nav.vue → ui-uni/uni-goods-nav/uni-goods-nav.vue} +1 -1
  54. package/ui-uni/uni-grid/uni-grid.vue +141 -0
  55. package/ui-uni/uni-grid-item/uni-grid-item.vue +123 -0
  56. package/ui-uni/uni-group/uni-group.vue +123 -0
  57. package/ui-uni/uni-icons/icons.js +132 -0
  58. package/ui-uni/uni-icons/uni-icons.vue +72 -0
  59. package/{ui-cv/cv-icon2 → ui-uni/uni-icons}/uni.ttf +0 -0
  60. package/ui-uni/uni-indexed-list/uni-indexed-list-item.vue +142 -0
  61. package/ui-uni/uni-indexed-list/uni-indexed-list.vue +357 -0
  62. package/ui-uni/uni-link/uni-link.vue +117 -0
  63. package/ui-uni/uni-list/uni-list.vue +107 -0
  64. package/ui-uni/uni-list/uni-refresh.vue +65 -0
  65. package/{ui-cv/cv-list → ui-uni/uni-list}/uni-refresh.wxs +0 -0
  66. package/ui-uni/uni-list-ad/uni-list-ad.vue +106 -0
  67. package/{ui-cv/cv-list-chat/cv-list-chat.scss → ui-uni/uni-list-chat/uni-list-chat.scss} +0 -0
  68. package/{ui-cv/cv-list-chat/cv-list-chat.vue → ui-uni/uni-list-chat/uni-list-chat.vue} +0 -0
  69. package/ui-uni/uni-list-item/uni-list-item.vue +428 -0
  70. package/ui-uni/uni-load-more/uni-load-more.vue +366 -0
  71. package/ui-uni/uni-nav-bar/uni-nav-bar.vue +244 -0
  72. package/{ui-cv/cv-nav-bar/cv-status-bar.vue → ui-uni/uni-nav-bar/uni-status-bar.vue} +0 -0
  73. package/ui-uni/uni-notice-bar/uni-notice-bar.vue +394 -0
  74. package/ui-uni/uni-number-box/uni-number-box.vue +224 -0
  75. package/ui-uni/uni-pagination/uni-pagination.vue +376 -0
  76. package/{ui-cv/cv-popup → ui-uni/uni-popup}/keypress.js +0 -0
  77. package/{ui-cv/cv-popup → ui-uni/uni-popup}/popup.js +0 -0
  78. package/ui-uni/uni-popup/uni-popup.vue +412 -0
  79. package/{ui-cv/cv-popup-dialog → ui-uni/uni-popup-dialog}/keypress.js +0 -0
  80. package/{ui-cv/cv-popup-dialog/cv-popup-dialog.vue → ui-uni/uni-popup-dialog/uni-popup-dialog.vue} +0 -0
  81. package/ui-uni/uni-popup-message/uni-popup-message.vue +143 -0
  82. package/{ui-cv/cv-popup-share/cv-popup-share.vue → ui-uni/uni-popup-share/uni-popup-share.vue} +0 -0
  83. package/ui-uni/uni-rate/uni-rate.vue +357 -0
  84. package/ui-uni/uni-row/uni-row.vue +155 -0
  85. package/ui-uni/uni-search-bar/uni-search-bar.vue +262 -0
  86. package/{ui-cv/cv-section/cv-section.vue → ui-uni/uni-section/uni-section.vue} +0 -0
  87. package/{ui-cv/cv-segmented-control/cv-segmented-control.vue → ui-uni/uni-segmented-control/uni-segmented-control.vue} +0 -0
  88. package/{ui-cv/cv-status-bar/cv-status-bar.vue → ui-uni/uni-status-bar/uni-status-bar.vue} +0 -0
  89. package/ui-uni/uni-steps/uni-steps.vue +250 -0
  90. package/{ui-cv/cv-swipe-action/cv-swipe-action.vue → ui-uni/uni-swipe-action/uni-swipe-action.vue} +0 -0
  91. package/{ui-cv/cv-swipe-action-item → ui-uni/uni-swipe-action-item}/bindingx.js +0 -0
  92. package/{ui-cv/cv-swipe-action-item → ui-uni/uni-swipe-action-item}/index.wxs +0 -0
  93. package/{ui-cv/cv-swipe-action-item → ui-uni/uni-swipe-action-item}/isPC.js +0 -0
  94. package/{ui-cv/cv-swipe-action-item → ui-uni/uni-swipe-action-item}/mpalipay.js +0 -0
  95. package/{ui-cv/cv-swipe-action-item → ui-uni/uni-swipe-action-item}/mpother.js +0 -0
  96. package/{ui-cv/cv-swipe-action-item → ui-uni/uni-swipe-action-item}/mpwxs.js +0 -0
  97. package/{ui-cv/cv-swipe-action-item/cv-swipe-action-item.vue → ui-uni/uni-swipe-action-item/uni-swipe-action-item.vue} +0 -0
  98. package/ui-uni/uni-swiper-dot/uni-swiper-dot.vue +205 -0
  99. package/ui-uni/uni-table/uni-table.vue +455 -0
  100. package/ui-uni/uni-tag/uni-tag.vue +283 -0
  101. package/ui-uni/uni-tbody/uni-tbody.vue +30 -0
  102. package/ui-uni/uni-td/uni-td.vue +88 -0
  103. package/{ui-cv/cv-test/cv-test.vue → ui-uni/uni-test/uni-test.vue} +0 -0
  104. package/{ui-cv/cv-th → ui-uni/uni-th}/filter-dropdown.vue +0 -0
  105. package/ui-uni/uni-th/uni-th.vue +259 -0
  106. package/ui-uni/uni-thead/uni-thead.vue +114 -0
  107. package/ui-uni/uni-title/uni-title.vue +171 -0
  108. package/{ui-cv/cv-tr → ui-uni/uni-tr}/table-checkbox.vue +0 -0
  109. package/ui-uni/uni-tr/uni-tr.vue +156 -0
  110. package/{ui-cv/cv-transition → ui-uni/uni-transition}/createAnimation.js +0 -0
  111. package/ui-uni/uni-transition/uni-transition.vue +287 -0
  112. package/ui-cv/cv-badge/cv-badge.vue +0 -249
  113. package/ui-cv/cv-calendar/calendar.js +0 -963
  114. package/ui-cv/cv-calendar/cv-calendar-item.vue +0 -198
  115. package/ui-cv/cv-calendar/cv-calendar.vue +0 -508
  116. package/ui-cv/cv-card/cv-card.vue +0 -427
  117. package/ui-cv/cv-col/cv-col.vue +0 -2965
  118. package/ui-cv/cv-collapse/cv-collapse.vue +0 -146
  119. package/ui-cv/cv-collapse-item/cv-collapse-item.vue +0 -395
  120. package/ui-cv/cv-combox/cv-combox.vue +0 -250
  121. package/ui-cv/cv-countdown/cv-countdown.vue +0 -245
  122. package/ui-cv/cv-data-checkbox/cv-data-checkbox.vue +0 -841
  123. package/ui-cv/cv-data-indexed-list/cv-data-indexed-list-item.vue +0 -154
  124. package/ui-cv/cv-data-indexed-list/cv-data-indexed-list.vue +0 -376
  125. package/ui-cv/cv-data-picker/cv-data-picker.vue +0 -486
  126. package/ui-cv/cv-data-pickerview/cv-data-pickerview.vue +0 -304
  127. package/ui-cv/cv-dateformat/cv-dateformat.vue +0 -86
  128. package/ui-cv/cv-datetime-picker/calendar.vue +0 -761
  129. package/ui-cv/cv-datetime-picker/cv-datetime-picker.vue +0 -958
  130. package/ui-cv/cv-datetime-picker/time-picker.vue +0 -907
  131. package/ui-cv/cv-drawer/cv-drawer.vue +0 -185
  132. package/ui-cv/cv-drawer/keypress.js +0 -45
  133. package/ui-cv/cv-easyinput/cv-easyinput.vue +0 -514
  134. package/ui-cv/cv-fab/cv-fab.vue +0 -465
  135. package/ui-cv/cv-fav/cv-fav.vue +0 -150
  136. package/ui-cv/cv-file-picker/cv-file-picker.vue +0 -619
  137. package/ui-cv/cv-form-base/cv-form-base.vue +0 -470
  138. package/ui-cv/cv-form-base/validate.js +0 -477
  139. package/ui-cv/cv-grid-group/cv-grid-group.vue +0 -148
  140. package/ui-cv/cv-grid-item/cv-grid-item.vue +0 -132
  141. package/ui-cv/cv-icon2/cv-icon2.vue +0 -78
  142. package/ui-cv/cv-icon2/icons.js +0 -132
  143. package/ui-cv/cv-indexed-list/cv-indexed-list-item.vue +0 -154
  144. package/ui-cv/cv-indexed-list/cv-indexed-list.vue +0 -371
  145. package/ui-cv/cv-link2/cv-link2.vue +0 -130
  146. package/ui-cv/cv-list/cv-list.vue +0 -107
  147. package/ui-cv/cv-list/cv-refresh.vue +0 -65
  148. package/ui-cv/cv-list-ad/cv-list-ad.vue +0 -113
  149. package/ui-cv/cv-list-item/cv-list-item.vue +0 -449
  150. package/ui-cv/cv-nav-bar/cv-nav-bar.vue +0 -256
  151. package/ui-cv/cv-notice-bar/cv-notice-bar.vue +0 -453
  152. package/ui-cv/cv-number-box/cv-number-box.vue +0 -223
  153. package/ui-cv/cv-pagination/cv-pagination.vue +0 -397
  154. package/ui-cv/cv-popup/cv-popup.vue +0 -429
  155. package/ui-cv/cv-popup-message/cv-popup-message.vue +0 -143
  156. package/ui-cv/cv-row/cv-row.vue +0 -157
  157. package/ui-cv/cv-search-bar/cv-search-bar.vue +0 -280
  158. package/ui-cv/cv-steps/cv-steps.vue +0 -293
  159. package/ui-cv/cv-swiper-dot/cv-swiper-dot.vue +0 -255
  160. package/ui-cv/cv-table/cv-table.vue +0 -460
  161. package/ui-cv/cv-tag/cv-tag.vue +0 -276
  162. package/ui-cv/cv-tbody/cv-tbody.vue +0 -28
  163. package/ui-cv/cv-td/cv-td.vue +0 -93
  164. package/ui-cv/cv-th/cv-th.vue +0 -270
  165. package/ui-cv/cv-thead/cv-thead.vue +0 -114
  166. package/ui-cv/cv-title/cv-title.vue +0 -168
  167. package/ui-cv/cv-tr/cv-tr.vue +0 -166
  168. package/ui-cv/cv-transition/cv-transition.vue +0 -279
@@ -1,465 +0,0 @@
1
- <template>
2
- <view class="uni-cursor-point">
3
- <view
4
- v-if="popMenu && (leftBottom || rightBottom || leftTop || rightTop) && content.length > 0"
5
- :class="{
6
- 'uni-fab--leftBottom': leftBottom,
7
- 'uni-fab--rightBottom': rightBottom,
8
- 'uni-fab--leftTop': leftTop,
9
- 'uni-fab--rightTop': rightTop
10
- }"
11
- class="uni-fab"
12
- >
13
- <view
14
- :class="{
15
- 'uni-fab__content--left': horizontal === 'left',
16
- 'uni-fab__content--right': horizontal === 'right',
17
- 'uni-fab__content--flexDirection': direction === 'vertical',
18
- 'uni-fab__content--flexDirectionStart': flexDirectionStart,
19
- 'uni-fab__content--flexDirectionEnd': flexDirectionEnd,
20
- 'uni-fab__content--other-platform': !isAndroidNvue
21
- }"
22
- :style="{ width: boxWidth, height: boxHeight, backgroundColor: styles.backgroundColor }"
23
- class="uni-fab__content"
24
- elevation="5"
25
- >
26
- <view v-if="flexDirectionStart || horizontalLeft" class="uni-fab__item uni-fab__item--first" />
27
- <view
28
- v-for="(item, index) in content"
29
- :key="index"
30
- :class="{ 'uni-fab__item--active': isShow }"
31
- class="uni-fab__item"
32
- @click="_onItemClick(index, item)"
33
- >
34
- <image :src="item.active ? item.selectedIconPath : item.iconPath" class="uni-fab__item-image" mode="widthFix" />
35
- <text class="uni-fab__item-text" :style="{ color: item.active ? styles.selectedColor : styles.color }">
36
- {{ item.text }}
37
- </text>
38
- </view>
39
- <view v-if="flexDirectionEnd || horizontalRight" class="uni-fab__item uni-fab__item--first" />
40
- </view>
41
- </view>
42
- <view
43
- :class="{
44
- 'uni-fab__circle--leftBottom': leftBottom,
45
- 'uni-fab__circle--rightBottom': rightBottom,
46
- 'uni-fab__circle--leftTop': leftTop,
47
- 'uni-fab__circle--rightTop': rightTop,
48
- 'uni-fab__content--other-platform': !isAndroidNvue
49
- }"
50
- class="uni-fab__circle uni-fab__plus"
51
- :style="{ 'background-color': styles.buttonColor }"
52
- @click="_onClick"
53
- >
54
- <view class="fab-circle-v" :class="{ 'uni-fab__plus--active': isShow && content.length > 0 }"></view>
55
- <view class="fab-circle-h" :class="{ 'uni-fab__plus--active': isShow && content.length > 0 }"></view>
56
- </view>
57
- </view>
58
- </template>
59
-
60
- <script>
61
- let platform = 'other';
62
- // #ifdef APP-NVUE
63
- platform = uni.getSystemInfoSync().platform;
64
- // #endif
65
-
66
- /**
67
- * Fab 悬浮按钮
68
- * @description 点击可展开一个图形按钮菜单
69
- * @tutorial https://ext.dcloud.net.cn/plugin?id=144
70
- * @property {Object} pattern 可选样式配置项
71
- * @property {Object} horizontal = [left | right] 水平对齐方式
72
- * @value left 左对齐
73
- * @value right 右对齐
74
- * @property {Object} vertical = [bottom | top] 垂直对齐方式
75
- * @value bottom 下对齐
76
- * @value top 上对齐
77
- * @property {Object} direction = [horizontal | vertical] 展开菜单显示方式
78
- * @value horizontal 水平显示
79
- * @value vertical 垂直显示
80
- * @property {Array} content 展开菜单内容配置项
81
- * @property {Boolean} popMenu 是否使用弹出菜单
82
- * @event {Function} trigger 展开菜单点击事件,返回点击信息
83
- * @event {Function} fabClick 悬浮按钮点击事件
84
- */
85
- export default {
86
- name: 'cvFab',
87
- emits: ['fabClick', 'trigger'],
88
- props: {
89
- pattern: {
90
- type: Object,
91
- default() {
92
- return {};
93
- }
94
- },
95
- horizontal: {
96
- type: String,
97
- default: 'left'
98
- },
99
- vertical: {
100
- type: String,
101
- default: 'bottom'
102
- },
103
- direction: {
104
- type: String,
105
- default: 'horizontal'
106
- },
107
- content: {
108
- type: Array,
109
- default() {
110
- return [];
111
- }
112
- },
113
- show: {
114
- type: Boolean,
115
- default: false
116
- },
117
- popMenu: {
118
- type: Boolean,
119
- default: true
120
- }
121
- },
122
- data() {
123
- return {
124
- fabShow: false,
125
- isShow: false,
126
- isAndroidNvue: platform === 'android',
127
- styles: {
128
- color: '#3c3e49',
129
- selectedColor: '#007AFF',
130
- backgroundColor: '#fff',
131
- buttonColor: '#007AFF'
132
- }
133
- };
134
- },
135
- computed: {
136
- contentWidth(e) {
137
- return (this.content.length + 1) * 55 + 10 + 'px';
138
- },
139
- contentWidthMin() {
140
- return 55 + 'px';
141
- },
142
- // 动态计算宽度
143
- boxWidth() {
144
- return this.getPosition(3, 'horizontal');
145
- },
146
- // 动态计算高度
147
- boxHeight() {
148
- return this.getPosition(3, 'vertical');
149
- },
150
- // 计算左下位置
151
- leftBottom() {
152
- return this.getPosition(0, 'left', 'bottom');
153
- },
154
- // 计算右下位置
155
- rightBottom() {
156
- return this.getPosition(0, 'right', 'bottom');
157
- },
158
- // 计算左上位置
159
- leftTop() {
160
- return this.getPosition(0, 'left', 'top');
161
- },
162
- rightTop() {
163
- return this.getPosition(0, 'right', 'top');
164
- },
165
- flexDirectionStart() {
166
- return this.getPosition(1, 'vertical', 'top');
167
- },
168
- flexDirectionEnd() {
169
- return this.getPosition(1, 'vertical', 'bottom');
170
- },
171
- horizontalLeft() {
172
- return this.getPosition(2, 'horizontal', 'left');
173
- },
174
- horizontalRight() {
175
- return this.getPosition(2, 'horizontal', 'right');
176
- }
177
- },
178
- watch: {
179
- pattern(newValue, oldValue) {
180
- //console.log(JSON.stringify(newValue))
181
- this.styles = Object.assign({}, this.styles, newValue);
182
- }
183
- },
184
- created() {
185
- this.isShow = this.show;
186
- if (this.top === 0) {
187
- this.fabShow = true;
188
- }
189
- // 初始化样式
190
- this.styles = Object.assign({}, this.styles, this.pattern);
191
- },
192
- methods: {
193
- _onClick() {
194
- this.$emit('fabClick');
195
- if (!this.popMenu) {
196
- return;
197
- }
198
- this.isShow = !this.isShow;
199
- },
200
- open() {
201
- this.isShow = true;
202
- },
203
- close() {
204
- this.isShow = false;
205
- },
206
- /**
207
- * 按钮点击事件
208
- */
209
- _onItemClick(index, item) {
210
- this.$emit('trigger', {
211
- index,
212
- item
213
- });
214
- },
215
- /**
216
- * 获取 位置信息
217
- */
218
- getPosition(types, paramA, paramB) {
219
- if (types === 0) {
220
- return this.horizontal === paramA && this.vertical === paramB;
221
- } else if (types === 1) {
222
- return this.direction === paramA && this.vertical === paramB;
223
- } else if (types === 2) {
224
- return this.direction === paramA && this.horizontal === paramB;
225
- } else {
226
- return this.isShow && this.direction === paramA ? this.contentWidth : this.contentWidthMin;
227
- }
228
- }
229
- }
230
- };
231
- </script>
232
-
233
- <style scoped>
234
- .uni-fab {
235
- position: fixed;
236
- /* #ifndef APP-NVUE */
237
- display: flex;
238
- /* #endif */
239
- justify-content: center;
240
- align-items: center;
241
- z-index: 10;
242
- }
243
-
244
- .uni-cursor-point {
245
- /* #ifdef H5 */
246
- cursor: pointer;
247
- /* #endif */
248
- }
249
-
250
- .uni-fab--active {
251
- opacity: 1;
252
- }
253
-
254
- .uni-fab--leftBottom {
255
- left: 5px;
256
- bottom: 20px;
257
- /* #ifdef H5 */
258
- left: calc(5px + var(--window-left));
259
- bottom: calc(20px + var(--window-bottom));
260
- /* #endif */
261
- padding: 10px;
262
- }
263
-
264
- .uni-fab--leftTop {
265
- left: 5px;
266
- top: 30px;
267
- /* #ifdef H5 */
268
- left: calc(5px + var(--window-left));
269
- top: calc(30px + var(--window-top));
270
- /* #endif */
271
- padding: 10px;
272
- }
273
-
274
- .uni-fab--rightBottom {
275
- right: 5px;
276
- bottom: 20px;
277
- /* #ifdef H5 */
278
- right: calc(5px + var(--window-right));
279
- bottom: calc(20px + var(--window-bottom));
280
- /* #endif */
281
- padding: 10px;
282
- }
283
-
284
- .uni-fab--rightTop {
285
- right: 5px;
286
- top: 30px;
287
- /* #ifdef H5 */
288
- right: calc(5px + var(--window-right));
289
- top: calc(30px + var(--window-top));
290
- /* #endif */
291
- padding: 10px;
292
- }
293
-
294
- .uni-fab__circle {
295
- position: fixed;
296
- /* #ifndef APP-NVUE */
297
- display: flex;
298
- /* #endif */
299
- justify-content: center;
300
- align-items: center;
301
- width: 55px;
302
- height: 55px;
303
- background-color: #3c3e49;
304
- border-radius: 55px;
305
- z-index: 11;
306
- }
307
-
308
- .uni-fab__circle--leftBottom {
309
- left: 15px;
310
- bottom: 30px;
311
- /* #ifdef H5 */
312
- left: calc(15px + var(--window-left));
313
- bottom: calc(30px + var(--window-bottom));
314
- /* #endif */
315
- }
316
-
317
- .uni-fab__circle--leftTop {
318
- left: 15px;
319
- top: 40px;
320
- /* #ifdef H5 */
321
- left: calc(15px + var(--window-left));
322
- top: calc(40px + var(--window-top));
323
- /* #endif */
324
- }
325
-
326
- .uni-fab__circle--rightBottom {
327
- right: 15px;
328
- bottom: 30px;
329
- /* #ifdef H5 */
330
- right: calc(15px + var(--window-right));
331
- bottom: calc(30px + var(--window-bottom));
332
- /* #endif */
333
- }
334
-
335
- .uni-fab__circle--rightTop {
336
- right: 15px;
337
- top: 40px;
338
- /* #ifdef H5 */
339
- right: calc(15px + var(--window-right));
340
- top: calc(40px + var(--window-top));
341
- /* #endif */
342
- }
343
-
344
- .uni-fab__circle--left {
345
- left: 0;
346
- }
347
-
348
- .uni-fab__circle--right {
349
- right: 0;
350
- }
351
-
352
- .uni-fab__circle--top {
353
- top: 0;
354
- }
355
-
356
- .uni-fab__circle--bottom {
357
- bottom: 0;
358
- }
359
-
360
- .uni-fab__plus {
361
- font-weight: bold;
362
- }
363
-
364
- .fab-circle-v {
365
- position: absolute;
366
- width: 3px;
367
- height: 31px;
368
- left: 26px;
369
- top: 12px;
370
- background-color: white;
371
- transform: rotate(0deg);
372
- transition: transform 0.3s;
373
- }
374
-
375
- .fab-circle-h {
376
- position: absolute;
377
- width: 31px;
378
- height: 3px;
379
- left: 12px;
380
- top: 26px;
381
- background-color: white;
382
- transform: rotate(0deg);
383
- transition: transform 0.3s;
384
- }
385
-
386
- .uni-fab__plus--active {
387
- transform: rotate(135deg);
388
- }
389
-
390
- .uni-fab__content {
391
- /* #ifndef APP-NVUE */
392
- box-sizing: border-box;
393
- display: flex;
394
- /* #endif */
395
- flex-direction: row;
396
- border-radius: 55px;
397
- overflow: hidden;
398
- transition-property: width, height;
399
- transition-duration: 0.2s;
400
- width: 55px;
401
- border-color: #dddddd;
402
- border-width: 1rpx;
403
- border-style: solid;
404
- }
405
-
406
- .uni-fab__content--other-platform {
407
- border-width: 0px;
408
- box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.2);
409
- }
410
-
411
- .uni-fab__content--left {
412
- justify-content: flex-start;
413
- }
414
-
415
- .uni-fab__content--right {
416
- justify-content: flex-end;
417
- }
418
-
419
- .uni-fab__content--flexDirection {
420
- flex-direction: column;
421
- justify-content: flex-end;
422
- }
423
-
424
- .uni-fab__content--flexDirectionStart {
425
- flex-direction: column;
426
- justify-content: flex-start;
427
- }
428
-
429
- .uni-fab__content--flexDirectionEnd {
430
- flex-direction: column;
431
- justify-content: flex-end;
432
- }
433
-
434
- .uni-fab__item {
435
- /* #ifndef APP-NVUE */
436
- display: flex;
437
- /* #endif */
438
- flex-direction: column;
439
- justify-content: center;
440
- align-items: center;
441
- width: 55px;
442
- height: 55px;
443
- opacity: 0;
444
- transition: opacity 0.2s;
445
- }
446
-
447
- .uni-fab__item--active {
448
- opacity: 1;
449
- }
450
-
451
- .uni-fab__item-image {
452
- width: 25px;
453
- height: 25px;
454
- margin-bottom: 3px;
455
- }
456
-
457
- .uni-fab__item-text {
458
- color: #ffffff;
459
- font-size: 12px;
460
- }
461
-
462
- .uni-fab__item--first {
463
- width: 55px;
464
- }
465
- </style>
@@ -1,150 +0,0 @@
1
- <template>
2
- <view
3
- :class="[circle === true || circle === 'true' ? 'uni-fav--circle' : '']"
4
- :style="[{ backgroundColor: checked ? bgColorChecked : bgColor }]"
5
- @click="onClick"
6
- class="uni-fav"
7
- >
8
- <!-- #ifdef MP-ALIPAY -->
9
- <view class="uni-fav-star" v-if="!checked && (star === true || star === 'true')">
10
- <cv-icon2 :color="fgColor" :style="{ color: checked ? fgColorChecked : fgColor }" size="14" type="star-filled" />
11
- </view>
12
- <!-- #endif -->
13
- <!-- #ifndef MP-ALIPAY -->
14
- <cv-icon2
15
- :color="fgColor"
16
- :style="{ color: checked ? fgColorChecked : fgColor }"
17
- class="uni-fav-star"
18
- size="14"
19
- type="star-filled"
20
- v-if="!checked && (star === true || star === 'true')"
21
- />
22
- <!-- #endif -->
23
- <text :style="{ color: checked ? fgColorChecked : fgColor }" class="uni-fav-text">
24
- {{ checked ? contentText.contentFav : contentText.contentDefault }}
25
- </text>
26
- </view>
27
- </template>
28
-
29
- <script>
30
- /**
31
- * Fav 收藏按钮
32
- * @description 用于收藏功能,可点击切换选中、不选中的状态
33
- * @tutorial https://ext.dcloud.net.cn/plugin?id=864
34
- * @property {Boolean} star = [true|false] 按钮是否带星星
35
- * @property {String} bgColor 未收藏时的背景色
36
- * @property {String} bgColorChecked 已收藏时的背景色
37
- * @property {String} fgColor 未收藏时的文字颜色
38
- * @property {String} fgColorChecked 已收藏时的文字颜色
39
- * @property {Boolean} circle = [true|false] 是否为圆角
40
- * @property {Boolean} checked = [true|false] 是否为已收藏
41
- * @property {Object} contentText = [true|false] 收藏按钮文字
42
- * @event {Function} click 点击 fav按钮触发事件
43
- * @example <uni-fav :checked="true"/>
44
- */
45
- export default {
46
- name: 'cvFav',
47
- // TODO 兼容 vue3,需要注册事件
48
- emits: ['click'],
49
- props: {
50
- star: {
51
- type: [Boolean, String],
52
- default: true
53
- },
54
- bgColor: {
55
- type: String,
56
- default: '#eeeeee'
57
- },
58
- fgColor: {
59
- type: String,
60
- default: '#666666'
61
- },
62
- bgColorChecked: {
63
- type: String,
64
- default: '#007aff'
65
- },
66
- fgColorChecked: {
67
- type: String,
68
- default: '#FFFFFF'
69
- },
70
- circle: {
71
- type: [Boolean, String],
72
- default: false
73
- },
74
- checked: {
75
- type: Boolean,
76
- default: false
77
- },
78
- contentText: {
79
- type: Object,
80
- default() {
81
- return {
82
- contentDefault: '收藏',
83
- contentFav: '已收藏'
84
- };
85
- }
86
- }
87
- },
88
- watch: {
89
- checked() {
90
- if (uni.report) {
91
- if (this.checked) {
92
- uni.report('收藏', '收藏');
93
- } else {
94
- uni.report('取消收藏', '取消收藏');
95
- }
96
- }
97
- }
98
- },
99
- methods: {
100
- onClick() {
101
- this.$emit('click');
102
- }
103
- }
104
- };
105
- </script>
106
-
107
- <style scoped>
108
- .uni-fav {
109
- /* #ifndef APP-NVUE */
110
- display: flex;
111
- /* #endif */
112
- flex-direction: row;
113
- align-items: center;
114
- justify-content: center;
115
- width: 60px;
116
- height: 25px;
117
- line-height: 25px;
118
- text-align: center;
119
- border-radius: 3px;
120
- /* #ifdef H5 */
121
- cursor: pointer;
122
- /* #endif */
123
- }
124
-
125
- .uni-fav--circle {
126
- border-radius: 30px;
127
- }
128
-
129
- .uni-fav-star {
130
- /* #ifndef APP-NVUE */
131
- display: flex;
132
- /* #endif */
133
- height: 25px;
134
- line-height: 24px;
135
- margin-right: 3px;
136
- align-items: center;
137
- justify-content: center;
138
- }
139
-
140
- .uni-fav-text {
141
- /* #ifndef APP-NVUE */
142
- display: flex;
143
- /* #endif */
144
- height: 25px;
145
- line-height: 25px;
146
- align-items: center;
147
- justify-content: center;
148
- font-size: 14px;
149
- }
150
- </style>