Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MuGuiLin
uni-app
提交
e3cd58ad
U
uni-app
项目概览
MuGuiLin
/
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,发现更多精彩内容 >>
提交
e3cd58ad
编写于
10月 12, 2021
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into alpha
上级
cf36ed57
40d3070d
变更
25
展开全部
显示空白变更内容
内联
并排
Showing
25 changed file
with
223 addition
and
52 deletion
+223
-52
packages/uni-mp-alipay/dist/uni.api.esm.js
packages/uni-mp-alipay/dist/uni.api.esm.js
+1
-1
packages/uni-mp-alipay/dist/uni.mp.esm.js
packages/uni-mp-alipay/dist/uni.mp.esm.js
+1
-1
packages/uni-mp-baidu/dist/uni.api.esm.js
packages/uni-mp-baidu/dist/uni.api.esm.js
+1
-1
packages/uni-mp-baidu/dist/uni.mp.esm.js
packages/uni-mp-baidu/dist/uni.mp.esm.js
+1
-1
packages/uni-mp-kuaishou/dist/uni.api.esm.js
packages/uni-mp-kuaishou/dist/uni.api.esm.js
+1
-1
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
+1
-1
packages/uni-mp-qq/dist/uni.api.esm.js
packages/uni-mp-qq/dist/uni.api.esm.js
+1
-1
packages/uni-mp-qq/dist/uni.mp.esm.js
packages/uni-mp-qq/dist/uni.mp.esm.js
+1
-1
packages/uni-mp-toutiao/dist/uni.api.esm.js
packages/uni-mp-toutiao/dist/uni.api.esm.js
+1
-1
packages/uni-mp-toutiao/dist/uni.mp.esm.js
packages/uni-mp-toutiao/dist/uni.mp.esm.js
+1
-1
packages/uni-mp-vue/dist/vue.runtime.esm.js
packages/uni-mp-vue/dist/vue.runtime.esm.js
+110
-14
packages/uni-mp-weixin/dist/uni.api.esm.js
packages/uni-mp-weixin/dist/uni.api.esm.js
+1
-1
packages/uni-mp-weixin/dist/uni.mp.esm.js
packages/uni-mp-weixin/dist/uni.mp.esm.js
+1
-1
packages/uni-quickapp-webview/dist/uni.api.esm.js
packages/uni-quickapp-webview/dist/uni.api.esm.js
+1
-1
packages/uni-quickapp-webview/dist/uni.mp.esm.js
packages/uni-quickapp-webview/dist/uni.mp.esm.js
+1
-1
packages/vue-cli-plugin-hbuilderx/packages/webpack-uni-nvue-loader/lib/style.js
...n-hbuilderx/packages/webpack-uni-nvue-loader/lib/style.js
+14
-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/api/context/create-map-context.js
src/core/service/api/context/create-map-context.js
+8
-1
src/core/view/components/rich-text/index.vue
src/core/view/components/rich-text/index.vue
+1
-1
src/core/view/components/rich-text/nodes-parser.js
src/core/view/components/rich-text/nodes-parser.js
+9
-2
src/platforms/app-plus-nvue/service/api/context/operate-map-player.js
...s/app-plus-nvue/service/api/context/operate-map-player.js
+3
-0
src/platforms/app-plus/service/api/ui/popup.js
src/platforms/app-plus/service/api/ui/popup.js
+19
-8
src/platforms/h5/components/app/popup/mixins/modal.js
src/platforms/h5/components/app/popup/mixins/modal.js
+3
-3
src/platforms/h5/components/app/popup/modal.vue
src/platforms/h5/components/app/popup/modal.vue
+38
-2
src/platforms/h5/service/api/ui/popup.js
src/platforms/h5/service/api/ui/popup.js
+3
-5
未找到文件。
packages/uni-mp-alipay/dist/uni.api.esm.js
浏览文件 @
e3cd58ad
...
...
@@ -734,7 +734,7 @@ const getLocale = () => {
if
(
app
&&
app
.
$vm
)
{
return
app
.
$vm
.
$locale
;
}
return
uni
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
;
return
my
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
;
};
const
setLocale
=
(
locale
)
=>
{
const
app
=
getApp
();
...
...
packages/uni-mp-alipay/dist/uni.mp.esm.js
浏览文件 @
e3cd58ad
...
...
@@ -601,7 +601,7 @@ function initCreateApp(parseAppOptions) {
};
}
function
initLocale
(
appVm
)
{
const
locale
=
ref
(
uni
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
const
locale
=
ref
(
my
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
Object
.
defineProperty
(
appVm
,
'
$locale
'
,
{
get
()
{
return
locale
.
value
;
...
...
packages/uni-mp-baidu/dist/uni.api.esm.js
浏览文件 @
e3cd58ad
...
...
@@ -734,7 +734,7 @@ const getLocale = () => {
if
(
app
&&
app
.
$vm
)
{
return
app
.
$vm
.
$locale
;
}
return
uni
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
;
return
swan
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
;
};
const
setLocale
=
(
locale
)
=>
{
const
app
=
getApp
();
...
...
packages/uni-mp-baidu/dist/uni.mp.esm.js
浏览文件 @
e3cd58ad
...
...
@@ -622,7 +622,7 @@ function initCreateApp(parseAppOptions) {
};
}
function
initLocale
(
appVm
)
{
const
locale
=
ref
(
uni
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
const
locale
=
ref
(
swan
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
Object
.
defineProperty
(
appVm
,
'
$locale
'
,
{
get
()
{
return
locale
.
value
;
...
...
packages/uni-mp-kuaishou/dist/uni.api.esm.js
浏览文件 @
e3cd58ad
...
...
@@ -734,7 +734,7 @@ const getLocale = () => {
if
(
app
&&
app
.
$vm
)
{
return
app
.
$vm
.
$locale
;
}
return
uni
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
;
return
ks
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
;
};
const
setLocale
=
(
locale
)
=>
{
const
app
=
getApp
();
...
...
packages/uni-mp-kuaishou/dist/uni.mp.esm.js
浏览文件 @
e3cd58ad
...
...
@@ -622,7 +622,7 @@ function initCreateApp(parseAppOptions) {
};
}
function
initLocale
(
appVm
)
{
const
locale
=
ref
(
uni
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
const
locale
=
ref
(
ks
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
Object
.
defineProperty
(
appVm
,
'
$locale
'
,
{
get
()
{
return
locale
.
value
;
...
...
packages/uni-mp-qq/dist/uni.api.esm.js
浏览文件 @
e3cd58ad
...
...
@@ -734,7 +734,7 @@ const getLocale = () => {
if
(
app
&&
app
.
$vm
)
{
return
app
.
$vm
.
$locale
;
}
return
uni
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
;
return
qq
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
;
};
const
setLocale
=
(
locale
)
=>
{
const
app
=
getApp
();
...
...
packages/uni-mp-qq/dist/uni.mp.esm.js
浏览文件 @
e3cd58ad
...
...
@@ -622,7 +622,7 @@ function initCreateApp(parseAppOptions) {
};
}
function
initLocale
(
appVm
)
{
const
locale
=
ref
(
uni
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
const
locale
=
ref
(
qq
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
Object
.
defineProperty
(
appVm
,
'
$locale
'
,
{
get
()
{
return
locale
.
value
;
...
...
packages/uni-mp-toutiao/dist/uni.api.esm.js
浏览文件 @
e3cd58ad
...
...
@@ -734,7 +734,7 @@ const getLocale = () => {
if
(
app
&&
app
.
$vm
)
{
return
app
.
$vm
.
$locale
;
}
return
uni
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
;
return
tt
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
;
};
const
setLocale
=
(
locale
)
=>
{
const
app
=
getApp
();
...
...
packages/uni-mp-toutiao/dist/uni.mp.esm.js
浏览文件 @
e3cd58ad
...
...
@@ -625,7 +625,7 @@ function initCreateApp(parseAppOptions) {
};
}
function
initLocale
(
appVm
)
{
const
locale
=
ref
(
uni
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
const
locale
=
ref
(
tt
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
Object
.
defineProperty
(
appVm
,
'
$locale
'
,
{
get
()
{
return
locale
.
value
;
...
...
packages/uni-mp-vue/dist/vue.runtime.esm.js
浏览文件 @
e3cd58ad
...
...
@@ -2561,7 +2561,7 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
// local registration
// check instance[type] first which is resolved for options API
resolve
(
instance
[
type
]
||
Component
[
type
],
name
)
||
//
window
registration
//
global
registration
resolve
(
instance
.
appContext
[
type
],
name
);
if
(
!
res
&&
maybeSelfReference
)
{
// fallback to implicit self-reference
...
...
@@ -3048,7 +3048,7 @@ const PublicInstanceProxyHandlers = {
return
ctx
[
key
];
}
else
if
(
//
window
properties
//
global
properties
((
globalProperties
=
appContext
.
config
.
globalProperties
),
hasOwn
(
globalProperties
,
key
)))
{
{
...
...
@@ -3392,6 +3392,11 @@ let compile;
const
isRuntimeOnly
=
()
=>
!
compile
;
function
finishComponentSetup
(
instance
,
isSSR
,
skipOptions
)
{
const
Component
=
instance
.
type
;
// template / render function normalization
// could be already set when returned from setup()
if
(
!
instance
.
render
)
{
instance
.
render
=
(
Component
.
render
||
NOOP
);
}
// support for 2.x options
if
(
__VUE_OPTIONS_API__
&&
!
(
false
))
{
setCurrentInstance
(
instance
);
...
...
@@ -4276,15 +4281,21 @@ function getContext() {
* only.
* @internal
*/
function
mergeDefaults
(
// the base props is compiler-generated and guaranteed to be in this shape.
props
,
defaults
)
{
function
mergeDefaults
(
raw
,
defaults
)
{
const
props
=
isArray
(
raw
)
?
raw
.
reduce
((
normalized
,
p
)
=>
((
normalized
[
p
]
=
{}),
normalized
),
{})
:
raw
;
for
(
const
key
in
defaults
)
{
const
val
=
props
[
key
];
if
(
val
)
{
val
.
default
=
defaults
[
key
];
const
opt
=
props
[
key
];
if
(
opt
)
{
if
(
isArray
(
opt
)
||
isFunction
(
opt
))
{
props
[
key
]
=
{
type
:
opt
,
default
:
defaults
[
key
]
};
}
else
{
opt
.
default
=
defaults
[
key
];
}
}
else
if
(
val
===
null
)
{
else
if
(
opt
===
null
)
{
props
[
key
]
=
{
default
:
defaults
[
key
]
};
}
else
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
...
...
@@ -4341,7 +4352,7 @@ const useSSRContext = () => {
};
// Core API ------------------------------------------------------------------
const
version
=
"
3.2.
19
"
;
const
version
=
"
3.2.
20
"
;
/**
* @internal only exposed in compat builds
*/
...
...
@@ -4664,10 +4675,48 @@ function mountComponent(initialVNode, options) {
}
return
instance
.
proxy
;
}
const
getFunctionalFallthrough
=
(
attrs
)
=>
{
let
res
;
for
(
const
key
in
attrs
)
{
if
(
key
===
'
class
'
||
key
===
'
style
'
||
isOn
(
key
))
{
(
res
||
(
res
=
{}))[
key
]
=
attrs
[
key
];
}
}
return
res
;
};
function
renderComponentRoot
(
instance
)
{
const
{
type
:
Component
,
vnode
,
proxy
,
withProxy
,
props
,
slots
,
attrs
,
emit
,
render
,
renderCache
,
data
,
setupState
,
ctx
}
=
instance
;
let
result
;
const
prev
=
setCurrentRenderingInstance
(
instance
);
try
{
if
(
vnode
.
shapeFlag
&
4
/* STATEFUL_COMPONENT */
)
{
// withProxy is a proxy with a different `has` trap only for
// runtime-compiled render functions using `with` block.
const
proxyToUse
=
withProxy
||
proxy
;
result
=
render
.
call
(
proxyToUse
,
proxyToUse
,
renderCache
,
props
,
setupState
,
data
,
ctx
);
}
else
{
// functional
const
render
=
Component
;
result
=
render
.
length
>
1
?
render
(
props
,
{
attrs
,
slots
,
emit
})
:
render
(
props
,
null
/* we know it doesn't need it */
)
?
attrs
:
getFunctionalFallthrough
(
attrs
);
}
}
catch
(
err
)
{
handleError
(
err
,
instance
,
1
/* RENDER_FUNCTION */
);
result
=
false
;
}
setCurrentRenderingInstance
(
prev
);
return
result
;
}
function
setupRenderEffect
(
instance
)
{
const
componentUpdateFn
=
()
=>
{
if
(
!
instance
.
isMounted
)
{
instance
.
render
&&
instance
.
render
.
call
(
instance
.
proxy
);
renderComponentRoot
(
instance
);
patch
(
instance
);
}
else
{
...
...
@@ -4680,6 +4729,7 @@ function setupRenderEffect(instance) {
invokeArrayFns
(
bu
);
}
effect
.
allowRecurse
=
true
;
renderComponentRoot
(
instance
);
patch
(
instance
);
// updated hook
if
(
u
)
{
...
...
@@ -4818,8 +4868,44 @@ function initOptionMergeStrategies(optionMergeStrategies) {
});
}
let
realAtob
;
const
b64
=
'
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
'
;
const
b64re
=
/^
(?:[
A-Za-z
\d
+
/]{4})
*
?(?:[
A-Za-z
\d
+
/]{2}(?:
==
)?
|
[
A-Za-z
\d
+
/]{3}
=
?)?
$/
;
if
(
typeof
atob
!==
'
function
'
)
{
realAtob
=
function
(
str
)
{
str
=
String
(
str
).
replace
(
/
[\t\n\f\r
]
+/g
,
''
);
if
(
!
b64re
.
test
(
str
))
{
throw
new
Error
(
"
Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.
"
);
}
// Adding the padding if missing, for semplicity
str
+=
'
==
'
.
slice
(
2
-
(
str
.
length
&
3
));
var
bitmap
;
var
result
=
''
;
var
r1
;
var
r2
;
var
i
=
0
;
for
(;
i
<
str
.
length
;)
{
bitmap
=
(
b64
.
indexOf
(
str
.
charAt
(
i
++
))
<<
18
)
|
(
b64
.
indexOf
(
str
.
charAt
(
i
++
))
<<
12
)
|
((
r1
=
b64
.
indexOf
(
str
.
charAt
(
i
++
)))
<<
6
)
|
(
r2
=
b64
.
indexOf
(
str
.
charAt
(
i
++
)));
result
+=
r1
===
64
?
String
.
fromCharCode
((
bitmap
>>
16
)
&
255
)
:
r2
===
64
?
String
.
fromCharCode
((
bitmap
>>
16
)
&
255
,
(
bitmap
>>
8
)
&
255
)
:
String
.
fromCharCode
((
bitmap
>>
16
)
&
255
,
(
bitmap
>>
8
)
&
255
,
bitmap
&
255
);
}
return
result
;
};
}
else
{
// 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
realAtob
=
atob
;
}
function
b64DecodeUnicode
(
str
)
{
return
decodeURIComponent
(
a
tob
(
str
)
return
decodeURIComponent
(
realA
tob
(
str
)
.
split
(
''
)
.
map
(
function
(
c
)
{
return
'
%
'
+
(
'
00
'
+
c
.
charCodeAt
(
0
).
toString
(
16
)).
slice
(
-
2
);
...
...
@@ -4883,11 +4969,21 @@ function initApp(app) {
var
plugin
=
{
install
(
app
)
{
initApp
(
app
);
// TODO 旧编译器使用了$createElement 导致告警
app
.
config
.
globalProperties
.
$createElement
=
()
=>
{
};
const
oldMount
=
app
.
mount
;
app
.
mount
=
function
mount
(
rootContainer
)
{
const
instance
=
oldMount
.
call
(
app
,
rootContainer
);
if
(
global
.
createApp
)
{
global
.
createApp
(
instance
);
}
else
{
// @ts-ignore 旧编译器
if
(
typeof
createMiniProgramApp
!==
'
undefined
'
)
{
// @ts-ignore
createMiniProgramApp
(
instance
);
}
}
return
instance
;
};
},
...
...
packages/uni-mp-weixin/dist/uni.api.esm.js
浏览文件 @
e3cd58ad
...
...
@@ -698,7 +698,7 @@ const getLocale = () => {
if
(
app
&&
app
.
$vm
)
{
return
app
.
$vm
.
$locale
;
}
return
uni
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
;
return
wx
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
;
};
const
setLocale
=
(
locale
)
=>
{
const
app
=
getApp
();
...
...
packages/uni-mp-weixin/dist/uni.mp.esm.js
浏览文件 @
e3cd58ad
...
...
@@ -568,7 +568,7 @@ function initCreateApp(parseAppOptions) {
};
}
function
initLocale
(
appVm
)
{
const
locale
=
ref
(
uni
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
const
locale
=
ref
(
wx
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
Object
.
defineProperty
(
appVm
,
'
$locale
'
,
{
get
()
{
return
locale
.
value
;
...
...
packages/uni-quickapp-webview/dist/uni.api.esm.js
浏览文件 @
e3cd58ad
...
...
@@ -734,7 +734,7 @@ const getLocale = () => {
if
(
app
&&
app
.
$vm
)
{
return
app
.
$vm
.
$locale
;
}
return
uni
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
;
return
qa
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
;
};
const
setLocale
=
(
locale
)
=>
{
const
app
=
getApp
();
...
...
packages/uni-quickapp-webview/dist/uni.mp.esm.js
浏览文件 @
e3cd58ad
...
...
@@ -553,7 +553,7 @@ function initCreateApp(parseAppOptions) {
};
}
function
initLocale
(
appVm
)
{
const
locale
=
ref
(
uni
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
const
locale
=
ref
(
qa
.
getSystemInfoSync
().
language
||
'
zh-Hans
'
);
Object
.
defineProperty
(
appVm
,
'
$locale
'
,
{
get
()
{
return
locale
.
value
;
...
...
packages/vue-cli-plugin-hbuilderx/packages/webpack-uni-nvue-loader/lib/style.js
浏览文件 @
e3cd58ad
...
...
@@ -30,6 +30,15 @@ function convertLength (k, v) {
}
let
isFirst
=
true
const
ZERO_WIDTH_CHAR
=
{
NOTE
:
''
,
WARNING
:
'
\
u200B
'
,
ERROR
:
'
\
u200C
'
,
backup0
:
'
\
u200D
'
,
backup1
:
'
\
u200E
'
,
backup2
:
'
\
u200F
'
,
backup3
:
'
\
uFEFF
'
}
function
genStyleString
(
input
,
loader
)
{
var
output
=
'
{}
'
...
...
@@ -56,7 +65,11 @@ function genStyleString (input, loader) {
msgs
.
unshift
(
uniI18n
.
__
(
'
pluginHbuilderx.nvueCssWarning
'
))
isFirst
=
false
}
msgs
.
forEach
(
msg
=>
console
.
warn
(
msg
))
msgs
.
forEach
(
msg
=>
{
const
msgType
=
ZERO_WIDTH_CHAR
[
msg
.
split
(
'
:
'
)[
0
]]
msgType
&&
(
msg
=
msgType
+
msg
+
msgType
)
console
.
warn
(
msg
)
})
}
}
try
{
...
...
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
浏览文件 @
e3cd58ad
此差异已折叠。
点击以展开。
src/core/service/api/context/create-map-context.js
浏览文件 @
e3cd58ad
...
...
@@ -40,6 +40,13 @@ export class MapContext {
this
.
id
=
id
this
.
pageVm
=
pageVm
}
on
(
name
,
callback
)
{
operateMapPlayer
(
this
.
id
,
this
.
pageVm
,
'
on
'
,
{
name
,
callback
})
}
}
MapContext
.
prototype
.
$getAppMap
=
function
()
{
...
...
src/core/view/components/rich-text/index.vue
浏览文件 @
e3cd58ad
...
...
@@ -38,7 +38,7 @@ export default {
if
(
typeof
nodes
===
'
string
'
)
{
nodes
=
parseHtml
(
nodes
)
}
const
nodeList
=
parseNodes
(
nodes
,
document
.
createDocumentFragment
())
const
nodeList
=
parseNodes
(
nodes
,
document
.
createDocumentFragment
()
,
this
)
nodeList
.
appendChild
(
this
.
$refs
.
sensor
.
$el
)
const
content
=
this
.
$refs
.
content
content
.
innerHTML
=
''
...
...
src/core/view/components/rich-text/nodes-parser.js
浏览文件 @
e3cd58ad
...
...
@@ -96,7 +96,13 @@ function decodeEntities (htmlString) {
})
}
export
default
function
parseNodes
(
nodes
,
parentNode
)
{
export
default
function
parseNodes
(
nodes
,
parentNode
,
$vm
)
{
let
scopeId
=
''
while
(
$vm
)
{
!
scopeId
&&
(
scopeId
=
$vm
.
$options
.
_scopeId
)
$vm
=
$vm
.
$parent
}
nodes
.
forEach
(
function
(
node
)
{
if
(
!
isPlainObject
(
node
))
{
return
...
...
@@ -124,6 +130,7 @@ export default function parseNodes (nodes, parentNode) {
Array
.
isArray
(
value
)
&&
(
value
=
value
.
join
(
'
'
))
case
'
style
'
:
elem
.
setAttribute
(
name
,
value
)
scopeId
&&
elem
.
setAttribute
(
scopeId
,
''
)
break
default
:
if
(
tagAttrs
.
indexOf
(
name
)
!==
-
1
)
{
...
...
src/platforms/app-plus-nvue/service/api/context/operate-map-player.js
浏览文件 @
e3cd58ad
...
...
@@ -52,6 +52,9 @@ const METHODS = {
},
openMapApp
(
ctx
,
args
)
{
return
invokeVmMethod
(
ctx
,
'
openMapApp
'
,
args
)
},
on
(
ctx
,
args
)
{
return
ctx
.
on
(
args
.
name
,
args
.
callback
)
}
}
...
...
src/platforms/app-plus/service/api/ui/popup.js
浏览文件 @
e3cd58ad
...
...
@@ -121,24 +121,35 @@ export function showModal ({
cancelText
,
cancelColor
,
confirmText
,
confirmColor
confirmColor
,
editable
=
false
,
placeholderText
=
''
}
=
{},
callbackId
)
{
// TODO 在 editable 为 true 时,content 应该是输入框中可修改内容。后续找客户端商量。
const
buttons
=
showCancel
?
[
cancelText
,
confirmText
]
:
[
confirmText
]
const
tip
=
editable
?
placeholderText
:
buttons
content
=
content
||
'
'
plus
.
nativeUI
.
confirm
(
content
,
(
e
)
=>
{
plus
.
nativeUI
[
editable
?
'
prompt
'
:
'
confirm
'
]
(
content
,
(
e
)
=>
{
if
(
showCancel
)
{
invoke
(
callbackId
,
{
const
isConfirm
=
e
.
index
===
1
const
res
=
{
errMsg
:
'
showModal:ok
'
,
confirm
:
e
.
index
===
1
,
confirm
:
isConfirm
,
cancel
:
e
.
index
===
0
||
e
.
index
===
-
1
})
}
isConfirm
&&
editable
&&
(
res
.
content
=
e
.
value
)
invoke
(
callbackId
,
res
)
}
else
{
invoke
(
callbackId
,
{
const
res
=
{
errMsg
:
'
showModal:ok
'
,
confirm
:
e
.
index
===
0
,
cancel
:
false
})
}
},
title
,
showCancel
?
[
cancelText
,
confirmText
]
:
[
confirmText
])
editable
&&
(
res
.
content
=
e
.
value
)
invoke
(
callbackId
,
res
)
}
},
title
,
tip
,
buttons
)
}
export
function
showActionSheet
({
itemList
=
[],
...
...
src/platforms/h5/components/app/popup/mixins/modal.js
浏览文件 @
e3cd58ad
...
...
@@ -21,9 +21,9 @@ export default {
},
methods
:
{
// 处理 modal close 回调
_onModalClose
(
type
)
{
_onModalClose
(
res
)
{
this
.
showModal
.
visible
=
false
isFn
(
this
.
onModalCloseCallback
)
&&
this
.
onModalCloseCallback
(
type
)
isFn
(
this
.
onModalCloseCallback
)
&&
this
.
onModalCloseCallback
(
res
)
}
}
}
src/platforms/h5/components/app/popup/modal.vue
浏览文件 @
e3cd58ad
...
...
@@ -15,7 +15,16 @@
v-text=
"title"
/>
</div>
<textarea
v-if=
"editable"
ref=
"editContent"
class=
"uni-modal__textarea"
rows=
"1"
:placeholder=
"placeholderText"
:value=
"content"
/>
<div
v-else
class=
"uni-modal__bd"
@
touchmove.stop
v-text=
"content"
...
...
@@ -41,7 +50,7 @@
<keypress
:disable=
"!visible"
@
esc=
"_close('cancel')"
@
enter=
"_close('confirm')"
@
enter=
"
!editable &&
_close('confirm')"
/>
</uni-modal>
</transition>
...
...
@@ -86,11 +95,25 @@ export default {
visible
:
{
type
:
Boolean
,
default
:
false
},
editable
:
{
type
:
Boolean
,
default
:
false
},
placeholderText
:
{
type
:
String
,
default
:
''
}
},
methods
:
{
_close
(
type
)
{
this
.
$emit
(
'
close
'
,
type
)
const
res
=
{
[
type
]:
true
}
if
(
this
.
editable
&&
type
===
'
confirm
'
)
{
res
.
content
=
this
.
$refs
.
editContent
.
value
}
this
.
$emit
(
'
close
'
,
res
)
}
}
}
...
...
@@ -156,6 +179,19 @@ export default {
overflow-y
:
auto
;
}
uni-modal
.uni-modal__textarea
{
resize
:
none
;
border
:
0
;
margin
:
0
;
width
:
90%
;
padding
:
10px
;
font-size
:
20px
;
outline
:
none
;
border
:
none
;
background-color
:
#eee
;
text-decoration
:
inherit
;
}
uni-modal
.uni-modal__ft
{
position
:
relative
;
line-height
:
48px
;
...
...
src/platforms/h5/service/api/ui/popup.js
浏览文件 @
e3cd58ad
...
...
@@ -4,10 +4,8 @@ const {
}
=
UniServiceJSBridge
export
function
showModal
(
args
,
callbackId
)
{
emit
(
'
onShowModal
'
,
args
,
function
(
type
)
{
invoke
(
callbackId
,
{
[
type
]:
true
})
emit
(
'
onShowModal
'
,
args
,
function
(
res
)
{
invoke
(
callbackId
,
res
)
})
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录