Skip to content

Commit f93c591

Browse files
committed
- uni-ui 新增 Title 标题组件
- uni-ui 新增 GoodsNav 商品导航组件 - uni-ui 新增 SearchBar 搜索栏 - uni-ui 新增 Fav 收藏按钮 - uni-ui 修复 Icons 组件在 H5 平台不显示的 BUG - uni-ui 优化 SwipeAction 滑动操作组件(App平台、H5 平台、微信小程序平台)使用 wxs 示例 - uni-ui 优化 Collapse 折叠面板在低配设备中动画卡顿的问题 - uni-ui 优化 LoadMore 加载更多加载图标分平台配置 - uni-ui 优化 SwipeDot 修改默认样式
1 parent ba6c2e2 commit f93c591

File tree

50 files changed

+5622
-3317
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+5622
-3317
lines changed

components/uni-calendar/uni-calendar.vue

Lines changed: 698 additions & 693 deletions
Large diffs are not rendered by default.

components/uni-card/uni-card.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
content: '';
175175
-webkit-transform: scaleY(.5);
176176
transform: scaleY(.5);
177-
background-color: #c8c7cc
177+
background-color: #e5e5e5
178178
}
179179
180180
.uni-card__header-title {

components/uni-collapse-item/uni-collapse-item.vue

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<uni-icons color="#bbb" size="20" type="arrowdown" />
1212
</view>
1313
</view>
14-
<view :class="{ 'uni-collapse-cell--animation': showAnimation === true }" :style="{ height: isOpen ? height : '0px' }" class="uni-collapse-cell__content">
15-
<view :id="elId">
14+
<view :style="{ height: isOpen ? 'auto' : '0px' }" class="uni-collapse-cell__content">
15+
<view :class="{ 'uni-collapse-cell--animation': showAnimation === true }" :style="{ transform: isOpen ? 'translateY(0px)' : 'translateY(-50%)' }">
1616
<slot />
1717
</view>
1818
</view>
@@ -59,11 +59,8 @@
5959
}
6060
},
6161
data() {
62-
const elId = `Uni_${Math.ceil(Math.random() * 10e5).toString(36)}`
6362
return {
64-
isOpen: false,
65-
height: 'auto',
66-
elId: elId
63+
isOpen: false
6764
}
6865
},
6966
watch: {
@@ -85,29 +82,7 @@
8582
}
8683
}
8784
},
88-
// #ifdef H5
89-
mounted() {
90-
this._getSize()
91-
},
92-
// #endif
93-
// #ifndef H5
94-
onReady() {
95-
this._getSize()
96-
},
97-
// #endif
9885
methods: {
99-
_getSize() {
100-
if (this.showAnimation) {
101-
uni.createSelectorQuery()
102-
.in(this)
103-
.select(`#${this.elId}`)
104-
.boundingClientRect()
105-
.exec(ret => {
106-
this.height = ret[0].height + 'px'
107-
console.log(this.height)
108-
})
109-
}
110-
},
11186
onClick() {
11287
if (this.disabled) {
11388
return
@@ -160,7 +135,7 @@
160135
content: '';
161136
-webkit-transform: scaleY(.5);
162137
transform: scaleY(.5);
163-
background-color: #c8c7cc
138+
background-color: #e5e5e5
164139
}
165140
166141
.uni-collapse-cell__title {
@@ -196,7 +171,7 @@
196171
}
197172
198173
.uni-collapse-cell__title-arrow.uni-active {
199-
transform: rotate(-180deg)
174+
transform: rotate(180deg)
200175
}
201176
202177
.uni-collapse-cell__title-inner {
@@ -218,8 +193,7 @@
218193
.uni-collapse-cell__content {
219194
position: relative;
220195
width: 100%;
221-
overflow: hidden;
222-
background: #fff
196+
overflow: hidden
223197
}
224198
225199
.uni-collapse-cell__content .view {

components/uni-collapse/uni-collapse.vue

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@
3333
}
3434
})
3535
this.$emit('change', activeItem)
36-
},
37-
resize() {
38-
this.childrens.forEach(vue => {
39-
console.log('更新')
40-
vue._getSize()
41-
})
4236
}
4337
}
4438
}
@@ -64,7 +58,7 @@
6458
content: '';
6559
-webkit-transform: scaleY(.5);
6660
transform: scaleY(.5);
67-
background-color: #c8c7cc
61+
background-color: #e5e5e5
6862
}
6963
7064
.uni-collapse:before {
@@ -77,6 +71,6 @@
7771
content: '';
7872
-webkit-transform: scaleY(.5);
7973
transform: scaleY(.5);
80-
background-color: #c8c7cc
74+
background-color: #e5e5e5
8175
}
8276
</style>

components/uni-fav/uni-fav.vue

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<template>
2+
<view :style="{backgroundColor:checked?bgColorChecked:bgColor,color:checked?fgColorChecked:fgColor}" :class="[
3+
circle === true || circle === 'true' ? 'uni-fav--circle' : '',
4+
]" class="uni-fav" @click="onClick">
5+
<uni-icons v-if="!checked&&(star===true||star==='true')" :color="fgColor" class="uni-fav-star" type="star-filled" size="16" />
6+
<text class="uni-fav-text">
7+
{{ checked ? contentText.contentFav : contentText.contentDefault }}
8+
</text>
9+
</view>
10+
</template>
11+
12+
<script>
13+
import uniIcons from '../uni-icons/uni-icons.vue'
14+
export default {
15+
name: 'UniFav',
16+
components: {
17+
uniIcons
18+
},
19+
props: {
20+
star: {
21+
type: [Boolean, String],
22+
default: true
23+
},
24+
bgColor: {
25+
type: String,
26+
default: '#eeeeee'
27+
},
28+
fgColor: {
29+
type: String,
30+
default: '#666666'
31+
},
32+
bgColorChecked: {
33+
type: String,
34+
default: '#007aff'
35+
},
36+
fgColorChecked: {
37+
type: String,
38+
default: '#FFFFFF'
39+
},
40+
circle: {
41+
type: [Boolean, String],
42+
default: false
43+
},
44+
checked: {
45+
type: Boolean,
46+
default: false
47+
},
48+
contentText: {
49+
type: Object,
50+
default () {
51+
return {
52+
contentDefault: '收藏',
53+
contentFav: '已收藏'
54+
}
55+
}
56+
}
57+
},
58+
methods: {
59+
onClick() {
60+
this.$emit('click')
61+
}
62+
}
63+
}
64+
</script>
65+
66+
<style>
67+
@charset "UTF-8";
68+
69+
.uni-fav {
70+
display: inline-block;
71+
width: 120rpx;
72+
height: 50rpx;
73+
line-height: 50rpx;
74+
text-align: center;
75+
font-size: 28rpx;
76+
box-sizing: border-box;
77+
border-radius: 6rpx
78+
}
79+
80+
.uni-fav--circle {
81+
border-radius: 60rpx
82+
}
83+
84+
.uni-fav-star {
85+
height: 50rpx;
86+
line-height: 50rpx;
87+
margin-right: 5rpx;
88+
vertical-align: middle
89+
}
90+
91+
.uni-fav-text {
92+
display: inline-block;
93+
height: 50rpx;
94+
line-height: 50rpx;
95+
vertical-align: middle
96+
}
97+
</style>

0 commit comments

Comments
 (0)