Skip to content

Commit 2bd00f1

Browse files
committed
update(uni-ui): 更新uni-ui
1 parent 5828112 commit 2bd00f1

File tree

15 files changed

+238
-93
lines changed

15 files changed

+238
-93
lines changed

components/uni-badge/uni-badge.vue

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@
33
</template>
44

55
<script>
6+
/**
7+
* Badge 数字角标
8+
* @description 数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景
9+
* @tutorial https://ext.dcloud.net.cn/plugin?id=21
10+
* @property {String} text 角标内容
11+
* @property {String} type = [default|primary|success|warning|error] 颜色类型
12+
* @value default 灰色
13+
* @value primary 蓝色
14+
* @value success 绿色
15+
* @value warning 黄色
16+
* @value error 红色
17+
* @property {String} size = [normal|small] Badge 大小
18+
* @value normal 一般尺寸
19+
* @value small 小尺寸
20+
* @property {String} inverted = [true|false] 是否无需背景颜色
21+
* @event {Function} click 点击 Badge 触发事件
22+
* @example <uni-badge text="1"></uni-badge>
23+
*/
624
export default {
725
name: 'UniBadge',
826
props: {
@@ -19,7 +37,6 @@
1937
default: ''
2038
},
2139
size: {
22-
// small.normal
2340
type: String,
2441
default: 'normal'
2542
}

components/uni-calendar/uni-calendar.vue

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -60,65 +60,60 @@
6060
<script>
6161
import Calendar from './util.js';
6262
import uniCalendarItem from './uni-calendar-item.vue'
63+
/**
64+
* Calendar 日历
65+
* @description 日历组件可以查看日期,选择任意范围内的日期,打点操作。常用场景如:酒店日期预订、火车机票选择购买日期、上下班打卡等
66+
* @tutorial https://ext.dcloud.net.cn/plugin?id=56
67+
* @property {String} date 自定义当前时间,默认为今天
68+
* @property {Boolean} lunar 显示农历
69+
* @property {String} startDate 日期选择范围-开始日期
70+
* @property {String} endDate 日期选择范围-结束日期
71+
* @property {Boolean} range 范围选择
72+
* @property {Boolean} insert = [true|false] 插入模式,默认为false
73+
* @value true 弹窗模式
74+
* @value false 插入模式
75+
* @property {Array} selected 打点,期待格式[{date: '2019-06-27', info: '签到', data: { custom: '自定义信息', name: '自定义消息头',xxx:xxx... }}]
76+
* @property {Boolean} showMonth 是否选择月份为背景
77+
* @event {Function} change 日期改变,`insert :ture` 时生效
78+
* @event {Function} confirm 确认选择`insert :false` 时生效
79+
* @event {Function} monthSwitch 切换月份时触发
80+
* @example <uni-calendar :insert="true":lunar="true" :start-date="'2019-3-2'":end-date="'2019-5-20'"@change="change" />
81+
*/
6382
export default {
6483
components: {
6584
uniCalendarItem
6685
},
6786
props: {
68-
/**
69-
* 当前日期
70-
*/
7187
date: {
7288
type: String,
7389
default: ''
7490
},
75-
/**
76-
* 打点日期
77-
*/
7891
selected: {
7992
type: Array,
8093
default () {
8194
return []
8295
}
8396
},
84-
/**
85-
* 是否开启阴历日期
86-
*/
8797
lunar: {
8898
type: Boolean,
8999
default: false
90100
},
91-
/**
92-
* 开始时间
93-
*/
94101
startDate: {
95102
type: String,
96103
default: ''
97104
},
98-
/**
99-
* 结束时间
100-
*/
101105
endDate: {
102106
type: String,
103107
default: ''
104108
},
105-
/**
106-
* 范围
107-
*/
108109
range: {
109110
type: Boolean,
110111
default: false
111112
},
112-
/**
113-
* 插入
114-
*/
115113
insert: {
116114
type: Boolean,
117115
default: true
118116
},
119-
/**
120-
* 是否显示月份背景
121-
*/
122117
showMonth: {
123118
type: Boolean,
124119
default: true
@@ -160,7 +155,9 @@
160155
open() {
161156
this.show = true
162157
this.$nextTick(() => {
163-
this.aniMaskShow = true
158+
setTimeout(() => {
159+
this.aniMaskShow = true
160+
}, 50)
164161
})
165162
},
166163
close() {

components/uni-card/uni-card.vue

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,23 @@
3838
</template>
3939

4040
<script>
41+
/**
42+
* Card 卡片
43+
* @description 卡片视图组件
44+
* @tutorial https://ext.dcloud.net.cn/plugin?id=22
45+
* @property {String} title 标题文字
46+
* @property {String} extra 标题额外信息
47+
* @property {String} note 标题左侧缩略图
48+
* @property {String} thumbnail 底部信息
49+
* @property {String} mode = [basic|style|title] 卡片模式
50+
* @value basic 基础卡片
51+
* @value style 图文卡片
52+
* @value title 标题卡片
53+
* @property {Boolean} isFull = [true | false] 卡片内容是否通栏,为 true 时将去除padding值
54+
* @property {Boolean} isShadow = [true | false] 卡片内容是否开启阴影
55+
* @event {Function} click 点击 Card 触发事件
56+
* @example <uni-card title="标题文字" thumbnail="https://img-cdn-qiniu.dcloud.net.cn/new-page/uni.png" extra="额外信息" note="Tips">内容主体,可自定义内容及样式</uni-card>
57+
*/
4158
export default {
4259
name: 'UniCard',
4360
props: {

components/uni-fab/uni-fab.vue

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
'uni-fab__content--flexDirectionStart': flexDirectionStart,
1414
'uni-fab__content--flexDirectionEnd': flexDirectionEnd,
1515
'uni-fab__content--other-platform': !isAndroidNvue
16-
}" :style="{ width: boxWidth, height: boxHeight, backgroundColor: styles.backgroundColor }" class="uni-fab__content">
16+
}" :style="{ width: boxWidth, height: boxHeight, backgroundColor: styles.backgroundColor }" class="uni-fab__content" elevation="5">
1717
<view v-if="flexDirectionStart || horizontalLeft" class="uni-fab__item uni-fab__item--first" />
1818
<view v-for="(item, index) in content" :key="index" :class="{ 'uni-fab__item--active': isShow }" class="uni-fab__item" @click="_onItemClick(index, item)">
1919
<image :src="item.active ? item.selectedIconPath : item.iconPath" class="uni-fab__item-image" mode="widthFix" />
@@ -23,10 +23,10 @@
2323
</view>
2424
</view>
2525
<view :class="{
26-
'uni-fab--leftBottom': leftBottom,
27-
'uni-fab--rightBottom': rightBottom,
28-
'uni-fab--leftTop': leftTop,
29-
'uni-fab--rightTop': rightTop,
26+
'uni-fab__circle--leftBottom': leftBottom,
27+
'uni-fab__circle--rightBottom': rightBottom,
28+
'uni-fab__circle--leftTop': leftTop,
29+
'uni-fab__circle--rightTop': rightTop,
3030
'uni-fab__content--other-platform': !isAndroidNvue
3131
}" class="uni-fab__circle uni-fab__plus" :style="{ 'background-color': styles.buttonColor }" @click="_onClick">
3232
<view class="fab-circle-v" :class="{'uni-fab__plus--active': isShow}"></view>
@@ -190,47 +190,38 @@
190190
z-index: 10;
191191
}
192192
193-
.uni-fab--top {
194-
width: 30px;
195-
height: 30px;
196-
right: 15px;
197-
bottom: 30px;
198-
border-style: solid;
199-
border-width: 1px;
200-
border-color: #5989b9;
201-
border-radius: 5px;
202-
transition: opacity 0.3;
203-
opacity: 0;
204-
}
205-
206193
.uni-fab--active {
207194
opacity: 1;
208195
}
209196
210197
.uni-fab--leftBottom {
211-
left: 15px;
212-
bottom: 30px;
198+
left: 5px;
199+
bottom: 20px;
200+
padding: 10px;
213201
}
214202
215203
.uni-fab--leftTop {
216-
left: 15px;
217-
top: 40px;
204+
left: 5px;
205+
top: 30px;
218206
/* #ifdef H5 */
219-
top: calc(40px + var(--window-top));
207+
top: calc(30px + var(--window-top));
220208
/* #endif */
209+
padding: 10px;
221210
}
222211
223212
.uni-fab--rightBottom {
224-
right: 15px;
225-
bottom: 30px;
213+
right: 5px;
214+
bottom: 20px;
215+
padding: 10px;
226216
}
227217
228218
.uni-fab--rightTop {
229-
right: 15px;
230-
top: 40px;
219+
right: 5px;
220+
top: 30px;
231221
/* #ifdef H5 */
232-
top: calc(40px + var(--window-top));
222+
top: calc(30px + var(--window-top));
233223
/* #endif */
224+
padding: 10px;
234225
}
235226
236227
.uni-fab__circle {
@@ -247,6 +238,32 @@
247238
z-index: 11;
248239
}
249240
241+
.uni-fab__circle--leftBottom {
242+
left: 15px;
243+
bottom: 30px;
244+
}
245+
246+
.uni-fab__circle--leftTop {
247+
left: 15px;
248+
top: 40px;
249+
/* #ifdef H5 */
250+
top: calc(40px + var(--window-top));
251+
/* #endif */
252+
}
253+
254+
.uni-fab__circle--rightBottom {
255+
right: 15px;
256+
bottom: 30px;
257+
}
258+
259+
.uni-fab__circle--rightTop {
260+
right: 15px;
261+
top: 40px;
262+
/* #ifdef H5 */
263+
top: calc(40px + var(--window-top));
264+
/* #endif */
265+
}
266+
250267
.uni-fab__circle--left {
251268
left: 0;
252269
}

components/uni-list-item/uni-list-item.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<text v-if="note" class="uni-list-item__content-note">{{ note }}</text>
1717
</view>
1818
<view v-if="showBadge || showArrow || showSwitch" class="uni-list-item__extra">
19+
<text v-if="rightText" class="uni-list-item__extra-text">{{rightText}}</text>
1920
<uni-badge v-if="showBadge" :type="badgeType" :text="badgeText" />
2021
<switch v-if="showSwitch" :disabled="disabled" :checked="switchChecked" @change="onSwitchChange" />
2122
<uni-icons v-if="showArrow" :size="20" class="uni-icon-wrapper" color="#bbb" type="arrowright" />
@@ -80,6 +81,11 @@
8081
type: String,
8182
default: 'success'
8283
},
84+
rightText: {
85+
// 右侧文字内容
86+
type: String,
87+
default: ''
88+
},
8389
thumb: {
8490
// 缩略图
8591
type: String,
@@ -233,4 +239,9 @@
233239
height: 52rpx;
234240
width: 52rpx;
235241
}
242+
243+
.uni-list-item__extra-text {
244+
color: #999;
245+
font-size: 24rpx;
246+
}
236247
</style>

components/uni-popup/uni-popup.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@
105105
open() {
106106
this.showPopup = true
107107
this.$nextTick(() => {
108-
setTimeout(() => {
108+
clearTimeout(this.timer)
109+
this.timer = setTimeout(() => {
109110
this.showTrans = true
110111
}, 50);
111112
})

0 commit comments

Comments
 (0)