Skip to content

Commit 8f16628

Browse files
committed
1. 优化懒加载的方法
2. 优化步进器的代码逻辑 3. 修改评分组件对支付宝小程序的支持 4. 添加搜索组件的maxlength参数 5. 优化$u.getRect()方法,使其支持支付宝小程序 6. 修改README.md的描述错误 7. 优化按钮点击事件,阻止冒泡 8. 修复Empty组件的历史记录图标显示不全的问题,同时使该组件垂直居中 9. Icon图标组件新增label功能,支持右边和下方插入描述文字 10. 优化NoNetwork无网络提示组件,使其垂直居中 11. 给NumberBox步进器组件添加disabled-input组件,控制输入框是否可输入内容 12. 优化Swiper组件在App上滑动时圆角无效的问题 13. 改正Switch开关选择器参数的拼写错误 14. 添加Upload上传组件控制右上角删除图标的样式参数,可以定义颜色,背景等 15. 新增Card卡片组件 16. 新增Line线条组件 17. 给$u.test.empty改名$u.test.isEmpty,同时保留$u.test.empty,二者功能一致
1 parent 9d200c0 commit 8f16628

File tree

30 files changed

+729
-87
lines changed

30 files changed

+729
-87
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/unpackage/dist/*
22
/node_modules/*
33
/.idea/*
4+
deploy.sh

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Vue.use(uView);
4646
3. `uni.scss`引入全局scss变量文件
4747
```css
4848
/* uni.scss */
49-
@import "uview-ui/themb.scss";
49+
@import "uview-ui/theme.scss";
5050
```
5151

5252
4. `pages.json`配置easycom规则(按需引入)

manifest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@
113113
"h5" : {
114114
"template" : "template.h5.html",
115115
"router" : {
116-
"mode" : "history"
116+
"mode" : "hash",
117+
"base" : ""
117118
},
118119
"optimization" : {
119120
"treeShaking" : {

pages.json

Lines changed: 22 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/componentsA/navbar/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/line/index", //启动页面,必选
10+
// "query": "id=1&name=2" //启动参数,在页面的-+onLoad函数里面得到
11+
// }]
12+
// },
1313
"pages": [
1414
// 演示-组件
1515
{
@@ -578,6 +578,20 @@
578578
{
579579
"root": "pages/componentsB",
580580
"pages": [
581+
// line-线条
582+
{
583+
"path": "line/index",
584+
"style": {
585+
"navigationBarTitleText": "line-线条"
586+
}
587+
},
588+
// card-卡片
589+
{
590+
"path": "card/index",
591+
"style": {
592+
"navigationBarTitleText": "card-卡片"
593+
}
594+
},
581595
// divider-分割线
582596
{
583597
"path": "divider/index",

pages/componentsB/card/index.vue

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<template>
2+
<view class="">
3+
<view class="u-card-wrap">
4+
<u-card @click="click" @head-click="headClick" :title="title" :sub-title="subTitle" :thumb="thumb" :padding="padding" :border="border">
5+
<view class="" slot="body">
6+
<view class="u-body-item u-flex u-border-bottom u-col-between u-p-t-0">
7+
<view class="u-body-item-title u-line-2">
8+
瓶身描绘的牡丹一如你初妆,冉冉檀香透过窗心事我了然,宣纸上走笔至此搁一半
9+
</view>
10+
<image src="https://img11.360buyimg.com/n7/jfs/t1/94448/29/2734/524808/5dd4cc16E990dfb6b/59c256f85a8c3757.jpg" mode="aspectFill"></image>
11+
</view>
12+
<view class="u-body-item u-flex u-row-between u-p-b-0">
13+
<view class="u-body-item-title u-line-2">
14+
釉色渲染仕女图韵味被私藏,而你嫣然的一笑如含苞待放
15+
</view>
16+
<image src="https://img12.360buyimg.com/n7/jfs/t1/102191/19/9072/330688/5e0af7cfE17698872/c91c00d713bf729a.jpg" mode="aspectFill"></image>
17+
</view>
18+
</view>
19+
<view class="" slot="foot" v-if="bottomSlot">
20+
<u-icon name="chat-fill" size="34" color="" label="30评论"></u-icon>
21+
</view>
22+
</u-card>
23+
</view>
24+
<view class="u-config-wrap u-demo">
25+
<view class="u-config-title u-border-bottom">
26+
参数配置
27+
</view>
28+
<view class="u-config-item">
29+
<view class="u-item-title">左上角图标</view>
30+
<u-subsection vibrateShort :list="['显示', '隐藏']" @change="thumbChange"></u-subsection>
31+
</view>
32+
<view class="u-config-item">
33+
<view class="u-item-title">内边距</view>
34+
<u-subsection vibrateShort current="1" :list="['20', '30', '40']" @change="paddingChange"></u-subsection>
35+
</view>
36+
<view class="u-config-item">
37+
<view class="u-item-title">底部</view>
38+
<u-subsection vibrateShort :list="['显示', '隐藏']" @change="bottomChange"></u-subsection>
39+
</view>
40+
<view class="u-config-item">
41+
<view class="u-item-title">外边框</view>
42+
<u-subsection vibrateShort :list="['显示', '隐藏']" @change="borderChange"></u-subsection>
43+
</view>
44+
</view>
45+
</view>
46+
</template>
47+
48+
<script>
49+
export default {
50+
data() {
51+
return {
52+
title: '素胚勾勒出青花,笔锋浓转淡',
53+
subTitle: '2020-05-15',
54+
thumb: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
55+
padding: 20,
56+
bottomSlot: true,
57+
border: true
58+
}
59+
},
60+
methods: {
61+
thumbChange(index) {
62+
this.thumb = index == 0 ? 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg' : '';
63+
},
64+
paddingChange(index) {
65+
this.padding = [20, 30, 40][index];
66+
},
67+
bottomChange(index) {
68+
this.bottomSlot = !index;
69+
},
70+
borderChange(index) {
71+
this.border = !index;
72+
},
73+
click(index) {
74+
console.log(index);
75+
},
76+
headClick(index) {
77+
console.log(index);
78+
}
79+
}
80+
}
81+
</script>
82+
83+
<style scoped lang="scss">
84+
.u-demo {
85+
padding-top: 0;
86+
}
87+
88+
.u-card-wrap {
89+
background-color: $u-bg-color;
90+
padding: 1px;
91+
}
92+
93+
.u-body-item {
94+
font-size: 32rpx;
95+
color: #333;
96+
padding: 20rpx 10rpx;
97+
}
98+
99+
.u-body-item image {
100+
width: 120rpx;
101+
flex: 0 0 120rpx;
102+
height: 120rpx;
103+
border-radius: 8rpx;
104+
margin-left: 12rpx;
105+
}
106+
</style>

pages/componentsB/line/index.vue

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<template>
2+
<view class="u-demo">
3+
<view class="u-demo-wrap">
4+
<view class="u-demo-title">演示效果</view>
5+
<view class="u-demo-area">
6+
<u-line color="red" :color="color" :length="length" :direction="direction" :hair-line="hairLine"></u-line>
7+
</view>
8+
</view>
9+
<view class="u-config-wrap">
10+
<view class="u-config-title u-border-bottom">
11+
参数配置
12+
</view>
13+
<view class="u-config-item">
14+
<view class="u-item-title">颜色</view>
15+
<u-subsection vibrateShort :list="['primary', 'success', 'warning', 'error', 'info']" @change="colorChange"></u-subsection>
16+
</view>
17+
<view class="u-config-item">
18+
<view class="u-item-title">细边</view>
19+
<u-subsection vibrateShort :list="['是', '否']" @change="hairLineChange"></u-subsection>
20+
</view>
21+
<view class="u-config-item">
22+
<view class="u-item-title">方向</view>
23+
<u-subsection vibrateShort :list="['水平', '垂直']" @change="directionChange"></u-subsection>
24+
</view>
25+
</view>
26+
</view>
27+
</template>
28+
29+
<script>
30+
export default {
31+
data() {
32+
return {
33+
direction: 'row',
34+
hairLine: true,
35+
length: '100%',
36+
color: this.$u.color['primary']
37+
}
38+
},
39+
methods: {
40+
colorChange(index) {
41+
this.color = this.$u.color[['primary', 'success', 'warning', 'error', 'info'][index]];
42+
},
43+
hairLineChange(index) {
44+
this.hairLine = !index;
45+
},
46+
directionChange(index) {
47+
this.direction = index == 0 ? 'row' : 'col';
48+
if(index == 0) this.length = '100%';
49+
else this.length = '50rpx';
50+
},
51+
}
52+
}
53+
</script>
54+
55+
<style scoped lang="scss">
56+
.u-demo {
57+
58+
}
59+
</style>

pages/componentsC/alertTips/index.vue

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,4 @@
11
<template>
2-
<!-- <view class="wrap">
3-
<view class="item">
4-
<u-alert-tips @close="close" closeText="close" :closeAble="true" :show="show" type="primary" :title="title" :description="description"></u-alert-tips>
5-
</view>
6-
<view class="item">
7-
<u-alert-tips type="warning" :showIcon="false" :closeAble="true" :title="title" :description="description"></u-alert-tips>
8-
</view>
9-
<view class="item">
10-
<u-alert-tips type="success" :title="title" :closeAble="false" :description="description"></u-alert-tips>
11-
</view>
12-
<view class="item">
13-
<u-alert-tips type="error" :title="title" closeText="close" :closeAble="true"></u-alert-tips>
14-
</view>
15-
<view class="item">
16-
<u-alert-tips type="info" :title="title"></u-alert-tips>
17-
</view>
18-
</view> -->
192
<view class="u-demo">
203
<view class="u-demo-wrap">
214
<view class="u-demo-title">演示效果</view>

pages/componentsC/test/index.vue

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,48 @@
11
<template>
2-
<view class="">
3-
<u-modal v-model="show" @confirm="confirm" :async-close="true"></u-modal>
4-
<u-button @click="showModal">弹起Modal</u-button>
5-
</view>
2+
<u-card :title="title" :sub-title="subTitle" :thumb="thumb">
3+
<view class="" slot="body">
4+
<view class="u-body-item u-flex u-border-bottom u-col-between u-p-t-0">
5+
<view class="u-body-item-title u-line-2">瓶身描绘的牡丹一如你初妆,冉冉檀香透过窗心事我了然,宣纸上走笔至此搁一半</view>
6+
<image src="https://img11.360buyimg.com/n7/jfs/t1/94448/29/2734/524808/5dd4cc16E990dfb6b/59c256f85a8c3757.jpg" mode="aspectFill"></image>
7+
</view>
8+
<view class="u-body-item u-flex u-row-between u-p-b-0">
9+
<view class="u-body-item-title u-line-2">釉色渲染仕女图韵味被私藏,而你嫣然的一笑如含苞待放</view>
10+
<image src="https://img12.360buyimg.com/n7/jfs/t1/102191/19/9072/330688/5e0af7cfE17698872/c91c00d713bf729a.jpg" mode="aspectFill"></image>
11+
</view>
12+
</view>
13+
<view class="" slot="foot"><u-icon name="chat-fill" size="34" color="" label="30评论"></u-icon></view>
14+
</u-card>
615
</template>
716

817
<script>
918
export default {
10-
data() {
11-
return {
12-
show: false
13-
}
14-
},
15-
onLoad: function(opt) {
16-
17-
},
18-
methods:{
19-
showModal() {
20-
this.show = true;
21-
},
22-
confirm() {
23-
setTimeout(() => {
24-
this.show = false;
25-
}, 3000)
26-
}
27-
}
28-
}
19+
data() {
20+
return {
21+
title: '素胚勾勒出青花,笔锋浓转淡',
22+
subTitle: '2020-05-15',
23+
thumb: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
24+
};
25+
}
26+
};
2927
</script>
3028

29+
<style scoped lang="scss">
30+
.u-card-wrap {
31+
background-color: $u-bg-color;
32+
padding: 1px;
33+
}
34+
35+
.u-body-item {
36+
font-size: 32rpx;
37+
color: #333;
38+
padding: 20rpx 10rpx;
39+
}
40+
41+
.u-body-item image {
42+
width: 120rpx;
43+
flex: 0 0 120rpx;
44+
height: 120rpx;
45+
border-radius: 8rpx;
46+
margin-left: 12rpx;
47+
}
48+
</style>

pages/example/components.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,14 @@ export default [{
146146
}, {
147147
groupName: '布局组件',
148148
list: [{
149+
path: '/pages/componentsB/line/index',
150+
icon: 'line',
151+
title: 'Line 线条',
152+
},{
153+
path: '/pages/componentsB/card/index',
154+
icon: 'card',
155+
title: 'Card 卡片',
156+
}, {
149157
path: '/pages/componentsC/mask/index',
150158
icon: 'mask',
151159
title: 'Mask 遮罩层',

uview-ui/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Vue.use(uView);
4646
3. `uni.scss`引入全局scss变量文件
4747
```css
4848
/* uni.scss */
49-
@import "uview-ui/themb.scss";
49+
@import "uview-ui/theme.scss";
5050
```
5151

5252
4. `pages.json`配置easycom规则(按需引入)

uview-ui/components/u-action-sheet/u-action-sheet.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<u-popup mode="bottom" :border-radius="borderRadius" :popup="false" v-model="value" :maskCloseAble="maskCloseAble"
33
length="auto" :safeAreaInsetBottom="safeAreaInsetBottom" @close="popupClose" :z-index="uZIndex">
4-
<view class="u-tips u-border-bottom" v-if="tips.text" :style="tipsStyle">
4+
<view class="u-tips u-border-bottom" v-if="tips.text" :style="[tipsStyle]">
55
{{tips.text}}
66
</view>
77
<block v-for="(item, index) in list" :key="index">

uview-ui/components/u-alert-tips/u-alert-tips.vue

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,6 @@
9898
return {
9999
}
100100
},
101-
watch: {
102-
show(val) {
103-
if (val == false) {
104-
// 先opacity隐藏,再移除
105-
setTimeout(() => {
106-
this.showAlert = false;
107-
}, 300);
108-
}
109-
}
110-
},
111101
computed: {
112102
// 计算字体颜色,如果没有自定义的,就用uview主题颜色
113103
computeColor() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
@opensetting="opensetting"
2727
@launchapp="launchapp"
2828
:style="[buttonStyle]"
29-
@tap="click($event)"
29+
@tap.stop="click($event)"
3030
:hover-class="getHoverClass"
3131
:loading="loading"
3232
>

0 commit comments

Comments
 (0)