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
a8e8f5ba
Commit
a8e8f5ba
authored
Oct 31, 2020
by
yiruiwen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'yiruiwen'
parents
8659ce32
7a7b6a4d
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
69 additions
and
34 deletions
+69
-34
App.vue
App.vue
+0
-1
manifest.json
manifest.json
+1
-1
index.vue
pages/componentsC/layout/index.vue
+8
-2
u-avatar.vue
uview-ui/components/u-avatar/u-avatar.vue
+1
-1
u-col.vue
uview-ui/components/u-col/u-col.vue
+7
-2
u-grid-item.vue
uview-ui/components/u-grid-item/u-grid-item.vue
+1
-1
u-navbar.vue
uview-ui/components/u-navbar/u-navbar.vue
+7
-1
MpHtmlParser.js
uview-ui/components/u-parse/libs/MpHtmlParser.js
+1
-1
trees.vue
uview-ui/components/u-parse/libs/trees.vue
+3
-3
u-parse.vue
uview-ui/components/u-parse/u-parse.vue
+25
-14
u-row.vue
uview-ui/components/u-row/u-row.vue
+7
-2
config.js
uview-ui/libs/config/config.js
+2
-2
test.js
uview-ui/libs/function/test.js
+1
-2
mixin.js
uview-ui/libs/mixin/mixin.js
+4
-0
package.json
uview-ui/package.json
+1
-1
No files found.
App.vue
View file @
a8e8f5ba
...
...
@@ -16,5 +16,4 @@
<
style
lang=
"scss"
>
@import
"uview-ui/index.scss"
;
@import
"common/demo.scss"
;
/*每个页面公共css */
</
style
>
\ No newline at end of file
manifest.json
View file @
a8e8f5ba
...
...
@@ -2,7 +2,7 @@
"name"
:
"uView"
,
"appid"
:
"__UNI__60F4B81"
,
"description"
:
"多平台快速开发的UI框架"
,
"versionName"
:
"1.7.
4
"
,
"versionName"
:
"1.7.
8
"
,
"versionCode"
:
"100"
,
"transformPx"
:
false
,
"app-plus"
:
{
...
...
pages/componentsC/layout/index.vue
View file @
a8e8f5ba
...
...
@@ -3,8 +3,8 @@
<view
class=
"u-demo-wrap"
>
<view
class=
"u-demo-title"
>
演示效果
</view>
<view
class=
"u-demo-area"
>
<u-row
:justify=
"justify"
>
<u-col
:span=
"span"
:offset=
"offset"
@
click=
"click"
>
<u-row
:justify=
"justify"
@
click=
"rowClick"
>
<u-col
:span=
"span"
:offset=
"offset"
@
click=
"click"
stop
>
<view
class=
"demo-layout bg-purple-dark"
>
</view>
...
...
@@ -54,6 +54,12 @@
}
},
methods
:
{
click
()
{
console
.
log
(
'
col click
'
);
},
rowClick
()
{
console
.
log
(
'
row click
'
);
},
spanChange
(
e
)
{
switch
(
e
)
{
case
0
:
...
...
uview-ui/components/u-avatar/u-avatar.vue
View file @
a8e8f5ba
...
...
@@ -134,7 +134,7 @@
},
computed
:
{
wrapStyle
()
{
let
style
=
{};
let
style
=
{};
style
.
height
=
this
.
size
==
'
large
'
?
'
120rpx
'
:
this
.
size
==
'
default
'
?
'
90rpx
'
:
this
.
size
==
'
mini
'
?
'
70rpx
'
:
this
.
size
+
'
rpx
'
;
style
.
width
=
style
.
height
;
...
...
uview-ui/components/u-col/u-col.vue
View file @
a8e8f5ba
...
...
@@ -9,7 +9,7 @@
justifyContent: uJustify,
textAlign: textAlign
}"
@tap
.stop.prevent
="click">
@tap="click">
<slot></slot>
</view>
</
template
>
...
...
@@ -51,6 +51,11 @@
textAlign
:
{
type
:
String
,
default
:
'
left
'
},
// 是否阻止事件传播
stop
:
{
type
:
Boolean
,
default
:
true
}
},
data
()
{
...
...
@@ -81,7 +86,7 @@
}
},
methods
:
{
click
()
{
click
(
e
)
{
this
.
$emit
(
'
click
'
);
}
}
...
...
uview-ui/components/u-grid-item/u-grid-item.vue
View file @
a8e8f5ba
...
...
@@ -4,7 +4,7 @@
background: bgColor,
width: width,
}">
<view
class=
"u-grid-item-box"
:style=
"
customStyle
"
:class=
"[parentData.border ? 'u-border-right u-border-bottom' : '']"
>
<view
class=
"u-grid-item-box"
:style=
"
[customStyle]
"
:class=
"[parentData.border ? 'u-border-right u-border-bottom' : '']"
>
<slot
/>
</view>
</view>
...
...
uview-ui/components/u-navbar/u-navbar.vue
View file @
a8e8f5ba
...
...
@@ -14,7 +14,8 @@
class=
"u-title u-line-1"
:style=
"
{
color: titleColor,
fontSize: titleSize + 'rpx'
fontSize: titleSize + 'rpx',
fontWeight: titleBold ? 'bold' : 'normal'
}">
{{
title
}}
</view>
...
...
@@ -115,6 +116,11 @@
type
:
String
,
default
:
'
#606266
'
},
// 标题字体是否加粗
titleBold
:
{
type
:
Boolean
,
default
:
false
},
// 标题的字体大小
titleSize
:
{
type
:
[
String
,
Number
],
...
...
uview-ui/components/u-parse/libs/MpHtmlParser.js
View file @
a8e8f5ba
/**
* html 解析器
* @tutorial https://github.com/jin-yufeng/Parser
* @version 202010
14
* @version 202010
29
* @author JinYufeng
* @listens MIT
*/
...
...
uview-ui/components/u-parse/libs/trees.vue
View file @
a8e8f5ba
...
...
@@ -2,7 +2,7 @@
<view
:class=
"'interlayer '+(c||'')"
:style=
"s"
>
<block
v-for=
"(n, i) in nodes"
v-bind:key=
"i"
>
<!--图片-->
<view
v-if=
"n.name=='img'"
:class=
"'_img '+n.attrs.class"
:style=
"n.attrs.style"
:data-attrs=
"n.attrs"
@
tap=
"imgtap"
>
<view
v-if=
"n.name=='img'"
:class=
"'_img '+n.attrs.class"
:style=
"n.attrs.style"
:data-attrs=
"n.attrs"
@
tap
.stop
=
"imgtap"
>
<rich-text
v-if=
"ctrl[i]!=0"
:nodes=
"[
{attrs:{src:loading
&&
(ctrl[i]||0)
<2
?
loading:
(
lazyLoad
&&!
ctrl
[
i
]?
placeholder:(ctrl[i]=
=3?errorImg:n.attrs.src||'')),alt:n.attrs.alt||'',width:n.attrs.width||'',style:'-webkit-touch-callout:none;max-width:100%;display:block'+(n.attrs.height?';height:'+n.attrs.height:'')},name:'img'}]"
/>
<image
class=
"_image"
:src=
"lazyLoad&&!ctrl[i]?placeholder:n.attrs.src"
:lazy-load=
"lazyLoad"
:show-menu-by-longpress=
"!n.attrs.ignore"
:data-i=
"i"
:data-index=
"n.attrs.i"
data-source=
"img"
@
load=
"loadImg"
...
...
@@ -15,7 +15,7 @@
<!--#endif-->
<!--视频-->
<view
v-else-if=
"((n.lazyLoad&&!n.attrs.autoplay)||(n.name=='video'&&!loadVideo))&&ctrl[i]==undefined"
:id=
"n.attrs.id"
:class=
"'_video '+(n.attrs.class||'')"
:style=
"n.attrs.style"
:data-i=
"i"
@
tap=
"_loadVideo"
/>
:class=
"'_video '+(n.attrs.class||'')"
:style=
"n.attrs.style"
:data-i=
"i"
@
tap
.stop
=
"_loadVideo"
/>
<video
v-else-if=
"n.name=='video'"
:id=
"n.attrs.id"
:class=
"n.attrs.class"
:style=
"n.attrs.style"
:autoplay=
"n.attrs.autoplay||ctrl[i]==0"
:controls=
"n.attrs.controls"
:loop=
"n.attrs.loop"
:muted=
"n.attrs.muted"
:poster=
"n.attrs.poster"
:src=
"n.attrs.source[ctrl[i]||0]"
:unit-id=
"n.attrs['unit-id']"
:data-id=
"n.attrs.id"
:data-i=
"i"
data-source=
"video"
@
error=
"error"
@
play=
"play"
/>
...
...
@@ -26,7 +26,7 @@
@
play.native=
"play"
/>
<!--链接-->
<view
v-else-if=
"n.name=='a'"
:id=
"n.attrs.id"
:class=
"'_a '+(n.attrs.class||'')"
hover-class=
"_hover"
:style=
"n.attrs.style"
:data-attrs=
"n.attrs"
@
tap=
"linkpress"
>
:data-attrs=
"n.attrs"
@
tap
.stop
=
"linkpress"
>
<trees
class=
"_span"
c=
"_span"
:nodes=
"n.children"
/>
</view>
<!--广告-->
...
...
uview-ui/components/u-parse/u-parse.vue
View file @
a8e8f5ba
...
...
@@ -18,6 +18,7 @@
</
template
>
<
script
>
var
search
;
// #ifndef H5 || APP-PLUS-NVUE || MP-360
import
trees
from
'
./libs/trees
'
;
var
cache
=
{},
...
...
@@ -66,7 +67,7 @@
* @event {Function} imgtap 图片点击事件
* @event {Function} linkpress 链接点击事件
* @author JinYufeng
* @version 202010
14
* @version 202010
29
* @listens MIT
*/
export
default
{
...
...
@@ -173,6 +174,7 @@
// #ifndef H5 || APP-PLUS-NVUE || MP-360
if
(
dom
)
this
.
document
=
new
dom
(
this
);
// #endif
if
(
search
)
this
.
search
=
args
=>
search
(
this
,
args
);
// #ifdef APP-PLUS-NVUE
this
.
document
=
this
.
$refs
.
web
;
setTimeout
(()
=>
{
...
...
@@ -225,7 +227,7 @@
this
.
$refs
.
web
.
evalJs
(
'
var t=document.getElementsByTagName("title");t.length&&e({action:"getTitle",title:t[0].innerText});for(var o,n=document.getElementsByTagName("style"),r=1;o=n[r++];)o.innerHTML=o.innerHTML.replace(/body/g,"#parser");for(var a,c=document.getElementsByTagName("img"),s=[],i=0==c.length,d=0,l=0,g=0;a=c[l];l++)parseInt(a.style.width||a.getAttribute("width"))>
'
+
windowWidth
+
'
&&(a.style.height="auto"),a.onload=function(){++d==c.length&&(i=!0)},a.onerror=function(){++d==c.length&&(i=!0),
'
+
(
cfg
.
errorImg
?
'
this.src="
'
+
cfg
.
errorImg
+
'
",
'
:
''
)
+
'
e({action:"error",source:"img",target:this})},a.hasAttribute("ignore")||"A"==a.parentElement.nodeName||(a.i=g++,s.push(a.getAttribute("original-src")||a.src||a.getAttribute("data-src")),a.onclick=function(
){e({action:"preview",img:{i:this.i,src:this.src}})});e({action:"getImgList",imgList:s});for(var u,m=document.getElementsByTagName("a"),f=0;u=m[f];f++)u.onclick=function(){
var t,o=this.getAttribute("href");if("#"==o[0]){var n=document.getElementById(o.substr(1));n&&(t=n.offsetTop)}return e({action:"linkpress",href:o,offset:t}),!1};for(var h,y=document.getElementsByTagName("video"),v=0;h=y[v];v++)h.style.maxWidth="100%",h.onerror=function(){e({action:"error",source:"video",target:this})}
'
+
'
e({action:"error",source:"img",target:this})},a.hasAttribute("ignore")||"A"==a.parentElement.nodeName||(a.i=g++,s.push(a.getAttribute("original-src")||a.src||a.getAttribute("data-src")),a.onclick=function(
t){t.stopPropagation(),e({action:"preview",img:{i:this.i,src:this.src}})});e({action:"getImgList",imgList:s});for(var u,m=document.getElementsByTagName("a"),f=0;u=m[f];f++)u.onclick=function(m){m.stopPropagation();
var t,o=this.getAttribute("href");if("#"==o[0]){var n=document.getElementById(o.substr(1));n&&(t=n.offsetTop)}return e({action:"linkpress",href:o,offset:t}),!1};for(var h,y=document.getElementsByTagName("video"),v=0;h=y[v];v++)h.style.maxWidth="100%",h.onerror=function(){e({action:"error",source:"video",target:this})}
'
+
(
this
.
autopause
?
'
,h.onplay=function(){for(var e,t=0;e=y[t];t++)e!=this&&e.pause()}
'
:
''
)
+
'
;for(var _,p=document.getElementsByTagName("audio"),w=0;_=p[w];w++)_.onerror=function(){e({action:"error",source:"audio",target:this})};
'
+
(
this
.
autoscroll
?
'
for(var T,E=document.getElementsByTagName("table"),B=0;T=E[B];B++){var N=document.createElement("div");N.style.overflow="scroll",T.parentNode.replaceChild(N,T),N.appendChild(T)}
'
:
''
)
+
...
...
@@ -272,24 +274,29 @@
uni
.
setNavigationBarTitle
({
title
:
title
[
0
].
innerText
})
// 填充 domain
var
fill
=
target
=>
{
var
src
=
target
.
getAttribute
(
'
src
'
);
if
(
this
.
domain
&&
src
)
{
if
(
src
[
0
]
==
'
/
'
)
{
if
(
src
[
1
]
==
'
/
'
)
target
.
src
=
(
this
.
domain
.
includes
(
'
://
'
)
?
this
.
domain
.
split
(
'
://
'
)[
0
]
:
''
)
+
'
:
'
+
src
;
else
target
.
src
=
this
.
domain
+
src
;
}
else
if
(
!
src
.
includes
(
'
://
'
)
&&
src
.
indexOf
(
'
data:
'
)
!=
0
)
target
.
src
=
this
.
domain
+
'
/
'
+
src
;
}
}
// 图片处理
this
.
imgList
.
length
=
0
;
var
imgs
=
this
.
rtf
.
getElementsByTagName
(
'
img
'
);
for
(
let
i
=
0
,
j
=
0
,
img
;
img
=
imgs
[
i
];
i
++
)
{
if
(
parseInt
(
img
.
style
.
width
||
img
.
getAttribute
(
'
width
'
))
>
windowWidth
)
img
.
style
.
height
=
'
auto
'
;
var
src
=
img
.
getAttribute
(
'
src
'
);
if
(
this
.
domain
&&
src
)
{
if
(
src
[
0
]
==
'
/
'
)
{
if
(
src
[
1
]
==
'
/
'
)
img
.
src
=
(
this
.
domain
.
includes
(
'
://
'
)
?
this
.
domain
.
split
(
'
://
'
)[
0
]
:
''
)
+
'
:
'
+
src
;
else
img
.
src
=
this
.
domain
+
src
;
}
else
if
(
!
src
.
includes
(
'
://
'
))
img
.
src
=
this
.
domain
+
'
/
'
+
src
;
}
fill
(
img
);
if
(
!
img
.
hasAttribute
(
'
ignore
'
)
&&
img
.
parentElement
.
nodeName
!=
'
A
'
)
{
img
.
i
=
j
++
;
_ts
.
imgList
.
push
(
img
.
getAttribute
(
'
original-src
'
)
||
img
.
src
||
img
.
getAttribute
(
'
data-src
'
));
img
.
onclick
=
function
()
{
img
.
onclick
=
function
(
e
)
{
e
.
stopPropagation
();
var
preview
=
true
;
this
.
ignore
=
()
=>
preview
=
false
;
_ts
.
$emit
(
'
imgtap
'
,
this
);
...
...
@@ -318,7 +325,8 @@
// 链接处理
var
links
=
this
.
rtf
.
getElementsByTagName
(
'
a
'
);
for
(
var
link
of
links
)
{
link
.
onclick
=
function
()
{
link
.
onclick
=
function
(
e
)
{
e
.
stopPropagation
();
var
jump
=
true
,
href
=
this
.
getAttribute
(
'
href
'
);
_ts
.
$emit
(
'
linkpress
'
,
{
...
...
@@ -346,6 +354,7 @@
var
videos
=
this
.
rtf
.
getElementsByTagName
(
'
video
'
);
_ts
.
videoContexts
=
videos
;
for
(
let
video
,
i
=
0
;
video
=
videos
[
i
++
];)
{
fill
(
video
);
video
.
style
.
maxWidth
=
'
100%
'
;
video
.
onerror
=
function
()
{
_ts
.
$emit
(
'
error
'
,
{
...
...
@@ -361,13 +370,15 @@
}
// 音频处理
var
audios
=
this
.
rtf
.
getElementsByTagName
(
'
audio
'
);
for
(
var
audio
of
audios
)
for
(
var
audio
of
audios
)
{
fill
(
audio
);
audio
.
onerror
=
function
()
{
_ts
.
$emit
(
'
error
'
,
{
source
:
'
audio
'
,
target
:
this
});
}
}
// 表格处理
if
(
this
.
autoscroll
)
{
var
tables
=
this
.
rtf
.
getElementsByTagName
(
'
table
'
);
...
...
@@ -626,7 +637,7 @@
/* #ifdef MP-WEIXIN */
:host
{
display
:
block
;
overflow
:
scroll
;
overflow
:
auto
;
-webkit-overflow-scrolling
:
touch
;
}
...
...
uview-ui/components/u-row/u-row.vue
View file @
a8e8f5ba
...
...
@@ -3,7 +3,7 @@
alignItems: uAlignItem,
justifyContent: uJustify
}"
@tap
.stop.prevent
="click"
@tap="click"
>
<slot
/>
</view>
...
...
@@ -36,6 +36,11 @@
align
:
{
type
:
String
,
default
:
'
center
'
},
// 是否阻止事件传播
stop
:
{
type
:
Boolean
,
default
:
true
}
},
computed
:
{
...
...
@@ -51,7 +56,7 @@
}
},
methods
:
{
click
()
{
click
(
e
)
{
this
.
$emit
(
'
click
'
);
}
}
...
...
uview-ui/libs/config/config.js
View file @
a8e8f5ba
// 此版本发布于2020-10-
13
let
version
=
'
1.7.
4
'
;
// 此版本发布于2020-10-
31
let
version
=
'
1.7.
8
'
;
export
default
{
v
:
version
,
...
...
uview-ui/libs/function/test.js
View file @
a8e8f5ba
...
...
@@ -16,8 +16,7 @@ function mobile(value) {
* 验证URL格式
*/
function
url
(
value
)
{
return
/^
((
https|http|ftp|rtsp|mms
)
:
\/\/)(([
0-9a-zA-Z_!~*'().&=+$%-
]
+:
)?[
0-9a-zA-Z_!~*'().&=+$%-
]
+@
)?(([
0-9
]{1,3}
.
){3}[
0-9
]{1,3}
|
([
0-9a-zA-Z_!~*'()-
]
+.
)
*
([
0-9a-zA-Z
][
0-9a-zA-Z-
]{0,61})?[
0-9a-zA-Z
]
.
[
a-zA-Z
]{2,6})(
:
[
0-9
]{1,4})?((\/?)
|
(\/[
0-9a-zA-Z_!~*'().;?:@&=+$,%#-
]
+
)
+
\/?)
$/
.
test
(
value
)
return
/http
(
s
)?
:
\/\/([\w
-
]
+
\.)
+
[\w
-
]
+
(\/[\w
-.
\/
?%&=
]
*
)?
/
.
test
(
value
)
}
/**
...
...
uview-ui/libs/mixin/mixin.js
View file @
a8e8f5ba
...
...
@@ -39,6 +39,10 @@ module.exports = {
});
}
},
// 阻止事件冒泡
preventEvent
(
e
)
{
e
&&
e
.
stopPropagation
&&
e
.
stopPropagation
()
}
},
onReachBottom
()
{
uni
.
$emit
(
'
uOnReachBottom
'
)
...
...
uview-ui/package.json
View file @
a8e8f5ba
{
"name"
:
"uview-ui"
,
"version"
:
"1.7.
6
"
,
"version"
:
"1.7.
8
"
,
"description"
:
"uView UI,是uni-app生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水"
,
"main"
:
"index.js"
,
"keywords"
:
[
...
...
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