Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
cb178192
U
uni-app
项目概览
DCloud
/
uni-app
3 个月 前同步成功
通知
725
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,发现更多精彩内容 >>
提交
cb178192
编写于
3月 07, 2019
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 解决searchInput与app端表现不一致的问题。
上级
193a2c33
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
46 addition
and
40 deletion
+46
-40
src/platforms/h5/components/page/pageHead.vue
src/platforms/h5/components/page/pageHead.vue
+44
-39
src/platforms/h5/components/page/transparent.js
src/platforms/h5/components/page/transparent.js
+2
-1
未找到文件。
src/platforms/h5/components/page/pageHead.vue
浏览文件 @
cb178192
...
...
@@ -6,12 +6,12 @@
class="uni-page-head"
>
<div
class=
"uni-page-head-hd"
>
<div
v-show=
"backButton"
class=
"uni-page-head-btn"
<div
v-show=
"backButton"
class=
"uni-page-head-btn"
@
click=
"_back"
>
<i
:style=
"
{color:color,fontSize:'27px'}"
<i
:style=
"
{color:color,fontSize:'27px'}"
class="uni-btn-icon">

</i>
</div>
<template
v-for=
"(btn,index) in btns"
>
...
...
@@ -32,22 +32,22 @@
</div>
</
template
>
</div>
<div
v-if=
"!searchInput"
<div
v-if=
"!searchInput"
class=
"uni-page-head-bd"
>
<div
:style=
"{fontSize:titleSize,opacity:type==='transparent'?0:1}"
class=
"uni-page-head__title"
>
<i
v-if=
"loading"
<i
v-if=
"loading"
class=
"uni-loading"
/>
{{ titleText }}
</div>
</div>
<div
v-if=
"searchInput"
:style=
"{'background-color':searchInput.backgroundColor}"
:style=
"{'b
order-radius':searchInput.borderRadius,'b
ackground-color':searchInput.backgroundColor}"
class=
"uni-page-head-search"
>
<div
...
...
@@ -60,7 +60,7 @@
v-model=
"text"
:focus=
"searchInput.autoFocus"
:disabled=
"searchInput.disabled"
:style=
"{
'border-radius':searchInput.borderRadius,
color:searchInput.color}"
:style=
"{color:searchInput.color}"
:placeholder-style=
"`color:${searchInput.placeholderColor}`"
class=
"uni-page-head-search-input"
confirm-type=
"search"
...
...
@@ -89,8 +89,8 @@
</
template
>
</div>
</div>
<div
v-if=
"type!=='transparent'"
<div
v-if=
"type!=='transparent'"
class=
"uni-placeholder"
/>
</uni-page-head>
</template>
...
...
@@ -116,16 +116,6 @@ uni-page-head .uni-page-head {
transition-property
:
all
;
}
uni-page-head
.uni-page-head.uni-page-head-transparent
.uni-page-head-hd
>
div
,
uni-page-head
.uni-page-head.uni-page-head-transparent
.uni-page-head-ft
>
div
{
display
:
flex
;
align-items
:
center
;
width
:
32px
;
height
:
32px
;
background
:
#999
;
border-radius
:
50%
;
}
uni-page-head
.uni-page-head.uni-page-head-transparent
.uni-page-head-ft
>
div
{
justify-content
:
center
;
}
...
...
@@ -156,17 +146,23 @@ uni-page-head .uni-page-head-bd {
.uni-page-head-btn
{
position
:
relative
;
width
:
auto
;
word-break
:
keep-all
;
margin
:
0
2px
;
word-break
:
keep-all
;
white-space
:
pre
;
}
.uni-page-head-transparent
.uni-page-head-btn
{
background-color
:
rgba
(
153
,
153
,
153
,
1
);
.uni-page-head-transparent
.uni-page-head-btn
{
display
:
flex
;
align-items
:
center
;
width
:
32px
;
height
:
32px
;
border-radius
:
50%
;
background-color
:
rgba
(
0
,
0
,
0
,
0.5
);
}
uni-page-head
.uni-btn-icon
{
overflow
:
hidden
;
min-width
:
1em
;
}
.uni-page-head-btn-red-dot
::after
{
...
...
@@ -181,7 +177,7 @@ uni-page-head .uni-btn-icon {
line-height
:
18px
;
border-radius
:
18px
;
overflow
:
hidden
;
transform
:
scale
(
0.5
)
translate
(
40%
,
-40%
);
transform
:
scale
(
0.5
)
translate
(
40%
,
-40%
);
transform-origin
:
100%
0
;
}
...
...
@@ -192,10 +188,10 @@ uni-page-head .uni-btn-icon {
max-width
:
42px
;
text-align
:
center
;
padding
:
0
3px
;
transform
:
scale
(
0.7
)
translate
(
40%
,
-40%
);
transform
:
scale
(
0.7
)
translate
(
40%
,
-40%
);
}
.uni-page-head-btn-select
>
.uni-btn-icon
::after
{
.uni-page-head-btn-select
>
.uni-btn-icon
::after
{
display
:
inline-block
;
font-family
:
"unibtn"
;
content
:
"\e601"
;
...
...
@@ -209,13 +205,14 @@ uni-page-head .uni-btn-icon {
flex
:
1
;
margin
:
0
2px
;
line-height
:
30px
;
font-size
:
1
6
px
;
font-size
:
1
5
px
;
}
.uni-page-head-search-input
{
width
:
100%
;
height
:
100%
;
padding-left
:
34px
;
text-align
:
left
;
}
.uni-page-head-search-placeholder
{
...
...
@@ -225,6 +222,7 @@ uni-page-head .uni-btn-icon {
padding-left
:
34px
;
overflow
:
hidden
;
word-break
:
keep-all
;
white-space
:
pre
;
}
.uni-page-head-search-placeholder-right
{
...
...
@@ -355,16 +353,29 @@ export default {
computed
:
{
btns
()
{
const
btns
=
[]
const
fonts
=
{}
if
(
this
.
buttons
.
length
)
{
this
.
buttons
.
forEach
(
button
=>
{
let
btn
=
Object
.
assign
({},
button
)
if
(
btn
.
fontSrc
&&
!
btn
.
fontFamily
)
{
btn
.
fontSrc
=
getRealPath
(
btn
.
fontSrc
)
const
fontFamily
=
btn
.
fontSrc
.
substr
(
btn
.
fontSrc
.
lastIndexOf
(
'
/
'
)
+
1
).
replace
(
/
\.
/g
,
'
-
'
)
let
fontSrc
=
btn
.
fontSrc
=
getRealPath
(
btn
.
fontSrc
)
let
fontFamily
if
(
fontSrc
in
fonts
)
{
fontFamily
=
fonts
[
fontSrc
]
}
else
{
fontFamily
=
`font
${
Date
.
now
()}
`
fonts
[
fontSrc
]
=
fontFamily
const
cssText
=
`@font-face{font-family: "
${
fontFamily
}
";src: url("
${
fontSrc
}
") format("truetype")}`
appendCss
(
cssText
,
'
uni-btn-font-
'
+
fontFamily
)
}
btn
.
fontFamily
=
fontFamily
}
btn
.
color
=
this
.
type
===
'
transparent
'
?
'
#fff
'
:
(
btn
.
color
||
this
.
textColor
)
btn
.
fontSize
=
btn
.
fontSize
||
(
this
.
type
===
'
default
'
?
'
27px
'
:
'
22px
'
)
let
fontSize
=
btn
.
fontSize
||
(
this
.
type
===
'
transparent
'
||
btn
.
text
.
indexOf
(
'
\\
u
'
)
>=
0
?
'
22px
'
:
'
27px
'
)
if
(
/
\d
$/
.
test
(
fontSize
))
{
fontSize
+=
'
px
'
}
btn
.
fontSize
=
fontSize
btn
.
fontWeight
=
btn
.
fontWeight
||
'
normal
'
btns
.
push
(
btn
)
})
...
...
@@ -412,12 +423,6 @@ export default {
},
_formatBtnFontText
(
btn
)
{
if
(
btn
.
fontSrc
&&
btn
.
fontFamily
)
{
const
cssText
=
`@font-face{
font-family: "
${
btn
.
fontFamily
}
";
src: url("
${
btn
.
fontSrc
}
") format("truetype")
}`
appendCss
(
cssText
,
'
uni-btn-font-
'
+
btn
.
fontFamily
)
return
btn
.
text
.
replace
(
'
\\
u
'
,
'
&#x
'
)
}
else
if
(
FONTS
[
btn
.
type
])
{
return
FONTS
[
btn
.
type
]
...
...
src/platforms/h5/components/page/transparent.js
浏览文件 @
cb178192
...
...
@@ -46,7 +46,8 @@ export default {
transparentElemStyle
.
backgroundColor
=
`rgba(
${
this
.
_R
}
,
${
this
.
_G
}
,
${
this
.
_B
}
,
${
alpha
}
)`
borderRadiusElemsStyles
.
forEach
(
function
(
borderRadiusElemStyle
,
index
)
{
let
oldColor
=
oldColors
[
index
]
let
rgba
=
oldColor
.
match
(
/
\d
+/g
)
/* eslint-disable */
let
rgba
=
oldColor
.
match
(
/
[\d
+
\.]
+/g
)
rgba
[
3
]
=
(
1
-
alpha
)
*
(
rgba
.
length
===
4
?
rgba
[
3
]
:
1
)
borderRadiusElemStyle
.
backgroundColor
=
`rgba(
${
rgba
}
)`
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录