Skip to content

Commit ead9b90

Browse files
committed
1. Picker选择器组件新增单列和多列模式
2. Waterfall瀑布流组件新增清空和移除数据的组件方法 3. 重构圆型进度条组件,解决微信小程序可能报错的问题,新增动态减少百分比的功能 4. 新增Keyboard键盘组件无遮罩时,可以点击透明层关闭键盘的特性 5. MessageInput验证码输入框组件新增disabled-keyboard参数,用于禁止原生键盘 6. 修复Navbar自定义导航栏title-size参数无效的问题 7. 修复NumberBox步进器组件无法减到0的问题,添加cursor-spacing参数 8. 优化Tabs组件初次加载时的动画问题以及动态修改标签长度时重置current值 9. 优化Tag标签组件的内部逻辑 10. 修复slider滑块无法触发moving事件的问题 11. 优化NoticeBar横线滚动通知的事件问题
1 parent a8050ed commit ead9b90

File tree

28 files changed

+421
-462
lines changed

28 files changed

+421
-462
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
"template" : "template.h5.html",
115115
"router" : {
116116
"mode" : "hash",
117-
"base" : "/h5/"
117+
"base" : ""
118118
},
119119
"optimization" : {
120120
"treeShaking" : {

pages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// "current": 0, //当前激活的模式(list 的索引项)
77
// "list": [{
88
// "name": "test", //模式名称
9-
// "path": "pages/componentsB/line/index", //启动页面,必选
9+
// "path": "pages/componentsC/test/index", //启动页面,必选
1010
// "query": "id=1&name=2" //启动参数,在页面的-+onLoad函数里面得到
1111
// }]
1212
// },

pages/componentsB/picker/index.vue

Lines changed: 154 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,30 @@
33
<view class="u-demo-wrap">
44
<view class="u-demo-title">演示效果</view>
55
<view class="u-demo-area">
6-
<view class="u-demo-result-line">
7-
{{input ? input : 'Picker值'}}
8-
</view>
9-
<u-picker :mode="mode" :defaultTime="defaultTime" v-model="show"
10-
:defaultRegion="defaultRegion" :params="params" @confirm="confirm"></u-picker>
6+
<view class="u-demo-result-line">{{ input ? input : 'Picker值' }}</view>
7+
<u-picker
8+
:mode="mode"
9+
:defaultTime="defaultTime"
10+
v-model="show"
11+
:defaultRegion="defaultRegion"
12+
:params="params"
13+
@confirm="confirm"
14+
:defaultSelector="defaultSelector"
15+
:range="range"
16+
:range-key="rangKey"
17+
@columnchange="columnchange"
18+
></u-picker>
1119
</view>
1220
</view>
1321
<view class="u-config-wrap">
14-
<view class="u-config-title u-border-bottom">
15-
参数配置
16-
</view>
22+
<view class="u-config-title u-border-bottom">参数配置</view>
1723
<view class="u-config-item">
1824
<view class="u-item-title">Picker开关</view>
1925
<u-subsection vibrateShort :current="status" :list="['显示', '隐藏']" @change="statusChange"></u-subsection>
2026
</view>
2127
<view class="u-config-item">
2228
<view class="u-item-title">模式选择</view>
23-
<u-subsection vibrateShort :list="['时间', '地区']" @change="modeChange"></u-subsection>
29+
<u-subsection vibrateShort :list="['单列', '多列', '时间', '地区']" @change="modeChange"></u-subsection>
2430
</view>
2531
<view class="u-config-item">
2632
<view class="u-item-title">默认时间</view>
@@ -39,92 +45,153 @@
3945
</template>
4046

4147
<script>
42-
export default {
43-
data() {
44-
return {
45-
show: false,
46-
input: '',
47-
mode: 'time',
48-
defaultTime: '2019-12-11 20:15:35',
49-
defaultRegion: ['广东省', '深圳市', '宝安区'],
50-
params: {
51-
year: true,
52-
month: true,
53-
day: true,
54-
hour: true,
55-
minute: true,
56-
second: true,
57-
province: true,
58-
city: true,
59-
area: true
60-
}
48+
export default {
49+
data() {
50+
return {
51+
show: false,
52+
input: '',
53+
rangKey: 'name',
54+
mode: 'selector',
55+
range: ['', '', '', '', '', '', ''],
56+
defaultTime: '2019-12-11 20:15:35',
57+
defaultSelector: [0],
58+
defaultRegion: ['广东省', '深圳市', '宝安区'],
59+
params: {
60+
year: true,
61+
month: true,
62+
day: true,
63+
hour: true,
64+
minute: true,
65+
second: true,
66+
province: true,
67+
city: true,
68+
area: true
6169
}
70+
};
71+
},
72+
computed: {
73+
status() {
74+
return this.show == true ? 0 : 1;
75+
}
76+
},
77+
methods: {
78+
statusChange(index) {
79+
this.show = index == 0 ? true : false;
6280
},
63-
computed: {
64-
status() {
65-
return this.show == true ? 0 : 1;
81+
modeChange(index) {
82+
this.mode = ['selector', 'multiSelector', 'time', 'region'][index];
83+
if (this.mode == 'selector') {
84+
this.range = ['', '', '', '', '', '', ''];
85+
this.defaultSelector = [0];
86+
}
87+
if (this.mode == 'multiSelector') {
88+
this.range = [['亚洲', '欧洲'], ['中国', '日本'], ['北京', '上海', '广州']];
89+
this.defaultSelector = [0, 0, 0];
6690
}
91+
this.show = true;
92+
},
93+
defaultTimeChange(index) {
94+
this.defaultTime = index == 0 ? '2019-12-11 20:15:35' : '2020-02-05 13:09:42';
95+
this.mode = 'time';
96+
this.show = true;
6797
},
68-
methods: {
69-
statusChange(index) {
70-
this.show = index == 0 ? true : false;
71-
},
72-
modeChange(index) {
73-
this.mode = index == 0 ? 'time' : 'region';
74-
this.show = true;
75-
},
76-
defaultTimeChange(index) {
77-
this.defaultTime = index == 0 ? '2019-12-11 20:15:35' : '2020-02-05 13:09:42';
78-
this.mode = 'time';
79-
this.show = true;
80-
},
81-
defaultRegionChange(index) {
82-
this.defaultRegion = index == 0 ? ['广东省', '深圳市', '宝安区'] : ['海南省','三亚市', '海棠区'];
83-
this.mode = 'region';
84-
this.show = true;
85-
},
86-
minSecChange(index) {
87-
if(index == 0) {
88-
this.params.hour = true;
89-
this.params.minute = true;
90-
this.params.second = true;
91-
}
92-
if(index == 1) {
93-
this.params.hour = false;
94-
this.params.minute = false;
95-
this.params.second = false;
96-
}
97-
this.mode = 'time';
98-
this.show = true;
99-
},
100-
confirm(e) {
101-
this.input = '';
102-
if(this.mode == 'time') {
103-
if(this.params.year) this.input += e.year;
104-
if(this.params.month) this.input += '-' + e.month;
105-
if(this.params.day) this.input += '-' + e.day;
106-
if(this.params.hour) this.input += " " + e.day;
107-
if(this.params.minute) this.input += ':' + e.minute;
108-
if(this.params.second) this.input += ':' + e.second;
109-
} else {
110-
this.input = e.province.label + '-' + e.city.label + '-' + e.area.label;
111-
}
98+
defaultRegionChange(index) {
99+
this.defaultRegion = index == 0 ? ['广东省', '深圳市', '宝安区'] : ['海南省', '三亚市', '海棠区'];
100+
this.mode = 'region';
101+
this.show = true;
102+
},
103+
minSecChange(index) {
104+
if (index == 0) {
105+
this.params.hour = true;
106+
this.params.minute = true;
107+
this.params.second = true;
108+
}
109+
if (index == 1) {
110+
this.params.hour = false;
111+
this.params.minute = false;
112+
this.params.second = false;
112113
}
114+
this.mode = 'time';
115+
this.show = true;
113116
},
117+
confirm(e) {
118+
this.input = '';
119+
if (this.mode == 'time') {
120+
if (this.params.year) this.input += e.year;
121+
if (this.params.month) this.input += '-' + e.month;
122+
if (this.params.day) this.input += '-' + e.day;
123+
if (this.params.hour) this.input += ' ' + e.day;
124+
if (this.params.minute) this.input += ':' + e.minute;
125+
if (this.params.second) this.input += ':' + e.second;
126+
} else if (this.mode == 'region') {
127+
this.input = e.province.label + '-' + e.city.label + '-' + e.area.label;
128+
} else if (this.mode == 'selector') {
129+
this.input = this.range[e[0]];
130+
} else if (this.mode == 'multiSelector') {
131+
this.input = this.range[0][e[0]] + '-' + this.range[1][e[1]] + '-' + this.range[2][e[2]];
132+
}
133+
},
134+
columnchange(e) {
135+
let column = e.column, index = e.index;
136+
this.defaultSelector.splice(column, 1, index)
137+
switch (column) {
138+
case 0:
139+
switch (index) {
140+
case 0:
141+
this.range[1] = ['中国', '日本']
142+
this.range[2] = ['北京', '上海', '广州']
143+
break
144+
case 1:
145+
this.range[1] = ['英国', '法国']
146+
this.range[2] = ['伦敦', '曼彻斯特']
147+
break
148+
}
149+
this.defaultSelector.splice(1, 1, 0)
150+
this.defaultSelector.splice(2, 1, 0)
151+
break
152+
case 1: //拖动第2列
153+
switch (this.defaultSelector[0]) { //判断第一列是什么
154+
case 0:
155+
switch (this.defaultSelector[1]) {
156+
case 0:
157+
this.range[2] = ['北京', '上海', '广州']
158+
break
159+
case 1:
160+
this.range[2] = ['东京','北海道']
161+
break
162+
}
163+
break
164+
case 1:
165+
switch (this.defaultSelector[1]) {
166+
case 0:
167+
this.range[2] = ['伦敦', '曼彻斯特']
168+
break
169+
case 1:
170+
this.range[2] = ['巴黎', '马赛']
171+
break
172+
}
173+
break
174+
}
175+
this.defaultSelector.splice(2, 1, 0)
176+
break
177+
}
178+
this.$forceUpdate()
179+
}
114180
}
181+
};
115182
</script>
116183

117184
<style lang="scss" scoped>
118-
.input {
119-
border: 1px solid $u-light-color;
120-
border-radius: 4px;
121-
margin-bottom: 20px;
122-
height: 30px;
123-
font-size: 26rpx;
124-
flex: 1;
125-
}
126-
127-
.input-wrap {
128-
display: flex;
129-
}
185+
.input {
186+
border: 1px solid $u-light-color;
187+
border-radius: 4px;
188+
margin-bottom: 20px;
189+
height: 30px;
190+
font-size: 26rpx;
191+
flex: 1;
192+
}
193+
194+
.input-wrap {
195+
display: flex;
196+
}
130197
</style>

pages/componentsB/waterfall/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<view class="wrap">
3-
<u-waterfall :flowList="flowList" ref="uWaterfall">
3+
<u-waterfall v-model="flowList" ref="uWaterfall">
44
<template v-slot:left="{ leftList }">
55
<view class="demo-warter" v-for="(item, index) in leftList" :key="index">
66
<!-- 警告:微信小程序不支持嵌入lazyload组件,请自行如下使用image标签 -->

pages/componentsC/numberBox/index.vue

Lines changed: 1 addition & 1 deletion
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-number-box :value="value" :bg-color="bgColor" :color="color"
6+
<u-number-box :value="value" :bg-color="bgColor" :color="color" :min="0"
77
:step="step" :disabled="disabled"></u-number-box>
88
</view>
99
</view>

pages/componentsC/progress/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<u-subsection vibrateShort :current="current" :list="['线型', '圆型']" @change="modeChange"></u-subsection>
2424
</view>
2525
<view class="u-config-item">
26-
<view class="u-item-title">增减(圆型时只能增,不能减)</view>
26+
<view class="u-item-title">增减</view>
2727
<u-subsection vibrateShort :list="['减少30%', '增加30%']" @change="calcChange"></u-subsection>
2828
</view>
2929
<view class="u-config-item">

0 commit comments

Comments
 (0)