Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
anyefeiyu
uni-app
提交
1d08c3c8
U
uni-app
项目概览
anyefeiyu
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1d08c3c8
编写于
11月 23, 2018
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
调整部分代码,方便支持optimize
上级
9063ea96
变更
11
展开全部
显示空白变更内容
内联
并排
Showing
11 changed file
with
233 addition
and
211 deletion
+233
-211
build/webpack.config.js
build/webpack.config.js
+2
-1
build/webpack.config.test.js
build/webpack.config.test.js
+1
-0
lib/h5/main.js
lib/h5/main.js
+5
-3
packages/uni-h5/dist/index.css
packages/uni-h5/dist/index.css
+1
-1
packages/uni-h5/dist/index.umd.min.js
packages/uni-h5/dist/index.umd.min.js
+1
-1
src/core/view/components/index.js
src/core/view/components/index.js
+1
-40
src/core/vue.js
src/core/vue.js
+27
-0
src/platforms/h5/components/index.js
src/platforms/h5/components/index.js
+17
-0
src/platforms/h5/components/system-routes/choose-location/index.vue
...rms/h5/components/system-routes/choose-location/index.vue
+74
-69
src/platforms/h5/components/system-routes/open-location/index.vue
...forms/h5/components/system-routes/open-location/index.vue
+104
-96
src/platforms/h5/components/system-routes/system-header.vue
src/platforms/h5/components/system-routes/system-header.vue
+0
-0
未找到文件。
build/webpack.config.js
浏览文件 @
1d08c3c8
...
...
@@ -28,7 +28,8 @@ module.exports = {
'
uni-shared
'
:
resolve
(
'
src/shared
'
),
'
uni-mixins
'
:
resolve
(
'
src/core/view/mixins
'
),
'
uni-helpers
'
:
resolve
(
'
src/core/helpers
'
),
'
uni-platform
'
:
resolve
(
'
src/platforms/
'
+
process
.
env
.
UNI_PLATFORM
)
'
uni-platform
'
:
resolve
(
'
src/platforms/
'
+
process
.
env
.
UNI_PLATFORM
),
'
uni-components
'
:
resolve
(
'
src/core/view/components
'
)
}
},
module
:
{
...
...
build/webpack.config.test.js
浏览文件 @
1d08c3c8
...
...
@@ -40,6 +40,7 @@ config.plugins = config.plugins.concat([
__PLATFORM__
:
JSON
.
stringify
(
process
.
env
.
UNI_PLATFORM
)
}),
new
webpack
.
ProvidePlugin
({
'
console
'
:
[
resolve
(
'
src/core/helpers/console
'
),
'
default
'
],
'
UniViewJSBridge
'
:
[
resolve
(
'
src/core/view/bridge
'
)],
'
UniServiceJSBridge
'
:
[
resolve
(
'
src/core/service/bridge
'
)]
})
...
...
lib/h5/main.js
浏览文件 @
1d08c3c8
...
...
@@ -34,4 +34,6 @@ Vue.use(require('uni-view/plugins').default, {
routes
:
__uniRoutes
})
require
(
'
uni-view/components
'
)
require
(
'
uni-core/vue
'
)
require
(
'
uni-platform/components
'
)
require
(
'
uni-components
'
)
packages/uni-h5/dist/index.css
浏览文件 @
1d08c3c8
此差异已折叠。
点击以展开。
packages/uni-h5/dist/index.umd.min.js
浏览文件 @
1d08c3c8
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
src/core/view/components/index.js
浏览文件 @
1d08c3c8
import
Vue
from
'
vue
'
// 使用白名单过滤(前期有一批自定义组件使用了 uni-)
import
tags
from
'
uni-helpers/tags
'
import
baseMixin
from
'
uni-mixins/base
'
// const uniRegex = /^uni-/i
// const htmlRegex = /^html:/i
// const svgRegex = /^svg:/i
const
oldIsReservedTag
=
Vue
.
config
.
isReservedTag
Vue
.
config
.
isReservedTag
=
function
(
tag
)
{
return
tags
.
indexOf
(
tag
)
!==
-
1
||
oldIsReservedTag
(
tag
)
}
// Vue.config.parsePlatformTagName = function(tag) {
// return tag.replace(htmlRegex, '').replace(svgRegex, '')
// }
Vue
.
config
.
ignoredElements
=
tags
const
oldGetTagNamespace
=
Vue
.
config
.
getTagNamespace
const
conflictTags
=
[
'
switch
'
,
'
image
'
,
'
text
'
,
'
view
'
]
Vue
.
config
.
getTagNamespace
=
function
(
tag
)
{
if
(
~
conflictTags
.
indexOf
(
tag
))
{
// svg 部分标签名称与 uni 标签冲突
return
false
}
return
oldGetTagNamespace
(
tag
)
||
false
}
Vue
.
config
.
errorHandler
=
function
(
err
,
vm
,
info
)
{
console
.
error
(
'
errorHandler
'
,
err
,
vm
,
info
)
}
const
requireComponents
=
[
// frameworkComponents
/* eslint-disable no-undef */
require
.
context
(
'
../../../platforms/
'
+
__PLATFORM__
+
'
/components
'
,
true
,
/index
\.
vue$/
),
// baseComponents
require
.
context
(
'
./
'
,
true
,
/index
\.
vue$/
),
require
.
context
(
'
../../../platforms/
'
+
__PLATFORM__
+
'
/view/components
'
,
true
,
/index
\.
vue$/
)
...
...
@@ -54,9 +17,7 @@ requireComponents.forEach((components, index) => {
componentConfig
.
mixins
=
componentConfig
.
mixins
?
[].
concat
(
baseMixin
,
componentConfig
.
mixins
)
:
[
baseMixin
]
if
(
index
>
0
)
{
componentConfig
.
name
=
'
VUni
'
+
componentConfig
.
name
}
// 全局注册组件
Vue
.
component
(
componentConfig
.
name
,
componentConfig
)
...
...
src/core/vue.js
0 → 100644
浏览文件 @
1d08c3c8
import
Vue
from
'
vue
'
// 使用白名单过滤(前期有一批自定义组件使用了 uni-)
import
tags
from
'
uni-helpers/tags
'
const
oldIsReservedTag
=
Vue
.
config
.
isReservedTag
Vue
.
config
.
isReservedTag
=
function
(
tag
)
{
return
tags
.
indexOf
(
tag
)
!==
-
1
||
oldIsReservedTag
(
tag
)
}
Vue
.
config
.
ignoredElements
=
tags
const
oldGetTagNamespace
=
Vue
.
config
.
getTagNamespace
const
conflictTags
=
[
'
switch
'
,
'
image
'
,
'
text
'
,
'
view
'
]
Vue
.
config
.
getTagNamespace
=
function
(
tag
)
{
if
(
~
conflictTags
.
indexOf
(
tag
))
{
// svg 部分标签名称与 uni 标签冲突
return
false
}
return
oldGetTagNamespace
(
tag
)
||
false
}
Vue
.
config
.
errorHandler
=
function
(
err
,
vm
,
info
)
{
console
.
error
(
'
errorHandler
'
,
err
,
vm
,
info
)
}
src/platforms/h5/components/index.js
0 → 100644
浏览文件 @
1d08c3c8
import
Vue
from
'
vue
'
import
App
from
'
./app
'
import
Page
from
'
./page
'
import
AsyncError
from
'
./async-error
'
import
AsyncLoading
from
'
./async-loading
'
import
ChooseLocation
from
'
./system-routes/choose-location
'
import
OpenLocation
from
'
./system-routes/open-location
'
import
PreviewImage
from
'
./system-routes/preview-image
'
Vue
.
component
(
App
.
name
,
App
)
Vue
.
component
(
Page
.
name
,
Page
)
Vue
.
component
(
AsyncError
.
name
,
AsyncError
)
Vue
.
component
(
AsyncLoading
.
name
,
AsyncLoading
)
Vue
.
component
(
ChooseLocation
.
name
,
ChooseLocation
)
Vue
.
component
(
OpenLocation
.
name
,
OpenLocation
)
Vue
.
component
(
PreviewImage
.
name
,
PreviewImage
)
src/platforms/h5/components/system-routes/choose-location/index.vue
浏览文件 @
1d08c3c8
...
...
@@ -10,13 +10,18 @@
allow=
"geolocation"
seamless
sandbox=
"allow-scripts allow-same-origin allow-forms"
frameborder=
"0"
/>
frameborder=
"0"
/>
</div>
</div>
</
template
>
<
script
>
import
SystemHeader
from
'
../system-header
'
export
default
{
name
:
'
SystemChooseLocation
'
,
components
:
{
SystemHeader
},
data
()
{
return
{
src
:
''
,
...
...
@@ -53,7 +58,7 @@ export default {
}
</
script
>
<
style
>
.uni-system-choose-location
{
.uni-system-choose-location
{
display
:
block
;
position
:
fixed
;
left
:
0
;
...
...
@@ -61,19 +66,19 @@ export default {
width
:
100%
;
height
:
100%
;
background
:
#f8f8f8
;
}
}
.map-content
{
.map-content
{
position
:
absolute
;
left
:
0
;
top
:
44px
;
width
:
100%
;
bottom
:
0
;
overflow
:
hidden
;
}
}
.map-content
>
iframe
{
.map-content
>
iframe
{
width
:
100%
;
height
:
100%
;
}
}
</
style
>
src/platforms/h5/components/system-routes/open-location/index.vue
浏览文件 @
1d08c3c8
...
...
@@ -8,22 +8,27 @@
allow=
"geolocation"
sandbox=
"allow-scripts allow-same-origin allow-forms"
frameborder=
"0"
@
load=
"_load"
/>
@
load=
"_load"
/>
<!-- 去这里 -->
<div
v-if=
"isPoimarkerSrc"
class=
"actTonav"
@
click=
"_nav"
/>
@
click=
"_nav"
/>
</div>
</div>
</
template
>
<
script
>
import
SystemHeader
from
'
../system-header
'
const
key
=
'
WXTBZ-6WERU-ECCVS-BZJCK-LW5OJ-SIBOS
'
const
referer
=
'
uniapp
'
const
poimarkerSrc
=
'
https://apis.map.qq.com/tools/poimarker
'
export
default
{
name
:
'
SystemOpenLocation
'
,
components
:
{
SystemHeader
},
data
()
{
const
{
latitude
,
...
...
@@ -44,7 +49,8 @@ export default {
},
mounted
()
{
if
(
this
.
latitude
&&
this
.
longitude
)
{
this
.
src
=
`
${
poimarkerSrc
}
?type=0&marker=coord:
${
this
.
latitude
}
,
${
this
.
longitude
}
;title:
${
this
.
name
}
;addr:
${
this
.
address
}
;&key=
${
key
}
&referer=
${
referer
}
`
this
.
src
=
`
${
poimarkerSrc
}
?type=0&marker=coord:
${
this
.
latitude
}
,
${
this
.
longitude
}
;title:
${
this
.
name
}
;addr:
${
this
.
address
}
;&key=
${
key
}
&referer=
${
referer
}
`
}
},
methods
:
{
...
...
@@ -63,14 +69,15 @@ export default {
}
},
_nav
()
{
var
url
=
`https://apis.map.qq.com/uri/v1/routeplan?type=drive&to=
${
encodeURIComponent
(
this
.
name
)}
&tocoord=
${
this
.
latitude
}
,
${
this
.
longitude
}
&referer=
${
referer
}
`
var
url
=
`https://apis.map.qq.com/uri/v1/routeplan?type=drive&to=
${
encodeURIComponent
(
this
.
name
)}
&tocoord=
${
this
.
latitude
}
,
${
this
.
longitude
}
&referer=
${
referer
}
`
this
.
$refs
.
map
.
src
=
url
}
}
}
</
script
>
<
style
>
.uni-system-open-location
{
.uni-system-open-location
{
display
:
block
;
position
:
fixed
;
left
:
0
;
...
...
@@ -78,28 +85,29 @@ export default {
width
:
100%
;
height
:
100%
;
background
:
#f8f8f8
;
}
}
.map-content
{
.map-content
{
position
:
absolute
;
left
:
0
;
top
:
44px
;
width
:
100%
;
bottom
:
0
;
overflow
:
hidden
;
}
}
.map-content
>
iframe
{
.map-content
>
iframe
{
width
:
100%
;
height
:
100%
;
border
:
none
;
}
.actTonav
{
}
.actTonav
{
position
:
absolute
;
right
:
16px
;
bottom
:
56px
;
width
:
60px
;
height
:
60px
;
border-radius
:
60px
;
}
}
</
style
>
src/platforms/h5/components/system-routes/system-header
/index
.vue
→
src/platforms/h5/components/system-routes/system-header.vue
浏览文件 @
1d08c3c8
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录