Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
9fd4f733
U
uni-app
项目概览
DCloud
/
uni-app
2 个月 前同步成功
通知
717
Star
38705
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9fd4f733
编写于
11月 09, 2020
作者:
L
liuxiaohang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://github.com/dcloudio/uni-app
into dev
上级
1b22b6fd
52e0447a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
171 addition
and
57 deletion
+171
-57
src/platforms/h5/components/app/popup/actionSheet.vue
src/platforms/h5/components/app/popup/actionSheet.vue
+4
-4
src/platforms/h5/components/app/popup/mixins/popup.js
src/platforms/h5/components/app/popup/mixins/popup.js
+4
-1
src/platforms/h5/components/system-routes/choose-location/index.vue
...rms/h5/components/system-routes/choose-location/index.vue
+14
-14
src/platforms/h5/components/system-routes/open-location/index.vue
...forms/h5/components/system-routes/open-location/index.vue
+1
-1
src/platforms/h5/view/components/picker/index.vue
src/platforms/h5/view/components/picker/index.vue
+148
-37
未找到文件。
src/platforms/h5/components/app/popup/actionSheet.vue
浏览文件 @
9fd4f733
...
@@ -40,9 +40,9 @@
...
@@ -40,9 +40,9 @@
</div>
</div>
<div
:style=
"popupStyle.triangle"
/>
<div
:style=
"popupStyle.triangle"
/>
</div>
</div>
<keypress
<keypress
:disable=
"!visible"
:disable=
"!visible"
@
esc=
"_close(-1)"
@
esc=
"_close(-1)"
/>
/>
</uni-actionsheet>
</uni-actionsheet>
</
template
>
</
template
>
...
@@ -154,7 +154,7 @@ uni-actionsheet .uni-actionsheet__cell:first-child:before {
...
@@ -154,7 +154,7 @@ uni-actionsheet .uni-actionsheet__cell:first-child:before {
display
:
none
;
display
:
none
;
}
}
@media
screen
and
(
min-width
:
500px
)
{
@media
screen
and
(
min-width
:
500px
)
and
(
min-height
:
500px
)
{
.uni-mask.uni-actionsheet__mask
{
.uni-mask.uni-actionsheet__mask
{
background
:
none
;
background
:
none
;
}
}
...
...
src/platforms/h5/components/app/popup/mixins/popup.js
浏览文件 @
9fd4f733
...
@@ -6,6 +6,9 @@ export default {
...
@@ -6,6 +6,9 @@ export default {
}
}
},
},
computed
:
{
computed
:
{
isDesktop
()
{
return
this
.
popupWidth
>=
500
&&
this
.
popupHeight
>=
500
},
popupStyle
()
{
popupStyle
()
{
const
style
=
{}
const
style
=
{}
const
contentStyle
=
style
.
content
=
{}
const
contentStyle
=
style
.
content
=
{}
...
@@ -14,7 +17,7 @@ export default {
...
@@ -14,7 +17,7 @@ export default {
function
getNumber
(
value
)
{
function
getNumber
(
value
)
{
return
Number
(
value
)
||
0
return
Number
(
value
)
||
0
}
}
if
(
this
.
popupWidth
>=
500
&&
popover
)
{
if
(
this
.
isDesktop
&&
popover
)
{
Object
.
assign
(
triangleStyle
,
{
Object
.
assign
(
triangleStyle
,
{
position
:
'
absolute
'
,
position
:
'
absolute
'
,
width
:
'
0
'
,
width
:
'
0
'
,
...
...
src/platforms/h5/components/system-routes/choose-location/index.vue
浏览文件 @
9fd4f733
...
@@ -9,17 +9,17 @@
...
@@ -9,17 +9,17 @@
@
regionchange=
"_regionchange"
@
regionchange=
"_regionchange"
>
>
<div
class=
"map-location"
/>
<div
class=
"map-location"
/>
<div
<div
class=
"map-move"
class=
"map-move"
@
click=
"_moveToLocation"
@
click=
"_moveToLocation"
>
>
<i>

</i>
<i>

</i>
</div>
</div>
</v-uni-map>
</v-uni-map>
<div
class=
"nav"
>
<div
class=
"nav"
>
<div
<div
class=
"nav-btn back"
class=
"nav-btn back"
@
click=
"_back"
@
click=
"_back"
>
>
<i
class=
"uni-btn-icon"
>

</i>
<i
class=
"uni-btn-icon"
>

</i>
</div>
</div>
...
@@ -51,14 +51,14 @@
...
@@ -51,14 +51,14 @@
取消
取消
</div>
</div>
</div>
</div>
<v-uni-scroll-view
<v-uni-scroll-view
scroll-y
scroll-y
class=
"list"
class=
"list"
@
scrolltolower=
"_scrolltolower"
@
scrolltolower=
"_scrolltolower"
>
>
<div
<div
v-if=
"loading"
v-if=
"loading"
class=
"list-loading"
class=
"list-loading"
>
>
<i
class=
"uni-loading"
/>
<i
class=
"uni-loading"
/>
</div>
</div>
...
@@ -213,7 +213,7 @@ export default {
...
@@ -213,7 +213,7 @@ export default {
}
}
}
}
</
script
>
</
script
>
<
style
>
<
style
scoped
>
@font-face
{
@font-face
{
font-weight
:
normal
;
font-weight
:
normal
;
font-style
:
normal
;
font-style
:
normal
;
...
...
src/platforms/h5/components/system-routes/open-location/index.vue
浏览文件 @
9fd4f733
...
@@ -76,7 +76,7 @@ export default {
...
@@ -76,7 +76,7 @@ export default {
}
}
}
}
</
script
>
</
script
>
<
style
>
<
style
scoped
>
.uni-system-open-location
{
.uni-system-open-location
{
display
:
block
;
display
:
block
;
position
:
absolute
;
position
:
absolute
;
...
...
src/platforms/h5/view/components/picker/index.vue
浏览文件 @
9fd4f733
...
@@ -7,6 +7,8 @@
...
@@ -7,6 +7,8 @@
<div
<div
ref=
"picker"
ref=
"picker"
class=
"uni-picker-container"
class=
"uni-picker-container"
:class=
"`uni-$
{mode}-${selectorTypeComputed}`"
@wheel.prevent
@touchmove.prevent
@touchmove.prevent
>
>
<transition
name=
"uni-fade"
>
<transition
name=
"uni-fade"
>
...
@@ -17,9 +19,10 @@
...
@@ -17,9 +19,10 @@
/>
/>
</transition>
</transition>
<div
<div
v-if=
"!system"
:class=
"
{ 'uni-picker-toggle': visible }"
:class=
"
{ 'uni-picker-toggle': visible }"
:style="popupStyle.content"
:style="popupStyle.content"
class="uni-picker"
class="uni-picker
-custom
"
>
>
<div
<div
class=
"uni-picker-header"
class=
"uni-picker-header"
...
@@ -57,16 +60,44 @@
...
@@ -57,16 +60,44 @@
</div>
</div>
</v-uni-picker-view-column>
</v-uni-picker-view-column>
</v-uni-picker-view>
</v-uni-picker-view>
<!-- 第二种时间单位展示方式-暂时不用这种 -->
<div
<!--
<div
v-if=
"units.length"
class=
"uni-picker-units"
>
ref=
"select"
<div
v-for=
"(item,index) in units"
:key=
"index"
>
{{
item
}}
</div>
class=
"uni-picker-select"
</div>
-->
>
<div
v-for=
"(item, index) in rangeArray[0]"
:key=
"index"
class=
"uni-picker-item"
:class=
"
{ selected: valueArray[0] === index }"
@click="
valueArray[0] = index;
_change();
"
>
{{
typeof
item
===
"
object
"
?
item
[
rangeKey
]
||
""
:
item
}}
</div>
</div>
<div
:style=
"popupStyle.triangle"
/>
<div
:style=
"popupStyle.triangle"
/>
</div>
</div>
</div>
</div>
<div>
<div>
<slot
/>
<slot
/>
</div>
</div>
<div
v-if=
"system"
class=
"uni-picker-system"
>
<input
ref=
"input"
:value=
"valueSync"
:type=
"mode"
tabindex=
"-1"
:min=
"start"
:max=
"end"
:class=
"[system, popupStyle.dock]"
@
change.stop=
"_input"
>
</div>
<keypress
<keypress
:disable=
"!visible"
:disable=
"!visible"
@
esc=
"_cancel"
@
esc=
"_cancel"
...
@@ -92,7 +123,7 @@ function getDefaultStartValue () {
...
@@ -92,7 +123,7 @@ function getDefaultStartValue () {
return
year
.
toString
()
return
year
.
toString
()
case
fields
.
MONTH
:
case
fields
.
MONTH
:
return
year
+
'
-01
'
return
year
+
'
-01
'
case
fields
.
DAY
:
default
:
return
year
+
'
-01-01
'
return
year
+
'
-01-01
'
}
}
}
}
...
@@ -110,7 +141,7 @@ function getDefaultEndValue () {
...
@@ -110,7 +141,7 @@ function getDefaultEndValue () {
return
year
.
toString
()
return
year
.
toString
()
case
fields
.
MONTH
:
case
fields
.
MONTH
:
return
year
+
'
-12
'
return
year
+
'
-12
'
case
fields
.
DAY
:
default
:
return
year
+
'
-12-31
'
return
year
+
'
-12-31
'
}
}
}
}
...
@@ -130,6 +161,10 @@ const fields = {
...
@@ -130,6 +161,10 @@ const fields = {
MONTH
:
'
month
'
,
MONTH
:
'
month
'
,
DAY
:
'
day
'
DAY
:
'
day
'
}
}
const
selectorType
=
{
PICKER
:
'
picker
'
,
SELECT
:
'
select
'
}
export
default
{
export
default
{
name
:
'
Picker
'
,
name
:
'
Picker
'
,
components
:
{
keypress
},
components
:
{
keypress
},
...
@@ -157,15 +192,12 @@ export default {
...
@@ -157,15 +192,12 @@ export default {
type
:
String
,
type
:
String
,
default
:
mode
.
SELECTOR
,
default
:
mode
.
SELECTOR
,
validator
(
val
)
{
validator
(
val
)
{
return
Object
.
values
(
mode
).
in
dexOf
(
val
)
>=
0
return
Object
.
values
(
mode
).
in
cludes
(
val
)
}
}
},
},
fields
:
{
fields
:
{
type
:
String
,
type
:
String
,
default
:
'
day
'
,
default
:
''
validator
(
val
)
{
return
Object
.
values
(
fields
).
indexOf
(
val
)
>=
0
}
},
},
start
:
{
start
:
{
type
:
String
,
type
:
String
,
...
@@ -178,6 +210,10 @@ export default {
...
@@ -178,6 +210,10 @@ export default {
disabled
:
{
disabled
:
{
type
:
[
Boolean
,
String
],
type
:
[
Boolean
,
String
],
default
:
false
default
:
false
},
selectorType
:
{
type
:
String
,
default
:
''
}
}
},
},
data
()
{
data
()
{
...
@@ -211,7 +247,7 @@ export default {
...
@@ -211,7 +247,7 @@ export default {
return
[
dateArray
[
0
]]
return
[
dateArray
[
0
]]
case
fields
.
MONTH
:
case
fields
.
MONTH
:
return
[
dateArray
[
0
],
dateArray
[
1
]]
return
[
dateArray
[
0
],
dateArray
[
1
]]
case
fields
.
DAY
:
default
:
return
[
dateArray
[
0
],
dateArray
[
1
],
dateArray
[
2
]]
return
[
dateArray
[
0
],
dateArray
[
1
],
dateArray
[
2
]]
}
}
}
}
...
@@ -233,14 +269,31 @@ export default {
...
@@ -233,14 +269,31 @@ export default {
default
:
default
:
return
[]
return
[]
}
}
},
selectorTypeComputed
()
{
const
type
=
this
.
selectorType
if
(
Object
.
values
(
selectorType
).
includes
(
type
))
{
return
type
}
return
String
(
navigator
.
vendor
).
indexOf
(
'
Apple
'
)
===
0
&&
navigator
.
maxTouchPoints
>
0
?
selectorType
.
PICKER
:
selectorType
.
SELECT
},
system
()
{
if
(
this
.
mode
===
mode
.
DATE
&&
!
Object
.
values
(
fields
).
includes
(
this
.
fields
)
&&
this
.
isDesktop
&&
/win|mac/i
.
test
(
navigator
.
platform
))
{
if
(
navigator
.
vendor
===
'
Google Inc.
'
)
{
return
'
chrome
'
}
else
if
(
/Firefox/
.
test
(
navigator
.
userAgent
))
{
return
'
firefox
'
}
}
return
''
}
}
},
},
watch
:
{
watch
:
{
visible
(
val
)
{
visible
(
val
)
{
if
(
val
)
{
if
(
val
)
{
clearTimeout
(
this
.
__contentVisibleDelay
)
clearTimeout
(
this
.
__contentVisibleDelay
)
this
.
contentVisible
=
val
this
.
contentVisible
=
val
this
.
_select
()
}
else
{
}
else
{
this
.
__contentVisibleDelay
=
setTimeout
(()
=>
{
this
.
__contentVisibleDelay
=
setTimeout
(()
=>
{
this
.
contentVisible
=
val
this
.
contentVisible
=
val
...
@@ -512,7 +565,15 @@ export default {
...
@@ -512,7 +565,15 @@ export default {
value
value
})
})
},
},
_cancel
()
{
_cancel
(
$event
)
{
if
(
this
.
system
===
'
firefox
'
)
{
// Firefox 在 input 同位置区域点击无法隐藏控件
const
{
top
,
left
,
width
,
height
}
=
this
.
popover
const
{
pageX
,
pageY
}
=
$event
if
(
pageX
>
left
&&
pageX
<
left
+
width
&&
pageY
>
top
&&
pageY
<
top
+
height
)
{
return
}
}
this
.
_close
()
this
.
_close
()
this
.
$trigger
(
'
cancel
'
,
{},
{})
this
.
$trigger
(
'
cancel
'
,
{},
{})
},
},
...
@@ -524,6 +585,17 @@ export default {
...
@@ -524,6 +585,17 @@ export default {
this
.
$el
.
prepend
(
$picker
)
this
.
$el
.
prepend
(
$picker
)
$picker
.
style
.
display
=
'
none
'
$picker
.
style
.
display
=
'
none
'
},
260
)
},
260
)
},
_select
()
{
if
(
this
.
mode
===
mode
.
SELECTOR
&&
this
.
selectorTypeComputed
===
selectorType
.
SELECT
)
{
this
.
$refs
.
select
.
scrollTop
=
this
.
valueArray
[
0
]
*
34
}
},
_input
(
$event
)
{
this
.
valueSync
=
$event
.
target
.
value
this
.
$nextTick
(()
=>
{
this
.
_change
()
})
}
}
}
}
}
}
...
@@ -531,6 +603,7 @@ export default {
...
@@ -531,6 +603,7 @@ export default {
<
style
>
<
style
>
uni-picker
{
uni-picker
{
position
:
relative
;
display
:
block
;
display
:
block
;
cursor
:
pointer
;
cursor
:
pointer
;
}
}
...
@@ -555,11 +628,11 @@ uni-picker[disabled] {
...
@@ -555,11 +628,11 @@ uni-picker[disabled] {
font-size
:
16px
;
font-size
:
16px
;
}
}
.uni-picker-container
.uni-picker
*
{
.uni-picker-container
.uni-picker
-custom
*
{
box-sizing
:
border-box
;
box-sizing
:
border-box
;
}
}
.uni-picker-container
.uni-picker
{
.uni-picker-container
.uni-picker
-custom
{
position
:
fixed
;
position
:
fixed
;
left
:
0
;
left
:
0
;
bottom
:
0
;
bottom
:
0
;
...
@@ -572,7 +645,7 @@ uni-picker[disabled] {
...
@@ -572,7 +645,7 @@ uni-picker[disabled] {
transition
:
transform
0.3s
,
visibility
0.3s
;
transition
:
transform
0.3s
,
visibility
0.3s
;
}
}
.uni-picker-container
.uni-picker.uni-picker-toggle
{
.uni-picker-container
.uni-picker
-custom
.uni-picker-toggle
{
visibility
:
visible
;
visibility
:
visible
;
transform
:
translate
(
0
,
0
);
transform
:
translate
(
0
,
0
);
}
}
...
@@ -594,6 +667,7 @@ uni-picker[disabled] {
...
@@ -594,6 +667,7 @@ uni-picker[disabled] {
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
white-space
:
nowrap
;
overflow
:
hidden
;
overflow
:
hidden
;
cursor
:
pointer
;
}
}
.uni-picker-container
.uni-picker-header
{
.uni-picker-container
.uni-picker-header
{
...
@@ -642,33 +716,48 @@ uni-picker[disabled] {
...
@@ -642,33 +716,48 @@ uni-picker[disabled] {
color
:
#007aff
;
color
:
#007aff
;
}
}
/* .uni-picker
{
.uni-picker-container
.uni-picker-select
{
position: relativ
e;
display
:
non
e
;
}
}
.uni-picker-units {
.uni-picker-system
{
position
:
absolute
;
position
:
absolute
;
display: flex;
display
:
none
;
display
:
block
;
top
:
0
;
left
:
0
;
width
:
100%
;
width
:
100%
;
line-height: 16px;
height
:
100%
;
font-size: 14px;
top: 50%;
margin-top: 22.5px;
transform: translateY(-50%);
overflow
:
hidden
;
overflow
:
hidden
;
color: #666666;
pointer-events: none;
}
}
.uni-picker-units > div {
flex: 1;
text-align: center;
transform: translateX(2em);
} */
@media
screen
and
(
min-width
:
500px
)
{
.uni-picker-system
>
input
{
position
:
absolute
;
border
:
none
;
height
:
100%
;
opacity
:
0
;
}
.uni-picker-system
>
input
.firefox
{
top
:
0
;
left
:
0
;
width
:
100%
;
}
.uni-picker-system
>
input
.chrome
{
/* 翻转且使用较大字体保证可点击日历按钮 */
top
:
0
;
right
:
100%
;
font-size
:
9999px
;
transform-origin
:
100%
0
;
transform
:
scaleX
(
-1
);
}
@media
screen
and
(
min-width
:
500px
)
and
(
min-height
:
500px
)
{
.uni-mask.uni-picker-mask
{
.uni-mask.uni-picker-mask
{
background
:
none
;
background
:
none
;
}
}
.uni-picker-container
.uni-picker
{
.uni-picker-container
.uni-picker
-custom
{
width
:
300px
;
width
:
300px
;
left
:
50%
;
left
:
50%
;
right
:
auto
;
right
:
auto
;
...
@@ -689,9 +778,31 @@ uni-picker[disabled] {
...
@@ -689,9 +778,31 @@ uni-picker[disabled] {
overflow
:
hidden
;
overflow
:
hidden
;
border-radius
:
0
0
5px
5px
;
border-radius
:
0
0
5px
5px
;
}
}
.uni-picker-container
.uni-picker.uni-picker-toggle
{
.uni-picker-container
.uni-picker
-custom
.uni-picker-toggle
{
opacity
:
1
;
opacity
:
1
;
transform
:
translate
(
-50%
,
-50%
);
transform
:
translate
(
-50%
,
-50%
);
}
}
.uni-selector-select
.uni-picker-header
,
.uni-selector-select
.uni-picker-content
{
display
:
none
;
}
.uni-selector-select
.uni-picker-select
{
display
:
block
;
max-height
:
300px
;
overflow
:
auto
;
background-color
:
white
;
border-radius
:
5px
;
padding
:
6px
0
;
}
.uni-selector-select
.uni-picker-item
{
padding
:
0
10px
;
color
:
#555555
;
}
.uni-selector-select
.uni-picker-item
:hover
{
background-color
:
#f6f6f6
;
}
.uni-selector-select
.uni-picker-item.selected
{
color
:
#007aff
;
}
}
}
</
style
>
</
style
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录