Skip to content

Commit c185e80

Browse files
committed
1. 【新增】添加.editorconfig
2. 【新增】icon组件的lable新增在图标左边和上放的参数lebel-pos=left | top 3. 【优化】empty组件图标改由字体图标提供,详见文档说明 4. 【优化】avatar头像组件二次加载图片时无效的问题 5. 【优化】image组件图片加载完成时移除背景色,避免png图片能看到底色 6. 【优化】优化line线条组件的length参数单位问题 7. 【修复】由于deepClone导致null结果为{}而导致http的loading无效的问题
1 parent a5c163a commit c185e80

File tree

14 files changed

+240
-181
lines changed

14 files changed

+240
-181
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.1",
5+
"versionName" : "1.4.3",
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/componentsC/test/index", //启动页面,必选
10-
"query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
11-
}]
12-
},
5+
// "condition": { //模式配置,仅开发期间生效
6+
// "current": 0, //当前激活的模式(list 的索引项)
7+
// "list": [{
8+
// "name": "test", //模式名称
9+
// "path": "pages/componentsC/test/index", //启动页面,必选
10+
// "query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
11+
// }]
12+
// },
1313
"pages": [
1414
// 演示-组件
1515
{

pages/componentsC/layout/index.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
<view class="u-demo-title">演示效果</view>
55
<view class="u-demo-area">
66
<u-row gutter="20" :justify="justify">
7-
<u-col :span="span" :offset="offset">
7+
<u-col :span="span" :offset="offset" @click="click">
88
<view class="demo-layout bg-purple-dark">
9-
9+
1010
</view>
1111
</u-col>
1212
<u-col :span="span" :offset="offset">
1313
<view class="demo-layout bg-purple-dark">
14-
14+
1515
</view>
1616
</u-col>
1717
<u-col :span="span" :offset="offset">
1818
<view class="demo-layout bg-purple-dark">
19-
19+
2020
</view>
2121
</u-col>
2222
</u-row>
@@ -125,7 +125,7 @@
125125
.bg-purple-dark {
126126
background: #99a9bf;
127127
}
128-
128+
129129
// H5中,电脑端文档演示时,可能会导致演示块挤出边界,特别处理。
130130
// 真实使用环境不会产生此问题
131131
/* #ifdef H5 */

pages/template/keyboardPay/index.vue

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
<u-icon name="red-packet"></u-icon>
66
<text class="u-padding-left-10">发送1.00元红包</text>
77
</u-button>
8-
</view>
9-
10-
8+
</view>
119
<u-keyboard
12-
default="778"
10+
default=""
1311
ref="uKeyboard"
1412
mode="number"
1513
:mask="true"
@@ -19,8 +17,7 @@
1917
:safe-area-inset-bottom="true"
2018
:tooltip="false"
2119
@change="onChange"
22-
@backspace="onBackspace"
23-
>
20+
@backspace="onBackspace">
2421
<view>
2522
<view class="u-text-center u-padding-20 money">
2623
<text>1.00</text>
@@ -36,6 +33,7 @@
3633
:dot-fill="true"
3734
v-model="password"
3835
:disabled-keyboard="true"
36+
@finish="finish"
3937
></u-message-input>
4038
</view>
4139
<view class="u-text-center u-padding-top-10 u-padding-bottom-20 tips">支付键盘</view>
@@ -53,7 +51,7 @@
5351
}
5452
},
5553
onLoad() {
56-
console.log(this.$u.config.v)
54+
5755
},
5856
methods: {
5957
onChange(val){
@@ -87,6 +85,9 @@
8785
showPop(flag = true){
8886
this.password = '';
8987
this.show = flag;
88+
},
89+
finish(){
90+
console.log(11111)
9091
}
9192
}
9293
}
@@ -109,4 +110,4 @@
109110
.tips{
110111
color:$u-tips-color;
111112
}
112-
</style>
113+
</style>

pages/template/wxCenter/index.vue

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<view>
3-
<u-navbar title="" :border-bottom="false">
3+
<u-navbar :is-back="false" title=" " :border-bottom="false">
44
<view class="u-flex u-row-right" style="width: 100%;">
55
<view class="camera u-flex u-row-center">
66
<u-icon name="camera-fill" color="#000000" size="48"></u-icon>
@@ -23,28 +23,35 @@
2323
</view>
2424
</view>
2525

26-
<u-cell-group class="u-m-t-20">
27-
<u-cell-item icon="rmb-circle" title="支付"></u-cell-item>
28-
</u-cell-group>
26+
<view class="u-m-t-20">
27+
<u-cell-group>
28+
<u-cell-item icon="rmb-circle" title="支付"></u-cell-item>
29+
</u-cell-group>
30+
</view>
2931

30-
<u-cell-group class="u-m-t-20">
31-
<u-cell-item icon="star" title="收藏"></u-cell-item>
32-
<u-cell-item icon="photo" title="相册"></u-cell-item>
33-
<u-cell-item icon="coupon" title="卡券"></u-cell-item>
34-
<u-cell-item icon="heart" title="关注"></u-cell-item>
35-
</u-cell-group>
32+
<view class="u-m-t-20">
33+
<u-cell-group>
34+
<u-cell-item icon="star" title="收藏"></u-cell-item>
35+
<u-cell-item icon="photo" title="相册"></u-cell-item>
36+
<u-cell-item icon="coupon" title="卡券"></u-cell-item>
37+
<u-cell-item icon="heart" title="关注"></u-cell-item>
38+
</u-cell-group>
39+
</view>
3640

37-
<u-cell-group class="u-m-t-20">
38-
<u-cell-item icon="setting" title="设置"></u-cell-item>
39-
</u-cell-group>
41+
<view class="u-m-t-20">
42+
<u-cell-group>
43+
<u-cell-item icon="setting" title="设置"></u-cell-item>
44+
</u-cell-group>
45+
</view>
4046
</view>
4147
</template>
4248

4349
<script>
4450
export default {
4551
data() {
4652
return {
47-
pic:'https://uviewui.com/common/logo.png'
53+
pic:'https://uviewui.com/common/logo.png',
54+
show:true
4855
}
4956
},
5057
onLoad() {
@@ -59,7 +66,6 @@
5966
<style lang="scss">
6067
page{
6168
background-color: #ededed;
62-
min-height: 100vh;
6369
}
6470
6571
.camera{

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@
7272
data() {
7373
return {
7474
error: false,
75-
avatar: this.src, // 头像的地址,因为如果加载错误,需要赋值为默认图片,props值无法修改,所以需要一个中间值
75+
// 头像的地址,因为如果加载错误,需要赋值为默认图片,props值无法修改,所以需要一个中间值
76+
avatar: this.src ? this.src : base64Avatar,
7677
}
7778
},
7879
watch: {

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

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
]" :style="{
55
padding: `0 ${Number(gutter)/2 + 'rpx'}`,
66
marginLeft: 100 / 12 * offset + '%',
7-
flex: `0 0 ${100 / 12 * span}%`
7+
flex: `0 0 ${100 / 12 * span}%`,
8+
alignItems: uAlignItem,
9+
justifyContent: uJustify
810
}">
911
<slot></slot>
1012
</view>
@@ -32,8 +34,30 @@
3234
type: [Number, String],
3335
default: 0
3436
},
37+
// 水平排列方式,可选值为`start`(或`flex-start`)、`end`(或`flex-end`)、`center`、`around`(或`space-around`)、`between`(或`space-between`)
38+
justify: {
39+
type: String,
40+
default: 'start'
41+
},
42+
// 垂直对齐方式,可选值为top、center、bottom
43+
align: {
44+
type: String,
45+
default: 'center'
46+
}
3547
},
3648
inject: ['gutter'],
49+
computed: {
50+
uJustify() {
51+
if (this.justify == 'end' || this.justify == 'start') return 'flex-' + this.justify;
52+
else if (this.justify == 'around' || this.justify == 'between') return 'space-' + this.justify;
53+
else return this.justify;
54+
},
55+
uAlignItem() {
56+
if (this.align == 'top') return 'flex-start';
57+
if (this.align == 'bottom') return 'flex-end';
58+
else return this.align;
59+
}
60+
},
3761
}
3862
</script>
3963

uview-ui/components/u-empty/icon.js

Lines changed: 0 additions & 58 deletions
This file was deleted.

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

Lines changed: 90 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
<view class="u-empty" v-if="show" :style="{
33
marginTop: marginTop + 'rpx'
44
}">
5-
<image class="u-image" :src="src ? src : icons[mode].image" mode="widthFix" :style="{
6-
width: imgWidth + 'rpx',
7-
height: imgHeight == 'auto' ? 'auto' : imgHeight + 'rpx'
8-
}"></image>
9-
<text :style="{
10-
color: color,
11-
fontSize: fontSize + 'rpx',
12-
}">
13-
{{text ? text : icons[mode].text}}
14-
</text>
5+
<u-icon
6+
:name="src ? src : 'empty-' + mode"
7+
:custom-style="iconStyle"
8+
:label="text ? text : icons[mode]"
9+
label-pos="bottom"
10+
:label-color="color"
11+
:label-size="fontSize"
12+
:size="iconSize"
13+
:color="iconColor"
14+
margin-top="14"
15+
></u-icon>
1516
<view class="u-slot-wrap">
1617
<slot name="bottom"></slot>
1718
</view>
1819
</view>
1920
</template>
2021

2122
<script>
22-
import icon from "./icon.js";
2323
/**
2424
* empty 内容为空
2525
* @description 该组件用于需要加载内容,但是加载的第一页数据就为空,提示一个"没有内容"的场景, 我们精心挑选了十几个场景的图标,方便您使用。
@@ -55,6 +55,16 @@
5555
type: String,
5656
default: '#c0c4cc'
5757
},
58+
// 图标的颜色
59+
iconColor: {
60+
type: String,
61+
default: '#c0c4cc'
62+
},
63+
// 图标的大小
64+
iconSize: {
65+
type: [String, Number],
66+
default: 120
67+
},
5868
// 文字大小,单位rpx
5969
fontSize: {
6070
type: [String, Number],
@@ -68,7 +78,7 @@
6878
// 图标宽度,单位rpx
6979
imgWidth: {
7080
type: [String, Number],
71-
default: 240
81+
default: 120
7282
},
7383
// 图标高度,单位rpx
7484
imgHeight: {
@@ -84,19 +94,84 @@
8494
marginTop: {
8595
type: [String, Number],
8696
default: 0
97+
},
98+
iconStyle: {
99+
type: Object,
100+
default() {
101+
return {}
102+
}
87103
}
88104
},
89105
data() {
90106
return {
91-
icons: icon
107+
icons: {
108+
car: '购物车为空',
109+
page: '页面不存在',
110+
search: '没有搜索结果',
111+
address: '没有收货地址',
112+
wifi: '没有WiFi',
113+
order: '订单为空',
114+
coupon: '没有优惠券',
115+
favor: '暂无收藏',
116+
permission: '无权限',
117+
history: '无历史记录',
118+
news: '无新闻列表',
119+
message: '消息列表为空',
120+
list: '列表为空',
121+
data: '数据为空'
122+
},
123+
// icons: [{
124+
// icon: 'car',
125+
// text: '购物车为空'
126+
// },{
127+
// icon: 'page',
128+
// text: '页面不存在'
129+
// },{
130+
// icon: 'search',
131+
// text: '没有搜索结果'
132+
// },{
133+
// icon: 'address',
134+
// text: '没有收货地址'
135+
// },{
136+
// icon: 'wifi',
137+
// text: '没有WiFi'
138+
// },{
139+
// icon: 'order',
140+
// text: '订单为空'
141+
// },{
142+
// icon: 'coupon',
143+
// text: '没有优惠券'
144+
// },{
145+
// icon: 'favor',
146+
// text: '暂无收藏'
147+
// },{
148+
// icon: 'permission',
149+
// text: '无权限'
150+
// },{
151+
// icon: 'history',
152+
// text: '无历史记录'
153+
// },{
154+
// icon: 'news',
155+
// text: '无新闻列表'
156+
// },{
157+
// icon: 'message',
158+
// text: '消息列表为空'
159+
// },{
160+
// icon: 'list',
161+
// text: '列表为空'
162+
// },{
163+
// icon: 'data',
164+
// text: '数据为空'
165+
// }],
166+
92167
}
93168
}
94169
}
95170
</script>
96171

97-
<style lang="scss" scoped>
172+
<style scoped lang="scss">
98173
@import "../../libs/css/style.components.scss";
99-
174+
100175
.u-empty {
101176
display: flex;
102177
flex-direction: column;

0 commit comments

Comments
 (0)