Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uview-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李晖
uview-ui
Commits
0d653570
Commit
0d653570
authored
Jun 21, 2020
by
wlxuqu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 新增upload组件的before-upload钩子
2. 修复form表单综合演示中,switch没有垂直居中的问题
parent
c2f3c8da
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
79 deletions
+34
-79
index.vue
pages/componentsB/picker/index.vue
+3
-1
index.vue
pages/componentsB/upload/index.vue
+1
-4
index.vue
pages/componentsC/test/index.vue
+13
-26
uni.scss
uni.scss
+2
-1
u-button.vue
uview-ui/components/u-button/u-button.vue
+7
-46
u-picker.vue
uview-ui/components/u-picker/u-picker.vue
+8
-1
No files found.
pages/componentsB/picker/index.vue
View file @
0d653570
...
...
@@ -65,7 +65,8 @@ export default {
second
:
true
,
province
:
true
,
city
:
true
,
area
:
true
area
:
true
,
timestamp
:
true
}
};
},
...
...
@@ -115,6 +116,7 @@ export default {
this
.
show
=
true
;
},
confirm
(
e
)
{
console
.
log
(
e
);
this
.
input
=
''
;
if
(
this
.
mode
==
'
time
'
)
{
if
(
this
.
params
.
year
)
this
.
input
+=
e
.
year
;
...
...
pages/componentsB/upload/index.vue
View file @
0d653570
...
...
@@ -14,7 +14,7 @@
:percent=
"item.progress"
></u-line-progress>
</view>
</view>
<u-upload
:beforeUpload=
"beforeUpload"
ref=
"uUpload"
:custom-btn=
"customBtn"
:show-upload-list=
"showUploadList"
:action=
"action"
:auto-upload=
"autoUpload"
:file-list=
"fileList"
<u-upload
ref=
"uUpload"
:custom-btn=
"customBtn"
:show-upload-list=
"showUploadList"
:action=
"action"
:auto-upload=
"autoUpload"
:file-list=
"fileList"
:show-progress=
"showProgress"
:deletable=
"deletable"
:max-count=
"maxCount"
@
on-list-change=
"onListChange"
>
<view
v-if=
"customBtn"
slot=
"addBtn"
class=
"slot-btn"
hover-class=
"slot-btn__hover"
hover-stay-time=
"150"
>
<u-icon
name=
"photo"
size=
"60"
:color=
"$u.color['lightColor']"
></u-icon>
...
...
@@ -140,9 +140,6 @@
// console.log('onListChange', lists);
this
.
lists
=
lists
;
},
beforeUpload
(
index
,
lists
)
{
return
true
;
}
}
}
</
script
>
...
...
pages/componentsC/test/index.vue
View file @
0d653570
<
template
>
<view
class=
"wrap"
>
<u-swiper
:list=
"list"
></u-swiper>
</view>
<u-upload
:before-upload=
"beforeUpload"
></u-upload>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
list
:
[{
image
:
'
/static/uView/swiper/swiper1.jpg
'
,
title
:
'
蒹葭苍苍,白露为霜。所谓伊人,在水一方
'
},
{
image
:
'
/static/uView/swiper/swiper2.jpg
'
,
title
:
'
溯洄从之,道阻且长。溯游从之,宛在水中央
'
},
{
image
:
'
/static/uView/swiper/swiper3.jpg
'
,
title
:
'
蒹葭萋萋,白露未晞。所谓伊人,在水之湄
'
}
]
}
},
onLoad
()
{
setTimeout
(()
=>
{
this
.
list
.
pop
();
},
2000
)
},
methods
:
{
beforeUpload
(
index
,
list
)
{
// 返回一个promise
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
$u
.
post
(
'
http://www.tp5.com/index.php/index/index/hello
'
).
then
(
res
=>
{
// resolve()之后,将会进入promise的组件内部的then回调,相当于返回true
resolve
();
}).
catch
(
err
=>
{
// reject()之后,将会进入promise的组件内部的catch回调,相当于返回false
reject
();
})
})
}
}
}
</
script
>
...
...
uni.scss
View file @
0d653570
...
...
@@ -3,4 +3,5 @@
* 使用的时候,请将下面的一行复制到您的uniapp项目根目录的uni.scss中即可
* uView自定义的css类名和scss变量,均以"u-"开头,不会造成冲突,请放心使用
*/
@import
'uview-ui/theme.scss'
;
\ No newline at end of file
@import
'uview-ui/theme.scss'
;
uview-ui/components/u-button/u-button.vue
View file @
0d653570
...
...
@@ -7,7 +7,7 @@
plain ? 'u-btn--' + type + '--plain' : '',
loading ? 'u-loading' : '',
shape == 'circle' ? 'u-round-circle' : '',
hairLine ? showHairLineBorder : 'u-bold-border',
hairLine ? showHairLineBorder : 'u-b
tn--b
old-border',
'u-btn--' + type,
disabled ? `u-btn--$
{type}--disabled` : '',
...
...
@@ -28,7 +28,7 @@
@error="error"
@opensetting="opensetting"
@launchapp="launchapp"
:style="[
button
Style]"
:style="[
custom
Style]"
@tap.stop="click($event)"
:hover-class="getHoverClass"
:loading="loading"
...
...
@@ -209,45 +209,6 @@ export default {
hoverClass
=
this
.
plain
?
'
u-
'
+
this
.
type
+
'
-plain-hover
'
:
'
u-
'
+
this
.
type
+
'
-hover
'
;
return
hoverClass
;
},
// 按钮主题
buttonStyle
()
{
let
style
=
{};
// if (this.type == 'default') {
// if (this.disabled) {
// style.color = '#c0c4cc';
// style.backgroundColor = '#ffffff';
// style.borderColor = '#e4e7ed';
// } else {
// style.color = this.$u.color['contentColor'];
// style.backgroundColor = '#ffffff';
// style.borderColor = '#c0c4cc';
// }
// } else {
// if (this.disabled) {
// if (this.plain) {
// style.color = this.$u.color[this.type + 'Disabled'];
// style.backgroundColor = this.$u.color[this.type + 'Light'];
// style.borderColor = this.$u.color[this.type + 'Disabled'];
// } else {
// style.color = '#ffffff';
// style.backgroundColor = this.$u.color[this.type + 'Disabled'];
// style.borderColor = this.$u.color[this.type + 'Disabled'];
// }
// } else {
// if (this.plain) {
// style.color = this.$u.color[this.type];
// style.backgroundColor = this.$u.color[this.type + 'Light'];
// style.borderColor = this.$u.color[this.type + 'Disabled'];
// } else {
// style.color = '#ffffff';
// style.backgroundColor = this.$u.color[this.type];
// style.borderColor = this.$u.color[this.type];
// }
// }
// }
return
Object
.
assign
(
style
,
this
.
customStyle
);
},
// 在'primary', 'success', 'error', 'warning'类型下,不显示边框,否则会造成四角有毛刺现象
showHairLineBorder
()
{
if
([
'
primary
'
,
'
success
'
,
'
error
'
,
'
warning
'
].
indexOf
(
this
.
type
)
>=
0
&&
!
this
.
plain
)
{
...
...
@@ -374,9 +335,13 @@ export default {
box-sizing
:
border-box
;
transition
:
all
0
.15s
;
&
--bold-border
{
border
:
1px
solid
#ffffff
;
}
&
--default
{
color
:
$u-content-color
;
border-color
:
$u-type-warning
;
border-color
:
#c0c4cc
;
background-color
:
#ffffff
;
}
...
...
@@ -478,10 +443,6 @@ export default {
z-index
:
1
;
}
.u-bold-border
{
border
:
1px
solid
#ffffff
;
}
.u-wave-ripple
{
z-index
:
0
;
position
:
absolute
;
...
...
uview-ui/components/u-picker/u-picker.vue
View file @
0d653570
...
...
@@ -135,7 +135,8 @@ export default {
second
:
false
,
province
:
true
,
city
:
true
,
area
:
true
area
:
true
,
timestamp
:
true
,
};
}
},
...
...
@@ -546,6 +547,7 @@ export default {
if
(
this
.
params
.
hour
)
result
.
hour
=
this
.
formatNumber
(
this
.
hour
||
0
);
if
(
this
.
params
.
minute
)
result
.
minute
=
this
.
formatNumber
(
this
.
minute
||
0
);
if
(
this
.
params
.
second
)
result
.
second
=
this
.
formatNumber
(
this
.
second
||
0
);
if
(
this
.
params
.
timestamp
)
result
.
timestamp
=
this
.
getTimestamp
();
}
else
if
(
this
.
mode
==
'
region
'
)
{
if
(
this
.
params
.
province
)
result
.
province
=
provinces
[
this
.
province
];
if
(
this
.
params
.
city
)
result
.
city
=
citys
[
this
.
province
][
this
.
city
];
...
...
@@ -557,6 +559,11 @@ export default {
}
if
(
event
)
this
.
$emit
(
event
,
result
);
this
.
close
();
},
// 获取时间戳
getTimestamp
()
{
let
time
=
this
.
year
+
'
-
'
+
this
.
month
+
'
-
'
+
this
.
day
+
'
'
+
this
.
day
+
'
:
'
+
this
.
minute
+
'
:
'
+
this
.
second
;
return
new
Date
(
time
).
getTime
()
/
1000
;
}
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment