fusions-ui 1.2.3 → 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 -19
  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 +46 -56
  31. package/components/fu-form-item/props.js +34 -7
  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 +39 -44
  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 +26 -24
  107. package/components/fu-swiper/props.js +80 -24
  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
@@ -1,19 +1,25 @@
1
1
  <template>
2
2
  <view>
3
3
  <view ref="fu-rate" class="fu-rate">
4
- <view class="fu-rate__icon" :class="{'fu-cursor-not-allowed': disabled}"
5
- :style="{ 'margin-right': marginNumber + 'px' }" v-for="(star, index) in stars" :key="index"
6
- @touchstart.stop="touchstart" @touchmove.stop="touchmove" @mousedown.stop="mousedown"
7
- @mousemove.stop="mousemove" @mouseleave="mouseleave">
8
- <fu-icons :color="inactiveColor" :size="size" :name="isFill ? 'star-fill' : 'star'" />
4
+ <view
5
+ class="fu-rate__icon"
6
+ :class="{'fu-cursor-not-allowed': disabled}"
7
+ :style="{ 'margin-right': marginNumber + 'px' }"
8
+ v-for="(star, index) in stars" :key="index"
9
+ @touchstart.stop="touchstart"
10
+ @touchmove.stop="touchmove"
11
+ @mousedown.stop="mousedown"
12
+ @mousemove.stop="mousemove"
13
+ @mouseleave="mouseleave">
14
+ <fu-icon :color="inactiveColor" :size="size" :name="isFill ? 'star-fill' : 'star'" />
9
15
  <!-- #ifdef APP-NVUE -->
10
- <view :style="{ width: star.activeWitch.replace('%','')*size/100+'px'}" class="fu-rate__icon-on">
11
- <fu-icons style="text-align: left;" :color="disabled? '#ccc': activeColor" :size="size" name="star-fill" />
16
+ <view class="fu-rate__icon-on" :style="{ width: star.activeWitch.replace('%', '') * size / 100 + 'px'}">
17
+ <fu-icon style="text-align: left;" :color="disabled? '#cccccc': activeColor" :size="size" name="star-fill" />
12
18
  </view>
13
19
  <!-- #endif -->
14
20
  <!-- #ifndef APP-NVUE -->
15
- <view :style="{ width: star.activeWitch}" class="fu-rate__icon-on">
16
- <fu-icons :color="disabled? disabledColor: activeColor" :size="size" name="star-fill" />
21
+ <view class="fu-rate__icon-on" :style="{ width: star.activeWitch}">
22
+ <fu-icon :color="disabled? disabledColor: activeColor" :size="size" name="star-fill" />
17
23
  </view>
18
24
  <!-- #endif -->
19
25
  </view>
@@ -42,7 +48,9 @@
42
48
  * @property {Boolean} readonly = [true|false] 是否为只读状态,默认为 false
43
49
  * @property {Boolean} allowHalf = [true|false] 是否实现半星,默认为 false
44
50
  * @property {Boolean} touchable = [true|false] 是否支持滑动手势,默认为 true
51
+ *
45
52
  * @event {Function} change fuRate 的 value 改变时触发事件,e={value:Number}
53
+ * @example <fu-rate></fu-rate>
46
54
  */
47
55
  export default {
48
56
  name: "FuRate",
@@ -91,16 +99,16 @@
91
99
  },
92
100
  mounted() {
93
101
  setTimeout(() => {
94
- this._getSize()
102
+ this.handleSize()
95
103
  }, 100)
96
104
  // #ifdef H5
97
- this.PC = this.IsPC()
105
+ this.PC = this.isPC()
98
106
  // #endif
99
107
  },
100
108
  methods: {
101
109
  touchstart(e) {
102
110
  // #ifdef H5
103
- if (this.IsPC()) return
111
+ if (this.isPC()) return
104
112
  // #endif
105
113
  if (this.readonly || this.disabled) return
106
114
  const {
@@ -108,18 +116,18 @@
108
116
  screenX
109
117
  } = e.changedTouches[0]
110
118
  // 做一下兼容,只有 Nvue 下才有 screenX,其他平台式 clientX
111
- this._getRateCount(clientX || screenX)
119
+ this.handleRateCount(clientX || screenX)
112
120
  },
113
121
  touchmove(e) {
114
122
  // #ifdef H5
115
- if (this.IsPC()) return
123
+ if (this.isPC()) return
116
124
  // #endif
117
125
  if (this.readonly || this.disabled || !this.touchable) return
118
126
  const {
119
127
  clientX,
120
128
  screenX
121
129
  } = e.changedTouches[0]
122
- this._getRateCount(clientX || screenX)
130
+ this.handleRateCount(clientX || screenX)
123
131
  },
124
132
 
125
133
  /**
@@ -127,23 +135,22 @@
127
135
  */
128
136
  mousedown(e) {
129
137
  // #ifdef H5
130
- if (!this.IsPC()) return
138
+ if (!this.isPC()) return
131
139
  if (this.readonly || this.disabled) return
132
140
  const {
133
141
  clientX,
134
142
  } = e
135
143
  this.userLastRate = this.valueSync
136
- this._getRateCount(clientX)
144
+ this.handleRateCount(clientX)
137
145
  this.userRated = true
138
146
  // #endif
139
147
  },
140
148
 
141
149
  mousemove(e) {
142
150
  // #ifdef H5
143
- if (!this.IsPC()) return
151
+ if (!this.isPC()) return
144
152
  if (this.userRated) return
145
153
  if (this.userMouseFristMove) {
146
- // console.log('---mousemove----', this.valueSync);
147
154
  this.userLastRate = this.valueSync
148
155
  this.userMouseFristMove = false
149
156
  }
@@ -151,13 +158,13 @@
151
158
  const {
152
159
  clientX,
153
160
  } = e
154
- this._getRateCount(clientX)
161
+ this.handleRateCount(clientX)
155
162
  // #endif
156
163
  },
157
164
 
158
165
  mouseleave(e) {
159
166
  // #ifdef H5
160
- if (!this.IsPC()) return
167
+ if (!this.isPC()) return
161
168
  if (this.readonly || this.disabled || !this.touchable) return
162
169
  if (this.userRated) {
163
170
  this.userRated = false
@@ -168,7 +175,7 @@
168
175
  },
169
176
 
170
177
  // #ifdef H5
171
- IsPC() {
178
+ isPC() {
172
179
  var userAgentInfo = navigator.userAgent;
173
180
  var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
174
181
  var flag = true;
@@ -185,8 +192,8 @@
185
192
  /**
186
193
  * 获取星星个数
187
194
  */
188
- _getRateCount(clientX) {
189
- this._getSize()
195
+ handleRateCount(clientX) {
196
+ this.handleSize()
190
197
  const size = Number(this.size)
191
198
  if (isNaN(size)) {
192
199
  return new Error('size 属性只能设置为数字')
@@ -211,13 +218,13 @@
211
218
 
212
219
  value = Math.max(0.5, Math.min(value, this.max))
213
220
  this.valueSync = value
214
- this._onChange()
221
+ this.handleChange()
215
222
  },
216
223
 
217
224
  /**
218
225
  * 触发动态修改
219
226
  */
220
- _onChange() {
227
+ handleChange() {
221
228
  this.$emit("input", this.valueSync);
222
229
  this.$emit("update:modelValue", this.valueSync);
223
230
  this.$emit("change", {
@@ -228,7 +235,7 @@
228
235
  /**
229
236
  * 获取星星距离屏幕左侧距离
230
237
  */
231
- _getSize() {
238
+ handleSize() {
232
239
  // #ifndef APP-NVUE
233
240
  uni.createSelectorQuery().in(this).select('.fu-rate').boundingClientRect().exec(ret => {
234
241
  if (ret) {
@@ -252,19 +259,18 @@
252
259
  },
253
260
  modelValue(newVal) {
254
261
  this.valueSync = Number(newVal);
255
- },
262
+ }
256
263
  }
257
264
  };
258
265
  </script>
259
266
 
260
267
  <style lang="scss" scoped>
268
+ @import '../../libs/style/components.scss';
269
+
261
270
  .fu-rate {
262
- /* #ifndef APP-NVUE */
263
- display: flex;
264
- /* #endif */
271
+ @include flex(row);
265
272
  line-height: 1;
266
273
  font-size: 0;
267
- flex-direction: row;
268
274
  /* #ifdef H5 */
269
275
  cursor: pointer;
270
276
  /* #endif */
@@ -277,7 +283,9 @@
277
283
  }
278
284
 
279
285
  .fu-rate__icon-on {
286
+ /* #ifndef APP-NVUE */
280
287
  overflow: hidden;
288
+ /* #endif */
281
289
  position: absolute;
282
290
  top: 0;
283
291
  left: 0;
@@ -1,67 +1,101 @@
1
1
  export default {
2
2
  props: {
3
+ /**
4
+ * @description value / v-model 当前评分
5
+ */
3
6
  value: {
4
- // 当前评分
5
7
  type: [Number, String],
6
8
  default: 0
7
9
  },
8
10
  modelValue: {
9
- // 当前评分
10
11
  type: [Number, String],
11
12
  default: 0
12
13
  },
14
+ /**
15
+ * @description 星星的类型,是否镂空
16
+ * @default true
17
+ */
13
18
  isFill: {
14
- // 星星的类型,是否镂空
15
19
  type: [Boolean, String],
16
20
  default: true
17
21
  },
22
+ /**
23
+ * @description 星星选中状态颜色
24
+ * @default '#ffca3e'
25
+ */
18
26
  activeColor: {
19
- // 星星选中状态颜色
20
27
  type: String,
21
28
  default: "#ffca3e"
22
29
  },
30
+ /**
31
+ * @description 星星未选中的颜色
32
+ * @default '#ececec'
33
+ */
23
34
  inactiveColor: {
24
- // 星星未选中的颜色
25
35
  type: String,
26
36
  default: "#ececec"
27
37
  },
38
+ /**
39
+ * @description 星星禁用状态颜色
40
+ * @default "#c0c0c0"
41
+ */
28
42
  disabledColor: {
29
- // 星星禁用状态颜色
30
43
  type: String,
31
44
  default: "#c0c0c0"
32
45
  },
46
+ /**
47
+ * @description 星星的大小
48
+ * @default 24
49
+ */
33
50
  size: {
34
- // 星星的大小
35
51
  type: [Number, String],
36
52
  default: 24
37
53
  },
54
+ /**
55
+ * @description 最大评分
56
+ * @default 5
57
+ */
38
58
  max: {
39
- // 最大评分
40
59
  type: [Number, String],
41
60
  default: 5
42
61
  },
62
+ /**
63
+ * @description 星星的间距
64
+ * @default 0
65
+ */
43
66
  margin: {
44
- // 星星的间距
45
67
  type: [Number, String],
46
68
  default: 0
47
69
  },
70
+ /**
71
+ * @description 是否可点击
72
+ * @default false
73
+ */
48
74
  disabled: {
49
- // 是否可点击
50
75
  type: [Boolean, String],
51
76
  default: false
52
77
  },
78
+ /**
79
+ * @description 是否只读
80
+ * @default false
81
+ */
53
82
  readonly: {
54
- // 是否只读
55
83
  type: [Boolean, String],
56
84
  default: false
57
85
  },
86
+ /**
87
+ * @description 是否显示半星
88
+ * @default false
89
+ */
58
90
  allowHalf: {
59
- // 是否显示半星
60
91
  type: [Boolean, String],
61
92
  default: false
62
93
  },
94
+ /**
95
+ * @description 是否支持滑动手势
96
+ * @default true
97
+ */
63
98
  touchable: {
64
- // 是否支持滑动手势
65
99
  type: [Boolean, String],
66
100
  default: true
67
101
  }
@@ -9,7 +9,7 @@
9
9
  <view class="fu-read-more__show-more__wrap" :class="{'fu-read-more__show-more': showMore}" :style="[innerShadowStyle]" @tap="toggleReadMore" v-if="isLongContent">
10
10
  <text class="fu-read-more__show-more--text" :style="[fontStyle]">{{ showMore ? closeText : openText }}</text>
11
11
  <view class="fu-read-more__show-more--icon" v-if="showMore || openIcon">
12
- <fu-icons :name="showMore? closeIcon: openIcon? openIcon: ''" :size="fontStyle.fontSize" :color="fontStyle.color"></fu-icons>
12
+ <fu-icon :name="showMore? closeIcon: openIcon? openIcon: ''" :size="fontStyle.fontSize" :color="fontStyle.color" />
13
13
  </view>
14
14
  </view>
15
15
  </view>
@@ -28,12 +28,18 @@
28
28
  * @property {String} openIcon 展开提示图标(默认 'down')
29
29
  * @property {String} closeIcon 收起提示图标(默认 'up')
30
30
  * @property {Object} shadowStyle 阴影样式
31
- * @property {String,Number} index 组件标识
31
+ * @property {String,Number} index 组件标识
32
+ * @property {String} color 字体颜色(默认 '#e1534e')
33
+ * @property {String,Number} size 字体大小(默认 14)
34
+ *
35
+ * @event {Function} open 点击展开时触发
36
+ * @event {Function} close 点击收起时触发
37
+ * @example <fu-read-more>...</fu-read-more>
32
38
  */
33
39
  export default {
34
40
  name: 'FuReadMore',
35
- emits: ['open', 'close'],
36
41
  mixins: [mpMixin, props],
42
+ emits: ['open', 'close'],
37
43
  data() {
38
44
  const elId = this.$fu.uuid();
39
45
  return {
@@ -52,7 +58,6 @@
52
58
  paramsChange() {
53
59
  return `${this.open}-${this.showHeight}`
54
60
  },
55
-
56
61
  contentStyle() {
57
62
  let style = {}
58
63
  if (this.isLongContent && !this.showMore) {
@@ -66,7 +71,6 @@
66
71
  }
67
72
  return style
68
73
  },
69
-
70
74
  innerShadowStyle() {
71
75
  let style = {}
72
76
  // 折叠时才需要阴影样式
@@ -75,12 +79,11 @@
75
79
  }
76
80
  return style
77
81
  },
78
-
79
82
  fontStyle() {
80
- let style = {}
81
- // style.color = this.fontColorStyle ? this.fontColorStyle : '#dd524d'
82
- // style.fontSize = this.fontSizeStyle ? this.fontSizeStyle : '28rpx'
83
- return style
83
+ return {
84
+ color: this.color,
85
+ fontSize: this.$fu.addUnit(this.size)
86
+ }
84
87
  }
85
88
  },
86
89
  mounted() {
@@ -144,6 +147,8 @@
144
147
  </script>
145
148
 
146
149
  <style lang="scss" scoped>
150
+ @import '../../libs/style/components.scss';
151
+
147
152
  .fu-read-more {
148
153
 
149
154
  &__content {
@@ -151,7 +156,9 @@
151
156
  color: #333333;
152
157
  line-height: 1.8;
153
158
  text-align: left;
159
+ /* #ifndef APP-NVUE */
154
160
  overflow: hidden;
161
+ /* #endif */
155
162
  transition: all 0.3s linear;
156
163
  }
157
164
 
@@ -161,18 +168,16 @@
161
168
  margin-top: 20rpx;
162
169
 
163
170
  &__wrap {
171
+ @include flex(row);
164
172
  position: relative;
165
173
  width: 100%;
166
- display: flex;
167
- flex-direction: row;
168
174
  align-items: center;
169
175
  justify-content: center;
170
176
  padding-bottom: 26rpx;
171
177
  }
172
178
 
173
179
  &--text {
174
- display: flex;
175
- flex-direction: row;
180
+ @include flex(row);
176
181
  align-items: center;
177
182
  justify-content: center;
178
183
  line-height: 1;
@@ -1,50 +1,72 @@
1
1
  export default {
2
2
  props: {
3
- // 默认占位高度
4
- showHeight: {
5
- type: Number,
6
- default: 400
7
- },
8
- // 显示收起按钮
9
- closeBtn: {
10
- type: Boolean,
11
- default: false
12
- },
13
- // 展开提示文字
14
- openText: {
15
- type: String,
16
- default: '展开阅读全文'
17
- },
18
- // 收起提示文字
19
- closeText: {
20
- type: String,
21
- default: '收起'
22
- },
23
- // 展开提示图标
24
- openIcon: {
25
- type: String,
26
- default: 'down'
27
- },
28
- // 收起提示图标
29
- closeIcon: {
30
- type: String,
31
- default: 'up'
32
- },
33
- // 阴影样式
34
- shadowStyle: {
35
- type: Object,
36
- default () {
37
- return {
38
- backgroundImage: "linear-gradient(-180deg, rgba(255, 255, 255, 0) 0%, #fff 80%)",
39
- paddingTop: "300rpx",
40
- marginTop: "-300rpx"
41
- }
42
- }
43
- },
44
- // 组件标识
45
- index: {
46
- type: [String,Number],
47
- default: ''
48
- }
3
+ // 默认占位高度
4
+ showHeight: {
5
+ type: Number,
6
+ default: 400
7
+ },
8
+ // 显示收起按钮
9
+ closeBtn: {
10
+ type: Boolean,
11
+ default: false
12
+ },
13
+ // 展开提示文字
14
+ openText: {
15
+ type: String,
16
+ default: '展开阅读全文'
17
+ },
18
+ // 收起提示文字
19
+ closeText: {
20
+ type: String,
21
+ default: '收起'
22
+ },
23
+ // 展开提示图标
24
+ openIcon: {
25
+ type: String,
26
+ default: 'down'
27
+ },
28
+ /**
29
+ * @description 收起提示图标
30
+ */
31
+ closeIcon: {
32
+ type: String,
33
+ default: 'up'
34
+ },
35
+ /**
36
+ * @description 阴影样式
37
+ */
38
+ shadowStyle: {
39
+ type: Object,
40
+ default () {
41
+ return {
42
+ backgroundImage: "linear-gradient(-180deg, rgba(255, 255, 255, 0) 0%, #fff 80%)",
43
+ paddingTop: "300rpx",
44
+ marginTop: "-300rpx"
45
+ }
46
+ }
47
+ },
48
+ /**
49
+ * @description 组件标识
50
+ */
51
+ index: {
52
+ type: [String, Number],
53
+ default: ''
54
+ },
55
+ /**
56
+ * @description 字体颜色
57
+ * @default '#e1534e'
58
+ */
59
+ color: {
60
+ type: String,
61
+ default: '#e1534e'
62
+ },
63
+ /**
64
+ * @description 字体大小
65
+ * @default 14
66
+ */
67
+ size: {
68
+ type: [String,Number],
69
+ default: 14
70
+ }
49
71
  }
50
72
  }
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view class="fu-ribbon" :style="[modeStyle]">
2
+ <view class="fu-ribbon" :class="customClass" :style="[modeStyle, $fu.addStyle(customStyle)]">
3
3
  <span class="fu-ribbon__span" :style="[itemStyle, afterStyle]">
4
4
  <slot></slot>
5
5
  </span>
@@ -7,6 +7,7 @@
7
7
  </template>
8
8
 
9
9
  <script>
10
+ import mixin from '../../libs/mixin/mixin.js'
10
11
  import mpMixin from '../../libs/mixin/mpMixin.js'
11
12
  import props from './props.js'
12
13
  /**
@@ -18,16 +19,14 @@
18
19
  * @property {String} bgColor 背景色
19
20
  * @property {String,Number} size 字体大小(默认 10)
20
21
  * @property {String} color 字体颜色
22
+ * @property {String} customClass 定义需要用到的外部样式
23
+ * @property {Object,String} customStyle 定义需要用到的外部样式
24
+ *
21
25
  * @template <fu-ribbon mode="left" bgColor="red">审核中</fu-ribbon>
22
26
  */
23
27
  export default {
24
28
  name: "FuRibbon",
25
- mixins: [mpMixin, props],
26
- data() {
27
- return {
28
-
29
- };
30
- },
29
+ mixins: [mixin, mpMixin, props],
31
30
  computed: {
32
31
  modeStyle() {
33
32
  return {
@@ -60,7 +59,9 @@
60
59
  position: absolute;
61
60
  top: -5px;
62
61
  z-index: 1;
62
+ /* #ifndef APP-NVUE */
63
63
  overflow: hidden;
64
+ /* #endif */
64
65
  width: 75px;
65
66
  height: 75px;
66
67
  text-align: right;
@@ -1,21 +1,32 @@
1
1
  export default {
2
2
  props: {
3
- // 位置类型 left左侧 right右侧
3
+ /**
4
+ * @description 位置类型
5
+ * @values 'left' - 左侧, 'right' - 右侧
6
+ * @default 'right'
7
+ */
4
8
  mode: {
5
9
  type: String,
6
10
  default: 'right'
7
11
  },
8
- // 背景色
12
+ /**
13
+ * @description 背景颜色
14
+ */
9
15
  bgColor: {
10
16
  type: String,
11
17
  default: ''
12
18
  },
13
- // 字体大小
19
+ /**
20
+ * @description 字体大小
21
+ * @default 10
22
+ */
14
23
  size: {
15
24
  type: [String,Number],
16
25
  default: 10
17
26
  },
18
- // 字体颜色
27
+ /**
28
+ * @description 字体颜色
29
+ */
19
30
  color: {
20
31
  type: String,
21
32
  default: ''