Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
D-GSQ
uni-app
提交
5ba05318
U
uni-app
项目概览
D-GSQ
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
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,发现更多精彩内容 >>
提交
5ba05318
编写于
12月 16, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: lint
上级
47293ae3
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
43 addition
and
40 deletion
+43
-40
packages/uni-cli-shared/lib/package.js
packages/uni-cli-shared/lib/package.js
+1
-1
packages/uni-template-compiler/lib/template/traverse.js
packages/uni-template-compiler/lib/template/traverse.js
+1
-1
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
+10
-9
packages/vue-cli-plugin-uni/commands/build.js
packages/vue-cli-plugin-uni/commands/build.js
+1
-1
packages/vue-cli-plugin-uni/lib/copy-webpack-options.js
packages/vue-cli-plugin-uni/lib/copy-webpack-options.js
+20
-18
packages/webpack-uni-mp-loader/lib/plugin/generate-app.js
packages/webpack-uni-mp-loader/lib/plugin/generate-app.js
+1
-1
packages/webpack-uni-pages-loader/lib/platforms/mp-jd/index.js
...ges/webpack-uni-pages-loader/lib/platforms/mp-jd/index.js
+3
-3
src/platforms/mp-jd/runtime/api/protocols.js
src/platforms/mp-jd/runtime/api/protocols.js
+5
-5
src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js
src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js
+1
-1
未找到文件。
packages/uni-cli-shared/lib/package.js
浏览文件 @
5ba05318
...
...
@@ -8,7 +8,7 @@ const PLATFORMS = [
'
mp-baidu
'
,
'
mp-alipay
'
,
'
mp-toutiao
'
,
'
mp-jd
'
,
'
mp-jd
'
]
module
.
exports
=
{
...
...
packages/uni-template-compiler/lib/template/traverse.js
浏览文件 @
5ba05318
...
...
@@ -231,7 +231,7 @@ function traverseDataNode (dataNode, state, node) {
let
key
// 自定义组件不支持 hidden 属性
const
platform
=
state
.
options
.
platform
.
name
const
platforms
=
[
'
mp-weixin
'
,
'
mp-qq
'
,
'
mp-jd
'
,
'
mp-toutiao
'
,
'
mp-lark
'
]
const
platforms
=
[
'
mp-weixin
'
,
'
mp-qq
'
,
'
mp-jd
'
,
'
mp-toutiao
'
,
'
mp-lark
'
]
if
(
isComponent
(
node
.
type
)
&&
platforms
.
includes
(
platform
))
{
// 字节跳动|飞书小程序自定义属性不会反应在DOM上,只能使用事件格式
key
=
`
${
platform
===
'
mp-toutiao
'
||
platform
===
'
mp-lark
'
?
'
bind:-
'
:
''
}${
ATTE_DATA_CUSTOM_HIDDEN
}
`
...
...
packages/vue-cli-plugin-hbuilderx/build/webpack.nvue.conf.js
浏览文件 @
5ba05318
...
...
@@ -213,15 +213,16 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
from
:
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
static
'
),
to
:
'
static
'
}]
const
androidPrivacyPath
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
androidPrivacy.json
'
)
if
(
fs
.
existsSync
(
androidPrivacyPath
))
{
array
.
push
({
from
:
androidPrivacyPath
,
to
:
'
androidPrivacy.json
'
})
// 自动化测试时,不启用androidPrivacy.json
if
(
!
process
.
env
.
UNI_AUTOMATOR_WS_ENDPOINT
)
{
const
androidPrivacyPath
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
androidPrivacy.json
'
)
if
(
fs
.
existsSync
(
androidPrivacyPath
))
{
array
.
push
({
from
:
androidPrivacyPath
,
to
:
'
androidPrivacy.json
'
})
}
}
const
hybridHtmlPath
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
hybrid/html
'
)
if
(
fs
.
existsSync
(
hybridHtmlPath
))
{
array
.
push
({
...
...
@@ -389,4 +390,4 @@ module.exports = function () {
zlib
:
false
}
}
}
}
packages/vue-cli-plugin-uni/commands/build.js
浏览文件 @
5ba05318
...
...
@@ -48,7 +48,7 @@ module.exports = (api, options) => {
return
buildManifestJson
()
}
const
platforms
=
[
'
mp-weixin
'
,
'
mp-qq
'
,
'
mp-jd
'
,
'
mp-baidu
'
,
'
mp-alipay
'
,
'
mp-toutiao
'
,
'
mp-lark
'
]
const
platforms
=
[
'
mp-weixin
'
,
'
mp-qq
'
,
'
mp-jd
'
,
'
mp-baidu
'
,
'
mp-alipay
'
,
'
mp-toutiao
'
,
'
mp-lark
'
]
if
(
args
.
subpackage
&&
platforms
.
includes
(
process
.
env
.
UNI_PLATFORM
))
{
process
.
env
.
UNI_SUBPACKGE
=
args
.
subpackage
}
...
...
packages/vue-cli-plugin-uni/lib/copy-webpack-options.js
浏览文件 @
5ba05318
const
fs
=
require
(
'
fs
'
)
const
path
=
require
(
'
path
'
)
const
{
compileI18nJsonStr
}
=
require
(
'
@dcloudio/uni-i18n
'
)
const
{
initI18nOptions
}
=
require
(
'
@dcloudio/uni-cli-shared/lib/i18n
'
)
const
{
compileI18nJsonStr
}
=
require
(
'
@dcloudio/uni-i18n
'
)
const
{
initI18nOptions
}
=
require
(
'
@dcloudio/uni-cli-shared/lib/i18n
'
)
const
assetsDir
=
'
static
'
function
getAssetsCopyOption
(
from
,
options
=
{})
{
if
(
path
.
isAbsolute
(
from
))
{
if
(
fs
.
existsSync
(
from
))
{
return
Object
.
assign
(
{
from
,
to
:
path
.
resolve
(
process
.
env
.
UNI_OUTPUT_DIR
)
},
options
return
Object
.
assign
({
from
,
to
:
path
.
resolve
(
process
.
env
.
UNI_OUTPUT_DIR
)
},
options
)
}
}
const
to
=
from
from
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
from
)
if
(
fs
.
existsSync
(
from
))
{
return
Object
.
assign
(
{
from
,
to
:
path
.
resolve
(
process
.
env
.
UNI_OUTPUT_DIR
,
to
)
},
options
return
Object
.
assign
({
from
,
to
:
path
.
resolve
(
process
.
env
.
UNI_OUTPUT_DIR
,
to
)
},
options
)
}
}
...
...
@@ -50,8 +52,7 @@ function getAssetsCopyOptions (assetsDir) {
process
.
UNI_SUBPACKAGES
&&
Object
.
keys
(
process
.
UNI_SUBPACKAGES
).
forEach
(
root
=>
{
const
subAssetsCopyOption
=
getAssetsCopyOption
(
path
.
join
(
root
,
assetsDir
),
{
path
.
join
(
root
,
assetsDir
),
{
ignore
}
)
...
...
@@ -86,7 +87,8 @@ function getCopyWebpackPluginOptions (platformOptions, vueOptions) {
copyOption
&&
copyOptions
.
push
(
copyOption
)
})
})
if
(
process
.
env
.
UNI_PLATFORM
===
'
app-plus
'
)
{
// 自动化测试时,不启用androidPrivacy.json
if
(
process
.
env
.
UNI_PLATFORM
===
'
app-plus
'
&&
!
process
.
env
.
UNI_AUTOMATOR_WS_ENDPOINT
)
{
copyOptions
.
push
({
from
:
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
android*.json
'
),
to
:
'
[name].[ext]
'
,
...
...
@@ -116,4 +118,4 @@ function getCopyWebpackPluginOptions (platformOptions, vueOptions) {
module
.
exports
=
{
assetsDir
,
getCopyWebpackPluginOptions
}
}
packages/webpack-uni-mp-loader/lib/plugin/generate-app.js
浏览文件 @
5ba05318
...
...
@@ -47,7 +47,7 @@ module.exports = function generateApp (compilation) {
// 框架预设样式 用于隐藏自定义组件
// TODO 分平台 import 不同 css
const
platforms
=
[
'
mp-weixin
'
,
'
mp-qq
'
,
'
mp-jd
'
,
'
mp-toutiao
'
,
'
mp-lark
'
]
const
platforms
=
[
'
mp-weixin
'
,
'
mp-qq
'
,
'
mp-jd
'
,
'
mp-toutiao
'
,
'
mp-lark
'
]
const
presetStyle
=
platforms
.
includes
(
process
.
env
.
UNI_PLATFORM
)
?
'
[data-custom-hidden="true"],[bind-data-custom-hidden="true"]{display: none !important;}
'
:
''
if
(
compilation
.
assets
[
`common/main
${
ext
}
`
])
{
// 是否存在 main.css
...
...
packages/webpack-uni-pages-loader/lib/platforms/mp-jd/index.js
浏览文件 @
5ba05318
...
...
@@ -3,9 +3,9 @@ module.exports = function (pagesJson, manifestJson) {
app
,
project
}
=
require
(
'
../mp
'
)(
pagesJson
,
manifestJson
,
require
(
'
./project.config.json
'
))
//暂不支持分包,兼容引擎判断
if
(
app
.
content
.
subPackages
&&
!
app
.
content
.
subPackages
.
length
)
{
delete
app
.
content
.
subPackages
;
//
暂不支持分包,兼容引擎判断
if
(
app
.
content
.
subPackages
&&
!
app
.
content
.
subPackages
.
length
)
{
delete
app
.
content
.
subPackages
}
return
[
app
,
project
]
}
src/platforms/mp-jd/runtime/api/protocols.js
浏览文件 @
5ba05318
import
navigateTo
from
'
uni-helpers/navigate-to
'
import
redirectTo
from
'
../../../mp-weixin/helpers/redirect-to
'
import
previewImage
from
'
../../../mp-weixin/helpers/normalize-preview-image
'
import
getSystemInfo
from
'
../../../mp-weixin/helpers/system-info
'
import
getUserProfile
from
'
../../../mp-weixin/helpers/get-user-profile
'
//
import navigateTo from 'uni-helpers/navigate-to'
//
import redirectTo from '../../../mp-weixin/helpers/redirect-to'
//
import previewImage from '../../../mp-weixin/helpers/normalize-preview-image'
//
import getSystemInfo from '../../../mp-weixin/helpers/system-info'
//
import getUserProfile from '../../../mp-weixin/helpers/get-user-profile'
// 需要做转换的 API 列表
export
const
protocols
=
{
...
...
src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js
浏览文件 @
5ba05318
...
...
@@ -110,7 +110,7 @@ export default function parseBaseApp (vm, {
initRefs
})
{
initEventChannel
()
if
(
__PLATFORM__
===
'
mp-weixin
'
||
__PLATFORM__
===
'
mp-qq
'
||
__PLATFORM__
===
'
mp-jd
'
||
__PLATFORM__
===
'
mp-toutiao
'
||
__PLATFORM__
===
if
(
__PLATFORM__
===
'
mp-weixin
'
||
__PLATFORM__
===
'
mp-qq
'
||
__PLATFORM__
===
'
mp-jd
'
||
__PLATFORM__
===
'
mp-toutiao
'
||
__PLATFORM__
===
'
mp-kuaishou
'
||
__PLATFORM__
===
'
mp-alipay
'
||
__PLATFORM__
===
'
mp-baidu
'
||
__PLATFORM__
===
'
mp-lark
'
)
{
initScopedSlotsParams
()
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录