Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
m0_68066342
uni-app
提交
b614be4d
U
uni-app
项目概览
m0_68066342
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
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,发现更多精彩内容 >>
提交
b614be4d
编写于
2月 27, 2020
作者:
fxy060608
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://github.com/dcloudio/uni-app
into alpha
上级
14f5fba1
5659fdff
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
118 addition
and
116 deletion
+118
-116
packages/uni-template-compiler/lib/util.js
packages/uni-template-compiler/lib/util.js
+1
-1
packages/vue-cli-plugin-uni/lib/env.js
packages/vue-cli-plugin-uni/lib/env.js
+0
-4
src/platforms/h5/view/components/map/index.vue
src/platforms/h5/view/components/map/index.vue
+116
-110
src/platforms/mp-alipay/runtime/wrapper/component-parser.js
src/platforms/mp-alipay/runtime/wrapper/component-parser.js
+1
-1
未找到文件。
packages/uni-template-compiler/lib/util.js
浏览文件 @
b614be4d
...
...
@@ -176,7 +176,7 @@ function hasOwn (obj, key) {
return
hasOwnProperty
.
call
(
obj
,
key
)
}
const
tags
=
require
(
'
../..
/uni-cli-shared/lib/tags
'
)
const
tags
=
require
(
'
@dcloudio
/uni-cli-shared/lib/tags
'
)
const
{
getTagName
...
...
packages/vue-cli-plugin-uni/lib/env.js
浏览文件 @
b614be4d
...
...
@@ -38,10 +38,6 @@ if (process.env.UNI_CLOUD_SPACES) {
}))
}
}
catch
(
e
)
{}
}
if
(
process
.
UNI_CLOUD_TCB
)
{
console
.
warn
(
`当前项目使用了腾讯云云服务空间,需在uniCloud后台开启匿名登录,详见:https://uniapp.dcloud.io/uniCloud/authentication?id=auth-anonymously`
)
}
if
(
...
...
src/platforms/h5/view/components/map/index.vue
浏览文件 @
b614be4d
<
template
>
<uni-map
:id=
"id"
<uni-map
:id=
"id"
v-on=
"$listeners"
>
<div
ref=
"map"
...
...
@@ -20,7 +20,119 @@ import {
hasOwn
}
from
'
uni-shared
'
var
maps
let
maps
let
callbacks
function
loadMap
(
callback
)
{
if
(
maps
)
{
callback
()
}
else
if
(
window
.
qq
&&
window
.
qq
.
maps
)
{
maps
=
window
.
qq
.
maps
callback
()
}
else
if
(
callbacks
)
{
callbacks
.
push
(
callback
)
}
else
{
callbacks
=
[
callback
]
let
key
=
__uniConfig
.
qqMapKey
let
callbackName
=
'
_callback
'
+
Date
.
now
()
window
[
callbackName
]
=
function
()
{
delete
window
[
callbackName
]
maps
=
window
.
qq
.
maps
var
Callout
=
maps
.
Callout
=
function
(
option
=
{})
{
this
.
option
=
option
var
map
=
option
.
map
this
.
position
=
option
.
position
this
.
index
=
1
this
.
visible
=
this
.
alwaysVisible
=
option
.
display
===
'
ALWAYS
'
this
.
init
()
Object
.
defineProperty
(
this
,
'
onclick
'
,
{
setter
(
callback
)
{
this
.
div
.
onclick
=
callback
},
getter
()
{
return
this
.
div
.
onclick
}
})
if
(
map
)
{
this
.
setMap
(
map
)
}
}
Callout
.
prototype
=
new
maps
.
Overlay
()
Callout
.
prototype
.
init
=
function
()
{
var
option
=
this
.
option
var
div
=
this
.
div
=
document
.
createElement
(
'
div
'
)
var
divStyle
=
div
.
style
divStyle
.
position
=
'
absolute
'
divStyle
.
whiteSpace
=
'
nowrap
'
divStyle
.
transform
=
'
translateX(-50%) translateY(-100%)
'
divStyle
.
zIndex
=
1
divStyle
.
boxShadow
=
option
.
boxShadow
||
'
none
'
divStyle
.
display
=
this
.
visible
?
'
block
'
:
'
none
'
var
triangle
=
this
.
triangle
=
document
.
createElement
(
'
div
'
)
triangle
.
setAttribute
(
'
style
'
,
'
position: absolute;white-space: nowrap;border-width: 4px;border-style: solid;border-color: #fff transparent transparent;border-image: initial;font-size: 12px;padding: 0px;background-color: transparent;width: 0px;height: 0px;transform: translate(-50%, 100%);left: 50%;bottom: 0;
'
)
this
.
setStyle
(
option
)
this
.
changed
=
function
(
key
)
{
divStyle
.
display
=
this
.
visible
?
'
block
'
:
'
none
'
}
div
.
appendChild
(
triangle
)
}
Callout
.
prototype
.
construct
=
function
()
{
var
div
=
this
.
div
var
panes
=
this
.
getPanes
()
panes
.
floatPane
.
appendChild
(
div
)
}
Callout
.
prototype
.
draw
=
function
()
{
var
overlayProjection
=
this
.
getProjection
()
if
(
!
this
.
position
||
!
this
.
div
||
!
overlayProjection
)
{
return
}
var
pixel
=
overlayProjection
.
fromLatLngToDivPixel
(
this
.
position
)
var
divStyle
=
this
.
div
.
style
divStyle
.
left
=
pixel
.
x
+
'
px
'
divStyle
.
top
=
pixel
.
y
+
'
px
'
}
Callout
.
prototype
.
destroy
=
function
()
{
this
.
div
.
parentNode
.
removeChild
(
this
.
div
)
this
.
div
=
null
this
.
triangle
=
null
}
Callout
.
prototype
.
setOption
=
function
(
option
)
{
this
.
option
=
option
this
.
setPosition
(
option
.
position
)
if
(
option
.
display
===
'
ALWAYS
'
)
{
this
.
alwaysVisible
=
this
.
visible
=
true
}
else
{
this
.
alwaysVisible
=
false
}
this
.
setStyle
(
option
)
}
Callout
.
prototype
.
setStyle
=
function
(
option
)
{
var
div
=
this
.
div
var
divStyle
=
div
.
style
div
.
innerText
=
option
.
content
divStyle
.
lineHeight
=
(
option
.
fontSize
||
14
)
+
'
px
'
divStyle
.
fontSize
=
(
option
.
fontSize
||
14
)
+
'
px
'
divStyle
.
padding
=
(
option
.
padding
||
8
)
+
'
px
'
divStyle
.
color
=
option
.
color
||
'
#000
'
divStyle
.
borderRadius
=
(
option
.
borderRadius
||
0
)
+
'
px
'
divStyle
.
backgroundColor
=
option
.
bgColor
||
'
#fff
'
divStyle
.
marginTop
=
'
-
'
+
(
option
.
top
+
5
)
+
'
px
'
this
.
triangle
.
style
.
borderColor
=
`
${
option
.
bgColor
||
'
#fff
'
}
transparent transparent`
}
Callout
.
prototype
.
setPosition
=
function
(
position
)
{
this
.
position
=
position
this
.
draw
()
}
callbacks
.
forEach
(
callback
=>
callback
())
callbacks
=
null
}
let
script
=
document
.
createElement
(
'
script
'
)
script
.
src
=
`https://map.qq.com/api/js?v=2.exp&key=
${
key
}
&callback=
${
callbackName
}
&libraries=geometry`
document
.
body
.
appendChild
(
script
)
}
}
export
default
{
name
:
'
Map
'
,
mixins
:
[
subscriber
],
...
...
@@ -193,7 +305,7 @@ export default {
}
},
mounted
()
{
this
.
loadMap
(()
=>
{
loadMap
(()
=>
{
this
.
init
()
})
},
...
...
@@ -785,112 +897,6 @@ export default {
return
element
}
}
},
loadMap
(
callback
)
{
if
(
maps
)
{
callback
()
}
else
if
(
window
.
qq
&&
window
.
qq
.
maps
)
{
maps
=
window
.
qq
.
maps
callback
()
}
else
{
let
key
=
__uniConfig
.
qqMapKey
let
callbackName
=
'
_callback
'
+
Date
.
now
()
window
[
callbackName
]
=
function
()
{
delete
window
[
callbackName
]
maps
=
window
.
qq
.
maps
var
Callout
=
maps
.
Callout
=
function
(
option
=
{})
{
this
.
option
=
option
var
map
=
option
.
map
this
.
position
=
option
.
position
this
.
index
=
1
this
.
visible
=
this
.
alwaysVisible
=
option
.
display
===
'
ALWAYS
'
this
.
init
()
Object
.
defineProperty
(
this
,
'
onclick
'
,
{
setter
(
callback
)
{
this
.
div
.
onclick
=
callback
},
getter
()
{
return
this
.
div
.
onclick
}
})
if
(
map
)
{
this
.
setMap
(
map
)
}
}
Callout
.
prototype
=
new
maps
.
Overlay
()
Callout
.
prototype
.
init
=
function
()
{
var
option
=
this
.
option
var
div
=
this
.
div
=
document
.
createElement
(
'
div
'
)
var
divStyle
=
div
.
style
divStyle
.
position
=
'
absolute
'
divStyle
.
whiteSpace
=
'
nowrap
'
divStyle
.
transform
=
'
translateX(-50%) translateY(-100%)
'
divStyle
.
zIndex
=
1
divStyle
.
boxShadow
=
option
.
boxShadow
||
'
none
'
divStyle
.
display
=
this
.
visible
?
'
block
'
:
'
none
'
var
triangle
=
this
.
triangle
=
document
.
createElement
(
'
div
'
)
triangle
.
setAttribute
(
'
style
'
,
'
position: absolute;white-space: nowrap;border-width: 4px;border-style: solid;border-color: #fff transparent transparent;border-image: initial;font-size: 12px;padding: 0px;background-color: transparent;width: 0px;height: 0px;transform: translate(-50%, 100%);left: 50%;bottom: 0;
'
)
this
.
setStyle
(
option
)
this
.
changed
=
function
(
key
)
{
divStyle
.
display
=
this
.
visible
?
'
block
'
:
'
none
'
}
div
.
appendChild
(
triangle
)
}
Callout
.
prototype
.
construct
=
function
()
{
var
div
=
this
.
div
var
panes
=
this
.
getPanes
()
panes
.
floatPane
.
appendChild
(
div
)
}
Callout
.
prototype
.
draw
=
function
()
{
var
overlayProjection
=
this
.
getProjection
()
if
(
!
this
.
position
||
!
this
.
div
||
!
overlayProjection
)
{
return
}
var
pixel
=
overlayProjection
.
fromLatLngToDivPixel
(
this
.
position
)
var
divStyle
=
this
.
div
.
style
divStyle
.
left
=
pixel
.
x
+
'
px
'
divStyle
.
top
=
pixel
.
y
+
'
px
'
}
Callout
.
prototype
.
destroy
=
function
()
{
this
.
div
.
parentNode
.
removeChild
(
this
.
div
)
this
.
div
=
null
this
.
triangle
=
null
}
Callout
.
prototype
.
setOption
=
function
(
option
)
{
this
.
option
=
option
this
.
setPosition
(
option
.
position
)
if
(
option
.
display
===
'
ALWAYS
'
)
{
this
.
alwaysVisible
=
this
.
visible
=
true
}
else
{
this
.
alwaysVisible
=
false
}
this
.
setStyle
(
option
)
}
Callout
.
prototype
.
setStyle
=
function
(
option
)
{
var
div
=
this
.
div
var
divStyle
=
div
.
style
div
.
innerText
=
option
.
content
divStyle
.
lineHeight
=
(
option
.
fontSize
||
14
)
+
'
px
'
divStyle
.
fontSize
=
(
option
.
fontSize
||
14
)
+
'
px
'
divStyle
.
padding
=
(
option
.
padding
||
8
)
+
'
px
'
divStyle
.
color
=
option
.
color
||
'
#000
'
divStyle
.
borderRadius
=
(
option
.
borderRadius
||
0
)
+
'
px
'
divStyle
.
backgroundColor
=
option
.
bgColor
||
'
#fff
'
divStyle
.
marginTop
=
'
-
'
+
(
option
.
top
+
5
)
+
'
px
'
this
.
triangle
.
style
.
borderColor
=
`
${
option
.
bgColor
||
'
#fff
'
}
transparent transparent`
}
Callout
.
prototype
.
setPosition
=
function
(
position
)
{
this
.
position
=
position
this
.
draw
()
}
callback
()
}
let
script
=
document
.
createElement
(
'
script
'
)
script
.
src
=
`https://map.qq.com/api/js?v=2.exp&key=
${
key
}
&callback=
${
callbackName
}
&libraries=geometry`
document
.
body
.
appendChild
(
script
)
}
}
}
}
...
...
src/platforms/mp-alipay/runtime/wrapper/component-parser.js
浏览文件 @
b614be4d
...
...
@@ -109,7 +109,7 @@ export default function parseComponent (vueComponentOptions) {
}
},
didUnmount
()
{
this
.
$vm
.
$destroy
()
this
.
$vm
&&
this
.
$vm
.
$destroy
()
},
methods
:
{
__r
:
handleRef
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录