Skip to content

Commit 8047ade

Browse files
committed
1. 【优化】配置popup组件的外层元素z-index可动态调整
2. 【优化】select和picker组件在微信小程序上第二次打开,直接点确定返回可能不对的问题 3. 【优化】添加u-col的click事件 4. 【优化】优化table组件在支付宝小程序上报错的问题 5. 【优化】重构steps组件,支持竖向模式,同时兼容了支付宝小程序 6. 【优化】优化checkbox组件,兼容支付宝小程序 7. 【优化】优化swipeAction组件可能会闪烁的情况 8. 【优化】调整cell组件的高度 9. 【优化】重构优化radio组件,全面兼容支付宝小程序,修复每次点击都触发change事件的问题 10. 【优化】优化avatar-cropper头像裁剪组件,全面兼容支付宝小程序 11. 【优化】优化circle-progress组件,全面兼容支付宝小程序 12. 【修复】修复input组件在微信小程序第一次获得焦点时无法清空内容的问题 13. 【修复】修复image组件无需淡入效果时png图片能看到底色的问题 14. 【修复】修复checkbox的lable-disabled参数无效的问题 15. 【修复】修复cell组件在1.5.0版本导致变成了password模式的情况 16. 【修复】修复form-item的label-align无效的问题 17. 【修复】修复alert-tips的border-color和bg-color作用对象颠倒的问题 18. 【修复】修复picker组件时间模式timestamp在iOS上可能返回不正确的问题
1 parent abfb121 commit 8047ade

File tree

25 files changed

+447
-382
lines changed

25 files changed

+447
-382
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name" : "uView",
33
"appid" : "__UNI__60F4B81",
44
"description" : "多平台快速开发的UI框架",
5-
"versionName" : "1.4.8",
5+
"versionName" : "1.5.2",
66
"versionCode" : "100",
77
"transformPx" : false,
88
"app-plus" : {

pages.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"easycom": {
33
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
44
},
5-
"condition": { //模式配置,仅开发期间生效
6-
"current": 0, //当前激活的模式(list 的索引项)
7-
"list": [{
8-
"name": "test", //模式名称
9-
"path": "pages/componentsB/steps/index", //启动页面,必选
10-
"query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
11-
}]
12-
},
5+
// "condition": { //模式配置,仅开发期间生效
6+
// "current": 0, //当前激活的模式(list 的索引项)
7+
// "list": [{
8+
// "name": "test", //模式名称
9+
// "path": "pages/componentsB/picker/index", //启动页面,必选
10+
// "query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
11+
// }]
12+
// },
1313
"pages": [
1414
// 演示-组件
1515
{

pages/componentsB/picker/index.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ export default {
177177
this.defaultSelector.splice(2, 1, 0)
178178
break
179179
}
180-
this.$forceUpdate()
181180
}
182181
}
183182
};

pages/componentsB/radio/index.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@
7979
}
8080
],
8181
disabled: false,
82-
result: '',
83-
shape: 'square',
82+
result: '荔枝',
83+
shape: 'circle',
8484
value: '荔枝',
8585
activeColor: '#2979ff',
8686
size: 34,
@@ -121,12 +121,12 @@
121121
},
122122
// 选中某个单选框时,由radio时触发
123123
radioChange(e) {
124-
// console.log(e);
124+
console.log(e);
125125
},
126126
// 选中任一radio时,由radio-group触发
127127
radioGroupChange(e) {
128128
this.result = e;
129-
// console.log(e);
129+
console.log(e);
130130
},
131131
widthChange(index) {
132132
this.width = index == 0 ? '50%' : '';

pages/componentsB/steps/index.vue

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<view class="u-demo-wrap">
44
<view class="u-demo-title">演示效果</view>
55
<view class="u-demo-area">
6-
<u-steps :current="current" :list="steps" :mode="mode" :icon="icon"></u-steps>
6+
<u-steps :direction="direction" :current="current" :list="steps" :mode="mode" :icon="icon"></u-steps>
77
</view>
88
</view>
99
<view class="u-config-wrap">
@@ -14,6 +14,10 @@
1414
<view class="u-item-title">模式</view>
1515
<u-subsection vibrateShort :list="['number', 'dot']" @change="modeChange"></u-subsection>
1616
</view>
17+
<view class="u-config-item">
18+
<view class="u-item-title">方向</view>
19+
<u-subsection vibrateShort :list="['横向', '竖向']" @change="directionChange"></u-subsection>
20+
</view>
1721
<view class="u-config-item">
1822
<view class="u-item-title">自定义图标</view>
1923
<u-subsection vibrateShort :list="['否', '是']" @change="iconChange"></u-subsection>
@@ -41,18 +45,22 @@
4145
}, ],
4246
current: 0,
4347
icon: 'checkmark',
44-
mode: 'number'
48+
mode: 'number',
49+
direction: 'row'
4550
}
4651
},
4752
methods: {
4853
modeChange(index) {
4954
this.mode = index == 0 ? 'number' : 'dot';
5055
},
5156
stepChange(index) {
52-
this.current = index == 0 ? 0 : index == 1 ? 1 : index == 2 ? 2 : 3;
57+
this.current = [0, 1, 2, 3][index];
5358
},
5459
iconChange(index) {
5560
this.icon = index == 0 ? 'checkmark' : 'map-fill';
61+
},
62+
directionChange(index) {
63+
this.direction = index == 0 ? 'row' : 'column';
5664
}
5765
}
5866
}

pages/componentsC/test/index.vue

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
<template>
2-
<view>
3-
<u-field></u-field>
4-
<u-button @click="password = !password"></u-button>
2+
<view class="">
3+
<u-checkbox-group>
4+
<u-checkbox v-model="checked" active-color="red">光影</u-checkbox>
5+
</u-checkbox-group>
56
</view>
67
</template>
78

89
<script>
9-
export default {
10-
data() {
11-
return {
12-
password: false
13-
}
14-
},
15-
}
16-
</script>
17-
18-
<style>
19-
20-
</style>
10+
export default {
11+
data() {
12+
return {
13+
checked: true
14+
};
15+
},
16+
};
17+
</script>

pages/library/timeFrom/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<view class="u-config-item">
2020
<view class="u-item-title">时间</view>
2121
<u-subsection vibrateShort :list="timeArr1" @change="timeArr1Change"></u-subsection>
22+
<u-gap></u-gap>
2223
<u-subsection vibrateShort style="margin-top: 40rpx;" :list="timeArr2" @change="timeArr2Change"></u-subsection>
2324
</view>
2425
</view>

uview-ui/components/u-avatar-cropper/u-avatar-cropper.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
@touchend="touchEnd"
1010
:style="{ width: cropperOpt.width, height: cropperOpt.height, backgroundColor: 'rgba(0, 0, 0, 0.8)' }"
1111
canvas-id="cropper"
12+
id="cropper"
1213
></canvas>
1314
<canvas
1415
class="cropper"
@@ -21,6 +22,7 @@
2122
height: `${cropperOpt.height * cropperOpt.pixelRatio}`
2223
}"
2324
canvas-id="targetId"
25+
id="targetId"
2426
></canvas>
2527
</view>
2628
<view class="cropper-buttons safe-area-padding" :style="{ height: bottomNavHeight + 'px' }">
@@ -181,7 +183,6 @@ export default {
181183
this.cropper.touchEnd(e);
182184
},
183185
getCropperImage(isPre = false) {
184-
console.log(this.src);
185186
if(!this.src) return this.$u.toast('请先选择图片再裁剪');
186187
187188
let cropper_opt = {

uview-ui/components/u-cell-item/u-cell-item.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,9 @@ export default {
215215
display: flex;
216216
box-sizing: border-box;
217217
width: 100%;
218-
padding: 20rpx 32rpx;
218+
padding: 26rpx 32rpx;
219219
font-size: 28rpx;
220-
line-height: 48rpx;
220+
line-height: 54rpx;
221221
color: $u-content-color;
222222
background-color: #fff;
223223
text-align: left;

uview-ui/components/u-checkbox-group/u-checkbox-group.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
default: 'auto'
7676
},
7777
// 是否每个checkbox都换行
78-
wrap: {
78+
wrap: {
7979
type: Boolean,
8080
default: false
8181
},

uview-ui/components/u-checkbox/u-checkbox.vue

Lines changed: 67 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<template>
22
<view class="u-checkbox" :style="[checkboxStyle]">
3-
<view class="u-checkbox__icon-wrap" @tap="toggle">
4-
<u-icon :class="iconClass" name="checkbox-mark" :size="checkboxIconSize" :color="iconColor" class="u-checkbox__icon" :style="[iconStyle]" />
3+
<view class="u-checkbox__icon-wrap" @tap="toggle" :class="[iconClass]" :style="[iconStyle]">
4+
<u-icon name="checkbox-mark" :size="checkboxIconSize" :color="iconColor"/>
55
</view>
6-
<view class="u-label-class u-checkbox__label" @tap="onClickLabel" :style="{
7-
fontSize: labelSize + 'rpx'
6+
<view class="u-checkbox__label" @tap="onClickLabel" :style="{
7+
fontSize: $u.addUnit(labelSize)
88
}">
99
<slot />
1010
</view>
@@ -46,12 +46,12 @@
4646
},
4747
// 是否禁用
4848
disabled: {
49-
type: [Boolean, String],
49+
type: [String, Boolean],
5050
default: ''
5151
},
5252
// 是否禁止点击提示语选中复选框
5353
labelDisabled: {
54-
type: [Boolean, String],
54+
type: [String, Boolean],
5555
default: ''
5656
},
5757
// 选中状态下的颜色,如设置此值,将会覆盖checkboxGroup的activeColor值
@@ -116,7 +116,7 @@
116116
let style = {};
117117
// 既要判断是否手动禁用,还要判断用户v-model绑定的值,如果绑定为false,那么也无法选中
118118
if (this.elActiveColor && this.value && !this.isDisabled) {
119-
style.borderColor = this.elActiveColor;
119+
style.borderColor = this.elActiveColor;
120120
style.backgroundColor = this.elActiveColor;
121121
}
122122
style.width = this.$u.addUnit(this.checkboxSize);
@@ -128,12 +128,13 @@
128128
return this.value ? '#ffffff' : 'transparent';
129129
},
130130
iconClass() {
131-
let classs = [];
132-
classs.push('u-checkbox__icon--' + this.elShape);
133-
if (this.value == true) classs.push('u-checkbox__icon--checked');
134-
if (this.isDisabled) classs.push('u-checkbox__icon--disabled');
135-
if (this.value && this.isDisabled) classs.push('u-checkbox__icon--disabled--checked');
136-
return classs;
131+
let classes = [];
132+
classes.push('u-checkbox__icon-wrap--' + this.elShape);
133+
if (this.value == true) classes.push('u-checkbox__icon-wrap--checked');
134+
if (this.isDisabled) classes.push('u-checkbox__icon-wrap--disabled');
135+
if (this.value && this.isDisabled) classes.push('u-checkbox__icon-wrap--disabled--checked');
136+
// 支付宝小程序无法动态绑定一个数组类名,否则解析出来的结果会带有",",而导致失效
137+
return classes.join(' ');
137138
},
138139
checkboxStyle() {
139140
let style = {};
@@ -217,69 +218,58 @@
217218
overflow: hidden;
218219
user-select: none;
219220
line-height: 1.8;
220-
}
221-
222-
.u-checkbox__icon-wrap,
223-
.u-checkbox__label {
224-
color: $u-content-color;
225-
}
226-
227-
.u-checkbox__icon-wrap {
228-
flex: none;
229-
}
230-
231-
.u-checkbox__icon {
232-
display: -webkit-flex;
233-
display: flex;
234-
align-items: center;
235-
justify-content: center;
236-
box-sizing: border-box;
237-
width: 42rpx;
238-
height: 42rpx;
239-
color: transparent;
240-
text-align: center;
241-
transition-property: color, border-color, background-color;
242-
font-size: 20px;
243-
border: 1px solid #c8c9cc;
244-
transition-duration: 0.2s;
245-
}
246-
247-
.u-checkbox__icon--circle {
248-
border-radius: 100%;
249-
}
250-
251-
.u-checkbox__icon--square {
252-
border-radius: 3px;
253-
}
254-
255-
.u-checkbox__icon--checked {
256-
color: #fff;
257-
background-color: $u-type-primary;
258-
border-color: $u-type-primary;
259-
}
260-
261-
.u-checkbox__icon--disabled {
262-
background-color: #ebedf0;
263-
border-color: #c8c9cc;
264-
}
265-
266-
.u-checkbox__icon--disabled--checked {
267-
color: #c8c9cc !important;
268-
}
269-
270-
.u-checkbox__label {
271-
word-wrap: break-word;
272-
margin-left: 10rpx;
273-
margin-right: 24rpx;
274-
color: $u-content-color;
275-
font-size: 30rpx;
276-
}
277-
278-
.u-checkbox__label--disabled {
279-
color: #c8c9cc;
280-
}
281-
282-
.u-checkbox__label:empty {
283-
margin: 0;
221+
222+
&__icon-wrap {
223+
color: $u-content-color;
224+
flex: none;
225+
display: -webkit-flex;
226+
display: flex;
227+
align-items: center;
228+
justify-content: center;
229+
box-sizing: border-box;
230+
width: 42rpx;
231+
height: 42rpx;
232+
color: transparent;
233+
text-align: center;
234+
transition-property: color, border-color, background-color;
235+
font-size: 20px;
236+
border: 1px solid #c8c9cc;
237+
transition-duration: 0.2s;
238+
239+
&--circle {
240+
border-radius: 100%;
241+
}
242+
243+
&--square {
244+
border-radius: 6rpx;
245+
}
246+
247+
&--checked {
248+
color: #fff;
249+
background-color: $u-type-primary;
250+
border-color: $u-type-primary;
251+
}
252+
253+
&--disabled {
254+
background-color: #ebedf0;
255+
border-color: #c8c9cc;
256+
}
257+
258+
&--disabled--checked {
259+
color: #c8c9cc !important;
260+
}
261+
}
262+
263+
&__label {
264+
word-wrap: break-word;
265+
margin-left: 10rpx;
266+
margin-right: 24rpx;
267+
color: $u-content-color;
268+
font-size: 30rpx;
269+
270+
&--disabled {
271+
color: #c8c9cc;
272+
}
273+
}
284274
}
285275
</style>

0 commit comments

Comments
 (0)