@10yun/cv-mobile-ui 0.5.30 → 0.5.32

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 (111) hide show
  1. package/package.json +5 -1
  2. package/ui-cv/components/cv-btn-base/cv-btn-base.vue +1 -1
  3. package/uview-plus/README.md +1 -1
  4. package/uview-plus/components/u-action-sheet/u-action-sheet.vue +8 -8
  5. package/uview-plus/components/u-album/u-album.vue +1 -1
  6. package/uview-plus/components/u-alert/u-alert.vue +5 -5
  7. package/uview-plus/components/u-app-update/u-app-update.vue +2 -2
  8. package/uview-plus/components/u-avatar/u-avatar.vue +2 -2
  9. package/uview-plus/components/u-avatar-group/u-avatar-group.vue +79 -3
  10. package/uview-plus/components/u-back-top/u-back-top.vue +4 -4
  11. package/uview-plus/components/u-badge/u-badge.vue +1 -1
  12. package/uview-plus/components/u-button/u-button.vue +8 -8
  13. package/uview-plus/components/u-button-wu/u-button-wu.vue +9 -9
  14. package/uview-plus/components/u-calendar/u-calendar.vue +5 -6
  15. package/uview-plus/components/u-car-keyboard/u-car-keyboard.vue +2 -2
  16. package/uview-plus/components/u-card/u-card.vue +139 -3
  17. package/uview-plus/components/u-cell/u-cell.vue +4 -4
  18. package/uview-plus/components/u-cell-group/u-cell-group.vue +2 -2
  19. package/uview-plus/components/u-checkbox/u-checkbox.vue +4 -4
  20. package/uview-plus/components/u-checkbox-group/u-checkbox-group.vue +1 -1
  21. package/uview-plus/components/u-code/u-code.vue +1 -1
  22. package/uview-plus/components/u-code-input/u-code-input.vue +1 -1
  23. package/uview-plus/components/u-col/u-col.vue +1 -1
  24. package/uview-plus/components/u-collapse/u-collapse.vue +2 -2
  25. package/uview-plus/components/u-collapse-item/u-collapse-item.vue +218 -3
  26. package/uview-plus/components/u-column-notice/u-column-notice.vue +3 -3
  27. package/uview-plus/components/u-copy/u-copy.vue +68 -1
  28. package/uview-plus/components/u-count-down/u-count-down.vue +1 -1
  29. package/uview-plus/components/u-count-to/u-count-to.vue +1 -1
  30. package/uview-plus/components/u-datetime-picker/u-datetime-picker.vue +3 -3
  31. package/uview-plus/components/u-divider/u-divider.vue +3 -3
  32. package/uview-plus/components/u-dropdown/u-dropdown.vue +3 -3
  33. package/uview-plus/components/u-dropdown-item/u-dropdown-item.vue +1 -1
  34. package/uview-plus/components/u-empty/u-empty.vue +3 -3
  35. package/uview-plus/components/u-form/u-form.vue +243 -1
  36. package/uview-plus/components/u-form-item/u-form-item.vue +4 -4
  37. package/uview-plus/components/u-gap/u-gap.vue +1 -1
  38. package/uview-plus/components/u-grid/u-grid.vue +1 -1
  39. package/uview-plus/components/u-grid-item/u-grid-item.vue +1 -1
  40. package/uview-plus/components/u-icon/u-icon.vue +1 -1
  41. package/uview-plus/components/u-icon/u-icon2.vue +1 -1
  42. package/uview-plus/components/u-image/u-image.vue +5 -5
  43. package/uview-plus/components/u-image-wu/u-image-wu.vue +5 -5
  44. package/uview-plus/components/u-index-anchor/u-index-anchor.vue +1 -1
  45. package/uview-plus/components/u-index-list/u-index-list.vue +2 -2
  46. package/uview-plus/components/u-input/u-input.vue +4 -4
  47. package/uview-plus/components/u-keyboard/u-keyboard.vue +6 -6
  48. package/uview-plus/components/u-lazy-load/u-lazy-load.vue +257 -3
  49. package/uview-plus/components/u-line/u-line.vue +1 -1
  50. package/uview-plus/components/u-line-progress/u-line-progress.vue +1 -1
  51. package/uview-plus/components/u-link/u-link.vue +1 -1
  52. package/uview-plus/components/u-list/u-list.vue +1 -1
  53. package/uview-plus/components/u-list-item/u-list-item.vue +1 -1
  54. package/uview-plus/components/u-loading-icon/u-loading-icon.vue +191 -3
  55. package/uview-plus/components/u-loading-page/u-loading-page.vue +4 -4
  56. package/uview-plus/components/u-loadmore/u-loadmore.vue +4 -4
  57. package/uview-plus/components/u-mask/u-mask.vue +120 -113
  58. package/uview-plus/components/u-message-input/u-message-input.vue +1 -1
  59. package/uview-plus/components/u-modal/u-modal.vue +6 -6
  60. package/uview-plus/components/u-navbar/u-navbar.vue +4 -4
  61. package/uview-plus/components/u-navbar-mini/u-navbar-mini.vue +2 -2
  62. package/uview-plus/components/u-navbar-wu/u-navbar-wu.vue +4 -4
  63. package/uview-plus/components/u-no-network/u-no-network.vue +5 -5
  64. package/uview-plus/components/u-notice-bar/u-notice-bar.vue +5 -5
  65. package/uview-plus/components/u-notify/u-notify.vue +6 -6
  66. package/uview-plus/components/u-number-box/u-number-box.vue +9 -3
  67. package/uview-plus/components/u-number-keyboard/u-number-keyboard.vue +1 -1
  68. package/uview-plus/components/u-overlay/u-overlay.vue +3 -3
  69. package/uview-plus/components/u-picker/u-picker.vue +5 -5
  70. package/uview-plus/components/u-popup/u-popup.vue +8 -8
  71. package/uview-plus/components/u-popup-wu/u-popup-wu.vue +7 -7
  72. package/uview-plus/components/u-qrcode/u-qrcode.vue +275 -3
  73. package/uview-plus/components/u-radio/u-radio.vue +4 -4
  74. package/uview-plus/components/u-radio-group/u-radio-group.vue +1 -1
  75. package/uview-plus/components/u-rate/u-rate.vue +5 -5
  76. package/uview-plus/components/u-read-more/u-read-more.vue +126 -3
  77. package/uview-plus/components/u-row/u-row.vue +1 -1
  78. package/uview-plus/components/u-row-notice/u-row-notice.vue +3 -3
  79. package/uview-plus/components/u-safe-bottom/u-safe-bottom.vue +48 -3
  80. package/uview-plus/components/u-search/u-search.vue +4 -4
  81. package/uview-plus/components/u-select/u-select.vue +175 -3
  82. package/uview-plus/components/u-skeleton/u-skeleton.vue +3 -3
  83. package/uview-plus/components/u-sku-wu/u-sku-wu.vue +4 -4
  84. package/uview-plus/components/u-status-bar/u-status-bar.vue +1 -1
  85. package/uview-plus/components/u-steps/u-steps.vue +1 -1
  86. package/uview-plus/components/u-steps-item/u-steps-item.vue +7 -7
  87. package/uview-plus/components/u-sticky/u-sticky.vue +1 -1
  88. package/uview-plus/components/u-subsection/u-subsection.vue +1 -1
  89. package/uview-plus/components/u-swipe-action/u-swipe-action.vue +1 -1
  90. package/uview-plus/components/u-swipe-action-item/u-swipe-action-item.vue +3 -3
  91. package/uview-plus/components/u-swiper/u-swiper.vue +1 -1
  92. package/uview-plus/components/u-swiper-indicator/u-swiper-indicator.vue +1 -1
  93. package/uview-plus/components/u-switch/u-switch.vue +2 -2
  94. package/uview-plus/components/u-tabbar/u-tabbar.vue +2 -2
  95. package/uview-plus/components/u-tabbar-item/u-tabbar-item.vue +9 -4
  96. package/uview-plus/components/u-table/u-table.vue +1 -1
  97. package/uview-plus/components/u-tabs/u-tabs.vue +3 -3
  98. package/uview-plus/components/u-tag/u-tag.vue +5 -5
  99. package/uview-plus/components/u-text/u-text.vue +159 -3
  100. package/uview-plus/components/u-toast/u-toast.vue +8 -8
  101. package/uview-plus/components/u-tooltip/u-tooltip.vue +6 -6
  102. package/uview-plus/components/u-upload/u-upload.vue +10 -10
  103. package/uview-plus/components/u-waterfall/u-waterfall.vue +221 -3
  104. package/uview-plus/index.js +4 -2
  105. package/uview-plus/libs/ctocode/image.js +17 -0
  106. package/uview-plus/libs/ctocode/index.js +150 -0
  107. package/uview-plus/libs/ctocode/map.js +38 -0
  108. package/uview-plus/libs/function/index-wu.js +6 -34
  109. package/uview-plus/package.json +3 -3
  110. package/uview-plus/readme-wu.md +1 -1
  111. package/uview-plus/libs/function/cc.js +0 -66
@@ -7,14 +7,14 @@
7
7
  ref="u-rate__content__item__icon-wrap"
8
8
  @tap.stop="clickHandler($event, index + 1)"
9
9
  >
10
- <u-icon
10
+ <up-icon
11
11
  :name="Math.floor(activeIndex) > index ? activeIcon : inactiveIcon"
12
12
  :color="disabled ? '#c8c9cc' : Math.floor(activeIndex) > index ? activeColor : inactiveColor"
13
13
  :custom-style="{
14
14
  padding: `0 ${addUnit(gutter / 2)}`
15
15
  }"
16
16
  :size="size"
17
- ></u-icon>
17
+ ></up-icon>
18
18
  </view>
19
19
  <view
20
20
  v-if="allowHalf"
@@ -27,14 +27,14 @@
27
27
  ]"
28
28
  ref="u-rate__content__item__icon-wrap"
29
29
  >
30
- <u-icon
30
+ <up-icon
31
31
  :name="Math.ceil(activeIndex) > index ? activeIcon : inactiveIcon"
32
32
  :color="disabled ? '#c8c9cc' : Math.ceil(activeIndex) > index ? activeColor : inactiveColor"
33
33
  :custom-style="{
34
34
  padding: `0 ${addUnit(gutter / 2)}`
35
35
  }"
36
36
  :size="size"
37
- ></u-icon>
37
+ ></up-icon>
38
38
  </view>
39
39
  </view>
40
40
  </view>
@@ -67,7 +67,7 @@ const dom = weex.requireModule('dom');
67
67
  * @property {Boolean} touchable 是否可以通过滑动手势选择评分 (默认 'true' )
68
68
  * @property {Object} customStyle 组件的样式,对象形式
69
69
  * @event {Function} change 选中的星星发生变化时触发
70
- * @example <u-rate :count="count" :value="2"></u-rate>
70
+ * @example <up-rate :count="count" :value="2"></up-rate>
71
71
  */
72
72
  export default {
73
73
  name: 'u-rate',
@@ -1,3 +1,126 @@
1
- <template>
2
1
  <view class="u-read-more">
3
2
  <view
4
3
  class="u-read-more__content"
5
4
  :style="{
6
5
  height: isLongContent && status === 'close' ? addUnit(showHeight) : addUnit(contentHeight),
7
6
  textIndent: textIndent
8
7
  }"
9
8
  >
10
9
  <view class="u-read-more__content__inner" ref="u-read-more__content__inner" :class="[elId]">
11
10
  <slot></slot>
12
11
  </view>
13
12
  </view>
14
13
  <view class="u-read-more__toggle" :style="[innerShadowStyle]" v-if="isLongContent">
15
14
  <slot name="toggle">
16
15
  <view class="u-read-more__toggle__text" @tap="toggleReadMore">
17
16
  <up-text
18
17
  :text="status === 'close' ? closeText : openText"
19
18
  :color="color"
20
19
  :size="fontSize"
21
20
  :lineHeight="fontSize"
22
21
  margin="0 5px 0 0"
23
22
  ></up-text>
24
23
  <view class="u-read-more__toggle__icon">
25
24
  <u-icon :color="color" :size="fontSize + 2" :name="status === 'close' ? 'arrow-down' : 'arrow-up'"></u-icon>
26
25
  </view>
27
26
  </view>
28
27
  </slot>
29
28
  </view>
30
29
  </view>
31
30
  * readMore 阅读更多
32
31
  * @description 该组件一般用于内容较长,预先收起一部分,点击展开全部内容的场景。
33
32
  * @tutorial https://ijry.github.io/uview-plus/components/readMore.html
34
33
  * @property {String | Number} showHeight 内容超出此高度才会显示展开全文按钮,单位px(默认 400 )
35
34
  * @property {Boolean} toggle 展开后是否显示收起按钮(默认 false )
36
35
  * @property {String} closeText 关闭时的提示文字(默认 '展开阅读全文' )
37
36
  * @property {String} openText 展开时的提示文字(默认 '收起' )
38
37
  * @property {String} color 提示文字的颜色(默认 '#2979ff' )
39
38
  * @property {String | Number} fontSize 提示文字的大小,单位px (默认 14 )
40
39
  * @property {Object} shadowStyle 显示阴影的样式
41
40
  * @property {String} textIndent 段落首行缩进的字符个数 (默认 '2em' )
42
41
  * @property {String | Number} name 用于在 open 和 close 事件中当作回调参数返回
43
42
  * @event {Function} open 内容被展开时触发
44
43
  * @event {Function} close 内容被收起时触发
45
44
  * @example <u-read-more><rich-text :nodes="content"></rich-text></u-read-more>
46
45
  */
47
46
  name: 'u-read-more',
48
47
  mixins: [mpMixin, mixin, props],
49
48
  data() {
50
49
  return {
51
50
  isLongContent: false, // 是否需要隐藏一部分内容
52
51
  status: 'close', // 当前隐藏与显示的状态,close-收起状态,open-展开状态
53
52
  elId: guid(), // 生成唯一class
54
53
  contentHeight: 100 // 内容高度
55
54
  };
56
55
  },
57
56
  computed: {
58
57
  // 展开后无需阴影,收起时才需要阴影样式
59
58
  innerShadowStyle() {
60
59
  if (this.status === 'open') return {};
61
60
  else return this.shadowStyle;
62
61
  }
63
62
  },
64
63
  mounted() {
65
64
  this.init();
66
65
  },
67
66
  emits: ['open', 'close'],
68
67
  methods: {
69
68
  addUnit,
70
69
  async init() {
71
70
  this.getContentHeight().then((height) => {
72
71
  this.contentHeight = height;
73
72
  // 判断高度,如果真实内容高度大于占位高度,则显示收起与展开的控制按钮
74
73
  if (height > getPx(this.showHeight)) {
75
74
  this.isLongContent = true;
76
75
  this.status = 'close';
77
76
  } else {
78
77
  // https://github.com/ijry/uview-plus/issues/270
79
78
  this.isLongContent = false;
80
79
  this.status = 'close';
81
80
  }
82
81
  });
83
82
  },
84
83
  // 获取内容的高度
85
84
  async getContentHeight() {
86
85
  // 延时一定时间再获取节点
87
86
  await sleep(30);
88
87
  return new Promise((resolve) => {
89
88
  // #ifndef APP-NVUE
90
89
  this.$uGetRect('.' + this.elId).then((res) => {
91
90
  resolve(res.height);
92
91
  });
93
92
  // #endif
94
93
  // #ifdef APP-NVUE
95
94
  const ref = this.$refs['u-read-more__content__inner'];
96
95
  dom.getComponentRect(ref, (res) => {
97
96
  resolve(res.size.height);
98
97
  });
99
98
  // #endif
100
99
  });
101
100
  },
102
101
  // 展开或者收起
103
102
  toggleReadMore() {
104
103
  this.status = this.status === 'close' ? 'open' : 'close';
105
104
  // 如果toggle为false,隐藏"收起"部分的内容
106
105
  if (this.toggle == false) this.isLongContent = false;
107
106
  // 发出打开或者收齐的事件
108
107
  this.$emit(this.status, this.name);
109
108
  }
110
109
  }
111
- @import './style.css';
112
- </style>
110
+ <template>
111
+ <view class="u-read-more">
112
+ <view
113
+ class="u-read-more__content"
114
+ :style="{
115
+ height: isLongContent && status === 'close' ? addUnit(showHeight) : addUnit(contentHeight),
116
+ textIndent: textIndent
117
+ }"
118
+ >
119
+ <view class="u-read-more__content__inner" ref="u-read-more__content__inner" :class="[elId]">
120
+ <slot></slot>
121
+ </view>
122
+ </view>
123
+ <view class="u-read-more__toggle" :style="[innerShadowStyle]" v-if="isLongContent">
124
+ <slot name="toggle">
125
+ <view class="u-read-more__toggle__text" @tap="toggleReadMore">
126
+ <up-text
127
+ :text="status === 'close' ? closeText : openText"
128
+ :color="color"
129
+ :size="fontSize"
130
+ :lineHeight="fontSize"
131
+ margin="0 5px 0 0"
132
+ ></up-text>
133
+ <view class="u-read-more__toggle__icon">
134
+ <up-icon :color="color" :size="fontSize + 2" :name="status === 'close' ? 'arrow-down' : 'arrow-up'"></up-icon>
135
+ </view>
136
+ </view>
137
+ </slot>
138
+ </view>
139
+ </view>
140
+ </template>
141
+ <script>
142
+ // #ifdef APP-NVUE
143
+ const dom = uni.requireNativePlugin('dom');
144
+ // #endif
145
+ import { props } from './props';
146
+ import { mpMixin } from '../../libs/mixin/mpMixin';
147
+ import { mixin } from '../../libs/mixin/mixin';
148
+ import { addUnit, guid, getPx, sleep } from '../../libs/function/index';
149
+ /**
150
+ * readMore 阅读更多
151
+ * @description 该组件一般用于内容较长,预先收起一部分,点击展开全部内容的场景。
152
+ * @tutorial https://ijry.github.io/uview-plus/components/readMore.html
153
+ * @property {String | Number} showHeight 内容超出此高度才会显示展开全文按钮,单位px(默认 400 )
154
+ * @property {Boolean} toggle 展开后是否显示收起按钮(默认 false )
155
+ * @property {String} closeText 关闭时的提示文字(默认 '展开阅读全文' )
156
+ * @property {String} openText 展开时的提示文字(默认 '收起' )
157
+ * @property {String} color 提示文字的颜色(默认 '#2979ff' )
158
+ * @property {String | Number} fontSize 提示文字的大小,单位px (默认 14 )
159
+ * @property {Object} shadowStyle 显示阴影的样式
160
+ * @property {String} textIndent 段落首行缩进的字符个数 (默认 '2em' )
161
+ * @property {String | Number} name 用于在 open 和 close 事件中当作回调参数返回
162
+ * @event {Function} open 内容被展开时触发
163
+ * @event {Function} close 内容被收起时触发
164
+ * @example <up-read-more><rich-text :nodes="content"></rich-text></up-read-more>
165
+ */
166
+ export default {
167
+ name: 'u-read-more',
168
+ mixins: [mpMixin, mixin, props],
169
+ data() {
170
+ return {
171
+ isLongContent: false, // 是否需要隐藏一部分内容
172
+ status: 'close', // 当前隐藏与显示的状态,close-收起状态,open-展开状态
173
+ elId: guid(), // 生成唯一class
174
+ contentHeight: 100 // 内容高度
175
+ };
176
+ },
177
+ computed: {
178
+ // 展开后无需阴影,收起时才需要阴影样式
179
+ innerShadowStyle() {
180
+ if (this.status === 'open') return {};
181
+ else return this.shadowStyle;
182
+ }
183
+ },
184
+ mounted() {
185
+ this.init();
186
+ },
187
+ emits: ['open', 'close'],
188
+ methods: {
189
+ addUnit,
190
+ async init() {
191
+ this.getContentHeight().then((height) => {
192
+ this.contentHeight = height;
193
+ // 判断高度,如果真实内容高度大于占位高度,则显示收起与展开的控制按钮
194
+ if (height > getPx(this.showHeight)) {
195
+ this.isLongContent = true;
196
+ this.status = 'close';
197
+ } else {
198
+ // https://github.com/ijry/uview-plus/issues/270
199
+ this.isLongContent = false;
200
+ this.status = 'close';
201
+ }
202
+ });
203
+ },
204
+ // 获取内容的高度
205
+ async getContentHeight() {
206
+ // 延时一定时间再获取节点
207
+ await sleep(30);
208
+ return new Promise((resolve) => {
209
+ // #ifndef APP-NVUE
210
+ this.$uGetRect('.' + this.elId).then((res) => {
211
+ resolve(res.height);
212
+ });
213
+ // #endif
214
+ // #ifdef APP-NVUE
215
+ const ref = this.$refs['u-read-more__content__inner'];
216
+ dom.getComponentRect(ref, (res) => {
217
+ resolve(res.size.height);
218
+ });
219
+ // #endif
220
+ });
221
+ },
222
+ // 展开或者收起
223
+ toggleReadMore() {
224
+ this.status = this.status === 'close' ? 'open' : 'close';
225
+ // 如果toggle为false,隐藏"收起"部分的内容
226
+ if (this.toggle == false) this.isLongContent = false;
227
+ // 发出打开或者收齐的事件
228
+ this.$emit(this.status, this.name);
229
+ }
230
+ }
231
+ };
232
+ </script>
233
+ <style scoped>
234
+ @import './style.css';
235
+ </style>
@@ -21,7 +21,7 @@ import { addUnit, addStyle, deepMerge, sleep } from '../../libs/function/index';
21
21
  * @property {Object} customStyle 定义需要用到的外部样式
22
22
  *
23
23
  * @event {Function} click row被点击
24
- * @example <u-row justify="space-between" customStyle="margin-bottom: 10px"></u-row>
24
+ * @example <up-row justify="space-between" customStyle="margin-bottom: 10px"></up-row>
25
25
  */
26
26
  export default {
27
27
  name: 'u-row',
@@ -2,7 +2,7 @@
2
2
  <view class="u-notice" @tap="clickHandler">
3
3
  <slot name="icon">
4
4
  <view class="u-notice__left-icon" v-if="icon">
5
- <u-icon :name="icon" :color="color" size="19"></u-icon>
5
+ <up-icon :name="icon" :color="color" size="19"></up-icon>
6
6
  </view>
7
7
  </slot>
8
8
  <view class="u-notice__content" ref="u-notice__content">
@@ -11,8 +11,8 @@
11
11
  </view>
12
12
  </view>
13
13
  <view class="u-notice__right-icon" v-if="['link', 'closable'].includes(mode)">
14
- <u-icon v-if="mode === 'link'" name="arrow-right" :size="17" :color="color"></u-icon>
15
- <u-icon v-if="mode === 'closable'" @click="close" name="close" :size="16" :color="color"></u-icon>
14
+ <up-icon v-if="mode === 'link'" name="arrow-right" :size="17" :color="color"></up-icon>
15
+ <up-icon v-if="mode === 'closable'" @click="close" name="close" :size="16" :color="color"></up-icon>
16
16
  </view>
17
17
  </view>
18
18
  </template>
@@ -1,3 +1,48 @@
1
- <template>
2
1
  <view class="u-safe-bottom" :style="[style]" :class="[!isNvue && 'u-safe-area-inset-bottom']"></view>
3
2
  * SafeBottom 底部安全区
4
3
  * @description 这个适配,主要是针对IPhone X等一些底部带指示条的机型,指示条的操作区域与页面底部存在重合,容易导致用户误操作,因此我们需要针对这些机型进行底部安全区适配。
5
4
  * @tutorial https://ijry.github.io/uview-plus/components/safeAreaInset.html
6
5
  * @property {type} prop_name
7
6
  * @property {Object} customStyle 定义需要用到的外部样式
8
7
  *
9
8
  * @event {Function()}
10
9
  * @example <u-status-bar></u-status-bar>
11
10
  */
12
11
  name: 'u-safe-bottom',
13
12
  mixins: [mpMixin, mixin, props],
14
13
  data() {
15
14
  return {
16
15
  safeAreaBottomHeight: 0,
17
16
  isNvue: false
18
17
  };
19
18
  },
20
19
  computed: {
21
20
  style() {
22
21
  const style = {};
23
22
  // #ifdef APP-NVUE || MP-TOUTIAO
24
23
  // nvue下,高度使用js计算填充
25
24
  style.height = addUnit(getWindowInfo().safeAreaInsets.bottom, 'px');
26
25
  // #endif
27
26
  return deepMerge(style, addStyle(this.customStyle));
28
27
  }
29
28
  },
30
29
  mounted() {
31
30
  // #ifdef APP-NVUE
32
31
  // 标识为是否nvue
33
32
  this.isNvue = true;
34
33
  // #endif
35
34
  }
36
- @import './style.css';
37
- </style>
35
+ <template>
36
+ <view class="u-safe-bottom" :style="[style]" :class="[!isNvue && 'u-safe-area-inset-bottom']"></view>
37
+ </template>
38
+ <script>
39
+ import { props } from './props.js';
40
+ import { mpMixin } from '../../libs/mixin/mpMixin';
41
+ import { mixin } from '../../libs/mixin/mixin';
42
+ import { addStyle, deepMerge, addUnit, getWindowInfo } from '../../libs/function/index';
43
+ /**
44
+ * SafeBottom 底部安全区
45
+ * @description 这个适配,主要是针对IPhone X等一些底部带指示条的机型,指示条的操作区域与页面底部存在重合,容易导致用户误操作,因此我们需要针对这些机型进行底部安全区适配。
46
+ * @tutorial https://ijry.github.io/uview-plus/components/safeAreaInset.html
47
+ * @property {type} prop_name
48
+ * @property {Object} customStyle 定义需要用到的外部样式
49
+ *
50
+ * @event {Function()}
51
+ * @example <up-status-bar></up-status-bar>
52
+ */
53
+ export default {
54
+ name: 'u-safe-bottom',
55
+ mixins: [mpMixin, mixin, props],
56
+ data() {
57
+ return {
58
+ safeAreaBottomHeight: 0,
59
+ isNvue: false
60
+ };
61
+ },
62
+ computed: {
63
+ style() {
64
+ const style = {};
65
+ // #ifdef APP-NVUE || MP-TOUTIAO
66
+ // nvue下,高度使用js计算填充
67
+ style.height = addUnit(getWindowInfo().safeAreaInsets.bottom, 'px');
68
+ // #endif
69
+ return deepMerge(style, addStyle(this.customStyle));
70
+ }
71
+ },
72
+ mounted() {
73
+ // #ifdef APP-NVUE
74
+ // 标识为是否nvue
75
+ this.isNvue = true;
76
+ // #endif
77
+ }
78
+ };
79
+ </script>
80
+ <style scoped>
81
+ @import './style.css';
82
+ </style>
@@ -24,12 +24,12 @@
24
24
  </slot>
25
25
  </template>
26
26
  <view class="u-search__content__icon">
27
- <u-icon
27
+ <up-icon
28
28
  @tap="clickIcon"
29
29
  :size="searchIconSize"
30
30
  :name="searchIcon"
31
31
  :color="searchIconColor ? searchIconColor : color"
32
- ></u-icon>
32
+ ></up-icon>
33
33
  </view>
34
34
  <input
35
35
  confirm-type="search"
@@ -60,7 +60,7 @@
60
60
  ]"
61
61
  />
62
62
  <view class="u-search__content__icon u-search__content__close" v-if="keyword && clearabled && focused" @click="clear">
63
- <u-icon name="close" size="11" color="#ffffff" customStyle="line-height: 12px"></u-icon>
63
+ <up-icon name="close" size="11" color="#ffffff" customStyle="line-height: 12px"></up-icon>
64
64
  </view>
65
65
  </view>
66
66
  <text
@@ -114,7 +114,7 @@ import { addUnit, addStyle } from '../../libs/function/index';
114
114
  * @event {Function} search 用户确定搜索时触发,用户按回车键,或者手机键盘右下角的"搜索"键时触发
115
115
  * @event {Function} custom 用户点击右侧控件时触发
116
116
  * @event {Function} clear 用户点击清除按钮时触发
117
- * @example <u-search placeholder="日照香炉生紫烟" v-model="keyword"></u-search>
117
+ * @example <up-search placeholder="日照香炉生紫烟" v-model="keyword"></up-search>
118
118
  */
119
119
  export default {
120
120
  name: 'u-search',