Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
erosXXX
uni-app
提交
e4d94a97
U
uni-app
项目概览
erosXXX
/
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,发现更多精彩内容 >>
提交
e4d94a97
编写于
12月 11, 2020
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into alpha
上级
d40c57a7
bd9c3666
变更
32
展开全部
隐藏空白更改
内联
并排
Showing
32 changed file
with
294 addition
and
203 deletion
+294
-203
packages/uni-app-plus/template/common/__uniappchooselocation.js
...es/uni-app-plus/template/common/__uniappchooselocation.js
+1
-1
packages/uni-cli-shared/components/unicloud-db.vue
packages/uni-cli-shared/components/unicloud-db.vue
+8
-8
packages/uni-cli-shared/template/common/__uniappchooselocation.js
.../uni-cli-shared/template/common/__uniappchooselocation.js
+1
-1
packages/uni-mp-vue/dist/vue.runtime.esm.js
packages/uni-mp-vue/dist/vue.runtime.esm.js
+9
-5
packages/uni-template-compiler/lib/auto-components.js
packages/uni-template-compiler/lib/auto-components.js
+22
-17
packages/vue-cli-plugin-uni/lib/chain-webpack.js
packages/vue-cli-plugin-uni/lib/chain-webpack.js
+1
-1
packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.common.js
...ugin-uni/packages/h5-vue-router/dist/vue-router.common.js
+6
-4
packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.esm.js
...-plugin-uni/packages/h5-vue-router/dist/vue-router.esm.js
+6
-4
packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.js
...-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.js
+6
-4
packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.min.js
...-plugin-uni/packages/h5-vue-router/dist/vue-router.min.js
+1
-1
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
+1
-1
src/core/service/plugins/app/router-guard.js
src/core/service/plugins/app/router-guard.js
+1
-1
src/core/view/components/picker-view-column/index.vue
src/core/view/components/picker-view-column/index.vue
+9
-0
src/core/view/components/slider/index.vue
src/core/view/components/slider/index.vue
+90
-19
src/platforms/app-plus/service/api/ad/full-screen-video-ad.js
...platforms/app-plus/service/api/ad/full-screen-video-ad.js
+5
-1
src/platforms/app-plus/service/api/ad/rewarded-video-ad.js
src/platforms/app-plus/service/api/ad/rewarded-video-ad.js
+5
-1
src/platforms/app-plus/service/api/device/brightness.js
src/platforms/app-plus/service/api/device/brightness.js
+3
-3
src/platforms/app-plus/service/api/media/preview-image.js
src/platforms/app-plus/service/api/media/preview-image.js
+1
-1
src/platforms/app-plus/service/api/network/upload-file.js
src/platforms/app-plus/service/api/network/upload-file.js
+1
-1
src/platforms/app-plus/service/api/plugin/get-provider.js
src/platforms/app-plus/service/api/plugin/get-provider.js
+2
-2
src/platforms/app-plus/service/api/plugin/oauth.js
src/platforms/app-plus/service/api/plugin/oauth.js
+4
-12
src/platforms/app-plus/service/api/plugin/payment.js
src/platforms/app-plus/service/api/plugin/payment.js
+9
-11
src/platforms/app-plus/service/api/plugin/share.js
src/platforms/app-plus/service/api/plugin/share.js
+64
-93
src/platforms/app-plus/service/api/route/navigate-back.js
src/platforms/app-plus/service/api/route/navigate-back.js
+1
-1
src/platforms/app-plus/service/api/util.js
src/platforms/app-plus/service/api/util.js
+3
-1
src/platforms/app-plus/view/components/ad/index.vue
src/platforms/app-plus/view/components/ad/index.vue
+2
-3
src/platforms/h5/components/app/tabBar.vue
src/platforms/h5/components/app/tabBar.vue
+1
-1
src/platforms/h5/helpers/can-i-use.js
src/platforms/h5/helpers/can-i-use.js
+1
-1
src/platforms/h5/helpers/file.js
src/platforms/h5/helpers/file.js
+10
-0
src/platforms/h5/service/api/network/download-file.js
src/platforms/h5/service/api/network/download-file.js
+15
-1
src/platforms/mp-alipay/runtime/wrapper/page-parser.js
src/platforms/mp-alipay/runtime/wrapper/page-parser.js
+4
-2
src/platforms/mp-alipay/runtime/wrapper/util.js
src/platforms/mp-alipay/runtime/wrapper/util.js
+1
-1
未找到文件。
packages/uni-app-plus/template/common/__uniappchooselocation.js
浏览文件 @
e4d94a97
此差异已折叠。
点击以展开。
packages/uni-cli-shared/components/unicloud-db.vue
浏览文件 @
e4d94a97
...
...
@@ -258,18 +258,18 @@ export default {
}
=
res
.
result
this
.
_isEnded
=
data
.
length
<
this
.
pageSize
callback
&&
callback
(
data
,
this
.
_isEnded
)
this
.
_dispatchEvent
(
events
.
load
,
data
)
const
data2
=
this
.
getone
?
(
data
.
length
?
data
[
0
]
:
undefined
)
:
data
if
(
this
.
getone
)
{
this
.
dataList
=
data
.
length
?
data
[
0
]
:
undefined
}
else
if
(
this
.
pageData
===
pageMode
.
add
)
{
this
.
dataList
.
push
(...
data
)
callback
&&
callback
(
data2
,
this
.
_isEnded
)
this
.
_dispatchEvent
(
events
.
load
,
data2
)
if
(
this
.
pageData
===
pageMode
.
add
)
{
this
.
dataList
.
push
(...
data2
)
if
(
this
.
dataList
.
length
)
{
this
.
paginationInternal
.
current
++
}
}
else
if
(
this
.
pageData
===
pageMode
.
replace
)
{
this
.
dataList
=
data
}
else
{
this
.
dataList
=
data
2
}
if
(
this
.
getcount
)
{
...
...
packages/uni-cli-shared/template/common/__uniappchooselocation.js
浏览文件 @
e4d94a97
此差异已折叠。
点击以展开。
packages/uni-mp-vue/dist/vue.runtime.esm.js
浏览文件 @
e4d94a97
...
...
@@ -1386,7 +1386,7 @@ function resolveAsset(type, name, warnMissing = true) {
if
(
name
===
`_self`
)
{
return
Component
;
}
const
selfName
=
Component
.
displayName
||
Component
.
name
;
const
selfName
=
getComponentName
(
Component
)
;
if
(
selfName
&&
(
selfName
===
name
||
selfName
===
camelize
(
name
)
||
...
...
@@ -2354,6 +2354,7 @@ function applyOptions(instance, options, deferredData = [], deferredWatch = [],
deferredData
.
forEach
(
dataFn
=>
resolveData
(
instance
,
dataFn
,
publicThis
));
}
if
(
dataOptions
)
{
// @ts-ignore dataOptions is not fully type safe
resolveData
(
instance
,
dataOptions
,
publicThis
);
}
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
...
...
@@ -3190,11 +3191,14 @@ function recordInstanceBoundEffect(effect, instance = currentInstance) {
}
const
classifyRE
=
/
(?:
^|
[
-_
])(\w)
/g
;
const
classify
=
(
str
)
=>
str
.
replace
(
classifyRE
,
c
=>
c
.
toUpperCase
()).
replace
(
/
[
-_
]
/g
,
''
);
/* istanbul ignore next */
function
formatComponentName
(
instance
,
Component
,
isRoot
=
false
)
{
let
name
=
isFunction
(
Component
)
function
getComponentName
(
Component
)
{
return
isFunction
(
Component
)
?
Component
.
displayName
||
Component
.
name
:
Component
.
name
;
}
/* istanbul ignore next */
function
formatComponentName
(
instance
,
Component
,
isRoot
=
false
)
{
let
name
=
getComponentName
(
Component
);
if
(
!
name
&&
Component
.
__file
)
{
const
match
=
Component
.
__file
.
match
(
/
([^/\\]
+
)\.\w
+$/
);
if
(
match
)
{
...
...
@@ -3243,7 +3247,7 @@ function defineEmit() {
}
// Core API ------------------------------------------------------------------
const
version
=
"
3.0.
3
"
;
const
version
=
"
3.0.
4
"
;
// import deepCopy from './deepCopy'
/**
...
...
packages/uni-template-compiler/lib/auto-components.js
浏览文件 @
e4d94a97
...
...
@@ -63,23 +63,28 @@ function generateAutoComponentsCode (autoComponents, dynamic = false) {
// 统一转换为驼峰命名
name
=
name
.
replace
(
/-
(\w)
/g
,
(
_
,
str
)
=>
str
.
toUpperCase
())
if
(
dynamic
)
{
components
.
push
(
`'
${
name
}
': function(){return import(/* webpackChunkName: "
${
getWebpackChunkName
(
source
)}
" */'
${
source
}
')}`
)
components
.
push
(
`'
${
name
}
': function(){return import(/* webpackChunkName: "
${
getWebpackChunkName
(
source
)}
" */'
${
source
}
')}`
)
}
else
{
components
.
push
(
`'
${
name
}
': require('
${
source
}
').default`
)
}
})
return
`var components;
try{
components = {
${
components
.
join
(
'
,
'
)}
}
}catch(e){
if(e.message.indexOf('Cannot find module') !== -1 && e.message.indexOf('.vue') !== -1){
console.error(e.message)
console.error('1. 排查组件名称拼写是否正确')
console.error('2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom')
console.error('3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件')
} else {
throw e
}
if
(
process
.
env
.
NODE_ENV
===
'
production
'
)
{
return
`var components = {
${
components
.
join
(
'
,
'
)}
}`
}
return
`var components;
try{
components = {
${
components
.
join
(
'
,
'
)}
}
}catch(e){
if(e.message.indexOf('Cannot find module') !== -1 && e.message.indexOf('.vue') !== -1){
console.error(e.message)
console.error('1. 排查组件名称拼写是否正确')
console.error('2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom')
console.error('3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件')
} else {
throw e
}
}`
}
...
...
@@ -99,9 +104,9 @@ function compileTemplate (source, options, compile) {
}
const
compilerModule
=
{
preTransformNode
(
el
,
options
)
{
if
(
el
.
tag
===
'
match-media
'
&&
process
.
env
.
UNI_PLATFORM
!==
'
mp-weixin
'
)
{
el
.
tag
=
'
uni-match-media
'
preTransformNode
(
el
,
options
)
{
if
(
el
.
tag
===
'
match-media
'
&&
process
.
env
.
UNI_PLATFORM
!==
'
mp-weixin
'
)
{
el
.
tag
=
'
uni-match-media
'
}
if
(
process
.
env
.
UNI_PLATFORM
===
'
quickapp-native
'
)
{
// 排查所有标签
...
...
@@ -115,4 +120,4 @@ const compilerModule = {
module
.
exports
=
{
compileTemplate
,
module
:
compilerModule
}
}
packages/vue-cli-plugin-uni/lib/chain-webpack.js
浏览文件 @
e4d94a97
...
...
@@ -95,7 +95,7 @@ module.exports = function chainWebpack (platformOptions, vueOptions, api) {
const
defines
=
{
'
process.env.UNI_ENV
'
:
JSON
.
stringify
(
process
.
env
.
UNI_PLATFORM
),
'
process.env.UNI_CLOUD_PROVIDER
'
:
process
.
env
.
UNI_CLOUD_PROVIDER
,
'
process.env.
HBX_USER_TOKEN
'
:
JSON
.
stringify
(
process
.
env
.
HBX_USER_TOKEN
||
''
)
,
'
process.env.
UNICLOUD_DEBUG
'
:
process
.
env
.
UNICLOUD_DEBUG
,
'
process.env.UNI_AUTOMATOR_WS_ENDPOINT
'
:
JSON
.
stringify
(
process
.
env
.
UNI_AUTOMATOR_WS_ENDPOINT
)
}
if
(
process
.
env
.
UNI_USING_VUE3
)
{
...
...
packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.common.js
浏览文件 @
e4d94a97
...
...
@@ -2204,8 +2204,9 @@ var HTML5History = (function (History$$1) {
// fixed by xxxxxx
var
id
=
e
.
state
&&
e
.
state
.
id
;
if
(
!
id
)
{
// TODO
id
=
router
.
id
;
// 当手动切换页面时,强制刷新
return
window
.
location
.
reload
()
// id = router.id
}
this
$1
.
transitionTo
({
// fixed by xxxxxx
...
...
@@ -2353,8 +2354,9 @@ var HashHistory = (function (History$$1) {
// fixed by xxxxxx
var
id
=
e
.
state
&&
e
.
state
.
id
;
if
(
!
id
)
{
// TODO
id
=
router
.
id
;
// 当手动切换页面时,强制刷新
return
window
.
location
.
reload
()
// id = router.id
}
this
$1
.
transitionTo
({
...
...
packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.esm.js
浏览文件 @
e4d94a97
...
...
@@ -2202,8 +2202,9 @@ var HTML5History = (function (History$$1) {
// fixed by xxxxxx
var
id
=
e
.
state
&&
e
.
state
.
id
;
if
(
!
id
)
{
// TODO
id
=
router
.
id
;
// 当手动切换页面时,强制刷新
return
window
.
location
.
reload
()
// id = router.id
}
this
$1
.
transitionTo
({
// fixed by xxxxxx
...
...
@@ -2351,8 +2352,9 @@ var HashHistory = (function (History$$1) {
// fixed by xxxxxx
var
id
=
e
.
state
&&
e
.
state
.
id
;
if
(
!
id
)
{
// TODO
id
=
router
.
id
;
// 当手动切换页面时,强制刷新
return
window
.
location
.
reload
()
// id = router.id
}
this
$1
.
transitionTo
({
...
...
packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.js
浏览文件 @
e4d94a97
...
...
@@ -2208,8 +2208,9 @@ var HTML5History = (function (History$$1) {
// fixed by xxxxxx
var
id
=
e
.
state
&&
e
.
state
.
id
;
if
(
!
id
)
{
// TODO
id
=
router
.
id
;
// 当手动切换页面时,强制刷新
return
window
.
location
.
reload
()
// id = router.id
}
this
$1
.
transitionTo
({
// fixed by xxxxxx
...
...
@@ -2357,8 +2358,9 @@ var HashHistory = (function (History$$1) {
// fixed by xxxxxx
var
id
=
e
.
state
&&
e
.
state
.
id
;
if
(
!
id
)
{
// TODO
id
=
router
.
id
;
// 当手动切换页面时,强制刷新
return
window
.
location
.
reload
()
// id = router.id
}
this
$1
.
transitionTo
({
...
...
packages/vue-cli-plugin-uni/packages/h5-vue-router/dist/vue-router.min.js
浏览文件 @
e4d94a97
此差异已折叠。
点击以展开。
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
浏览文件 @
e4d94a97
此差异已折叠。
点击以展开。
src/core/service/plugins/app/router-guard.js
浏览文件 @
e4d94a97
...
...
@@ -81,7 +81,7 @@ function beforeEach (to, from, next, routes) {
if
(
toId
===
fromId
&&
to
.
type
!==
'
reLaunch
'
)
{
// 相同页面阻止
// 处理外部修改 history 导致卡在当前页面的问题
if
(
to
.
fullPath
!==
from
.
fullPath
)
{
remove
KeepAliveInclude
.
call
(
this
,
toName
)
add
KeepAliveInclude
.
call
(
this
,
toName
)
next
()
}
else
{
next
(
false
)
...
...
src/core/view/components/picker-view-column/index.vue
浏览文件 @
e4d94a97
...
...
@@ -95,6 +95,15 @@ export default {
})
initClick
(
this
.
$el
)
initScrollBounce
()
let
$vm
=
this
while
(
$vm
)
{
const
scopeId
=
$vm
.
$options
.
_scopeId
if
(
scopeId
)
{
this
.
$refs
.
indicator
.
setAttribute
(
scopeId
,
''
)
}
$vm
=
$vm
.
$parent
}
},
methods
:
{
_setItemHeight
(
height
)
{
...
...
src/core/view/components/slider/index.vue
浏览文件 @
e4d94a97
...
...
@@ -2,33 +2,33 @@
<uni-slider
ref=
"uni-slider"
v-on=
"$listeners"
@
click=
"_onClick"
@
click=
"_onClick"
>
<div
class=
"uni-slider-wrapper"
>
<div
class=
"uni-slider-tap-area"
>
<div
:style=
"setBgColor"
class=
"uni-slider-handle-wrapper"
class=
"uni-slider-handle-wrapper"
>
<div
ref=
"uni-slider-handle"
:style=
"setBlockBg"
class=
"uni-slider-handle"
class=
"uni-slider-handle"
/>
<div
:style=
"setBlockStyle"
class=
"uni-slider-thumb"
class=
"uni-slider-thumb"
/>
<div
:style=
"setActiveColor"
class=
"uni-slider-track"
class=
"uni-slider-track"
/>
</div>
</div>
<span
v-show=
"showValue"
v-show=
"showValue"
ref=
"uni-slider-value"
class=
"uni-slider-value"
class=
"uni-slider-value"
>
{{
sliderValue
}}
</span>
</div>
<slot
/>
...
...
@@ -40,6 +40,78 @@ import {
listeners
}
from
'
uni-mixins
'
import
touchtrack
from
'
uni-mixins/touchtrack
'
// 处理js计算小数时的精度问题
var
computeController
=
{
add
:
function
(
arg
)
{
var
r1
,
r2
,
m
try
{
// 获得小数位数
r1
=
this
.
toString
().
split
(
'
.
'
)[
1
].
length
}
catch
(
e
)
{
r1
=
0
}
try
{
// 获得小数位数
r2
=
arg
.
toString
().
split
(
'
.
'
)[
1
].
length
}
catch
(
e
)
{
r2
=
0
}
m
=
Math
.
pow
(
10
,
Math
.
max
(
r1
,
r2
))
return
(
this
*
m
+
arg
*
m
)
/
m
},
sub
:
function
(
arg
)
{
return
this
.
add
(
-
arg
)
},
mul
:
function
(
arg
)
{
var
m
=
0
;
var
s1
=
this
.
toString
();
var
s2
=
arg
.
toString
()
try
{
// 获得小数位数
m
+=
s1
.
split
(
'
.
'
)[
1
].
length
}
catch
(
e
)
{
}
try
{
// 获得小数位数
m
+=
s2
.
split
(
'
.
'
)[
1
].
length
}
catch
(
e
)
{
}
// 转为十进制计算后,要除以两个数的共同小数位数
return
Number
(
s1
.
replace
(
'
.
'
,
''
))
*
Number
(
s2
.
replace
(
'
.
'
,
''
))
/
Math
.
pow
(
10
,
m
)
},
div
:
function
(
arg
)
{
var
t1
=
0
;
var
t2
=
0
;
var
r1
;
var
r2
try
{
// 获得小数位数
t1
=
this
.
toString
().
split
(
'
.
'
)[
1
].
length
}
catch
(
e
)
{
}
try
{
// 获得小数位数
t2
=
arg
.
toString
().
split
(
'
.
'
)[
1
].
length
}
catch
(
e
)
{
}
r1
=
Number
(
this
.
toString
().
replace
(
'
.
'
,
''
))
r2
=
Number
(
arg
.
toString
().
replace
(
'
.
'
,
''
))
// 转为十进制计算后,要乘以除数与被除数小数位数的差
return
(
r1
/
r2
)
*
Math
.
pow
(
10
,
t2
-
t1
)
},
mod
:
function
(
arg
)
{
var
t1
=
0
;
var
t2
=
0
;
var
r1
;
var
r2
try
{
t1
=
this
.
toString
().
split
(
'
.
'
)[
1
].
length
}
catch
(
e
)
{
}
try
{
t2
=
arg
.
toString
().
split
(
'
.
'
)[
1
].
length
}
catch
(
e
)
{
}
// 小数位数
var
digit
=
Math
.
pow
(
10
,
Math
.
abs
(
t1
-
t2
))
// eslint-disable-next-line eqeqeq
if
(
digit
==
1
)
{
digit
=
Math
.
pow
(
10
,
t1
)
}
// 计算余数
r1
=
(
this
*
digit
).
toString
().
split
(
'
.
'
)[
0
]
r2
=
arg
*
digit
// 小数点后数字,直接拼接上即可
var
decimals
=
(
this
*
digit
).
toString
().
split
(
'
.
'
)[
1
]
?
(
this
*
digit
).
toString
().
split
(
'
.
'
)[
1
]
:
''
return
(
r1
%
r2
+
decimals
)
/
digit
}
}
export
default
{
name
:
'
Slider
'
,
mixins
:
[
emitter
,
listeners
,
touchtrack
],
...
...
@@ -151,22 +223,21 @@ export default {
})
},
methods
:
{
_onUserChangedValue
(
e
)
{
const
sliderRightBox
=
this
.
$refs
[
'
uni-slider-value
'
]
const
sliderRightBoxLeft
=
getComputedStyle
(
sliderRightBox
,
null
).
marginLeft
let
sliderRightBoxWidth
=
sliderRightBox
.
offsetWidth
sliderRightBoxWidth
=
sliderRightBoxWidth
+
parseInt
(
sliderRightBoxLeft
)
_onUserChangedValue
(
e
)
{
const
sliderRightBox
=
this
.
$refs
[
'
uni-slider-value
'
]
const
sliderRightBoxLeft
=
getComputedStyle
(
sliderRightBox
,
null
).
marginLeft
let
sliderRightBoxWidth
=
sliderRightBox
.
offsetWidth
sliderRightBoxWidth
=
sliderRightBoxWidth
+
parseInt
(
sliderRightBoxLeft
)
const
slider
=
this
.
$refs
[
'
uni-slider
'
]
const
offsetWidth
=
slider
.
offsetWidth
-
(
this
.
showValue
?
sliderRightBoxWidth
:
0
)
const
boxLeft
=
slider
.
getBoundingClientRect
().
left
const
value
=
(
e
.
x
-
boxLeft
)
*
(
this
.
max
-
this
.
min
)
/
offsetWidth
+
Number
(
this
.
min
)
this
.
sliderValue
=
this
.
_filterValue
(
value
)
},
_filterValue
(
e
)
{
const
max
=
Number
(
this
.
max
)
_filterValue
(
e
)
{
const
max
=
Number
(
this
.
max
)
const
min
=
Number
(
this
.
min
)
return
e
<
min
?
min
:
e
>
max
?
max
:
Math
.
round
((
e
-
min
)
/
this
.
step
)
*
this
.
step
+
min
return
e
<
min
?
min
:
e
>
max
?
max
:
computeController
.
mul
.
call
(
Math
.
round
((
e
-
min
)
/
this
.
step
),
this
.
step
)
+
min
},
_getValueWidth
()
{
return
100
*
(
this
.
sliderValue
-
this
.
min
)
/
(
this
.
max
-
this
.
min
)
+
'
%
'
...
...
@@ -180,7 +251,7 @@ export default {
:
'
#e9e9e9
'
)
},
_onTrack
:
function
(
e
)
{
if
(
!
this
.
disabled
)
{
if
(
!
this
.
disabled
)
{
return
e
.
detail
.
state
===
'
move
'
?
(
this
.
_onUserChangedValue
({
x
:
e
.
detail
.
x0
}),
this
.
$trigger
(
'
changing
'
,
e
,
{
...
...
@@ -288,11 +359,11 @@ export default {
z-index
:
1
;
}
uni-slider
.uni-slider-value
{
uni-slider
.uni-slider-value
{
width
:
3ch
;
color
:
#888
;
font-size
:
14px
;
margin-left
:
1em
;
margin-left
:
1em
;
}
uni-slider
.uni-slider-disabled
.uni-slider-track
{
...
...
src/platforms/app-plus/service/api/ad/full-screen-video-ad.js
浏览文件 @
e4d94a97
const
eventNames
=
[
'
load
'
,
'
close
'
,
'
error
'
'
error
'
,
'
adClicked
'
]
class
FullScreenVideoAd
{
...
...
@@ -50,6 +51,9 @@ class FullScreenVideoAd {
this
.
_loadPromiseReject
=
null
}
})
ad
.
onAdClicked
((
e
)
=>
{
this
.
_dispatchEvent
(
'
adClicked
'
,
{})
})
}
load
()
{
...
...
src/platforms/app-plus/service/api/ad/rewarded-video-ad.js
浏览文件 @
e4d94a97
...
...
@@ -2,7 +2,8 @@ const eventNames = [
'
load
'
,
'
close
'
,
'
verify
'
,
'
error
'
'
error
'
,
'
adClicked
'
]
const
ERROR_CODE_LIST
=
[
-
5001
,
-
5002
,
-
5003
,
-
5004
,
-
5005
,
-
5006
]
...
...
@@ -62,6 +63,9 @@ class RewardedVideoAd {
this
.
_loadPromiseReject
=
null
}
})
rewardAd
.
onAdClicked
((
e
)
=>
{
this
.
_dispatchEvent
(
'
adClicked
'
,
{})
})
if
(
this
.
_preload
)
{
this
.
_loadAd
()
...
...
src/platforms/app-plus/service/api/device/brightness.js
浏览文件 @
e4d94a97
export
function
getScreenBrightness
()
{
return
{
errMsg
:
'
getScreenBrightness:ok
'
,
value
:
plus
.
screen
.
getBrightness
()
value
:
plus
.
screen
.
getBrightness
(
false
)
}
}
export
function
setScreenBrightness
({
value
}
=
{})
{
plus
.
screen
.
setBrightness
(
value
)
plus
.
screen
.
setBrightness
(
value
,
false
)
return
{
errMsg
:
'
setScreenBrightness:ok
'
}
...
...
@@ -21,4 +21,4 @@ export function setKeepScreenOn ({
return
{
errMsg
:
'
setKeepScreenOn:ok
'
}
}
}
src/platforms/app-plus/service/api/media/preview-image.js
浏览文件 @
e4d94a97
...
...
@@ -49,7 +49,7 @@ export function previewImagePlus ({
title
:
item
,
color
:
itemColor
})),
cancel
:
'
取消
'
cancel
:
''
}
if
(
title
)
{
options
.
title
=
title
...
...
src/platforms/app-plus/service/api/network/upload-file.js
浏览文件 @
e4d94a97
...
...
@@ -52,7 +52,7 @@ const createUploadTaskById = function (uploadTaskId, {
for
(
const
name
in
header
)
{
if
(
hasOwn
(
header
,
name
))
{
uploader
.
setRequestHeader
(
name
,
header
[
name
]
)
uploader
.
setRequestHeader
(
name
,
String
(
header
[
name
])
)
}
}
for
(
const
name
in
formData
)
{
...
...
src/platforms/app-plus/service/api/plugin/get-provider.js
浏览文件 @
e4d94a97
...
...
@@ -58,7 +58,7 @@ export function getProvider ({
providers
[
service
]((
err
,
provider
)
=>
{
if
(
err
)
{
invoke
(
callbackId
,
{
errMsg
:
'
getProvider:fail
:
'
+
err
.
message
errMsg
:
'
getProvider:fail
'
+
err
.
message
})
}
else
{
invoke
(
callbackId
,
{
...
...
@@ -70,7 +70,7 @@ export function getProvider ({
})
}
else
{
invoke
(
callbackId
,
{
errMsg
:
'
getProvider:fail
:
服务[
'
+
service
+
'
]不支持
'
errMsg
:
'
getProvider:fail
服务[
'
+
service
+
'
]不支持
'
})
}
}
src/platforms/app-plus/service/api/plugin/oauth.js
浏览文件 @
e4d94a97
...
...
@@ -20,6 +20,8 @@ function getService (provider) {
*/
export
function
login
(
params
,
callbackId
)
{
const
provider
=
params
.
provider
||
'
weixin
'
const
errorCallback
=
warpPlusErrorCallback
(
callbackId
,
'
login
'
)
getService
(
provider
).
then
(
service
=>
{
function
login
()
{
service
.
login
(
res
=>
{
...
...
@@ -29,12 +31,7 @@ export function login (params, callbackId) {
authResult
:
authResult
,
errMsg
:
'
login:ok
'
})
},
err
=>
{
invoke
(
callbackId
,
{
code
:
err
.
code
,
errMsg
:
'
login:fail:
'
+
err
.
message
})
},
provider
===
'
apple
'
?
{
scope
:
'
email
'
}
:
params
.
univerifyStyle
||
{})
},
errorCallback
,
provider
===
'
apple
'
?
{
scope
:
'
email
'
}
:
params
.
univerifyStyle
||
{})
}
// 先注销再登录
// apple登录logout之后无法重新触发获取email,fullname;一键登录无logout
...
...
@@ -43,12 +40,7 @@ export function login (params, callbackId) {
}
else
{
service
.
logout
(
login
,
login
)
}
}).
catch
(
err
=>
{
invoke
(
callbackId
,
{
code
:
err
.
code
||
''
,
errMsg
:
'
login:fail:
'
+
err
.
message
})
})
}).
catch
(
errorCallback
)
}
export
function
getUserInfo
(
params
,
callbackId
)
{
...
...
src/platforms/app-plus/service/api/plugin/payment.js
浏览文件 @
e4d94a97
...
...
@@ -2,29 +2,27 @@ import {
invoke
}
from
'
../../bridge
'
import
{
warpPlusErrorCallback
}
from
'
../util
'
export
function
requestPayment
(
params
,
callbackId
)
{
const
provider
=
params
.
provider
const
errorCallback
=
warpPlusErrorCallback
(
callbackId
,
'
requestPayment
'
)
plus
.
payment
.
getChannels
(
services
=>
{
const
service
=
services
.
find
(({
id
})
=>
id
===
provider
)
if
(
!
service
)
{
invoke
(
callbackId
,
{
errMsg
:
'
requestPayment:fail
:
支付服务[
'
+
provider
+
'
]不存在
'
errMsg
:
'
requestPayment:fail
支付服务[
'
+
provider
+
'
]不存在
'
})
}
else
{
plus
.
payment
.
request
(
service
,
params
.
orderInfo
,
res
=>
{
res
.
errMsg
=
'
requestPayment:ok
'
invoke
(
callbackId
,
res
)
},
err
=>
{
invoke
(
callbackId
,
{
errMsg
:
'
requestPayment:fail:
'
+
err
.
message
})
})
},
errorCallback
)
}
},
err
=>
{
invoke
(
callbackId
,
{
errMsg
:
'
requestPayment:fail:
'
+
err
.
message
})
})
},
errorCallback
)
}
src/platforms/app-plus/service/api/plugin/share.js
浏览文件 @
e4d94a97
...
...
@@ -3,7 +3,8 @@ import {
}
from
'
../constants
'
import
{
getRealPath
getRealPath
,
warpPlusErrorCallback
}
from
'
../util
'
import
{
...
...
@@ -82,19 +83,13 @@ const parseParams = (args, callbackId, method) => {
}
const
sendShareMsg
=
function
(
service
,
params
,
callbackId
,
method
=
'
share
'
)
{
service
.
send
(
params
,
()
=>
{
invoke
(
callbackId
,
{
errMsg
:
method
+
'
:ok
'
})
},
err
=>
{
invoke
(
callbackId
,
{
errMsg
:
method
+
'
:fail:
'
+
err
.
message
})
}
)
const
errorCallback
=
warpPlusErrorCallback
(
callbackId
,
method
)
service
.
send
(
params
,
()
=>
{
invoke
(
callbackId
,
{
errMsg
:
method
+
'
:ok
'
})
},
errorCallback
)
}
export
function
shareAppMessageDirectly
({
...
...
@@ -117,37 +112,24 @@ export function shareAppMessageDirectly ({
'
shareAppMessageDirectly
'
)
}
const
errorCallback
=
warpPlusErrorCallback
(
callbackId
,
'
shareAppMessageDirectly
'
)
if
(
useDefaultSnapshot
)
{
const
pages
=
getCurrentPages
()
const
webview
=
plus
.
webview
.
getWebviewById
(
pages
[
pages
.
length
-
1
].
__wxWebviewId__
+
''
)
if
(
webview
)
{
const
bitmap
=
new
plus
.
nativeObj
.
Bitmap
()
webview
.
draw
(
bitmap
,
()
=>
{
const
fileName
=
TEMP_PATH
+
'
/share/snapshot.jpg
'
bitmap
.
save
(
fileName
,
{
overwrite
:
true
,
format
:
'
jpg
'
},
()
=>
{
imageUrl
=
fileName
goShare
()
},
err
=>
{
invoke
(
callbackId
,
{
errMsg
:
'
shareAppMessageDirectly:fail:
'
+
err
.
message
})
}
)
},
err
=>
{
invoke
(
callbackId
,
{
errMsg
:
'
shareAppMessageDirectly:fail:
'
+
err
.
message
})
}
)
webview
.
draw
(
bitmap
,
()
=>
{
const
fileName
=
TEMP_PATH
+
'
/share/snapshot.jpg
'
bitmap
.
save
(
fileName
,
{
overwrite
:
true
,
format
:
'
jpg
'
},
()
=>
{
imageUrl
=
fileName
goShare
()
},
errorCallback
)
},
errorCallback
)
}
else
{
goShare
()
}
...
...
@@ -158,73 +140,62 @@ export function shareAppMessageDirectly ({
export
function
share
(
params
,
callbackId
,
method
=
'
share
'
)
{
params
=
parseParams
(
params
,
callbackId
,
method
)
const
errorCallback
=
warpPlusErrorCallback
(
callbackId
,
method
)
if
(
typeof
params
===
'
string
'
)
{
return
invoke
(
callbackId
,
{
errMsg
:
method
+
'
:fail
:
'
+
params
errMsg
:
method
+
'
:fail
'
+
params
})
}
const
provider
=
params
.
provider
plus
.
share
.
getServices
(
services
=>
{
const
service
=
services
.
find
(({
id
})
=>
id
===
provider
)
if
(
!
service
)
{
invoke
(
callbackId
,
{
errMsg
:
method
+
'
:fail:分享服务[
'
+
provider
+
'
]不存在
'
})
}
else
{
if
(
service
.
authenticated
)
{
sendShareMsg
(
service
,
params
,
callbackId
)
}
else
{
service
.
authorize
(
()
=>
sendShareMsg
(
service
,
params
,
callbackId
),
err
=>
{
invoke
(
callbackId
,
{
errMsg
:
method
+
'
:fail:
'
+
err
.
message
})
}
)
}
}
},
err
=>
{
plus
.
share
.
getServices
(
services
=>
{
const
service
=
services
.
find
(({
id
})
=>
id
===
provider
)
if
(
!
service
)
{
invoke
(
callbackId
,
{
errMsg
:
method
+
'
:fail
:
'
+
err
.
message
errMsg
:
method
+
'
:fail
分享服务[
'
+
provider
+
'
]不存在
'
})
}
else
{
if
(
service
.
authenticated
)
{
sendShareMsg
(
service
,
params
,
callbackId
)
}
else
{
service
.
authorize
(
()
=>
sendShareMsg
(
service
,
params
,
callbackId
),
errorCallback
)
}
}
)
},
errorCallback
)
}
export
function
shareWithSystem
(
params
,
callbackId
,
method
=
'
shareWithSystem
'
)
{
let
{
type
,
imageUrl
,
summary
:
content
,
href
export
function
shareWithSystem
(
params
,
callbackId
,
method
=
'
shareWithSystem
'
)
{
let
{
type
,
imageUrl
,
summary
:
content
,
href
}
=
params
type
=
type
||
'
text
'
const
allowedTypes
=
[
'
text
'
,
'
image
'
]
if
(
allowedTypes
.
indexOf
(
type
)
<
0
)
{
invoke
(
callbackId
,
{
errMsg
:
method
+
'
:fail:分享参数 type 不正确
'
})
}
if
(
typeof
imageUrl
===
'
string
'
&&
imageUrl
)
{
imageUrl
=
getRealPath
(
imageUrl
)
const
allowedTypes
=
[
'
text
'
,
'
image
'
]
const
errorCallback
=
warpPlusErrorCallback
(
callbackId
,
method
)
if
(
allowedTypes
.
indexOf
(
type
)
<
0
)
{
invoke
(
callbackId
,
{
errMsg
:
method
+
'
:fail 分享参数 type 不正确
'
})
}
if
(
typeof
imageUrl
===
'
string
'
&&
imageUrl
)
{
imageUrl
=
getRealPath
(
imageUrl
)
}
plus
.
share
.
sendWithSystem
({
type
,
pictures
:
imageUrl
&&
[
imageUrl
],
content
,
href
plus
.
share
.
sendWithSystem
({
type
,
pictures
:
imageUrl
&&
[
imageUrl
],
content
,
href
},
function
(
res
)
{
invoke
(
callbackId
,
{
errMsg
:
method
+
'
:ok
'
})
},
function
(
err
)
{
invoke
(
callbackId
,
{
errMsg
:
method
+
'
:fail:
'
+
err
.
message
})
})
}
},
errorCallback
)
}
src/platforms/app-plus/service/api/route/navigate-back.js
浏览文件 @
e4d94a97
...
...
@@ -37,7 +37,7 @@ function backWebview (webview, callback) {
// 如果页面有subNvues,切使用了webview组件,则返回时子webview会取错,因此需要做id匹配
const
childWebview
=
children
.
find
(
webview
=>
webview
.
id
.
indexOf
(
WEBVIEW_ID_PREFIX
)
===
0
)
||
children
[
0
]
console
.
log
(
'
backWebview -> childWebview
'
,
childWebview
)
childWebview
.
canBack
(({
canBack
})
=>
{
...
...
src/platforms/app-plus/service/api/util.js
浏览文件 @
e4d94a97
...
...
@@ -190,9 +190,11 @@ export function warpPlusSuccessCallback (callbackId, neme) {
export
function
warpPlusErrorCallback
(
callbackId
,
neme
,
errMsg
)
{
return
function
errorCallback
(
error
)
{
error
=
error
||
{}
const
code
=
error
.
code
||
0
invoke
(
callbackId
,
{
errMsg
:
`
${
neme
}
:fail
${
error
.
message
||
errMsg
||
''
}
`
,
errCode
:
error
.
code
||
0
errCode
:
code
,
code
})
}
}
...
...
src/platforms/app-plus/view/components/ad/index.vue
浏览文件 @
e4d94a97
...
...
@@ -136,9 +136,8 @@ export default {
})
}
})
// 仅 Android 下载类广告
adView
.
setDownloadListener
&&
adView
.
setDownloadListener
((
data
)
=>
{
this
.
$trigger
(
'
downloadchange
'
,
{},
data
)
adView
.
setAdClickedListener
((
data
)
=>
{
this
.
$trigger
(
'
adclicked
'
,
{},
data
)
})
this
.
_request
()
},
...
...
src/platforms/h5/components/app/tabBar.vue
浏览文件 @
e4d94a97
...
...
@@ -220,7 +220,7 @@ import getRealPath from 'uni-platform/helpers/get-real-path'
import
{
isPlainObject
}
from
'
uni-shared
'
import
{
publish
}
from
'
uni-platform/service/bridge
'
function
cssSupports
(
css
)
{
return
window
.
CSS
&&
CSS
.
supports
&&
(
CSS
.
supports
(
css
)
||
CSS
.
supports
.
apply
(
undefined
,
css
.
split
(
'
:
'
)))
return
window
.
CSS
&&
CSS
.
supports
&&
(
CSS
.
supports
(
css
)
||
CSS
.
supports
.
apply
(
CSS
,
css
.
split
(
'
:
'
)))
}
export
default
{
name
:
'
TabBar
'
,
...
...
src/platforms/h5/helpers/can-i-use.js
浏览文件 @
e4d94a97
function
cssSupports
(
css
)
{
return
window
.
CSS
&&
CSS
.
supports
&&
(
CSS
.
supports
(
css
)
||
CSS
.
supports
.
apply
(
undefined
,
css
.
split
(
'
:
'
)))
return
window
.
CSS
&&
CSS
.
supports
&&
(
CSS
.
supports
(
css
)
||
CSS
.
supports
.
apply
(
CSS
,
css
.
split
(
'
:
'
)))
}
export
default
{
...
...
src/platforms/h5/helpers/file.js
浏览文件 @
e4d94a97
...
...
@@ -55,6 +55,16 @@ function getExtname (type) {
const
extname
=
type
.
split
(
'
/
'
)[
1
]
return
extname
?
`.
${
extname
}
`
:
''
}
/**
* 简易获取文件名
* @param {*} url
*/
export
function
getFileName
(
url
)
{
url
=
url
.
split
(
'
#
'
)[
0
].
split
(
'
?
'
)[
0
]
const
array
=
url
.
split
(
'
/
'
)
return
array
[
array
.
length
-
1
]
}
/**
* blob转File
* @param {Blob} blob
...
...
src/platforms/h5/service/api/network/download-file.js
浏览文件 @
e4d94a97
import
{
fileToUrl
}
from
'
uni-platform/helpers/file
'
import
{
fileToUrl
,
getFileName
}
from
'
uni-platform/helpers/file
'
/**
* 下载任务
*/
...
...
@@ -63,6 +66,17 @@ export function downloadFile ({
clearTimeout
(
timer
)
const
statusCode
=
xhr
.
status
const
blob
=
this
.
response
let
filename
// 使用 getResponseHeader 跨域时会出现警告,但相比 getAllResponseHeaders 更方便
const
contentDisposition
=
xhr
.
getResponseHeader
(
'
content-disposition
'
)
if
(
contentDisposition
)
{
// 暂时仅解析 filename 不解析 filename*
const
res
=
contentDisposition
.
match
(
/filename="
?(\S
+
)
"
?\b
/
)
if
(
res
)
{
filename
=
res
[
1
]
}
}
blob
.
name
=
filename
||
getFileName
(
url
)
invoke
(
callbackId
,
{
errMsg
:
'
downloadFile:ok
'
,
statusCode
,
...
...
src/platforms/mp-alipay/runtime/wrapper/page-parser.js
浏览文件 @
e4d94a97
...
...
@@ -17,6 +17,7 @@ import {
handleRef
,
handleLink
,
initBehavior
,
triggerEvent
,
initChildVues
,
initSpecialMethods
}
from
'
./util
'
...
...
@@ -85,7 +86,8 @@ export default function parsePage (vuePageOptions) {
},
__r
:
handleRef
,
__e
:
handleEvent
,
__l
:
handleLink
__l
:
handleLink
,
triggerEvent
}
initHooks
(
pageOptions
,
hooks
,
vuePageOptions
)
...
...
@@ -99,4 +101,4 @@ export default function parsePage (vuePageOptions) {
}
return
pageOptions
}
}
src/platforms/mp-alipay/runtime/wrapper/util.js
浏览文件 @
e4d94a97
...
...
@@ -122,7 +122,7 @@ export function handleRef (ref) {
}
export
function
triggerEvent
(
type
,
detail
,
options
)
{
const
handler
=
this
.
props
[
customize
(
'
on-
'
+
type
)]
const
handler
=
this
.
props
&&
this
.
props
[
customize
(
'
on-
'
+
type
)]
if
(
!
handler
)
{
return
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录