Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Velpro187
uni-app
提交
275b578e
U
uni-app
项目概览
Velpro187
/
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,发现更多精彩内容 >>
提交
275b578e
编写于
10月 29, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(mp): mp-alipay
上级
da1dab32
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
148 addition
and
27 deletion
+148
-27
packages/uni-app-plus/dist/uni-app-service.es.js
packages/uni-app-plus/dist/uni-app-service.es.js
+4
-0
packages/uni-app-plus/dist/uni-app-view.umd.js
packages/uni-app-plus/dist/uni-app-view.umd.js
+3
-3
packages/uni-cli-shared/src/env/define.ts
packages/uni-cli-shared/src/env/define.ts
+3
-0
packages/uni-cli-shared/src/json/mp/pages.ts
packages/uni-cli-shared/src/json/mp/pages.ts
+8
-1
packages/uni-i18n/dist/uni-i18n.cjs.js
packages/uni-i18n/dist/uni-i18n.cjs.js
+4
-0
packages/uni-i18n/dist/uni-i18n.es.js
packages/uni-i18n/dist/uni-i18n.es.js
+4
-0
packages/uni-i18n/src/I18n.ts
packages/uni-i18n/src/I18n.ts
+4
-0
packages/uni-mp-alipay/dist/uni.compiler.js
packages/uni-mp-alipay/dist/uni.compiler.js
+29
-1
packages/uni-mp-alipay/dist/uni.mp.esm.js
packages/uni-mp-alipay/dist/uni.mp.esm.js
+10
-1
packages/uni-mp-alipay/src/compiler/options.ts
packages/uni-mp-alipay/src/compiler/options.ts
+29
-1
packages/uni-mp-core/src/runtime/componentInstance/index.ts
packages/uni-mp-core/src/runtime/componentInstance/index.ts
+9
-1
packages/uni-mp-vite/src/plugin/build.ts
packages/uni-mp-vite/src/plugin/build.ts
+35
-19
packages/uni-mp-vite/src/plugin/index.ts
packages/uni-mp-vite/src/plugin/index.ts
+5
-0
packages/uni-mp-vite/src/plugins/pagesJson.ts
packages/uni-mp-vite/src/plugins/pagesJson.ts
+1
-0
未找到文件。
packages/uni-app-plus/dist/uni-app-service.es.js
浏览文件 @
275b578e
...
...
@@ -1395,6 +1395,10 @@ var serviceContext = (function (vue) {
return locale;
}
locale = locale.toLowerCase();
if (locale === 'chinese') {
// 支付宝
return LOCALE_ZH_HANS;
}
if (locale.indexOf('zh') === 0) {
if (locale.indexOf('-hans') > -1) {
return LOCALE_ZH_HANS;
...
...
packages/uni-app-plus/dist/uni-app-view.umd.js
浏览文件 @
275b578e
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
packages/uni-cli-shared/src/env/define.ts
浏览文件 @
275b578e
...
...
@@ -13,6 +13,9 @@ export function initDefine(stringifyBoolean: boolean = false) {
'
process.env.UNI_APP_ID
'
:
JSON
.
stringify
(
manifestJson
.
appid
||
''
),
'
process.env.UNI_APP_NAME
'
:
JSON
.
stringify
(
manifestJson
.
name
||
''
),
'
process.env.UNI_PLATFORM
'
:
JSON
.
stringify
(
process
.
env
.
UNI_PLATFORM
),
'
process.env.UNI_COMPILER_VERSION
'
:
JSON
.
stringify
(
process
.
env
.
UNI_COMPILER_VERSION
),
'
process.env.RUN_BY_HBUILDERX
'
:
stringifyBoolean
?
JSON
.
stringify
(
isRunByHBuilderX
)
:
isRunByHBuilderX
,
...
...
packages/uni-cli-shared/src/json/mp/pages.ts
浏览文件 @
275b578e
...
...
@@ -34,6 +34,8 @@ function parsePagesJson(
networkTimeout
,
subpackages
,
windowOptionsMap
,
tabBarOptionsMap
,
tabBarItemOptionsMap
,
}:
ParsePagesJsonOptions
=
{
subpackages
:
false
,
}
...
...
@@ -107,7 +109,12 @@ function parsePagesJson(
// tabBar
if
(
pagesJson
.
tabBar
)
{
const
tabBar
=
parseTabBar
(
pagesJson
.
tabBar
!
,
platform
)
const
tabBar
=
parseTabBar
(
pagesJson
.
tabBar
!
,
platform
,
tabBarOptionsMap
,
tabBarItemOptionsMap
)
if
(
tabBar
)
{
appJson
.
tabBar
=
tabBar
}
...
...
packages/uni-i18n/dist/uni-i18n.cjs.js
浏览文件 @
275b578e
...
...
@@ -125,6 +125,10 @@ function normalizeLocale(locale, messages) {
return
locale
;
}
locale
=
locale
.
toLowerCase
();
if
(
locale
===
'
chinese
'
)
{
// 支付宝
return
LOCALE_ZH_HANS
;
}
if
(
locale
.
indexOf
(
'
zh
'
)
===
0
)
{
if
(
locale
.
indexOf
(
'
-hans
'
)
>
-
1
)
{
return
LOCALE_ZH_HANS
;
...
...
packages/uni-i18n/dist/uni-i18n.es.js
浏览文件 @
275b578e
...
...
@@ -121,6 +121,10 @@ function normalizeLocale(locale, messages) {
return
locale
;
}
locale
=
locale
.
toLowerCase
();
if
(
locale
===
'
chinese
'
)
{
// 支付宝
return
LOCALE_ZH_HANS
;
}
if
(
locale
.
indexOf
(
'
zh
'
)
===
0
)
{
if
(
locale
.
indexOf
(
'
-hans
'
)
>
-
1
)
{
return
LOCALE_ZH_HANS
;
...
...
packages/uni-i18n/src/I18n.ts
浏览文件 @
275b578e
...
...
@@ -59,6 +59,10 @@ export function normalizeLocale(
return
locale
as
BuiltInLocale
}
locale
=
locale
.
toLowerCase
()
if
(
locale
===
'
chinese
'
)
{
// 支付宝
return
LOCALE_ZH_HANS
}
if
(
locale
.
indexOf
(
'
zh
'
)
===
0
)
{
if
(
locale
.
indexOf
(
'
-hans
'
)
>
-
1
)
{
return
LOCALE_ZH_HANS
...
...
packages/uni-mp-alipay/dist/uni.compiler.js
浏览文件 @
275b578e
...
...
@@ -95,7 +95,8 @@ const miniProgram = {
},
slot
:
{
$slots
:
true
,
fallback
:
true
,
// 支付宝 fallback 有 bug,当多个带默认 slot 组件嵌套使用时,所有的默认slot均会显示,如uni-file-picker(image)
fallback
:
false
,
},
directive
:
'
a:
'
,
};
...
...
@@ -133,6 +134,33 @@ const options = {
},
},
global
:
'
my
'
,
json
:
{
windowOptionsMap
:
{
defaultTitle
:
'
navigationBarTitleText
'
,
pullRefresh
:
'
enablePullDownRefresh
'
,
allowsBounceVertical
:
'
allowsBounceVertical
'
,
titleBarColor
:
'
navigationBarBackgroundColor
'
,
optionMenu
:
'
optionMenu
'
,
backgroundColor
:
'
backgroundColor
'
,
usingComponents
:
'
usingComponents
'
,
navigationBarShadow
:
'
navigationBarShadow
'
,
titleImage
:
'
titleImage
'
,
transparentTitle
:
'
transparentTitle
'
,
titlePenetrate
:
'
titlePenetrate
'
,
},
tabBarOptionsMap
:
{
textColor
:
'
color
'
,
selectedColor
:
'
selectedColor
'
,
backgroundColor
:
'
backgroundColor
'
,
items
:
'
list
'
,
},
tabBarItemOptionsMap
:
{
pagePath
:
'
pagePath
'
,
name
:
'
text
'
,
icon
:
'
iconPath
'
,
activeIcon
:
'
selectedIconPath
'
,
},
},
app
:
{
darkmode
:
false
,
subpackages
:
true
,
...
...
packages/uni-mp-alipay/dist/uni.mp.esm.js
浏览文件 @
275b578e
...
...
@@ -163,7 +163,16 @@ function initBaseInstance(instance, options) {
{
Object
.
defineProperty
(
instance
,
'
slots
'
,
{
get
()
{
return
this
.
$scope
&&
this
.
$scope
.
props
.
$slots
;
if
(
this
.
$scope
)
{
const
slots
=
this
.
$scope
.
props
.
$slots
;
if
(
slots
.
$default
)
{
slots
.
default
=
slots
.
$default
;
}
else
{
delete
slots
.
default
;
}
return
slots
;
}
},
});
}
...
...
packages/uni-mp-alipay/src/compiler/options.ts
浏览文件 @
275b578e
...
...
@@ -19,7 +19,8 @@ export const miniProgram: MiniProgramCompilerOptions = {
},
slot
:
{
$slots
:
true
,
fallback
:
true
,
// 支付宝 fallback 有 bug,当多个带默认 slot 组件嵌套使用时,所有的默认slot均会显示,如uni-file-picker(image)
fallback
:
false
,
},
directive
:
'
a:
'
,
}
...
...
@@ -57,6 +58,33 @@ export const options: UniMiniProgramPluginOptions = {
},
},
global
:
'
my
'
,
json
:
{
windowOptionsMap
:
{
defaultTitle
:
'
navigationBarTitleText
'
,
pullRefresh
:
'
enablePullDownRefresh
'
,
allowsBounceVertical
:
'
allowsBounceVertical
'
,
titleBarColor
:
'
navigationBarBackgroundColor
'
,
optionMenu
:
'
optionMenu
'
,
backgroundColor
:
'
backgroundColor
'
,
usingComponents
:
'
usingComponents
'
,
navigationBarShadow
:
'
navigationBarShadow
'
,
titleImage
:
'
titleImage
'
,
transparentTitle
:
'
transparentTitle
'
,
titlePenetrate
:
'
titlePenetrate
'
,
},
tabBarOptionsMap
:
{
textColor
:
'
color
'
,
selectedColor
:
'
selectedColor
'
,
backgroundColor
:
'
backgroundColor
'
,
items
:
'
list
'
,
},
tabBarItemOptionsMap
:
{
pagePath
:
'
pagePath
'
,
name
:
'
text
'
,
icon
:
'
iconPath
'
,
activeIcon
:
'
selectedIconPath
'
,
},
},
app
:
{
darkmode
:
false
,
subpackages
:
true
,
...
...
packages/uni-mp-core/src/runtime/componentInstance/index.ts
浏览文件 @
275b578e
...
...
@@ -68,7 +68,15 @@ export function initBaseInstance(
if
(
__PLATFORM__
===
'
mp-alipay
'
)
{
Object
.
defineProperty
(
instance
,
'
slots
'
,
{
get
()
{
return
this
.
$scope
&&
this
.
$scope
.
props
.
$slots
if
(
this
.
$scope
)
{
const
slots
=
this
.
$scope
.
props
.
$slots
if
(
slots
.
$default
)
{
slots
.
default
=
slots
.
$default
}
else
{
delete
slots
.
default
}
return
slots
}
},
})
}
else
{
...
...
packages/uni-mp-vite/src/plugin/build.ts
浏览文件 @
275b578e
...
...
@@ -13,7 +13,7 @@ import {
resolveMainPathOnce
,
normalizeMiniProgramFilename
,
}
from
'
@dcloudio/uni-cli-shared
'
import
{
GetManualChunk
,
GetModuleInfo
}
from
'
rollup
'
import
{
GetManualChunk
,
GetModuleInfo
,
Plugin
,
PreRenderedChunk
}
from
'
rollup
'
import
{
isUniComponentUrl
,
isUniPageUrl
,
...
...
@@ -44,25 +44,9 @@ export function buildOptions(): UserConfig['build'] {
output
:
{
entryFileNames
:
'
app.js
'
,
manualChunks
:
createMoveToVendorChunkFn
(),
chunkFileNames
(
chunk
)
{
if
(
chunk
.
isDynamicEntry
&&
chunk
.
facadeModuleId
)
{
let
id
=
chunk
.
facadeModuleId
if
(
isUniPageUrl
(
id
))
{
id
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
parseVirtualPagePath
(
id
)
)
}
else
if
(
isUniComponentUrl
(
id
))
{
id
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
parseVirtualComponentPath
(
id
)
)
}
return
removeExt
(
normalizeMiniProgramFilename
(
id
,
inputDir
))
+
'
.js
'
}
return
'
[name].js
'
},
chunkFileNames
:
createChunkFileNames
(
inputDir
),
assetFileNames
:
'
[name][extname]
'
,
plugins
:
[
dynamicImportPolyfill
()],
},
},
}
...
...
@@ -148,3 +132,35 @@ function staticImportedByEntry(
cache
.
set
(
id
,
someImporterIs
)
return
someImporterIs
}
function
createChunkFileNames
(
inputDir
:
string
):
(
chunkInfo
:
PreRenderedChunk
)
=>
string
{
return
function
chunkFileNames
(
chunk
)
{
if
(
chunk
.
isDynamicEntry
&&
chunk
.
facadeModuleId
)
{
let
id
=
chunk
.
facadeModuleId
if
(
isUniPageUrl
(
id
))
{
id
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
parseVirtualPagePath
(
id
))
}
else
if
(
isUniComponentUrl
(
id
))
{
id
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
parseVirtualComponentPath
(
id
)
)
}
return
removeExt
(
normalizeMiniProgramFilename
(
id
,
inputDir
))
+
'
.js
'
}
return
'
[name].js
'
}
}
function
dynamicImportPolyfill
():
Plugin
{
return
{
name
:
'
dynamic-import-polyfill
'
,
renderDynamicImport
()
{
return
{
left
:
'
(
'
,
right
:
'
)
'
,
}
},
}
}
packages/uni-mp-vite/src/plugin/index.ts
浏览文件 @
275b578e
...
...
@@ -27,6 +27,11 @@ export interface UniMiniProgramPluginOptions {
}
}
global
:
string
json
?:
{
windowOptionsMap
?:
Record
<
string
,
string
>
tabBarOptionsMap
?:
Record
<
string
,
string
>
tabBarItemOptionsMap
?:
Record
<
string
,
string
>
}
app
:
{
darkmode
:
boolean
subpackages
:
boolean
...
...
packages/uni-mp-vite/src/plugins/pagesJson.ts
浏览文件 @
275b578e
...
...
@@ -54,6 +54,7 @@ export function uniPagesJsonPlugin(
fs
.
existsSync
(
path
.
resolve
(
inputDir
,
'
theme.json
'
)),
networkTimeout
:
manifestJson
.
networkTimeout
,
subpackages
:
options
.
app
.
subpackages
,
...
options
.
json
,
}
)
nvueCssPathsCache
.
set
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录