Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
9c77d5a2
U
uni-app
项目概览
DCloud
/
uni-app
2 个月 前同步成功
通知
717
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,发现更多精彩内容 >>
提交
9c77d5a2
编写于
7月 23, 2021
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into alpha
上级
52947b84
35673b2d
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
133 addition
and
100 deletion
+133
-100
lib/apis.js
lib/apis.js
+3
-2
packages/uni-cli-shared/components/unicloud-db.vue
packages/uni-cli-shared/components/unicloud-db.vue
+5
-5
packages/uni-h5/dist/index.css
packages/uni-h5/dist/index.css
+1
-1
packages/uni-template-compiler/lib/mp.js
packages/uni-template-compiler/lib/mp.js
+10
-2
packages/vue-cli-plugin-uni/index.js
packages/vue-cli-plugin-uni/index.js
+5
-3
src/core/helpers/interceptor.js
src/core/helpers/interceptor.js
+19
-15
src/core/service/api/base/interceptor.js
src/core/service/api/base/interceptor.js
+1
-1
src/platforms/app-plus/service/api/media/choose-video.js
src/platforms/app-plus/service/api/media/choose-video.js
+2
-2
src/platforms/h5/components/page/pageHead.vue
src/platforms/h5/components/page/pageHead.vue
+85
-67
src/platforms/mp-weixin/runtime/wrapper/fix-set-data.js
src/platforms/mp-weixin/runtime/wrapper/fix-set-data.js
+2
-2
未找到文件。
lib/apis.js
浏览文件 @
9c77d5a2
...
@@ -2,7 +2,8 @@ const base = [
...
@@ -2,7 +2,8 @@ const base = [
'
base64ToArrayBuffer
'
,
'
base64ToArrayBuffer
'
,
'
arrayBufferToBase64
'
,
'
arrayBufferToBase64
'
,
'
addInterceptor
'
,
'
addInterceptor
'
,
'
removeInterceptor
'
'
removeInterceptor
'
,
'
interceptors
'
]
]
const
network
=
[
const
network
=
[
...
@@ -242,7 +243,7 @@ const third = [
...
@@ -242,7 +243,7 @@ const third = [
const
ad
=
[
const
ad
=
[
'
createRewardedVideoAd
'
,
'
createRewardedVideoAd
'
,
'
createFullScreenVideoAd
'
,
'
createFullScreenVideoAd
'
,
'
createInterstitialAd
'
,
'
createInterstitialAd
'
,
'
createInteractiveAd
'
'
createInteractiveAd
'
]
]
...
...
packages/uni-cli-shared/components/unicloud-db.vue
浏览文件 @
9c77d5a2
...
@@ -410,7 +410,7 @@ export default {
...
@@ -410,7 +410,7 @@ export default {
complete
&&
complete
()
complete
&&
complete
()
})
})
},
},
getTemp
(
isTemp
=
true
)
{
getTemp
(
isTemp
=
true
)
{
/* eslint-disable no-undef */
/* eslint-disable no-undef */
let
db
=
uniCloud
.
database
()
let
db
=
uniCloud
.
database
()
...
@@ -471,7 +471,7 @@ export default {
...
@@ -471,7 +471,7 @@ export default {
return
db
return
db
},
},
setResult
(
result
)
{
setResult
(
result
)
{
if
(
result
.
code
===
0
)
{
if
(
result
.
code
===
0
)
{
this
.
_execLoadDataSuccess
(
result
)
this
.
_execLoadDataSuccess
(
result
)
}
else
{
}
else
{
...
@@ -505,12 +505,12 @@ export default {
...
@@ -505,12 +505,12 @@ export default {
this
.
_execLoadDataFail
(
err
,
callback
)
this
.
_execLoadDataFail
(
err
,
callback
)
})
})
},
},
_execLoadDataSuccess
(
result
,
callback
,
clear
)
{
_execLoadDataSuccess
(
result
,
callback
,
clear
)
{
const
{
const
{
data
,
data
,
count
count
}
=
result
}
=
result
this
.
_isEnded
=
data
.
length
<
this
.
pageSize
this
.
_isEnded
=
count
!=
undefined
?
(
this
.
paginationInternal
.
current
*
this
.
paginationInternal
.
size
>=
count
)
:
(
data
.
length
<
this
.
pageSize
)
this
.
hasMore
=
!
this
.
_isEnded
this
.
hasMore
=
!
this
.
_isEnded
const
data2
=
this
.
getone
?
(
data
.
length
?
data
[
0
]
:
undefined
)
:
data
const
data2
=
this
.
getone
?
(
data
.
length
?
data
[
0
]
:
undefined
)
:
data
...
@@ -532,7 +532,7 @@ export default {
...
@@ -532,7 +532,7 @@ export default {
}
}
}
}
},
},
_execLoadDataFail
(
err
,
callback
)
{
_execLoadDataFail
(
err
,
callback
)
{
this
.
errorMessage
=
err
this
.
errorMessage
=
err
callback
&&
callback
()
callback
&&
callback
()
this
.
$emit
(
events
.
error
,
err
)
this
.
$emit
(
events
.
error
,
err
)
...
...
packages/uni-h5/dist/index.css
浏览文件 @
9c77d5a2
此差异已折叠。
点击以展开。
packages/uni-template-compiler/lib/mp.js
浏览文件 @
9c77d5a2
...
@@ -49,12 +49,20 @@ const tags = {
...
@@ -49,12 +49,20 @@ const tags = {
'
video
'
,
'
video
'
,
'
view
'
,
'
view
'
,
'
web-view
'
,
'
web-view
'
,
'
editor
'
,
'
editor
'
],
],
// 支付宝小程序平台独有组件
// 支付宝小程序平台独有组件
'
mp-alipay
'
:
[
'
mp-alipay
'
:
[
'
lifestyle
'
,
'
lifestyle
'
,
'
life-follow
'
'
life-follow
'
,
'
contact-button
'
,
'
spread
'
,
'
error-view
'
,
'
poster
'
,
'
cashier
'
,
'
ix-grid
'
,
'
ix-native-grid
'
,
'
ix-native-list
'
]
]
}
}
...
...
packages/vue-cli-plugin-uni/index.js
浏览文件 @
9c77d5a2
...
@@ -83,7 +83,9 @@ module.exports = (api, options) => {
...
@@ -83,7 +83,9 @@ module.exports = (api, options) => {
})
})
}
}
const
args
=
require
(
'
minimist
'
)(
process
.
argv
.
slice
(
2
))
module
.
exports
.
defaultModes
=
{
module
.
exports
.
defaultModes
=
{
'
uni-serve
'
:
'
development
'
,
'
uni-serve
'
:
args
.
mode
||
'
development
'
,
'
uni-build
'
:
process
.
env
.
NODE_ENV
'
uni-build
'
:
args
.
mode
||
process
.
env
.
NODE_ENV
}
}
src/core/helpers/interceptor.js
浏览文件 @
9c77d5a2
...
@@ -105,7 +105,7 @@ function queue (hooks, data) {
...
@@ -105,7 +105,7 @@ function queue (hooks, data) {
}
}
if
(
res
===
false
)
{
if
(
res
===
false
)
{
return
{
return
{
then
()
{}
then
()
{
}
}
}
}
}
}
}
...
@@ -153,15 +153,15 @@ function getApiInterceptorHooks (method) {
...
@@ -153,15 +153,15 @@ function getApiInterceptorHooks (method) {
if
(
hook
!==
'
returnValue
'
)
{
if
(
hook
!==
'
returnValue
'
)
{
interceptor
[
hook
]
=
globalInterceptors
[
hook
].
slice
()
interceptor
[
hook
]
=
globalInterceptors
[
hook
].
slice
()
}
}
})
})
const
scopedInterceptor
=
scopedInterceptors
[
method
]
const
scopedInterceptor
=
scopedInterceptors
[
method
]
if
(
scopedInterceptor
)
{
if
(
scopedInterceptor
)
{
Object
.
keys
(
scopedInterceptor
).
forEach
(
hook
=>
{
Object
.
keys
(
scopedInterceptor
).
forEach
(
hook
=>
{
if
(
hook
!==
'
returnValue
'
)
{
if
(
hook
!==
'
returnValue
'
)
{
interceptor
[
hook
]
=
(
interceptor
[
hook
]
||
[]).
concat
(
scopedInterceptor
[
hook
])
interceptor
[
hook
]
=
(
interceptor
[
hook
]
||
[]).
concat
(
scopedInterceptor
[
hook
])
}
}
})
})
}
}
return
interceptor
return
interceptor
}
}
...
@@ -185,10 +185,14 @@ export const promiseInterceptor = {
...
@@ -185,10 +185,14 @@ export const promiseInterceptor = {
if
(
!
isPromise
(
res
))
{
if
(
!
isPromise
(
res
))
{
return
res
return
res
}
}
return
res
.
then
(
res
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
res
[
1
]
res
.
then
(
res
=>
{
}).
catch
(
res
=>
{
if
(
res
[
0
])
{
return
res
[
0
]
reject
(
res
[
0
])
}
else
{
resolve
(
res
[
1
])
}
})
})
})
}
}
}
}
src/core/service/api/base/interceptor.js
浏览文件 @
9c77d5a2
...
@@ -10,4 +10,4 @@ export {
...
@@ -10,4 +10,4 @@ export {
export
const
interceptors
=
{
export
const
interceptors
=
{
promiseInterceptor
promiseInterceptor
}
}
src/platforms/app-plus/service/api/media/choose-video.js
浏览文件 @
9c77d5a2
...
@@ -24,11 +24,11 @@ export function chooseVideo ({
...
@@ -24,11 +24,11 @@ export function chooseVideo ({
const
errorCallback
=
warpPlusErrorCallback
(
callbackId
,
'
chooseVideo
'
,
'
cancel
'
)
const
errorCallback
=
warpPlusErrorCallback
(
callbackId
,
'
chooseVideo
'
,
'
cancel
'
)
function
successCallback
(
tempFilePath
=
''
)
{
function
successCallback
(
tempFilePath
=
''
)
{
const
dst
=
`
${
TEMP_PATH
}
/compressed/
${
Date
.
now
()}
_
${
getFileName
(
tempFilePath
)}
`
const
filename
=
`
${
TEMP_PATH
}
/compressed/
${
Date
.
now
()}
_
${
getFileName
(
tempFilePath
)}
`
const
compressVideo
=
compressed
?
new
Promise
((
resolve
)
=>
{
const
compressVideo
=
compressed
?
new
Promise
((
resolve
)
=>
{
plus
.
zip
.
compressVideo
({
plus
.
zip
.
compressVideo
({
src
:
tempFilePath
,
src
:
tempFilePath
,
dst
filename
},
({
tempFilePath
})
=>
{
},
({
tempFilePath
})
=>
{
resolve
(
tempFilePath
)
resolve
(
tempFilePath
)
},
()
=>
{
},
()
=>
{
...
...
src/platforms/h5/components/page/pageHead.vue
浏览文件 @
9c77d5a2
<
template
>
<
template
>
<uni-page-head
:uni-page-head-type=
"type"
>
<uni-page-head
:uni-page-head-type=
"type"
>
<div
<div
:style=
"
{transitionDuration:duration,transitionTimingFunction:timingFunc,backgroundColor:bgColor,color:textColor}"
:style=
"
{transitionDuration:duration,transitionTimingFunction:timingFunc,backgroundColor:bgColor,color:textColor}"
:class="headClass"
:class="headClass"
class="uni-page-head"
class="uni-page-head"
>
>
<div
class=
"uni-page-head-hd"
>
<div
class=
"uni-page-head-hd"
>
<div
<div
v-show=
"backButton"
v-show=
"backButton"
class=
"uni-page-head-btn"
class=
"uni-page-head-btn"
@
click=
"_back"
@
click=
"_back"
>
>
<i
<i
:style=
"
{color:color,fontSize:'27px'}"
:style=
"
{color:color,fontSize:'27px'}"
class="uni-btn-icon"
class="uni-btn-icon"
>

</i>
>

</i>
</div>
</div>
<template
v-for=
"(btn,index) in btns"
>
<template
v-for=
"(btn,index) in btns"
>
<div
<div
v-if=
"btn.float === 'left'"
v-if=
"btn.float === 'left'"
:key=
"index"
:key=
"index"
:style=
"
{backgroundColor: type==='transparent'?btn.background:'transparent',width:btn.width}"
:style=
"
{backgroundColor: type==='transparent'?btn.background:'transparent',width:btn.width}"
:badge-text="btn.badgeText"
:badge-text="btn.badgeText"
:class="{'uni-page-head-btn-red-dot':btn.redDot||btn.badgeText,'uni-page-head-btn-select':btn.select}"
:class="{'uni-page-head-btn-red-dot':btn.redDot||btn.badgeText,'uni-page-head-btn-select':btn.select}"
class="uni-page-head-btn"
class="uni-page-head-btn"
>
>
<i
<i
:style=
"_formatBtnStyle(btn)"
:style=
"_formatBtnStyle(btn)"
class=
"uni-btn-icon"
class=
"uni-btn-icon"
@
click=
"_onBtnClick(index)"
@
click=
"_onBtnClick(index)"
v-html=
"_formatBtnFontText(btn)"
v-html=
"_formatBtnFontText(btn)"
/>
/>
</div>
</div>
</
template
>
</
template
>
</div>
</div>
<div
<div
v-if=
"!searchInput"
v-if=
"!searchInput"
class=
"uni-page-head-bd"
class=
"uni-page-head-bd"
>
>
<div
<div
:style=
"{fontSize:titleSize,opacity:type==='transparent'?0:1}"
:style=
"{fontSize:titleSize,opacity:type==='transparent'?0:1}"
class=
"uni-page-head__title"
class=
"uni-page-head__title"
>
>
<i
<i
v-if=
"loading"
v-if=
"loading"
class=
"uni-loading"
class=
"uni-loading"
/>
/>
<img
<img
v-if=
"titleImage!==''"
v-if=
"titleImage!==''"
:src=
"titleImage"
:src=
"titleImage"
class=
"uni-page-head__title_image"
class=
"uni-page-head__title_image"
>
>
<
template
v-else
>
<
template
v-else
>
{{
titleText
}}
{{
titleText
}}
</
template
>
</
template
>
</div>
</div>
</div>
</div>
<div
<div
v-if=
"searchInput"
v-if=
"searchInput"
:style=
"{'border-radius':searchInput.borderRadius,'background-color':searchInput.backgroundColor}"
:style=
"{'border-radius':searchInput.borderRadius,'background-color':searchInput.backgroundColor}"
class=
"uni-page-head-search"
class=
"uni-page-head-search"
>
>
<div
<div
:style=
"{color:searchInput.placeholderColor}"
:style=
"{color:searchInput.placeholderColor}"
:class=
"[`uni-page-head-search-placeholder-${focus ||
text
? 'left' : searchInput.align}`]"
:class=
"[`uni-page-head-search-placeholder-${focus ||
showPlaceholder
? 'left' : searchInput.align}`]"
class=
"uni-page-head-search-placeholder"
class=
"uni-page-head-search-placeholder"
v-text=
"
text || composing ? '' : searchInput.placeholder"
v-text=
"
showPlaceholder || composing ? '' : searchInput.placeholder"
/>
/>
<v-uni-input
<v-uni-input
ref=
"input"
ref=
"input"
v-model=
"text"
v-model=
"text"
:focus=
"searchInput.autoFocus"
:focus=
"searchInput.autoFocus"
:disabled=
"searchInput.disabled"
:disabled=
"searchInput.disabled"
:style=
"{color:searchInput.color}"
:style=
"{color:searchInput.color}"
:placeholder-style=
"`color:${searchInput.placeholderColor}`"
:placeholder-style=
"`color:${searchInput.placeholderColor}`"
class=
"uni-page-head-search-input"
class=
"uni-page-head-search-input"
confirm-type=
"search"
confirm-type=
"search"
@
focus=
"_focus"
@
focus=
"_focus"
@
blur=
"_blur"
@
blur=
"_blur"
@
update:value=
"_input"
@
update:value=
"_input"
/>
/>
<i
v-if=
"text"
class=
"uni-icon-clear"
@
click=
"_clearInput"
>

</i>
</div>
</div>
<div
class=
"uni-page-head-ft"
>
<div
class=
"uni-page-head-ft"
>
<
template
v-for=
"(btn,index) in btns"
>
<
template
v-for=
"(btn,index) in btns"
>
<div
<div
v-if=
"btn.float !== 'left'"
v-if=
"btn.float !== 'left'"
:key=
"index"
:key=
"index"
:style=
"
{backgroundColor: type==='transparent'?btn.background:'transparent',width:btn.width}"
:style=
"
{backgroundColor: type==='transparent'?btn.background:'transparent',width:btn.width}"
:badge-text="btn.badgeText"
:badge-text="btn.badgeText"
:class="{'uni-page-head-btn-red-dot':btn.redDot||btn.badgeText,'uni-page-head-btn-select':btn.select}"
:class="{'uni-page-head-btn-red-dot':btn.redDot||btn.badgeText,'uni-page-head-btn-select':btn.select}"
class="uni-page-head-btn"
class="uni-page-head-btn"
>
>
<i
<i
:style=
"_formatBtnStyle(btn)"
:style=
"_formatBtnStyle(btn)"
class=
"uni-btn-icon"
class=
"uni-btn-icon"
@
click=
"_onBtnClick(index)"
@
click=
"_onBtnClick(index)"
v-html=
"_formatBtnFontText(btn)"
v-html=
"_formatBtnFontText(btn)"
/>
/>
</div>
</div>
</
template
>
</
template
>
</div>
</div>
</div>
</div>
<div
<div
v-if=
"type!=='transparent'&&type!=='float'"
v-if=
"type!=='transparent'&&type!=='float'"
:class=
"{'uni-placeholder-titlePenetrate': titlePenetrate}"
:class=
"{'uni-placeholder-titlePenetrate': titlePenetrate}"
class=
"uni-placeholder"
class=
"uni-placeholder"
/>
/>
</uni-page-head>
</uni-page-head>
</template>
</template>
...
@@ -346,6 +351,11 @@
...
@@ -346,6 +351,11 @@
uni-page-head
.uni-page-head-shadow-yellow
::after
{
uni-page-head
.uni-page-head-shadow-yellow
::after
{
background-image
:
url("https://cdn.dcloud.net.cn/img/shadow-yellow.png")
;
background-image
:
url("https://cdn.dcloud.net.cn/img/shadow-yellow.png")
;
}
}
uni-page-head
.uni-icon-clear
{
align-self
:
center
;
padding-right
:
5px
;
}
</
style
>
</
style
>
<
script
>
<
script
>
import
appendCss
from
'
uni-platform/helpers/append-css
'
import
appendCss
from
'
uni-platform/helpers/append-css
'
...
@@ -441,7 +451,8 @@ export default {
...
@@ -441,7 +451,8 @@ export default {
return
{
return
{
focus
:
false
,
focus
:
false
,
text
:
''
,
text
:
''
,
composing
:
false
composing
:
false
,
showPlaceholder
:
false
}
}
},
},
computed
:
{
computed
:
{
...
@@ -496,6 +507,9 @@ export default {
...
@@ -496,6 +507,9 @@ export default {
input
.
$watch
(
'
composing
'
,
val
=>
{
input
.
$watch
(
'
composing
'
,
val
=>
{
this
.
composing
=
val
this
.
composing
=
val
})
})
input
.
$watch
(
'
valueSync
'
,
val
=>
{
this
.
showPlaceholder
=
!!
val
})
if
(
this
.
searchInput
.
disabled
)
{
if
(
this
.
searchInput
.
disabled
)
{
input
.
$el
.
addEventListener
(
'
click
'
,
()
=>
{
input
.
$el
.
addEventListener
(
'
click
'
,
()
=>
{
UniServiceJSBridge
.
emit
(
'
onNavigationBarSearchInputClicked
'
,
''
)
UniServiceJSBridge
.
emit
(
'
onNavigationBarSearchInputClicked
'
,
''
)
...
@@ -567,7 +581,11 @@ export default {
...
@@ -567,7 +581,11 @@ export default {
UniServiceJSBridge
.
emit
(
'
onNavigationBarSearchInputChanged
'
,
{
UniServiceJSBridge
.
emit
(
'
onNavigationBarSearchInputChanged
'
,
{
text
text
})
})
},
_clearInput
()
{
this
.
text
=
''
this
.
_input
(
this
.
text
)
}
}
}
}
}
}
</
script
>
</
script
>
src/platforms/mp-weixin/runtime/wrapper/fix-set-data.js
浏览文件 @
9c77d5a2
/**
/**
* 用于延迟调用 setData
* 用于延迟调用 setData
* 在 setData 真实调用的时机需执行 fixSetDataEnd
* 在 setData 真实调用的时机需执行 fixSetDataEnd
* @param {*} mpInstance
* @param {*} mpInstance
*/
*/
export
function
fixSetDataStart
(
mpInstance
)
{
export
function
fixSetDataStart
(
mpInstance
)
{
const
setData
=
mpInstance
.
setData
const
setData
=
mpInstance
.
setData
...
@@ -27,7 +27,7 @@ export function fixSetDataStart (mpInstance) {
...
@@ -27,7 +27,7 @@ export function fixSetDataStart (mpInstance) {
}
}
/**
/**
* 恢复真实的 setData 方法
* 恢复真实的 setData 方法
* @param {*} mpInstance
* @param {*} mpInstance
*/
*/
export
function
fixSetDataEnd
(
mpInstance
)
{
export
function
fixSetDataEnd
(
mpInstance
)
{
if
(
mpInstance
.
__fixInitData
)
{
if
(
mpInstance
.
__fixInitData
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录