Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
1eab7463
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,发现更多精彩内容 >>
提交
1eab7463
编写于
1月 14, 2022
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into alpha
上级
6fcc582d
c25fc1ca
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
64 addition
and
39 deletion
+64
-39
packages/uni-cli-i18n/locales/en.json
packages/uni-cli-i18n/locales/en.json
+1
-1
packages/uni-cli-i18n/locales/zh_CN.json
packages/uni-cli-i18n/locales/zh_CN.json
+1
-1
packages/uni-template-compiler/__tests__/compiler-mp-weixin.spec.js
...ni-template-compiler/__tests__/compiler-mp-weixin.spec.js
+14
-0
packages/uni-template-compiler/lib/util.js
packages/uni-template-compiler/lib/util.js
+6
-0
packages/vue-cli-plugin-uni/commands/build.js
packages/vue-cli-plugin-uni/commands/build.js
+14
-12
packages/vue-cli-plugin-uni/lib/env.js
packages/vue-cli-plugin-uni/lib/env.js
+1
-3
packages/vue-cli-plugin-uni/lib/mp/index.js
packages/vue-cli-plugin-uni/lib/mp/index.js
+7
-6
packages/webpack-uni-mp-loader/lib/plugin/index-new.js
packages/webpack-uni-mp-loader/lib/plugin/index-new.js
+9
-9
src/core/view/components/movable-view/index.vue
src/core/view/components/movable-view/index.vue
+1
-0
src/platforms/app-plus/service/api/ad/rewarded-video-ad.js
src/platforms/app-plus/service/api/ad/rewarded-video-ad.js
+1
-3
src/platforms/h5/view/components/ad/index.vue
src/platforms/h5/view/components/ad/index.vue
+9
-4
未找到文件。
packages/uni-cli-i18n/locales/en.json
浏览文件 @
1eab7463
...
...
@@ -62,7 +62,7 @@
"mpLoader.componentReferenceError"
:
"Component {{0}} reference error"
,
"mpLoader.componentReferenceErrorOnlySupportImport"
:
"Component {{0}} reference error, only supports import components"
,
"pagesLoader.pagesNodeCannotNull"
:
"Pages node in pages.json cannot be empty"
,
"pagesLoader.nvueFirstPageStartModeIsFast"
:
"
Nvue homepage
startup mode: fast. For details, see: {{0}}"
,
"pagesLoader.nvueFirstPageStartModeIsFast"
:
"
App
startup mode: fast. For details, see: {{0}}"
,
"pagesLoader.pagesTabbarMinItem2"
:
"{{0}} must contain at least 2 items"
,
"pagesLoader.needInPagesNode"
:
"{{0}} needs to be in the pages array"
,
"i18n.fallbackLocale.default"
:
"fallbackLocale is missing in manifest.json, use:{{locale}}"
,
...
...
packages/uni-cli-i18n/locales/zh_CN.json
浏览文件 @
1eab7463
...
...
@@ -62,7 +62,7 @@
"mpLoader.componentReferenceError"
:
"组件 {{0}} 引用错误"
,
"mpLoader.componentReferenceErrorOnlySupportImport"
:
"组件 {{0}} 引用错误,仅支持 import 方式引入组件"
,
"pagesLoader.pagesNodeCannotNull"
:
"pages.json 中的 pages 节点不能为空"
,
"pagesLoader.nvueFirstPageStartModeIsFast"
:
"
Nvue 首页
启动模式: fast, 详见: {{0}}"
,
"pagesLoader.nvueFirstPageStartModeIsFast"
:
"
App
启动模式: fast, 详见: {{0}}"
,
"pagesLoader.pagesTabbarMinItem2"
:
"{{0}} 需至少包含2项"
,
"pagesLoader.needInPagesNode"
:
"{{0}} 需在 pages 数组中"
,
"i18n.fallbackLocale.default"
:
"当前应用未在 manifest.json 配置 fallbackLocale,默认使用:{{locale}}"
,
...
...
packages/uni-template-compiler/__tests__/compiler-mp-weixin.spec.js
浏览文件 @
1eab7463
...
...
@@ -60,11 +60,25 @@ describe('mp:compiler-mp-weixin', () => {
'
<view data-text="{{$root.a0}}"></view>
'
,
`with(this){var a0=text+"'";$mp.data=Object.assign({},{$root:{a0:a0}})}`
)
assertCodegen
(
'
<view :data-text="`${text}
\'
`"></view>
'
,
'
<view data-text="{{$root.a0}}"></view>
'
,
'
with(this){var a0=`${text}
\'
`;$mp.data=Object.assign({},{$root:{a0:a0}})}
'
)
assertCodegen
(
`<view>{{text+'\\''}}</view>`
,
'
<view>{{$root.t0}}</view>
'
,
`with(this){var t0=text+"'";$mp.data=Object.assign({},{$root:{t0:t0}})}`
)
assertCodegen
(
'
<view>{{`${text}
\'
`}}</view>
'
,
'
<view>{{$root.t0}}</view>
'
,
'
with(this){var t0=`${text}
\'
`;$mp.data=Object.assign({},{$root:{t0:t0}})}
'
)
assertCodegen
(
'
<view>{{`${text}"`}}</view>
'
,
`<view>{{text+'"'}}</view>`
)
assertCodegen
(
`<view>{{text+"\\""}}</view>`
,
'
<view>{{$root.t0}}</view>
'
,
...
...
packages/uni-template-compiler/lib/util.js
浏览文件 @
1eab7463
...
...
@@ -255,6 +255,12 @@ function hasEscapeQuote (path) {
has
=
true
path
.
stop
()
}
},
TemplateElement
(
path
)
{
if
(
path
.
node
.
value
.
cooked
.
includes
(
'
\'
'
))
{
has
=
true
path
.
stop
()
}
}
})
}
...
...
packages/vue-cli-plugin-uni/commands/build.js
浏览文件 @
1eab7463
...
...
@@ -34,7 +34,7 @@ module.exports = (api, options) => {
'
--auto-host
'
:
'
specify automator host
'
,
'
--auto-port
'
:
'
specify automator port
'
,
'
--subpackage
'
:
'
specify subpackage
'
,
'
--plugin
'
:
'
specify plugin
'
,
'
--plugin
'
:
'
specify
mp
plugin
'
,
'
--manifest
'
:
'
build manifest.json
'
}
},
async
(
args
)
=>
{
...
...
@@ -244,6 +244,7 @@ function analysisPluginDir () {
const
pluginJson
=
parseJson
(
fs
.
readFileSync
(
pluginJsonPath
,
'
utf-8
'
),
true
)
// main 入口文件是否存在
if
(
pluginJson
.
main
)
{
process
.
env
.
UNI_MP_PLUGIN_MAIN
=
pluginJson
.
main
const
UNI_MP_PLUGIN_MAIN
=
process
.
env
.
UNI_MP_PLUGIN_MAIN
const
mainFilePath
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
UNI_MP_PLUGIN_MAIN
)
...
...
@@ -256,6 +257,7 @@ function analysisPluginDir () {
console
.
log
()
process
.
exit
(
0
)
}
}
}
function
buildManifestJson
()
{
...
...
packages/vue-cli-plugin-uni/lib/env.js
浏览文件 @
1eab7463
...
...
@@ -352,9 +352,7 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
if
(
process
.
env
.
UNI_PLATFORM
===
'
app-plus
'
)
{
const
pagesPkg
=
require
(
'
@dcloudio/webpack-uni-pages-loader/package.json
'
)
if
(
pagesPkg
)
{
const
v3Tips
=
`(v3)
${
uniI18n
.
__
(
'
see
'
)}
:https://ask.dcloud.net.cn/article/36599。`
info
=
uniI18n
.
__
(
'
compilerVersion
'
)
+
'
:
'
+
pagesPkg
[
'
uni-app
'
].
compilerVersion
+
(
process
.
env
.
UNI_USING_V3
?
v3Tips
:
''
)
info
=
uniI18n
.
__
(
'
compilerVersion
'
)
+
'
:
'
+
pagesPkg
[
'
uni-app
'
].
compilerVersion
}
if
(
process
.
env
.
UNI_USING_V3
)
{
console
.
log
(
info
)
...
...
packages/vue-cli-plugin-uni/lib/mp/index.js
浏览文件 @
1eab7463
...
...
@@ -178,11 +178,12 @@ module.exports = {
{
const
globalEnv
=
process
.
env
.
UNI_PLATFORM
===
'
mp-alipay
'
?
'
my
'
:
'
wx
'
;
[].
concat
(
process
.
env
.
UNI_MP_PLUGIN
?
process
.
env
.
UNI_MP_PLUGIN_MAIN
:
JSON
.
parse
(
process
.
env
.
UNI_MP_PLUGIN_EXPORT
))
.
forEach
(
fileName
=>
addToUniEntry
(
fileName
))
beforeCode
+=
`
${
globalEnv
}
.__webpack_require_
${(
process
.
env
.
UNI_MP_PLUGIN
||
'
UNI_MP_PLUGIN
'
).
replace
(
/-/g
,
'
_
'
)}
__ = __webpack_require__;`
[].
concat
(
process
.
env
.
UNI_MP_PLUGIN
?
process
.
env
.
UNI_MP_PLUGIN_MAIN
:
JSON
.
parse
(
process
.
env
.
UNI_MP_PLUGIN_EXPORT
)
).
forEach
(
fileName
=>
addToUniEntry
(
fileName
))
beforeCode
+=
`
${
globalEnv
}
.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;`
}
const
alias
=
{
// 仅 mp-weixin
...
...
packages/webpack-uni-mp-loader/lib/plugin/index-new.js
浏览文件 @
1eab7463
...
...
@@ -76,22 +76,22 @@ function addMPPluginRequire (compilation) {
const
needProcess
=
process
.
env
.
UNI_MP_PLUGIN
?
name
===
UNI_MP_PLUGIN_MAIN
:
UNI_MP_PLUGIN_EXPORT
.
includes
(
name
)
if
(
needProcess
)
{
const
modules
=
compilation
.
modules
const
orignalSource
=
compilation
.
assets
[
name
].
source
()
const
globalEnv
=
process
.
env
.
UNI_PLATFORM
===
'
mp-alipay
'
?
'
my
'
:
'
wx
'
;
const
filePath
=
normalizePath
(
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
name
))
const
uniModuleId
=
modules
.
find
(
module
=>
module
.
resource
&&
normalizePath
(
module
.
resource
)
===
filePath
).
id
const
newlineIndex
=
orignalSource
.
lastIndexOf
(
'
\n
'
)
const
newlineIndex
=
compilation
.
assets
[
name
].
source
().
lastIndexOf
(
'
\n
'
)
const
source
=
compilation
.
assets
[
name
].
source
().
substring
(
0
,
newlineIndex
)
+
`\nmodule.exports =
${
process
.
env
.
UNI_PLATFORM
===
'
mp-alipay
'
?
'
my
'
:
'
wx
'
}
.__webpack_require_
${(
process
.
env
.
UNI_MP_PLUGIN
||
'
UNI_MP_PLUGIN
'
).
replace
(
/-/g
,
'
_
'
)}
__('
${
uniModuleId
}
');\n`
+
compilation
.
assets
[
name
].
source
().
substring
(
newlineIndex
+
1
)
const
source
=
orignalSource
.
substring
(
0
,
newlineIndex
)
+
`\nmodule.exports =
${
globalEnv
}
.__webpack_require_UNI_MP_PLUGIN__('
${
uniModuleId
}
');\n`
+
orignalSource
.
substring
(
newlineIndex
+
1
)
compilation
.
assets
[
name
]
=
{
size
()
{
size
()
{
return
Buffer
.
byteLength
(
source
,
'
utf8
'
)
},
source
()
{
source
()
{
return
source
}
}
...
...
src/core/view/components/movable-view/index.vue
浏览文件 @
1eab7463
...
...
@@ -308,6 +308,7 @@ export default {
}
},
__handleTouchMove
:
function
(
event
)
{
event
.
stopPropagation
()
var
self
=
this
if
(
!
this
.
_isScaling
&&
!
this
.
disabled
&&
this
.
_isTouching
)
{
let
x
=
this
.
_translateX
...
...
src/platforms/app-plus/service/api/ad/rewarded-video-ad.js
浏览文件 @
1eab7463
...
...
@@ -72,10 +72,8 @@ class RewardedVideoAd {
this
.
_dispatchEvent
(
'
adClicked
'
,
{})
})
if
(
this
.
_preload
)
{
this
.
_loadAd
()
}
}
get
isExpired
()
{
return
(
this
.
_lastLoadTime
!==
0
&&
(
Math
.
abs
(
Date
.
now
()
-
this
.
_lastLoadTime
)
>
EXPIRED_TIME
))
...
...
src/platforms/h5/view/components/ad/index.vue
浏览文件 @
1eab7463
...
...
@@ -436,6 +436,7 @@ export default {
const
data
=
this
.
_pl
[
this
.
_pi
]
const
providerConfig
=
this
.
_b
[
data
.
a1
][
data
.
t
]
const
script
=
providerConfig
.
script
this
.
_currentChannel
=
data
.
a1
var
id
=
this
.
_randomId
()
var
view
=
this
.
_createView
(
id
)
...
...
@@ -517,7 +518,7 @@ export default {
_checkRender
()
{
var
hasContent
=
(
this
.
$refs
.
container
.
children
.
length
>
0
&&
this
.
$refs
.
container
.
clientHeight
>
40
)
if
(
hasContent
)
{
this
.
_report
(
40
)
this
.
_report
(
40
,
this
.
_currentChannel
)
}
return
hasContent
},
...
...
@@ -543,12 +544,16 @@ export default {
this
.
_checkTimer
=
null
}
},
_report
(
type
)
{
AdReport
.
instance
.
get
(
{
_report
(
type
,
currentChannel
)
{
let
reportData
=
{
h
:
__uniConfig
.
compilerVersion
,
a
:
this
.
adpid
,
at
:
type
})
}
if
(
currentChannel
)
{
reportData
.
t
=
currentChannel
}
AdReport
.
instance
.
get
(
reportData
)
},
_randomId
()
{
var
result
=
''
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录