Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Velpro187
uni-app
提交
3d2b4ba2
U
uni-app
项目概览
Velpro187
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3d2b4ba2
编写于
4月 20, 2022
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: build h5
上级
ec5088f7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
186 addition
and
122 deletion
+186
-122
packages/uni-h5/dist/uni-h5.cjs.js
packages/uni-h5/dist/uni-h5.cjs.js
+93
-61
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+93
-61
未找到文件。
packages/uni-h5/dist/uni-h5.cjs.js
浏览文件 @
3d2b4ba2
...
@@ -8190,6 +8190,40 @@ var MapMarker = /* @__PURE__ */ defineSystemComponent({
...
@@ -8190,6 +8190,40 @@ var MapMarker = /* @__PURE__ */ defineSystemComponent({
};
};
}
}
});
});
function
hexToRgba
(
hex
)
{
if
(
!
hex
)
{
return
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
};
}
let
tmpHex
=
hex
.
slice
(
1
);
const
tmpHexLen
=
tmpHex
.
length
;
if
(
!
[
3
,
4
,
6
,
8
].
includes
(
tmpHexLen
))
{
return
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
};
}
if
(
tmpHexLen
===
3
||
tmpHexLen
===
4
)
{
tmpHex
=
tmpHex
.
replace
(
/
(\w{1})
/g
,
"
$1$1
"
);
}
let
[
sr
,
sg
,
sb
,
sa
]
=
tmpHex
.
match
(
/
(\w{2})
/g
);
const
r
=
parseInt
(
sr
,
16
),
g2
=
parseInt
(
sg
,
16
),
b
=
parseInt
(
sb
,
16
);
if
(
!
sa
)
{
return
{
r
,
g
:
g2
,
b
,
a
:
1
};
}
return
{
r
,
g
:
g2
,
b
,
a
:
(
`0x100
${
sa
}
`
-
65536
)
/
255
};
}
const
props$6
=
{
const
props$6
=
{
points
:
{
points
:
{
type
:
Array
,
type
:
Array
,
...
@@ -8260,25 +8294,48 @@ var MapPolyline = /* @__PURE__ */ defineSystemComponent({
...
@@ -8260,25 +8294,48 @@ var MapPolyline = /* @__PURE__ */ defineSystemComponent({
path
.
push
(
new
maps
.
LatLng
(
point
.
latitude
,
point
.
longitude
));
path
.
push
(
new
maps
.
LatLng
(
point
.
latitude
,
point
.
longitude
));
});
});
const
strokeWeight
=
Number
(
option
.
width
)
||
1
;
const
strokeWeight
=
Number
(
option
.
width
)
||
1
;
polyline
=
new
maps
.
Polyline
({
const
{
r
:
sr
,
g
:
sg
,
b
:
sb
,
a
:
sa
}
=
hexToRgba
(
option
.
color
);
const
{
r
:
br
,
g
:
bg
,
b
:
bb
,
a
:
ba
}
=
hexToRgba
(
option
.
borderColor
);
const
polylineOptions
=
{
map
,
map
,
clickable
:
false
,
clickable
:
false
,
path
,
path
,
strokeWeight
,
strokeWeight
,
strokeColor
:
option
.
color
||
void
0
,
strokeColor
:
option
.
color
||
void
0
,
strokeDashStyle
:
option
.
dottedLine
?
"
dash
"
:
"
solid
"
strokeDashStyle
:
option
.
dottedLine
?
"
dash
"
:
"
solid
"
}
)
;
};
const
borderWidth
=
Number
(
option
.
borderWidth
)
||
0
;
const
borderWidth
=
Number
(
option
.
borderWidth
)
||
0
;
const
polylineBorderOptions
=
{
map
,
clickable
:
false
,
path
,
strokeWeight
:
strokeWeight
+
borderWidth
*
2
,
strokeColor
:
option
.
borderColor
||
void
0
,
strokeDashStyle
:
option
.
dottedLine
?
"
dash
"
:
"
solid
"
};
if
(
"
Color
"
in
maps
)
{
polylineOptions
.
strokeColor
=
new
maps
.
Color
(
sr
,
sg
,
sb
,
sa
);
polylineBorderOptions
.
strokeColor
=
new
maps
.
Color
(
br
,
bg
,
bb
,
ba
);
}
else
{
polylineOptions
.
strokeColor
=
`rgb(
${
sr
}
,
${
sg
}
,
${
sb
}
)`
;
polylineOptions
.
strokeOpacity
=
sa
;
polylineBorderOptions
.
strokeColor
=
`rgb(
${
br
}
,
${
bg
}
,
${
bb
}
)`
;
polylineBorderOptions
.
strokeOpacity
=
ba
;
}
if
(
borderWidth
)
{
if
(
borderWidth
)
{
polylineBorder
=
new
maps
.
Polyline
({
polylineBorder
=
new
maps
.
Polyline
(
polylineBorderOptions
);
map
,
clickable
:
false
,
path
,
strokeWeight
:
strokeWeight
+
borderWidth
*
2
,
strokeColor
:
option
.
borderColor
||
void
0
,
strokeDashStyle
:
option
.
dottedLine
?
"
dash
"
:
"
solid
"
});
}
}
polyline
=
new
maps
.
Polyline
(
polylineOptions
);
}
}
addPolyline
(
props2
);
addPolyline
(
props2
);
vue
.
watch
(
props2
,
updatePolyline
);
vue
.
watch
(
props2
,
updatePolyline
);
...
@@ -8299,11 +8356,11 @@ const props$5 = {
...
@@ -8299,11 +8356,11 @@ const props$5 = {
},
},
color
:
{
color
:
{
type
:
String
,
type
:
String
,
default
:
""
default
:
"
#000000
"
},
},
fillColor
:
{
fillColor
:
{
type
:
String
,
type
:
String
,
default
:
""
default
:
"
#00000000
"
},
},
radius
:
{
radius
:
{
type
:
[
Number
,
String
],
type
:
[
Number
,
String
],
...
@@ -8336,27 +8393,36 @@ var MapCircle = /* @__PURE__ */ defineSystemComponent({
...
@@ -8336,27 +8393,36 @@ var MapCircle = /* @__PURE__ */ defineSystemComponent({
}
}
function
addCircle
(
option
)
{
function
addCircle
(
option
)
{
const
center
=
new
maps
.
LatLng
(
option
.
latitude
,
option
.
longitude
);
const
center
=
new
maps
.
LatLng
(
option
.
latitude
,
option
.
longitude
);
function
getColor
(
color
)
{
const
circleOptions
=
{
const
c
=
color
&&
color
.
match
(
/#
[
0-9A-Fa-f
]{6}([
0-9A-Fa-f
]{2})?
/
);
if
(
"
Color
"
in
maps
)
{
if
(
c
&&
c
.
length
)
{
return
maps
.
Color
.
fromHex
(
c
[
0
],
Number
(
"
0x
"
+
c
[
1
]
||
255
)
/
255
).
toRGBA
();
}
else
{
return
void
0
;
}
}
return
color
;
}
circle
=
new
maps
.
Circle
({
map
,
map
,
center
,
center
,
clickable
:
false
,
clickable
:
false
,
radius
:
option
.
radius
,
radius
:
option
.
radius
,
strokeWeight
:
Number
(
option
.
strokeWidth
)
||
1
,
strokeWeight
:
Number
(
option
.
strokeWidth
)
||
1
,
fillColor
:
getColor
(
option
.
fillColor
)
||
getColor
(
"
#00000001
"
),
strokeColor
:
getColor
(
option
.
color
)
||
"
#000000
"
,
strokeDashStyle
:
"
solid
"
strokeDashStyle
:
"
solid
"
});
};
const
{
r
:
fr
,
g
:
fg
,
b
:
fb
,
a
:
fa
}
=
hexToRgba
(
option
.
fillColor
);
const
{
r
:
sr
,
g
:
sg
,
b
:
sb
,
a
:
sa
}
=
hexToRgba
(
option
.
color
);
if
(
"
Color
"
in
maps
)
{
circleOptions
.
fillColor
=
new
maps
.
Color
(
fr
,
fg
,
fb
,
fa
);
circleOptions
.
strokeColor
=
new
maps
.
Color
(
sr
,
sg
,
sb
,
sa
);
}
else
{
circleOptions
.
fillColor
=
`rgb(
${
fr
}
,
${
fg
}
,
${
fb
}
)`
;
circleOptions
.
fillOpacity
=
fa
;
circleOptions
.
strokeColor
=
`rgb(
${
sr
}
,
${
sg
}
,
${
sb
}
)`
;
circleOptions
.
strokeOpacity
=
sa
;
}
circle
=
new
maps
.
Circle
(
circleOptions
);
}
}
addCircle
(
props2
);
addCircle
(
props2
);
vue
.
watch
(
props2
,
updateCircle
);
vue
.
watch
(
props2
,
updateCircle
);
...
@@ -8488,40 +8554,6 @@ var props$3 = {
...
@@ -8488,40 +8554,6 @@ var props$3 = {
default
:
0
default
:
0
}
}
};
};
function
hexToRgba
(
hex
)
{
if
(
!
hex
)
{
return
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
};
}
let
tmpHex
=
hex
.
slice
(
1
);
const
tmpHexLen
=
tmpHex
.
length
;
if
(
!
[
3
,
4
,
6
,
8
].
includes
(
tmpHexLen
))
{
return
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
0
};
}
if
(
tmpHexLen
===
3
||
tmpHexLen
===
4
)
{
tmpHex
=
tmpHex
.
replace
(
/
(\w{1})
/g
,
"
$1$1
"
);
}
let
[
sr
,
sg
,
sb
,
sa
]
=
tmpHex
.
match
(
/
(\w{2})
/g
);
const
r
=
parseInt
(
sr
,
16
),
g2
=
parseInt
(
sg
,
16
),
b
=
parseInt
(
sb
,
16
);
if
(
!
sa
)
{
return
{
r
,
g
:
g2
,
b
,
a
:
1
};
}
return
{
r
,
g
:
g2
,
b
,
a
:
(
`0x100
${
sa
}
`
-
65536
)
/
255
};
}
var
MapPolygon
=
/* @__PURE__ */
defineSystemComponent
({
var
MapPolygon
=
/* @__PURE__ */
defineSystemComponent
({
name
:
"
MapPolygon
"
,
name
:
"
MapPolygon
"
,
props
:
props$3
,
props
:
props$3
,
...
...
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
3d2b4ba2
...
@@ -15814,6 +15814,40 @@ var MapMarker = /* @__PURE__ */ defineSystemComponent({
...
@@ -15814,6 +15814,40 @@ var MapMarker = /* @__PURE__ */ defineSystemComponent({
};
};
}
}
});
});
function hexToRgba(hex) {
if (!hex) {
return {
r: 0,
g: 0,
b: 0,
a: 0
};
}
let tmpHex = hex.slice(1);
const tmpHexLen = tmpHex.length;
if (![3, 4, 6, 8].includes(tmpHexLen)) {
return {
r: 0,
g: 0,
b: 0,
a: 0
};
}
if (tmpHexLen === 3 || tmpHexLen === 4) {
tmpHex = tmpHex.replace(/(\w{1})/g, "$1$1");
}
let [sr, sg, sb, sa] = tmpHex.match(/(\w{2})/g);
const r = parseInt(sr, 16), g2 = parseInt(sg, 16), b = parseInt(sb, 16);
if (!sa) {
return { r, g: g2, b, a: 1 };
}
return {
r,
g: g2,
b,
a: (`0x100${sa}` - 65536) / 255
};
}
const props$d = {
const props$d = {
points: {
points: {
type: Array,
type: Array,
...
@@ -15884,25 +15918,48 @@ var MapPolyline = /* @__PURE__ */ defineSystemComponent({
...
@@ -15884,25 +15918,48 @@ var MapPolyline = /* @__PURE__ */ defineSystemComponent({
path.push(new maps2.LatLng(point.latitude, point.longitude));
path.push(new maps2.LatLng(point.latitude, point.longitude));
});
});
const strokeWeight = Number(option.width) || 1;
const strokeWeight = Number(option.width) || 1;
polyline = new maps2.Polyline({
const {
r: sr,
g: sg,
b: sb,
a: sa
} = hexToRgba(option.color);
const {
r: br,
g: bg,
b: bb,
a: ba
} = hexToRgba(option.borderColor);
const polylineOptions = {
map,
map,
clickable: false,
clickable: false,
path,
path,
strokeWeight,
strokeWeight,
strokeColor: option.color || void 0,
strokeColor: option.color || void 0,
strokeDashStyle: option.dottedLine ? "dash" : "solid"
strokeDashStyle: option.dottedLine ? "dash" : "solid"
}
)
;
};
const borderWidth = Number(option.borderWidth) || 0;
const borderWidth = Number(option.borderWidth) || 0;
const polylineBorderOptions = {
map,
clickable: false,
path,
strokeWeight: strokeWeight + borderWidth * 2,
strokeColor: option.borderColor || void 0,
strokeDashStyle: option.dottedLine ? "dash" : "solid"
};
if ("Color" in maps2) {
polylineOptions.strokeColor = new maps2.Color(sr, sg, sb, sa);
polylineBorderOptions.strokeColor = new maps2.Color(br, bg, bb, ba);
} else {
polylineOptions.strokeColor = `rgb(${sr}, ${sg}, ${sb})`;
polylineOptions.strokeOpacity = sa;
polylineBorderOptions.strokeColor = `rgb(${br}, ${bg}, ${bb})`;
polylineBorderOptions.strokeOpacity = ba;
}
if (borderWidth) {
if (borderWidth) {
polylineBorder = new maps2.Polyline({
polylineBorder = new maps2.Polyline(polylineBorderOptions);
map,
clickable: false,
path,
strokeWeight: strokeWeight + borderWidth * 2,
strokeColor: option.borderColor || void 0,
strokeDashStyle: option.dottedLine ? "dash" : "solid"
});
}
}
polyline = new maps2.Polyline(polylineOptions);
}
}
addPolyline(props2);
addPolyline(props2);
watch(props2, updatePolyline);
watch(props2, updatePolyline);
...
@@ -15924,11 +15981,11 @@ const props$c = {
...
@@ -15924,11 +15981,11 @@ const props$c = {
},
},
color: {
color: {
type: String,
type: String,
default: ""
default: "
#000000
"
},
},
fillColor: {
fillColor: {
type: String,
type: String,
default: ""
default: "
#00000000
"
},
},
radius: {
radius: {
type: [Number, String],
type: [Number, String],
...
@@ -15961,27 +16018,36 @@ var MapCircle = /* @__PURE__ */ defineSystemComponent({
...
@@ -15961,27 +16018,36 @@ var MapCircle = /* @__PURE__ */ defineSystemComponent({
}
}
function addCircle(option) {
function addCircle(option) {
const center = new maps2.LatLng(option.latitude, option.longitude);
const center = new maps2.LatLng(option.latitude, option.longitude);
function getColor(color) {
const circleOptions = {
const c = color && color.match(/#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?/);
if ("Color" in maps2) {
if (c && c.length) {
return maps2.Color.fromHex(c[0], Number("0x" + c[1] || 255) / 255).toRGBA();
} else {
return void 0;
}
}
return color;
}
circle = new maps2.Circle({
map,
map,
center,
center,
clickable: false,
clickable: false,
radius: option.radius,
radius: option.radius,
strokeWeight: Number(option.strokeWidth) || 1,
strokeWeight: Number(option.strokeWidth) || 1,
fillColor: getColor(option.fillColor) || getColor("#00000001"),
strokeColor: getColor(option.color) || "#000000",
strokeDashStyle: "solid"
strokeDashStyle: "solid"
});
};
const {
r: fr,
g: fg,
b: fb,
a: fa
} = hexToRgba(option.fillColor);
const {
r: sr,
g: sg,
b: sb,
a: sa
} = hexToRgba(option.color);
if ("Color" in maps2) {
circleOptions.fillColor = new maps2.Color(fr, fg, fb, fa);
circleOptions.strokeColor = new maps2.Color(sr, sg, sb, sa);
} else {
circleOptions.fillColor = `rgb(${fr}, ${fg}, ${fb})`;
circleOptions.fillOpacity = fa;
circleOptions.strokeColor = `rgb(${sr}, ${sg}, ${sb})`;
circleOptions.strokeOpacity = sa;
}
circle = new maps2.Circle(circleOptions);
}
}
addCircle(props2);
addCircle(props2);
watch(props2, updateCircle);
watch(props2, updateCircle);
...
@@ -20214,40 +20280,6 @@ var props$3 = {
...
@@ -20214,40 +20280,6 @@ var props$3 = {
default: 0
default: 0
}
}
};
};
function hexToRgba(hex) {
if (!hex) {
return {
r: 0,
g: 0,
b: 0,
a: 0
};
}
let tmpHex = hex.slice(1);
const tmpHexLen = tmpHex.length;
if (![3, 4, 6, 8].includes(tmpHexLen)) {
return {
r: 0,
g: 0,
b: 0,
a: 0
};
}
if (tmpHexLen === 3 || tmpHexLen === 4) {
tmpHex = tmpHex.replace(/(\w{1})/g, "$1$1");
}
let [sr, sg, sb, sa] = tmpHex.match(/(\w{2})/g);
const r = parseInt(sr, 16), g2 = parseInt(sg, 16), b = parseInt(sb, 16);
if (!sa) {
return { r, g: g2, b, a: 1 };
}
return {
r,
g: g2,
b,
a: (`0x100${sa}` - 65536) / 255
};
}
var MapPolygon = /* @__PURE__ */ defineSystemComponent({
var MapPolygon = /* @__PURE__ */ defineSystemComponent({
name: "MapPolygon",
name: "MapPolygon",
props: props$3,
props: props$3,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录