Skip to content

Commit 1ba0eb4

Browse files
committed
publish v1.3.5
1 parent 3bee85e commit 1ba0eb4

File tree

14 files changed

+560
-71
lines changed

14 files changed

+560
-71
lines changed

docs/changelog.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,40 @@
77
- 主版本号:含有破坏性更新和新特性,不在发布周期内。
88

99
<!-- 更新占位 -->
10+
<log title="1.3.5" date="2021-07-02">
11+
<log-item title="uni-card 组件更新">
12+
<log-item-text tag-type="perf">
13+
图文卡片无图片加载时,提供占位图标
14+
</log-item-text>
15+
<log-item-text tag-type="feat">
16+
header 插槽,自定义卡片头部( 图文卡片 mode="style" 时,不支持)
17+
</log-item-text>
18+
<log-item-text tag-type="fix">
19+
thumbnail 不存在仍然占位的 bug
20+
</log-item-text>
21+
</log-item>
22+
<log-item title="uni-data-checkbox 组件更新">
23+
<log-item-text tag-type="fix">
24+
selectedTextColor 属性不生效的Bug
25+
</log-item-text>
26+
</log-item>
27+
<log-item title="uni-datetime-picker 组件更新">
28+
<log-item-text tag-type="perf">
29+
添加 uni-icons 依赖
30+
</log-item-text>
31+
</log-item>
32+
<log-item title="uni-easyinput 组件更新">
33+
<log-item-text tag-type="fix">
34+
confirmType 属性(仅 type="text" 生效)导致多行文本框无法换行的 bug
35+
</log-item-text>
36+
</log-item>
37+
<log-item title="uni-forms 组件更新">
38+
<log-item-text tag-type="fix">
39+
pattern 属性在微信小程序平台无效的问题
40+
</log-item-text>
41+
</log-item>
42+
</log>
43+
1044
<log title="1.3.4" date="2021-06-25">
1145
<log-item title="uni-badge 组件更新">
1246
<log-item-text tag-type="perf">

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "55",
33
"name": "@dcloudio/uni-ui",
4-
"version": "1.3.4",
4+
"version": "1.3.5",
55
"description": "",
66
"author": "dcloud",
77
"license": "Apache-2.0",

packages/lib/uni-card/uni-card.vue

Lines changed: 59 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,51 @@
11
<template>
2-
<view class="uni-card uni-border" :class="{ 'uni-card--full': isFull === true || isFull === 'true', 'uni-card--shadow': isShadow === true || isShadow === 'true'}">
2+
<view class="uni-card uni-border"
3+
:class="{ 'uni-card--full': isFull === true || isFull === 'true', 'uni-card--shadow': isShadow === true || isShadow === 'true'}">
34
<!-- 基础 -->
4-
<view v-if="mode === 'basic' && title" class="uni-card__header uni-border-bottom" @click.stop="onClick">
5-
<view v-if="thumbnail" class="uni-card__header-extra-img-view">
6-
<image :src="thumbnail" class="uni-card__header-extra-img" />
5+
<view v-if="mode === 'basic' && title" @click.stop="onClick" class="uni-card__head-padding">
6+
<view class="uni-card__header uni-border-bottom">
7+
<slot name="header">
8+
<view v-if="thumbnail" class="uni-card__header-extra-img-view">
9+
<image :src="thumbnail" class="uni-card__header-extra-img" />
10+
</view>
11+
<text class="uni-card__header-title-text">{{ title }}</text>
12+
<text v-if="extra" class="uni-card__header-extra-text">{{ extra }}</text>
13+
</slot>
714
</view>
8-
<text class="uni-card__header-title-text">{{ title }}</text>
9-
<text v-if="extra" class="uni-card__header-extra-text">{{ extra }}</text>
1015
</view>
1116
<!-- 标题 -->
12-
<view v-if="mode === 'title'" class="uni-card__title uni-border-bottom" @click.stop="onClick">
13-
<view class="uni-card__title-box">
14-
<view class="uni-card__title-header">
15-
<image class="uni-card__title-header-image" :src="thumbnail" mode="scaleToFill" />
16-
</view>
17-
<view class="uni-card__title-content">
18-
<text class="uni-card__title-content-title uni-ellipsis">{{ title }}</text>
19-
<text class="uni-card__title-content-extra uni-ellipsis">{{ subTitle }}</text>
20-
</view>
21-
</view>
22-
<view v-if="extra">
23-
<text class="uni-card__header-extra-text">{{ extra }}</text>
17+
<view v-if="mode === 'title'" @click.stop="onClick" class="uni-card__head-padding">
18+
<view class="uni-card__title uni-border-bottom">
19+
<slot name="header">
20+
<view class="uni-card__title-box">
21+
<view v-if="thumbnail" class="uni-card__title-header">
22+
<image class="uni-card__title-header-image" :src="thumbnail" mode="scaleToFill" />
23+
</view>
24+
<view class="uni-card__title-content">
25+
<text class="uni-card__title-content-title uni-ellipsis">{{ title }}</text>
26+
<text class="uni-card__title-content-extra uni-ellipsis">{{ subTitle }}</text>
27+
</view>
28+
</view>
29+
<view v-if="extra">
30+
<text class="uni-card__header-extra-text">{{ extra }}</text>
31+
</view>
32+
</slot>
2433
</view>
2534
</view>
2635
<!-- 图文 -->
2736
<view v-if="mode === 'style'" class="uni-card__thumbnailimage" @click.stop="onClick">
2837
<view class="uni-card__thumbnailimage-box">
29-
<image class="uni-card__thumbnailimage-image" :src="thumbnail" mode="aspectFill" />
38+
<image v-if="thumbnail" class="uni-card__thumbnailimage-image" :src="thumbnail" mode="aspectFill" />
39+
<uni-icons v-if="!thumbnail" type="image" size="30" color="#999" />
40+
</view>
41+
<view v-if="title" class="uni-card__thumbnailimage-title">
42+
<text class="uni-card__thumbnailimage-title-text">{{ title }}</text>
3043
</view>
31-
<view v-if="title" class="uni-card__thumbnailimage-title"><text class="uni-card__thumbnailimage-title-text">{{ title }}</text></view>
3244
</view>
3345
<!-- 内容 -->
3446
<view class="uni-card__content uni-card__content--pd" @click.stop="onClick">
35-
<view v-if="mode === 'style' && extra" class=""><text class="uni-card__content-extra">{{ extra }}</text></view>
47+
<view v-if="mode === 'style' && extra" class=""><text class="uni-card__content-extra">{{ extra }}</text>
48+
</view>
3649
<slot />
3750
</view>
3851
<!-- 底部 -->
@@ -52,8 +65,8 @@
5265
* @property {String} title 标题文字
5366
* @property {String} subTitle 副标题(仅仅mode=title下生效)
5467
* @property {String} extra 标题额外信息
55-
* @property {String} note 标题左侧缩略图
56-
* @property {String} thumbnail 底部信息
68+
* @property {String} note 底部信息
69+
* @property {String} thumbnail 标题左侧缩略图
5770
* @property {String} mode = [basic|style|title] 卡片模式
5871
* @value basic 基础卡片
5972
* @value style 图文卡片
@@ -121,9 +134,9 @@
121134
position: relative;
122135
flex-direction: column;
123136
border-radius: 5px;
124-
overflow: hidden;
125-
/* #ifdef H5 */
126-
cursor: pointer;
137+
overflow: hidden;
138+
/* #ifdef H5 */
139+
cursor: pointer;
127140
/* #endif */
128141
}
129142
@@ -217,20 +230,27 @@
217230
/* #endif */
218231
219232
.uni-card__thumbnailimage {
220-
position: relative;
233+
position: relative;
234+
/* #ifndef APP-NVUE */
235+
// display: flex;
236+
/* #endif */
221237
flex-direction: column;
222-
justify-content: center;
223-
height: 150px;
238+
justify-content: center;
239+
height: 150px;
240+
background-color: #F1F1F1;
224241
overflow: hidden;
225242
}
226243
227244
.uni-card__thumbnailimage-box {
228245
/* #ifndef APP-NVUE */
229246
display: flex;
230247
/* #endif */
231-
flex: 1;
232-
flex-direction: row;
233-
overflow: hidden;
248+
flex: 1;
249+
height: 150px;
250+
flex-direction: row;
251+
justify-content: center;
252+
align-items: center;
253+
overflow: hidden;
234254
}
235255
236256
.uni-card__thumbnailimage-image {
@@ -280,12 +300,13 @@
280300
width: 40px;
281301
height: 40px;
282302
overflow: hidden;
283-
border-radius: 5px;
303+
border-radius: 5px;
304+
padding-right: 10px;
284305
}
285306
286307
.uni-card__title-header-image {
287308
width: 40px;
288-
height: 40px;
309+
height: 40px;
289310
}
290311
291312
.uni-card__title-content {
@@ -295,7 +316,6 @@
295316
flex-direction: column;
296317
justify-content: center;
297318
flex: 1;
298-
padding-left: 10px;
299319
height: 40px;
300320
overflow: hidden;
301321
}
@@ -403,4 +423,8 @@
403423
lines: 1;
404424
/* #endif */
405425
}
426+
427+
.uni-card__head-padding {
428+
// mar: 12px;
429+
}
406430
</style>

packages/lib/uni-data-checkbox/uni-data-checkbox.vue

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
* @property {Boolean} selectedColor 选中颜色
6060
* @property {Boolean} emptyText 没有数据时显示的文字 ,本地数据无效
6161
* @property {Boolean} selectedTextColor 选中文本颜色,如不填写则自动显示
62+
* @property {Object} map 字段映射, 默认 map={text:'text',value:'value'}
6263
* @value left 左侧显示
6364
* @value right 右侧显示
6465
* @event {Function} change 选中发生变化触发
@@ -108,11 +109,11 @@
108109
},
109110
selectedColor: {
110111
type: String,
111-
default: '#007aff'
112+
default: ''
112113
},
113114
selectedTextColor: {
114115
type: String,
115-
default: '#333'
116+
default: ''
116117
},
117118
emptyText:{
118119
type: String,
@@ -385,13 +386,20 @@
385386
let classles = ''
386387
// if (item.selected) {
387388
// if (this.selectedTextColor) {
388-
// styles.color = item.selected?this.selectedTextColor:'#999'
389+
// if (this.mode === 'tag') {
390+
// styles.color = item.selected?this.selectedTextColor:'#333'
391+
392+
// } else {
393+
// styles.color = item.selected?this.selectedTextColor:'#333'
394+
// }
395+
// if(!item.selected && item.disabled){
396+
// styles.color = '#999'
397+
// }
389398
// } else {
390399
if (this.mode === 'tag') {
391-
styles.color = item.selected?'#fff':'#333'
392-
400+
styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:'#fff'):'#333'
393401
} else {
394-
styles.color = item.selected?this.selectedColor:'#333'
402+
styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:this.selectedColor):'#333'
395403
}
396404
if(!item.selected && item.disabled){
397405
styles.color = '#999'

packages/lib/uni-datetime-picker/uni-datetime-picker.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@
101101
* @tutorial https://ext.dcloud.net.cn/plugin?id=3962
102102
* @property {String} type 选择器类型
103103
* @property {String|Array} value 绑定值
104-
* @property {String} placeholder 单选择时的占位内容
104+
* @property {String} placeholder 单选择时的占位内容
105+
* @property {String} start 起始时间
106+
* @property {String} start 终止时间
105107
* @property {String} start-placeholder 范围选择时开始日期的占位内容
106108
* @property {String} end-placeholder 范围选择时结束日期的占位内容
107109
* @property {String} range-separator 选择范围时的分隔符

packages/lib/uni-easyinput/uni-easyinput.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<uni-icons v-if="prefixIcon" class="content-clear-icon" :type="prefixIcon" color="#c0c4cc" @click="onClickIcon('prefix')"></uni-icons>
66
<textarea v-if="type === 'textarea'" class="uni-easyinput__content-textarea" :class="{'input-padding':inputBorder}"
77
:name="name" :value="val" :placeholder="placeholder" :placeholderStyle="placeholderStyle" :disabled="disabled"
8-
:maxlength="inputMaxlength" :focus="focused" :autoHeight="autoHeight" :confirmType="confirmType" @input="onInput" @blur="onBlur" @focus="onFocus"
8+
:maxlength="inputMaxlength" :focus="focused" :autoHeight="autoHeight" @input="onInput" @blur="onBlur" @focus="onFocus"
99
@confirm="onConfirm"></textarea>
1010
<input v-else :type="type === 'password'?'text':type" class="uni-easyinput__content-input" :style="{
1111
'padding-right':type === 'password' ||clearable || prefixIcon?'':'10px',

packages/lib/uni-file-picker/uni-file-picker.vue

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,13 @@ export default {
192192
}
193193
newFils.push(files ? files : v)
194194
})
195+
let data = null
196+
if (this.returnType === 'object') {
197+
data = this.backObject(newFils)[0]
198+
} else {
199+
data = this.backObject(newFils)
200+
}
201+
this.formItem && this.formItem.setValue(data)
195202
this.files = newFils
196203
},
197204
immediate: true
@@ -241,9 +248,29 @@ export default {
241248
created() {
242249
// this.files = Object.assign([], this.value)
243250
this.tempData = {}
244-
251+
this.form = this.getForm('uniForms')
252+
this.formItem = this.getForm('uniFormsItem')
253+
if (this.form && this.formItem) {
254+
if (this.formItem.name) {
255+
this.rename = this.formItem.name
256+
this.form.inputChildrens.push(this)
257+
}
258+
}
245259
},
246260
methods: {
261+
/**
262+
* 获取父元素实例
263+
*/
264+
getForm(name = 'uniForms') {
265+
let parent = this.$parent;
266+
let parentName = parent.$options.name;
267+
while (parentName !== name) {
268+
parent = parent.$parent;
269+
if (!parent) return false;
270+
parentName = parent.$options.name;
271+
}
272+
return parent;
273+
},
247274
/**
248275
* 继续上传
249276
*/
@@ -402,13 +429,14 @@ export default {
402429
this.files[index].url = item.path
403430
this.files[index].status = 'error'
404431
this.files[index].errMsg = item.errMsg
405-
this.files[index].progress = -1
432+
// this.files[index].progress = -1
406433
errorData.push(this.files[index])
407434
errorTempFilePath.push(this.files[index].url)
408435
} else {
409436
this.files[index].errMsg = ''
410437
this.files[index].url = item.url
411438
this.files[index].status = 'success'
439+
this.files[index].progress += 1
412440
successData.push(this.files[index])
413441
tempFilePath.push(this.files[index].url)
414442
}
@@ -446,7 +474,8 @@ export default {
446474
idx = this.files.findIndex(p => p.uuid === progressEvent.tempFile.uuid)
447475
}
448476
if (idx === -1 || !this.files[idx]) return
449-
this.files[idx].progress = percentCompleted
477+
// fix by mehaotian 100 就会消失,-1 是为了让进度条消失
478+
this.files[idx].progress = percentCompleted - 1
450479
// 上传中
451480
this.$emit('progress', {
452481
index: idx,
@@ -459,10 +488,12 @@ export default {
459488
* 删除
460489
* @param {Object} index
461490
*/
462-
delFile(index) {
463-
let fileData = this.files[index]
464-
this.$emit('delete', fileData)
465-
this.files.splice(index, 1)
491+
delFile(index) {
492+
this.$emit('delete', {
493+
tempFile: this.files[index],
494+
tempFilePath: this.files[index].url
495+
})
496+
this.files.splice(index, 1)
466497
this.$nextTick(()=>{
467498
this.setEmit()
468499
})

packages/lib/uni-forms-item/uni-forms-item.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ export default {
205205
if(this.labelWid && this.labelWid !=='auto') {
206206
this.labelWid +='px'
207207
}
208-
console.log(this.labelWid);
209208
// this.labelWid = (this.labelWidth ? this.labelWidth : labelWidth) + 'px'
210209
// this.labelWid = this.label ? (this.labelWidth ? this.labelWidth : labelWidth) : 0;
211210
this.labelAli = this.labelAlign ? this.labelAlign : labelAlign;

0 commit comments

Comments
 (0)