fusions-ui 1.2.4 → 1.2.6

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 (176) hide show
  1. package/components/fu-avatar/fu-avatar.vue +4 -2
  2. package/components/fu-avatar/props.js +52 -15
  3. package/components/fu-avatar-group/fu-avatar-group.vue +3 -2
  4. package/components/fu-avatar-group/props.js +31 -9
  5. package/components/fu-badge/fu-badge.vue +8 -14
  6. package/components/fu-badge/props.js +56 -16
  7. package/components/fu-banner-arc/fu-banner-arc.vue +4 -5
  8. package/components/fu-banner-arc/props.js +15 -4
  9. package/components/fu-button/fu-button.vue +18 -20
  10. package/components/fu-button/props.js +108 -35
  11. package/components/fu-cell/fu-cell.vue +9 -8
  12. package/components/fu-cell-group/fu-cell-group.vue +2 -1
  13. package/components/fu-cell-group/props.js +7 -2
  14. package/components/fu-checkbox/fu-checkbox.vue +5 -4
  15. package/components/fu-checkbox/props.js +51 -14
  16. package/components/fu-code-input/fu-code-input.vue +10 -6
  17. package/components/fu-code-input/props.js +66 -17
  18. package/components/fu-code-verify/fu-code-verify.vue +9 -5
  19. package/components/fu-code-verify/props.js +64 -17
  20. package/components/fu-collapse/fu-collapse.vue +10 -3
  21. package/components/fu-collapse/props.js +9 -3
  22. package/components/fu-collapse-item/fu-collapse-item.vue +45 -31
  23. package/components/fu-collapse-item/props.js +49 -16
  24. package/components/fu-countdown/fu-countdown.vue +2 -1
  25. package/components/fu-countdown/props.js +15 -4
  26. package/components/fu-datetime-picker/fu-datetime-picker.vue +6 -5
  27. package/components/fu-datetime-picker/props.js +91 -25
  28. package/components/fu-form/fu-form.vue +2 -1
  29. package/components/fu-form/props.js +34 -6
  30. package/components/fu-form-item/fu-form-item.vue +26 -33
  31. package/components/fu-form-item/props.js +30 -8
  32. package/components/fu-grid/fu-grid.vue +16 -17
  33. package/components/fu-grid/props.js +20 -5
  34. package/components/fu-grid-item/fu-grid-item.vue +31 -35
  35. package/components/fu-grid-item/props.js +11 -3
  36. package/components/fu-icon/fu-icon.vue +107 -0
  37. package/components/fu-icon/icon.css +584 -0
  38. package/components/{fu-icons/icons.js → fu-icon/icon.js} +1031 -1031
  39. package/components/{fu-icons/fuicons.ttf → fu-icon/icon.ttf} +0 -0
  40. package/components/fu-icon/props.js +55 -0
  41. package/components/fu-image/fu-image.vue +15 -10
  42. package/components/fu-image/props.js +69 -18
  43. package/components/fu-index-anchor/fu-index-anchor.vue +6 -5
  44. package/components/fu-index-anchor/props.js +20 -6
  45. package/components/fu-index-item/fu-index-item.vue +4 -4
  46. package/components/fu-index-list/fu-index-list.vue +9 -9
  47. package/components/fu-index-list/props.js +19 -6
  48. package/components/fu-input/fu-input.vue +54 -68
  49. package/components/fu-input/props.js +145 -53
  50. package/components/fu-keyboard/fu-keyboard.vue +19 -9
  51. package/components/fu-keyboard/keyboard-car.vue +33 -22
  52. package/components/fu-keyboard/keyboard-number.vue +17 -9
  53. package/components/fu-keyboard/props.js +66 -17
  54. package/components/fu-line/fu-line.vue +17 -13
  55. package/components/fu-line/props.js +30 -5
  56. package/components/fu-link/fu-link.vue +14 -8
  57. package/components/fu-link/props.js +22 -7
  58. package/components/fu-loading/fu-loading.vue +32 -27
  59. package/components/fu-loading/props.js +28 -8
  60. package/components/fu-loading-more/fu-loading-more.vue +19 -23
  61. package/components/fu-loading-more/props.js +27 -13
  62. package/components/fu-modal/fu-modal.vue +11 -6
  63. package/components/fu-modal/props.js +61 -17
  64. package/components/{fu-nav-bar/fu-nav-bar.vue → fu-navbar/fu-navbar.vue} +37 -44
  65. package/components/fu-notice-bar/fu-notice-bar.vue +10 -8
  66. package/components/fu-notice-bar/notice-column.vue +187 -122
  67. package/components/fu-notice-bar/notice-row.vue +85 -28
  68. package/components/fu-notice-bar/props.js +83 -22
  69. package/components/fu-number-box/fu-number-box.vue +26 -28
  70. package/components/fu-number-box/props.js +37 -11
  71. package/components/fu-parse/fu-parse.vue +0 -1
  72. package/components/fu-picker/fu-picker.vue +22 -17
  73. package/components/fu-picker/props.js +70 -19
  74. package/components/fu-popup/fu-popup.vue +38 -43
  75. package/components/fu-popup/props.js +34 -9
  76. package/components/fu-progress/fu-progress.vue +3 -2
  77. package/components/fu-progress/props.js +36 -9
  78. package/components/fu-rate/fu-rate.vue +40 -32
  79. package/components/fu-rate/props.js +47 -13
  80. package/components/fu-read-more/fu-read-more.vue +19 -14
  81. package/components/fu-read-more/props.js +68 -46
  82. package/components/fu-ribbon/fu-ribbon.vue +8 -7
  83. package/components/fu-ribbon/props.js +15 -4
  84. package/components/fu-scroll-list/fu-scroll-list.vue +18 -34
  85. package/components/fu-scroll-list/props.js +19 -10
  86. package/components/fu-search/fu-search.vue +13 -18
  87. package/components/fu-search/props.js +69 -17
  88. package/components/fu-section/fu-section.vue +19 -22
  89. package/components/fu-section/props.js +30 -4
  90. package/components/fu-sign-board/fu-sign-board.vue +18 -3
  91. package/components/fu-sign-board/props.js +15 -5
  92. package/components/fu-skeleton/fu-skeleton.vue +8 -12
  93. package/components/fu-skeleton/props.js +15 -4
  94. package/components/fu-steps/fu-steps.vue +3 -2
  95. package/components/fu-steps/props.js +23 -7
  96. package/components/fu-steps-item/fu-steps-item.vue +3 -3
  97. package/components/fu-steps-item/props.js +15 -5
  98. package/components/fu-sticky/fu-sticky.vue +3 -3
  99. package/components/fu-sticky/props.js +21 -7
  100. package/components/fu-subsection/fu-subsection.vue +29 -22
  101. package/components/fu-subsection/props.js +40 -10
  102. package/components/fu-swipe-action-item/bindingx.js +1 -1
  103. package/components/fu-swipe-action-item/fu-swipe-action-item.vue +134 -123
  104. package/components/fu-swipe-action-item/mpwxs.js +1 -1
  105. package/components/fu-swipe-action-item/props.js +22 -6
  106. package/components/fu-swiper/fu-swiper.vue +29 -27
  107. package/components/fu-swiper/props.js +81 -25
  108. package/components/fu-switch/fu-switch.vue +20 -12
  109. package/components/fu-switch/props.js +48 -13
  110. package/components/fu-tabs/fu-tabs.vue +36 -33
  111. package/components/fu-tabs/props.js +46 -13
  112. package/components/fu-tag/fu-tag.vue +24 -21
  113. package/components/fu-tag/props.js +63 -17
  114. package/components/fu-text/fu-text.vue +72 -33
  115. package/components/fu-text/props.js +85 -27
  116. package/components/fu-text/value.js +6 -6
  117. package/components/fu-textarea/fu-textarea.vue +13 -17
  118. package/components/fu-textarea/props.js +103 -30
  119. package/components/fu-timeaxis/fu-timeaxis.vue +1 -1
  120. package/components/fu-timeaxis-item/fu-timeaxis-item.vue +8 -4
  121. package/components/fu-transition/fu-transition.vue +48 -49
  122. package/components/fu-transition/props.js +21 -0
  123. package/components/fu-upload/fu-upload.vue +3 -1
  124. package/components/fu-upload/props.js +67 -19
  125. package/components/fu-upload/upload-file.vue +31 -18
  126. package/components/fu-upload/upload-image.vue +37 -19
  127. package/components/fu-vtabs/fu-vtabs.vue +6 -4
  128. package/components/fu-vtabs/props.js +50 -15
  129. package/components/fu-waterfall/fu-waterfall.vue +11 -9
  130. package/components/fu-waterfall/props.js +37 -15
  131. package/index.js +17 -24
  132. package/index.scss +9 -7
  133. package/libs/config/config.js +16 -9
  134. package/libs/function/applyEven.js +9 -9
  135. package/libs/function/check.js +81 -89
  136. package/libs/function/{index.js → common.js} +5 -5
  137. package/libs/function/message.js +0 -27
  138. package/libs/mixin/mixin.js +26 -21
  139. package/libs/{utils/min.router.config.js → route/min.route.config.js} +7 -7
  140. package/libs/{utils/router.config.js → route/route.config.js} +10 -11
  141. package/libs/{css/main.scss → style/common.scss} +50 -87
  142. package/libs/style/style.h5.scss +8 -0
  143. package/libs/style/style.mp.scss +15 -0
  144. package/package.json +1 -1
  145. package/components/fu-calendar/calendar-item.vue +0 -214
  146. package/components/fu-calendar/calendar.js +0 -546
  147. package/components/fu-calendar/fu-calendar.vue +0 -536
  148. package/components/fu-calendar/i18n/en.json +0 -12
  149. package/components/fu-calendar/i18n/index.js +0 -8
  150. package/components/fu-calendar/i18n/zh-Hans.json +0 -12
  151. package/components/fu-calendar/i18n/zh-Hant.json +0 -12
  152. package/components/fu-calendar/util.js +0 -360
  153. package/components/fu-date-picker/calendar-item.vue +0 -177
  154. package/components/fu-date-picker/calendar.vue +0 -917
  155. package/components/fu-date-picker/fu-date-picker.vue +0 -1069
  156. package/components/fu-date-picker/i18n/en.json +0 -22
  157. package/components/fu-date-picker/i18n/index.js +0 -8
  158. package/components/fu-date-picker/i18n/zh-Hans.json +0 -22
  159. package/components/fu-date-picker/i18n/zh-Hant.json +0 -22
  160. package/components/fu-date-picker/props.js +0 -68
  161. package/components/fu-date-picker/time-picker.vue +0 -924
  162. package/components/fu-date-picker/util.js +0 -419
  163. package/components/fu-icons/fu-icons.vue +0 -102
  164. package/components/fu-icons/fuicons.css +0 -585
  165. package/components/fu-landscape/fu-landscape.vue +0 -167
  166. package/components/fu-landscape/props.js +0 -64
  167. package/components/fu-tabbar/fu-tabbar.vue +0 -333
  168. package/components/fu-tabbar/props.js +0 -78
  169. package/libs/css/style.h5.scss +0 -35
  170. package/libs/css/style.mp.scss +0 -50
  171. package/libs/utils/util.js +0 -58
  172. /package/components/{fu-nav-bar → fu-navbar}/props.js +0 -0
  173. /package/components/{fu-nav-bar → fu-navbar}/status-bar.vue +0 -0
  174. /package/{components/fu-datetime-picker → libs/function}/dayjs.js +0 -0
  175. /package/libs/{css → style}/color.scss +0 -0
  176. /package/libs/{css/component.scss → style/components.scss} +0 -0
@@ -28,7 +28,7 @@
28
28
  <!-- #endif -->
29
29
 
30
30
  <!-- 指示灯 -->
31
- <view class="fu-scroll-list__indicator" :style="[ledStyle]" v-show="indicator">
31
+ <view class="fu-scroll-list__indicator" v-show="indicator">
32
32
  <view class="fu-scroll-list__indicator__line" :style="[lineStyle]">
33
33
  <view ref="fu-scroll-list__indicator__line__bar" class="fu-scroll-list__indicator__line__bar" :style="[barStyle]"></view>
34
34
  </view>
@@ -53,7 +53,6 @@
53
53
  * @property {Boolean} indicator = [true|false] 是否显示面板指示器 (默认 true )
54
54
  * @property {String} indicatorColor 指示器非激活颜色 (默认 '#f2f2f2' )
55
55
  * @property {String} indicatorActiveColor 指示器的激活颜色(默认 '#2979ff')
56
- * @property {String,Object} indicatorStyle 指示器样式,可通过bottom,left,right进行定位
57
56
  */
58
57
  export default {
59
58
  name:"FuScrollList",
@@ -75,31 +74,28 @@
75
74
  computed: {
76
75
  // 指示器为线型的样式
77
76
  barStyle() {
78
- const style = {}
77
+ const style = {};
79
78
  // #ifndef APP-NVUE || MP-WEIXIN || H5 || APP-VUE || MP-QQ
80
79
  // 此为普通js方案,只有在非nvue和不支持wxs方案的端才使用、
81
80
  // 此处的计算理由为:scroll-view的滚动距离与目标滚动距离(scroll-view的实际宽度减去包裹元素的宽度)之比,等于滑块当前移动距离与总需
82
81
  // 滑动距离(指示器的总宽度减去滑块宽度)的比值
83
82
  const scrollLeft = this.scrollInfo.scrollLeft,
84
83
  scrollWidth = this.scrollInfo.scrollWidth,
85
- barAllMoveWidth = this.indicatorWidth - this.indicatorBarWidth
86
- const x = scrollLeft / (scrollWidth - this.scrollWidth) * barAllMoveWidth
87
- style.transform = `translateX(${ x }px)`
84
+ barAllMoveWidth = this.indicatorWidth - this.indicatorBarWidth;
85
+ const x = scrollLeft / (scrollWidth - this.scrollWidth) * barAllMoveWidth;
86
+ style.transform = `translateX(${ x }px)`;
88
87
  // #endif
89
88
  // 设置滑块的宽度和背景色,是每个平台都需要的
90
- style.width = this.$fu.addUnit(this.indicatorBarWidth)
89
+ style.width = this.$fu.addUnit(this.indicatorBarWidth);
91
90
  style.backgroundColor = this.indicatorActiveColor;
92
91
  return style
93
92
  },
93
+ // 指示器整体的样式,需要设置其宽度和背景色
94
94
  lineStyle() {
95
- const style = {}
96
- // 指示器整体的样式,需要设置其宽度和背景色
97
- style.width = this.$fu.addUnit(this.indicatorWidth)
98
- style.backgroundColor = this.indicatorColor
99
- return style
100
- },
101
- ledStyle() {
102
- return this.$fu.addStyle(this.indicatorStyle)
95
+ return {
96
+ width: this.$fu.addUnit(this.indicatorWidth),
97
+ backgroundColor: this.indicatorColor
98
+ }
103
99
  }
104
100
  },
105
101
  mounted() {
@@ -161,36 +157,22 @@
161
157
  </script>
162
158
 
163
159
  <style lang="scss" scoped>
164
- @import '../../libs/css/color.scss';
160
+ @import '../../libs/style/components.scss';
161
+ @import '../../libs/style/color.scss';
165
162
 
166
163
  .fu-scroll-list {
167
164
  padding-bottom: 10px;
168
165
 
169
166
  &__scroll-view {
170
- /* #ifndef APP-NVUE */
171
- display: flex;
172
- /* #endif */
173
- /* #ifdef APP-NVUE */
174
- flex-direction: row;
175
- /* #endif */
167
+ @include flex(row);
176
168
 
177
169
  &__content {
178
- /* #ifndef APP-NVUE */
179
- display: flex;
180
- /* #endif */
181
- /* #ifdef APP-NVUE */
182
- flex-direction: row;
183
- /* #endif */
170
+ @include flex(row);
184
171
  }
185
172
  }
186
173
 
187
174
  &__indicator {
188
- /* #ifndef APP-NVUE */
189
- display: flex;
190
- /* #endif */
191
- /* #ifdef APP-NVUE */
192
- flex-direction: row;
193
- /* #endif */
175
+ @include flex(row);
194
176
  justify-content: center;
195
177
  margin-top: 15px;
196
178
 
@@ -198,7 +180,9 @@
198
180
  width: 60px;
199
181
  height: 4px;
200
182
  border-radius: 100px;
183
+ /* #ifndef APP-NVUE */
201
184
  overflow: hidden;
185
+ /* #endif */
202
186
 
203
187
  &__bar {
204
188
  width: 20px;
@@ -1,34 +1,43 @@
1
1
  export default {
2
2
  props: {
3
- // 指示器的整体宽度
3
+ /**
4
+ * @description 指示器的整体宽度
5
+ * @default 50
6
+ */
4
7
  indicatorWidth: {
5
8
  type: [String, Number],
6
9
  default: 50
7
10
  },
8
- // 滑块的宽度
11
+ /**
12
+ * @description 滑块的宽度
13
+ * @default 20
14
+ */
9
15
  indicatorBarWidth: {
10
16
  type: [String, Number],
11
17
  default: 20
12
18
  },
13
- // 是否显示面板指示器
19
+ /**
20
+ * @description 是否显示面板指示器
21
+ * @default true
22
+ */
14
23
  indicator: {
15
24
  type: Boolean,
16
25
  default: true
17
26
  },
18
- // 指示器非激活颜色
27
+ /**
28
+ * @description 指示器非激活颜色
29
+ * @default '#f2f2f2'
30
+ */
19
31
  indicatorColor: {
20
32
  type: String,
21
33
  default: '#f2f2f2'
22
34
  },
23
- // 指示器的激活颜色
35
+ /**
36
+ * @description 指示器的激活颜色
37
+ */
24
38
  indicatorActiveColor: {
25
39
  type: String,
26
40
  default: ''
27
- },
28
- // 指示器样式,可通过bottom,left,right进行定位
29
- indicatorStyle: {
30
- type: [String, Object],
31
- default: 'bottom'
32
41
  }
33
42
  }
34
43
  }
@@ -3,7 +3,7 @@
3
3
  <view class="fu-search__box" :style="[searchStyle]" @click="searchClick">
4
4
  <view class="fu-search__box__icon-search">
5
5
  <slot name="searchIcon">
6
- <fu-icons :name="searchIcon" :color="searchIconColor" :size="searchIconSize" />
6
+ <fu-icon :name="searchIcon" :color="searchIconColor" :size="searchIconSize" />
7
7
  </slot>
8
8
  </view>
9
9
  <input
@@ -29,7 +29,7 @@
29
29
  <text class="fu-search__text-placeholder" :style="[inputStyle]" v-else>{{ placeholder }}</text>
30
30
  <view class="fu-search__box__icon-clear" v-if="show && (clearabled === 'always' || clearabled==='auto' && searchValue !=='') && !readonly" @click="clear">
31
31
  <slot name="clearIcon">
32
- <fu-icons name="close-fill" color="#c0c4cc" size="20" />
32
+ <fu-icon name="close-fill" color="#c0c4cc" size="20" />
33
33
  </slot>
34
34
  </view>
35
35
  </view>
@@ -69,6 +69,7 @@
69
69
  * @value right 右对齐
70
70
  * @property {String,Number} height 高度(默认 36)
71
71
  * @property {String} color 输入框字体颜色
72
+ *
72
73
  * @event {Function} confirm fuSearch 的输入框 confirm 事件,返回参数为fuSearch的value,e={value:Number}
73
74
  * @event {Function} input fuSearch 的 value 改变时触发事件,返回参数为fuSearch的value,e=value
74
75
  * @event {Function} clear 点击清除按钮时触发事件,返回参数为fuSearch的value,e={value:Number}
@@ -76,6 +77,7 @@
76
77
  * @event {Function} focus input聚焦时触发事件
77
78
  * @event {Function} custom 用户点击右侧控件时触发
78
79
  * @event {Function} click readonly为true时,点击输入框,发出此事件,用于跳转搜索页
80
+ * @example <fu-search></fu-search>
79
81
  */
80
82
  export default {
81
83
  name:"FuSearch",
@@ -122,7 +124,7 @@
122
124
  this.$emit("clear", {
123
125
  value: this.searchValue
124
126
  })
125
- this.searchValue = ""
127
+ this.searchValue = "";
126
128
  },
127
129
 
128
130
  // 点击右边自定义按钮的事件
@@ -131,8 +133,8 @@
131
133
  this.$emit("custom", {
132
134
  value: this.searchValue
133
135
  });
134
- this.show = false
135
- this.showFocus = false
136
+ this.show = false;
137
+ this.showFocus = false;
136
138
  // #ifndef APP-PLUS
137
139
  uni.hideKeyboard()
138
140
  // #endif
@@ -215,33 +217,29 @@
215
217
  </script>
216
218
 
217
219
  <style lang="scss" scoped>
220
+ @import '../../libs/style/components.scss';
218
221
  $fu-search-height: 36px;
219
222
 
220
223
  .fu-search {
224
+ @include flex(row);
221
225
  flex: 1;
222
- display: flex;
223
- flex-direction: row;
224
226
  position: relative;
225
227
  align-items: center;
226
228
 
227
229
  &__box {
230
+ @include flex(row);
228
231
  /* #ifndef APP-NVUE */
229
- display: flex;
230
232
  box-sizing: border-box;
231
- /* #endif */
232
233
  overflow: hidden;
234
+ /* #endif */
233
235
  position: relative;
234
236
  flex: 1;
235
237
  justify-content: center;
236
- flex-direction: row;
237
238
  align-items: center;
238
239
  height: $fu-search-height;
239
240
 
240
241
  &__icon-search {
241
- /* #ifndef APP-NVUE */
242
- display: flex;
243
- /* #endif */
244
- flex-direction: row;
242
+ @include flex(row);
245
243
  padding: 0 8px;
246
244
  justify-content: center;
247
245
  align-items: center;
@@ -255,10 +253,7 @@
255
253
  }
256
254
 
257
255
  &__icon-clear {
258
- /* #ifndef APP-NVUE */
259
- display: flex;
260
- /* #endif */
261
- flex-direction: row;
256
+ @include flex(row);
262
257
  align-items: center;
263
258
  padding: 0 8px;
264
259
  /* #ifdef H5 */
@@ -1,5 +1,8 @@
1
1
  export default {
2
2
  props: {
3
+ /**
4
+ * @description value / v-model 输入框初始值
5
+ */
3
6
  value: {
4
7
  type: [String,Number],
5
8
  default: ""
@@ -8,87 +11,136 @@ export default {
8
11
  type: [String,Number],
9
12
  default: ""
10
13
  },
11
- // 占位提示文字(默认 '搜索关键词')
14
+ /**
15
+ * @description 占位提示文字
16
+ * @default '搜索关键词'
17
+ */
12
18
  placeholder: {
13
19
  type: String,
14
20
  default: "搜索关键词"
15
21
  },
16
- // 搜索栏圆角(默认 5)
22
+ /**
23
+ * @description 搜索栏圆角
24
+ * @default 5
25
+ */
17
26
  radius: {
18
27
  type: [String,Number],
19
28
  default: 5
20
29
  },
21
- // 输入最大长度(默认 150)
30
+ /**
31
+ * @description 输入最大长度
32
+ * @default 150
33
+ */
22
34
  maxlength: {
23
35
  type: [String,Number],
24
36
  default: 150
25
37
  },
26
- // 是否显示清除按钮 always 一直显示 auto 输入框不为空时显示 none 一直不显示(默认 'auto')
38
+ /**
39
+ * @description 是否显示清除按钮
40
+ * @values 'always' - 一直显示, 'auto' - 输入框不为空时显示, 'none' - 一直不显示
41
+ * @default 'auto'
42
+ */
27
43
  clearabled: {
28
44
  type: String,
29
45
  default: "auto"
30
46
  },
31
- // 输入框背景颜色
47
+ /**
48
+ * @description 输入框背景颜色
49
+ * @default '#F8F8F8'
50
+ */
32
51
  bgColor: {
33
52
  type: String,
34
53
  default: '#F8F8F8'
35
54
  },
36
- // 是否自动聚焦(默认 false)
55
+ /**
56
+ * @description 是否自动聚焦
57
+ * @default false
58
+ */
37
59
  focus: {
38
60
  type: Boolean,
39
61
  default: false
40
62
  },
41
- // 只读,不能有任何操作,只做展示(默认 false)
63
+ /**
64
+ * @description 只读,不能有任何操作,只做展示
65
+ * @default false
66
+ */
42
67
  readonly: {
43
68
  type: Boolean,
44
69
  default: false
45
70
  },
46
- // 是否显示右侧控件(默认 true )
71
+ /**
72
+ * @description 是否显示右侧控件
73
+ * @default true
74
+ */
47
75
  showAction: {
48
76
  type: Boolean,
49
77
  default: true
50
78
  },
51
- // 右侧控件的样式,对象形式
79
+ /**
80
+ * @description 右侧控件的样式,对象形式
81
+ */
52
82
  actionStyle: {
53
83
  type: Object,
54
84
  default: () => ({})
55
85
  },
56
- // 右侧控件文字(默认 '搜索' )
86
+ /**
87
+ * @description 右侧控件文字
88
+ * @default '搜索'
89
+ */
57
90
  actionText: {
58
91
  type: String,
59
92
  default: '搜索'
60
93
  },
61
- // input输入框的样式,可以定义文字颜色,大小等,对象形式
94
+ /**
95
+ * @description input输入框的样式,可以定义文字颜色,大小等,对象形式
96
+ */
62
97
  inputStyle: {
63
98
  type: [String,Object],
64
99
  default: () => ({})
65
100
  },
66
- // 左边的图标,可以为uyIcons图标名称(默认 'magnifier')
101
+ /**
102
+ * @description 左边的图标,可以为Icon图标名称
103
+ * @default 'magnifier'
104
+ */
67
105
  searchIcon: {
68
106
  type: String,
69
107
  default: 'magnifier'
70
108
  },
71
- // 左边的图标大小(默认 18)
109
+ /**
110
+ * @description 左边的图标大小
111
+ * @default 18
112
+ */
72
113
  searchIconSize: {
73
114
  type: [String,Number],
74
115
  default: 18
75
116
  },
76
- // 左边图标的颜色(默认 '#c0c4cc')
117
+ /**
118
+ * @description 左边图标的颜色
119
+ * @default '#c0c4cc'
120
+ */
77
121
  searchIconColor: {
78
122
  type: String,
79
123
  default: '#c0c4cc'
80
124
  },
81
- // 输入框对齐方式(默认 'center')
125
+ /**
126
+ * @description 输入框对齐方式
127
+ * @default 'center'
128
+ */
82
129
  inputAlign: {
83
130
  type: String,
84
131
  default: 'center'
85
132
  },
86
- // 高度(默认 36)
133
+ /**
134
+ * @description 设置高度
135
+ * @default 36
136
+ */
87
137
  height: {
88
138
  type: [String,Number],
89
139
  default: 36
90
140
  },
91
- // 输入框字体颜色
141
+ /**
142
+ * @description 输入框字体颜色
143
+ */
92
144
  color: {
93
145
  type: String,
94
146
  default: ''
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <view class="fu-section" :class="customClass" :style="[customStyle]">
3
- <view class="fu-section-header" @click="onClick">
2
+ <view class="fu-section" :class="customClass" :style="[$fu.addStyle(customStyle)]">
3
+ <view class="fu-section-header" @click="handleClick">
4
4
  <view class="fu-section-header__decoration" :class="mode" v-if="mode" />
5
5
  <slot v-else name="decoration"></slot>
6
6
 
@@ -8,7 +8,7 @@
8
8
  <text class="fu-section__content-title"
9
9
  :class="{'distraction': !subTitle}"
10
10
  :style="{'font-size': $fu.addUnit(titleSize), 'color': titleColor}">{{ title }}</text>
11
- <text class="fu-section-header__content-sub" :style="{'font-size': $fu.addUnit(subTitleSize), 'color': subTitleColor}" v-if="subTitle">{{ subTitle }}</text>
11
+ <text class="fu-section-header__content-sub" :style="{fontSize: $fu.addUnit(subTitleSize), color: subTitleColor}" v-if="subTitle">{{ subTitle }}</text>
12
12
  </view>
13
13
 
14
14
  <view class="fu-section-header__slot-right">
@@ -34,44 +34,44 @@
34
34
  * @value circle 圆形
35
35
  * @value square 正方形
36
36
  * @property {String} title 主标题
37
- * @property {String} titleSize 主标题字体大小
37
+ * @property {String,Number} titleSize 主标题字体大小
38
38
  * @property {String} titleColor 主标题字体颜色
39
39
  * @property {String} subTitle 副标题
40
- * @property {String} subTitleSize 副标题字体大小
40
+ * @property {String,Number} subTitleSize 副标题字体大小
41
41
  * @property {String} subTitleColor 副标题字体颜色
42
- * @property {String} customClass 自定义class
43
- * @property {Object,String} customStyle 自定义样式
42
+ * @property {String} customClass 定义需要用到的外部样式
43
+ * @property {Object,String} customStyle 定义需要用到的外部样式
44
+ *
44
45
  * @event {Function} click 点击标题栏触发
46
+ * @example <fu-section title="标题"></fu-section>
45
47
  */
46
48
  export default {
47
49
  name: 'FuSection',
48
- emits: ['click'],
49
50
  mixins: [mpMixin, mixin, props],
51
+ emits: ['click'],
52
+ methods: {
53
+ handleClick() {
54
+ this.$emit('click')
55
+ }
56
+ },
50
57
  watch: {
51
58
  title(newVal) {
52
59
  if (uni.report && newVal !== '') {
53
60
  uni.report('title', newVal)
54
61
  }
55
62
  }
56
- },
57
- methods: {
58
- onClick() {
59
- this.$emit('click')
60
- }
61
63
  }
62
64
  }
63
65
  </script>
64
66
  <style lang="scss" scoped>
65
- $fu-primary: #2979ff !default;
67
+ @import '../../libs/style/components.scss';
68
+ @import '../../libs/style/color.scss';
66
69
 
67
70
  .fu-section {
68
71
 
69
72
  .fu-section-header {
73
+ @include flex(row);
70
74
  position: relative;
71
- /* #ifndef APP-NVUE */
72
- display: flex;
73
- /* #endif */
74
- flex-direction: row;
75
75
  align-items: center;
76
76
  font-weight: normal;
77
77
  padding: 12px 0;
@@ -102,10 +102,7 @@
102
102
  }
103
103
 
104
104
  &__content {
105
- /* #ifndef APP-NVUE */
106
- display: flex;
107
- /* #endif */
108
- flex-direction: column;
105
+ @include flex(column);
109
106
  flex: 1;
110
107
  color: #333;
111
108
 
@@ -1,30 +1,56 @@
1
1
  export default {
2
2
  props: {
3
+ /**
4
+ * @description 标题装饰类型
5
+ * @values 'line' - 竖线, 'circle' - 圆形, 'square' - 正方形
6
+ */
3
7
  mode: {
4
8
  type: String,
5
9
  default: ''
6
10
  },
11
+ /**
12
+ * @description 主标题
13
+ */
7
14
  title: {
8
15
  type: String,
9
16
  required: true,
10
17
  default: ''
11
18
  },
19
+ /**
20
+ * @description 主标题字体大小
21
+ * @default 14
22
+ */
12
23
  titleSize: {
13
- type: String,
14
- default: '13px'
24
+ type: [String,Number],
25
+ default: 14
15
26
  },
27
+ /**
28
+ * @description 主标题字体颜色
29
+ * @default '#333333'
30
+ */
16
31
  titleColor: {
17
32
  type: String,
18
33
  default: '#333333'
19
34
  },
35
+ /**
36
+ * @description 副标题
37
+ */
20
38
  subTitle: {
21
39
  type: String,
22
40
  default: ''
23
41
  },
42
+ /**
43
+ * @description 副标题字体大小
44
+ * @default 12
45
+ */
24
46
  subTitleSize: {
25
- type: String,
26
- default: '12px'
47
+ type: [String,Number],
48
+ default: 12
27
49
  },
50
+ /**
51
+ * @description 副标题字体颜色
52
+ * @default '#999999'
53
+ */
28
54
  subTitleColor: {
29
55
  type: String,
30
56
  default: '#999999'
@@ -40,9 +40,10 @@
40
40
  /**
41
41
  * @description SignBoard签名板
42
42
  * @property {Boolean} show = [true|false] 是否显示(默认 false)
43
- * @property {Array} signSelectColor 可选签名颜色
44
- * @property {Boolean} rotate 是否旋转输出图片
45
- * @property {String,Number} customBarHeight 自定义顶栏的高度
43
+ * @property {Array} signSelectColor 可选签名颜色(默认 ['#060606', '#ec3930'])
44
+ * @property {Boolean} rotate 是否旋转输出图片(默认 true)
45
+ * @property {String,Number} customBarHeight 自定义顶栏的高度(默认 0)
46
+ *
46
47
  * @event {Function} save 保存时触发
47
48
  * @event {Function} close 关闭时触发
48
49
  */
@@ -120,6 +121,7 @@
120
121
  this.ctx.fill()
121
122
  this.ctx.draw()
122
123
  },
124
+
123
125
  // 开始画
124
126
  onTouchStart(e) {
125
127
  // #ifdef APP
@@ -160,6 +162,7 @@
160
162
 
161
163
  this.pointToLine(currentLine)
162
164
  },
165
+
163
166
  // 正在画
164
167
  onTouchMove(e) {
165
168
  // #ifdef APP
@@ -217,6 +220,7 @@
217
220
 
218
221
  this.pointToLine(currentLine)
219
222
  },
223
+
220
224
  // 移动结束
221
225
  onTouchEnd(e) {
222
226
  // #ifdef APP
@@ -260,10 +264,12 @@
260
264
  this.linePrack = linePrack;
261
265
  this.currentLine = [];
262
266
  },
267
+
263
268
  // 重置绘画板
264
269
  reDraw() {
265
270
  this.initCanvas('#FFFFFF')
266
271
  },
272
+
267
273
  // 保存
268
274
  save() {
269
275
  // 在组件内使用需要第二个参数this
@@ -287,6 +293,7 @@
287
293
  }
288
294
  }, this)
289
295
  },
296
+
290
297
  // 预览图片
291
298
  previewImage() {
292
299
  // 在组件内使用需要第二个参数this
@@ -327,14 +334,17 @@
327
334
  }
328
335
  })
329
336
  },
337
+
330
338
  // 切换画笔颜色
331
339
  colorSwitch(color) {
332
340
  this.currentSelectColor = color;
333
341
  },
342
+
334
343
  // 绘制两点之间的线条
335
344
  pointToLine(line) {
336
345
  this.calcBethelLine(line)
337
346
  },
347
+
338
348
  // 计算插值,让线条更加圆滑
339
349
  calcBethelLine(line) {
340
350
  if (line.length <= 1) {
@@ -424,12 +434,14 @@
424
434
  }
425
435
  this.currentLine = line;
426
436
  },
437
+
427
438
  // 求两点之间的距离
428
439
  distance(a, b) {
429
440
  let x = b.x - a.x;
430
441
  let y = b.y - a.y;
431
442
  return Math.sqrt(x * x + y * y)
432
443
  },
444
+
433
445
  // 计算点信息
434
446
  ctaCalc(x0, y0, r0, x1, y1, r1, x2, y2, r2) {
435
447
  let a = [],
@@ -513,6 +525,7 @@
513
525
  }
514
526
  return a
515
527
  },
528
+
516
529
  // 绘制贝塞尔曲线
517
530
  drawBethel(point, is_fill, color) {
518
531
  this.ctx.beginPath()
@@ -534,6 +547,7 @@
534
547
  }
535
548
  this.ctx.draw(true)
536
549
  },
550
+
537
551
  // 旋转图片
538
552
  async getRotateImage(dataUrl) {
539
553
  // const url = await this.base64ToPath(dataUrl)
@@ -563,6 +577,7 @@
563
577
  }, 50)
564
578
  })
565
579
  },
580
+
566
581
  // 将base64转换为本地
567
582
  base64ToPath(dataUrl) {
568
583
  return new Promise((resolve, reject) => {