Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
1eee2d6b
U
uni-app
项目概览
DCloud
/
uni-app
3 个月 前同步成功
通知
720
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,发现更多精彩内容 >>
提交
1eee2d6b
编写于
9月 20, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://github.com/dcloudio/uni-app
into alpha
上级
e08ab898
a7d02107
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
115 addition
and
56 deletion
+115
-56
packages/uni-app-plus-nvue/dist/index.js
packages/uni-app-plus-nvue/dist/index.js
+6
-2
packages/uni-mp-toutiao/dist/index.js
packages/uni-mp-toutiao/dist/index.js
+37
-13
packages/uni-stat/dist/index.js
packages/uni-stat/dist/index.js
+9
-4
packages/uni-stat/src/index.js
packages/uni-stat/src/index.js
+9
-4
packages/vue-cli-plugin-uni/commands/info.js
packages/vue-cli-plugin-uni/commands/info.js
+2
-1
packages/vue-cli-plugin-uni/lib/check-update.js
packages/vue-cli-plugin-uni/lib/check-update.js
+2
-2
src/core/helpers/protocol/network/request.js
src/core/helpers/protocol/network/request.js
+7
-3
src/platforms/h5/components/page/pageHead.vue
src/platforms/h5/components/page/pageHead.vue
+1
-1
src/platforms/h5/components/page/transparent.js
src/platforms/h5/components/page/transparent.js
+4
-5
src/platforms/h5/service/api/network/request.js
src/platforms/h5/service/api/network/request.js
+0
-7
src/platforms/mp-toutiao/runtime/wrapper/util.js
src/platforms/mp-toutiao/runtime/wrapper/util.js
+38
-14
未找到文件。
packages/uni-app-plus-nvue/dist/index.js
浏览文件 @
1eee2d6b
...
...
@@ -2647,8 +2647,12 @@ var serviceContext = (function () {
header
:
{
type
:
Object
,
validator
(
value
,
params
)
{
params
.
header
=
value
||
{};
params
.
header
[
'
content-type
'
]
=
params
.
header
[
'
content-type
'
]
||
'
application/json
'
;
const
header
=
params
.
header
=
value
||
{};
if
(
params
.
method
!==
method
.
GET
)
{
if
(
!
Object
.
keys
(
header
).
find
(
key
=>
key
.
toLowerCase
()
===
'
content-type
'
))
{
header
[
'
Content-Type
'
]
=
'
application/json
'
;
}
}
}
},
dataType
:
{
...
...
packages/uni-mp-toutiao/dist/index.js
浏览文件 @
1eee2d6b
...
...
@@ -1376,21 +1376,45 @@ function isPage () {
function
initRefs
(
vm
)
{
const
mpInstance
=
vm
.
$scope
;
mpInstance
.
selectAllComponents
(
'
.vue-ref
'
,
(
components
)
=>
{
components
.
forEach
(
component
=>
{
const
ref
=
component
.
dataset
.
ref
;
vm
.
$refs
[
ref
]
=
component
.
$vm
||
component
;
});
});
mpInstance
.
selectAllComponents
(
'
.vue-ref-in-for
'
,
(
forComponents
)
=>
{
forComponents
.
forEach
(
component
=>
{
const
ref
=
component
.
dataset
.
ref
;
if
(
!
vm
.
$refs
[
ref
])
{
vm
.
$refs
[
ref
]
=
[];
/* eslint-disable no-undef */
const
minorVersion
=
parseInt
(
tt
.
getSystemInfoSync
().
SDKVersion
.
split
(
'
.
'
)[
1
]);
if
(
minorVersion
>
16
)
{
Object
.
defineProperty
(
vm
,
'
$refs
'
,
{
get
()
{
const
$refs
=
{};
const
components
=
mpInstance
.
selectAllComponents
(
'
.vue-ref
'
);
components
.
forEach
(
component
=>
{
const
ref
=
component
.
dataset
.
ref
;
$refs
[
ref
]
=
component
.
$vm
||
component
;
});
const
forComponents
=
mpInstance
.
selectAllComponents
(
'
.vue-ref-in-for
'
);
forComponents
.
forEach
(
component
=>
{
const
ref
=
component
.
dataset
.
ref
;
if
(
!
$refs
[
ref
])
{
$refs
[
ref
]
=
[];
}
$refs
[
ref
].
push
(
component
.
$vm
||
component
);
});
return
$refs
}
vm
.
$refs
[
ref
].
push
(
component
.
$vm
||
component
);
});
});
}
else
{
mpInstance
.
selectAllComponents
(
'
.vue-ref
'
,
(
components
)
=>
{
components
.
forEach
(
component
=>
{
const
ref
=
component
.
dataset
.
ref
;
vm
.
$refs
[
ref
]
=
component
.
$vm
||
component
;
});
});
mpInstance
.
selectAllComponents
(
'
.vue-ref-in-for
'
,
(
forComponents
)
=>
{
forComponents
.
forEach
(
component
=>
{
const
ref
=
component
.
dataset
.
ref
;
if
(
!
vm
.
$refs
[
ref
])
{
vm
.
$refs
[
ref
]
=
[];
}
vm
.
$refs
[
ref
].
push
(
component
.
$vm
||
component
);
});
});
}
}
const
instances
=
Object
.
create
(
null
);
...
...
packages/uni-stat/dist/index.js
浏览文件 @
1eee2d6b
...
...
@@ -836,7 +836,15 @@ const lifecycle = {
stat
.
ready
(
this
);
},
onLoad
(
options
)
{
stat
.
load
(
options
,
this
);
stat
.
load
(
options
,
this
);
// 重写分享,获取分享上报事件
if
(
this
.
$scope
&&
this
.
$scope
.
onShareAppMessage
)
{
let
oldShareAppMessage
=
this
.
$scope
.
onShareAppMessage
;
this
.
$scope
.
onShareAppMessage
=
function
(
options
)
{
stat
.
interceptShare
(
false
);
return
oldShareAppMessage
.
call
(
this
,
options
)
};
}
},
onShow
()
{
isHide
=
false
;
...
...
@@ -855,9 +863,6 @@ const lifecycle = {
},
onError
(
e
)
{
stat
.
error
(
e
);
},
onShareAppMessage
()
{
stat
.
interceptShare
(
false
);
}
};
...
...
packages/uni-stat/src/index.js
浏览文件 @
1eee2d6b
...
...
@@ -9,7 +9,15 @@ const lifecycle = {
stat
.
ready
(
this
);
},
onLoad
(
options
)
{
stat
.
load
(
options
,
this
);
stat
.
load
(
options
,
this
);
// 重写分享,获取分享上报事件
if
(
this
.
$scope
&&
this
.
$scope
.
onShareAppMessage
)
{
let
oldShareAppMessage
=
this
.
$scope
.
onShareAppMessage
;
this
.
$scope
.
onShareAppMessage
=
function
(
options
)
{
stat
.
interceptShare
(
false
);
return
oldShareAppMessage
.
call
(
this
,
options
)
}
}
},
onShow
()
{
isHide
=
false
...
...
@@ -28,9 +36,6 @@ const lifecycle = {
},
onError
(
e
)
{
stat
.
error
(
e
)
},
onShareAppMessage
()
{
stat
.
interceptShare
(
false
)
}
}
...
...
packages/vue-cli-plugin-uni/commands/info.js
浏览文件 @
1eee2d6b
console
.
log
(
'
uni-app v
'
+
require
(
'
../package.json
'
).
version
)
console
.
log
(
'
uni-app v
'
+
require
(
'
@dcloudio/webpack-uni-pages-loader/package.json
'
)[
'
uni-app
'
][
'
compilerVersion
'
])
console
.
log
(
'
uni-app cli v
'
+
require
(
'
../package.json
'
).
version
)
console
.
log
(
require
(
'
chalk
'
).
bold
(
'
\n
Environment Info:
'
))
require
(
'
envinfo
'
).
run
({
System
:
[
'
OS
'
,
'
CPU
'
],
...
...
packages/vue-cli-plugin-uni/lib/check-update.js
浏览文件 @
1eee2d6b
...
...
@@ -23,12 +23,12 @@ module.exports = async function checkUpdate () {
if
(
update
)
{
if
(
pkg
.
version
.
split
(
'
.
'
)[
0
]
!==
update
.
latest
.
split
(
'
.
'
)[
0
])
{
console
.
log
(
`发现 uni-app 新版本
${
update
.
latest
}
`
)
console
.
log
(
`发现 uni-app
cli
新版本
${
update
.
latest
}
`
)
console
.
log
(
`1.修改 package.json 中 @dcloudio 相关包版本为 ^
${
update
.
latest
}
`
)
console
.
log
(
'
2.删除 package-lock.json 或 yarn.lock
'
)
console
.
log
(
'
3.执行 npm install 或 yarn
'
)
}
else
{
console
.
log
(
`发现 uni-app 新版本
${
update
.
latest
}
. 请执行 npm update 升级`
)
console
.
log
(
`发现 uni-app
cli
新版本
${
update
.
latest
}
. 请执行 npm update 升级`
)
}
}
}
src/core/helpers/protocol/network/request.js
浏览文件 @
1eee2d6b
...
...
@@ -77,8 +77,12 @@ export const request = {
header
:
{
type
:
Object
,
validator
(
value
,
params
)
{
params
.
header
=
value
||
{}
params
.
header
[
'
content-type
'
]
=
params
.
header
[
'
content-type
'
]
||
'
application/json
'
const
header
=
params
.
header
=
value
||
{}
if
(
params
.
method
!==
method
.
GET
)
{
if
(
!
Object
.
keys
(
header
).
find
(
key
=>
key
.
toLowerCase
()
===
'
content-type
'
))
{
header
[
'
Content-Type
'
]
=
'
application/json
'
}
}
}
},
dataType
:
{
...
...
@@ -94,4 +98,4 @@ export const request = {
params
.
responseType
=
Object
.
values
(
responseType
).
indexOf
(
value
)
<
0
?
responseType
.
TEXT
:
value
}
}
}
}
src/platforms/h5/components/page/pageHead.vue
浏览文件 @
1eee2d6b
...
...
@@ -36,7 +36,7 @@
v-if=
"!searchInput"
class=
"uni-page-head-bd"
>
<div
:style=
"{fontSize:titleSize}"
:style=
"{fontSize:titleSize
,opacity:type==='transparent'?0:1
}"
class=
"uni-page-head__title"
>
<i
...
...
src/platforms/h5/components/page/transparent.js
浏览文件 @
1eee2d6b
...
...
@@ -6,7 +6,7 @@ export default {
mounted
()
{
if
(
this
.
type
===
'
transparent
'
)
{
const
transparentElemStyle
=
this
.
$el
.
querySelector
(
'
.uni-page-head-transparent
'
).
style
//
const titleElem = this.$el.querySelector('.uni-page-head__title')
const
titleElem
=
this
.
$el
.
querySelector
(
'
.uni-page-head__title
'
)
const
iconElems
=
this
.
$el
.
querySelectorAll
(
'
.uni-btn-icon
'
)
const
iconElemsStyles
=
[]
const
textColor
=
this
.
textColor
...
...
@@ -40,10 +40,9 @@ export default {
}
this
.
_A
=
alpha
// TODO 暂时仅处理背景色
// 对齐支付宝小程序,标题不透明渐变
// if (titleElem) {
// titleElem.style.opacity = alpha
// }
if
(
titleElem
)
{
titleElem
.
style
.
opacity
=
alpha
}
transparentElemStyle
.
backgroundColor
=
`rgba(
${
this
.
_R
}
,
${
this
.
_G
}
,
${
this
.
_B
}
,
${
alpha
}
)`
borderRadiusElemsStyles
.
forEach
(
function
(
borderRadiusElemStyle
,
index
)
{
let
oldColor
=
oldColors
[
index
]
...
...
src/platforms/h5/service/api/network/request.js
浏览文件 @
1eee2d6b
...
...
@@ -70,13 +70,6 @@ export function request ({
}
}
if
(
method
!==
'
GET
'
)
{
if
(
!
contentType
)
{
/**
* 跨域时部分服务器OPTION响应头Access-Control-Allow-Headers未包含Content-Type会请求失败
*/
header
[
'
Content-Type
'
]
=
'
application/json
'
contentType
=
'
json
'
}
if
(
typeof
data
===
'
string
'
||
data
instanceof
ArrayBuffer
)
{
body
=
data
}
else
{
...
...
src/platforms/mp-toutiao/runtime/wrapper/util.js
浏览文件 @
1eee2d6b
...
...
@@ -10,21 +10,45 @@ export function isPage () {
export
function
initRefs
(
vm
)
{
const
mpInstance
=
vm
.
$scope
mpInstance
.
selectAllComponents
(
'
.vue-ref
'
,
(
components
)
=>
{
components
.
forEach
(
component
=>
{
const
ref
=
component
.
dataset
.
ref
vm
.
$refs
[
ref
]
=
component
.
$vm
||
component
})
})
mpInstance
.
selectAllComponents
(
'
.vue-ref-in-for
'
,
(
forComponents
)
=>
{
forComponents
.
forEach
(
component
=>
{
const
ref
=
component
.
dataset
.
ref
if
(
!
vm
.
$refs
[
ref
])
{
vm
.
$refs
[
ref
]
=
[]
/* eslint-disable no-undef */
const
minorVersion
=
parseInt
(
tt
.
getSystemInfoSync
().
SDKVersion
.
split
(
'
.
'
)[
1
])
if
(
minorVersion
>
16
)
{
Object
.
defineProperty
(
vm
,
'
$refs
'
,
{
get
()
{
const
$refs
=
{}
const
components
=
mpInstance
.
selectAllComponents
(
'
.vue-ref
'
)
components
.
forEach
(
component
=>
{
const
ref
=
component
.
dataset
.
ref
$refs
[
ref
]
=
component
.
$vm
||
component
})
const
forComponents
=
mpInstance
.
selectAllComponents
(
'
.vue-ref-in-for
'
)
forComponents
.
forEach
(
component
=>
{
const
ref
=
component
.
dataset
.
ref
if
(
!
$refs
[
ref
])
{
$refs
[
ref
]
=
[]
}
$refs
[
ref
].
push
(
component
.
$vm
||
component
)
})
return
$refs
}
vm
.
$refs
[
ref
].
push
(
component
.
$vm
||
component
)
})
})
}
else
{
mpInstance
.
selectAllComponents
(
'
.vue-ref
'
,
(
components
)
=>
{
components
.
forEach
(
component
=>
{
const
ref
=
component
.
dataset
.
ref
vm
.
$refs
[
ref
]
=
component
.
$vm
||
component
})
})
mpInstance
.
selectAllComponents
(
'
.vue-ref-in-for
'
,
(
forComponents
)
=>
{
forComponents
.
forEach
(
component
=>
{
const
ref
=
component
.
dataset
.
ref
if
(
!
vm
.
$refs
[
ref
])
{
vm
.
$refs
[
ref
]
=
[]
}
vm
.
$refs
[
ref
].
push
(
component
.
$vm
||
component
)
})
})
}
}
const
instances
=
Object
.
create
(
null
)
...
...
@@ -77,4 +101,4 @@ export function handleLink ({
vm
.
_isMounted
=
true
vm
.
__call_hook
(
'
mounted
'
)
vm
.
__call_hook
(
'
onReady
'
)
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录