Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
touchx
uni-app
提交
4c96efe7
U
uni-app
项目概览
touchx
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
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,发现更多精彩内容 >>
提交
4c96efe7
编写于
12月 20, 2022
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into alpha
# Conflicts: # packages/uni-h5/dist/index.umd.min.js
上级
d5a8bd17
649071ec
变更
13
展开全部
隐藏空白更改
内联
并排
Showing
13 changed file
with
143 addition
and
37 deletion
+143
-37
packages/uni-cli-shared/lib/pages.js
packages/uni-cli-shared/lib/pages.js
+11
-2
packages/uni-cli-shared/lib/uts/uts.js
packages/uni-cli-shared/lib/uts/uts.js
+64
-1
packages/uni-cli-shared/package.json
packages/uni-cli-shared/package.json
+2
-1
packages/uni-h5/dist/index.umd.min.js
packages/uni-h5/dist/index.umd.min.js
+1
-1
packages/webpack-uni-pages-loader/lib/platforms/mp-alipay.js
packages/webpack-uni-pages-loader/lib/platforms/mp-alipay.js
+3
-6
packages/webpack-uni-pages-loader/lib/platforms/mp.js
packages/webpack-uni-pages-loader/lib/platforms/mp.js
+2
-1
src/core/view/components/button/index.vue
src/core/view/components/button/index.vue
+2
-2
src/core/view/components/input/index.vue
src/core/view/components/input/index.vue
+6
-2
src/platforms/h5/components/system-routes/open-location/index.vue
...forms/h5/components/system-routes/open-location/index.vue
+10
-18
src/platforms/h5/service/api/location/get-location.js
src/platforms/h5/service/api/location/get-location.js
+22
-0
src/platforms/h5/view/components/picker/index.vue
src/platforms/h5/view/components/picker/index.vue
+1
-1
src/platforms/h5/view/components/video/index.vue
src/platforms/h5/view/components/video/index.vue
+9
-2
src/platforms/mp-alipay/runtime/api/protocols.js
src/platforms/mp-alipay/runtime/api/protocols.js
+10
-0
未找到文件。
packages/uni-cli-shared/lib/pages.js
浏览文件 @
4c96efe7
...
...
@@ -425,6 +425,16 @@ function initAutoComponents () {
function
initAutoImportScanComponents
()
{
const
components
=
initAutoComponents
()
const
{
initUTSComponents
}
=
require
(
'
./uts/uts.js
'
)
initUTSComponents
(
process
.
env
.
UNI_INPUT_DIR
,
process
.
env
.
UNI_PLATFORM
).
forEach
((
item
)
=>
{
components
[
item
.
pattern
.
source
]
=
item
.
replacement
.
replace
(
'
\
0
'
,
''
).
replace
(
'
?uts-proxy
'
,
'
/package.json?uts-proxy
'
)
})
if
(
process
.
env
.
UNI_PLATFORM
===
'
quickapp-native
'
)
{
if
(
!
uniQuickAppAutoImportScanComponents
)
{
uniQuickAppAutoImportScanComponents
=
getAutoComponentsByDir
(
...
...
@@ -463,8 +473,7 @@ function initAutoImportComponents (easycom = {}) {
}
initBuiltInEasycom
(
BUILT_IN_EASYCOMS
,
usingAutoImportComponents
)
// 目前仅 mp-weixin 内置支持 page-meta 等组件
if
(
process
.
env
.
UNI_PLATFORM
===
'
mp-weixin
'
)
{
}
else
if
(
process
.
env
.
UNI_PLATFORM
===
'
mp-alipay
'
)
{
if
(
process
.
env
.
UNI_PLATFORM
===
'
mp-weixin
'
)
{}
else
if
(
process
.
env
.
UNI_PLATFORM
===
'
mp-alipay
'
)
{
initBuiltInEasycom
(
BUILT_IN_COMPONENTS_ALIPAY
,
usingAutoImportComponents
)
}
else
{
initBuiltInEasycom
(
BUILT_IN_COMPONENTS
,
usingAutoImportComponents
)
...
...
packages/uni-cli-shared/lib/uts/uts.js
浏览文件 @
4c96efe7
...
...
@@ -3,9 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return
(
mod
&&
mod
.
__esModule
)
?
mod
:
{
"
default
"
:
mod
};
};
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
exports
.
resolveUTSCompiler
=
exports
.
resolveUtsModule
=
exports
.
resolveUtsAppModule
=
void
0
;
exports
.
initUTSComponents
=
exports
.
resolveUTSCompiler
=
exports
.
resolveUtsModule
=
exports
.
resolveUtsAppModule
=
void
0
;
const
fs_1
=
__importDefault
(
require
(
"
fs
"
));
const
path_1
=
__importDefault
(
require
(
"
path
"
));
const
fast_glob_1
=
__importDefault
(
require
(
"
fast-glob
"
));
const
hbx_1
=
require
(
"
./hbx
"
);
const
utils_1
=
require
(
"
./utils
"
);
/**
...
...
@@ -99,3 +100,65 @@ function resolveUTSCompiler() {
return
require
(
compilerPath
);
}
exports
.
resolveUTSCompiler
=
resolveUTSCompiler
;
function
initUTSComponents
(
inputDir
,
platform
)
{
const
components
=
[];
if
(
platform
!==
'
app
'
&&
platform
!==
'
app-plus
'
)
{
return
components
;
}
const
easycomsObj
=
Object
.
create
(
null
);
const
dirs
=
resolveUTSComponentDirs
(
inputDir
);
dirs
.
forEach
((
dir
)
=>
{
const
is_uni_modules_utssdk
=
dir
.
endsWith
(
'
utssdk
'
);
const
is_ussdk
=
!
is_uni_modules_utssdk
&&
path_1
.
default
.
dirname
(
dir
).
endsWith
(
'
utssdk
'
);
if
(
is_uni_modules_utssdk
||
is_ussdk
)
{
fast_glob_1
.
default
.
sync
(
'
**/*.vue
'
,
{
cwd
:
dir
,
absolute
:
true
,
})
.
forEach
((
file
)
=>
{
let
name
=
parseVueComponentName
(
file
);
if
(
!
name
)
{
if
(
file
.
endsWith
(
'
index.vue
'
))
{
name
=
path_1
.
default
.
basename
(
is_uni_modules_utssdk
?
path_1
.
default
.
dirname
(
dir
)
:
dir
);
}
}
if
(
name
)
{
const
importDir
=
(
0
,
utils_1
.
normalizePath
)(
is_uni_modules_utssdk
?
path_1
.
default
.
dirname
(
dir
)
:
dir
);
easycomsObj
[
`^
${
name
}
$`
]
=
`\0
${
importDir
}
?uts-proxy`
;
}
});
}
});
Object
.
keys
(
easycomsObj
).
forEach
((
name
)
=>
{
components
.
push
({
pattern
:
new
RegExp
(
name
),
replacement
:
easycomsObj
[
name
],
});
});
return
components
;
}
exports
.
initUTSComponents
=
initUTSComponents
;
function
resolveUTSComponentDirs
(
inputDir
)
{
const
utssdkDir
=
path_1
.
default
.
resolve
(
inputDir
,
'
utssdk
'
);
const
uniModulesDir
=
path_1
.
default
.
resolve
(
inputDir
,
'
uni_modules
'
);
return
fast_glob_1
.
default
.
sync
(
'
*
'
,
{
cwd
:
utssdkDir
,
absolute
:
true
,
onlyDirectories
:
true
,
})
.
concat
(
fast_glob_1
.
default
.
sync
(
'
*/utssdk
'
,
{
cwd
:
uniModulesDir
,
absolute
:
true
,
onlyDirectories
:
true
,
}));
}
const
nameRE
=
/name
\s
*:
\s
*
[
'|"
](
.*
)[
'|"
]
/
;
function
parseVueComponentName
(
file
)
{
const
content
=
fs_1
.
default
.
readFileSync
(
file
,
'
utf8
'
);
const
matches
=
content
.
match
(
nameRE
);
if
(
matches
)
{
return
matches
[
1
];
}
}
packages/uni-cli-shared/package.json
浏览文件 @
4c96efe7
...
...
@@ -19,7 +19,8 @@
"author"
:
"fxy060608"
,
"license"
:
"Apache-2.0"
,
"dependencies"
:
{
"escape-string-regexp"
:
"^4.0.0"
,
"escape-string-regexp"
:
"^4.0.0"
,
"fast-glob"
:
"^3.2.11"
,
"glob-escape"
:
"^0.0.2"
,
"hash-sum"
:
"^1.0.2"
,
"postcss-urlrewrite"
:
"^0.2.2"
,
...
...
packages/uni-h5/dist/index.umd.min.js
浏览文件 @
4c96efe7
此差异已折叠。
点击以展开。
packages/webpack-uni-pages-loader/lib/platforms/mp-alipay.js
浏览文件 @
4c96efe7
...
...
@@ -32,7 +32,8 @@ const pagesJson2AppJson = {
tabBar
:
function
(
name
,
value
,
json
)
{
json
.
tabBar
=
parseTabBar
(
value
)
},
preloadRule
:
defaultCopy
preloadRule
:
defaultCopy
,
entryPagePath
:
defaultCopy
}
function
copyToJson
(
json
,
fromJson
,
options
)
{
...
...
@@ -96,10 +97,6 @@ module.exports = function (pagesJson, manifestJson) {
if
(
fs
.
existsSync
(
projectPath
))
{
project
=
require
(
projectPath
)
}
else
{
if
(
platformJson
.
appid
)
{
project
.
appid
=
platformJson
.
appid
}
project
.
component2
=
hasOwn
(
platformJson
,
'
component2
'
)
?
platformJson
.
component2
:
true
project
.
enableAppxNg
=
hasOwn
(
platformJson
,
'
enableAppxNg
'
)
?
platformJson
.
enableAppxNg
:
true
}
...
...
@@ -111,4 +108,4 @@ module.exports = function (pagesJson, manifestJson) {
name
:
'
mini.project
'
,
content
:
project
}]
}
}
packages/webpack-uni-pages-loader/lib/platforms/mp.js
浏览文件 @
4c96efe7
...
...
@@ -95,7 +95,8 @@ const pagesJson2AppJson = {
},
preloadRule
:
defaultCopy
,
workers
:
defaultCopy
,
plugins
:
defaultCopy
plugins
:
defaultCopy
,
entryPagePath
:
defaultCopy
}
const
manifestJson2AppJson
=
{
...
...
src/core/view/components/button/index.vue
浏览文件 @
4c96efe7
...
...
@@ -405,8 +405,8 @@ export default {
}
.button-hover
[
type
=
"primary"
][
plain
]
{
color
:
rgba
(
26
,
173
,
2
5
,
0.6
);
border-color
:
rgba
(
26
,
173
,
2
5
,
0.6
);
color
:
rgba
(
0
,
122
,
25
5
,
0.6
);
border-color
:
rgba
(
0
,
122
,
25
5
,
0.6
);
background-color
:
transparent
;
}
...
...
src/core/view/components/input/index.vue
浏览文件 @
4c96efe7
...
...
@@ -237,10 +237,14 @@ export default {
// 数字类型输入错误时无法获取具体的值,自定义校验和纠正。
this
.
__clearCachedValue
&&
$event
.
target
.
removeEventListener
(
'
blur
'
,
this
.
__clearCachedValue
)
if
(
$event
.
target
.
validity
&&
!
$event
.
target
.
validity
.
valid
)
{
if
((
!
this
.
cachedValue
&&
$event
.
data
===
'
-
'
)
||
(
this
.
cachedValue
[
0
]
===
'
-
'
&&
$event
.
inputType
===
'
deleteContentBackward
'
))
{
if
(
((
!
this
.
cachedValue
||
!
$event
.
target
.
value
)
&&
$event
.
data
===
'
-
'
)
||
(
this
.
cachedValue
[
0
]
===
'
-
'
&&
$event
.
inputType
===
'
deleteContentBackward
'
)
)
{
this
.
cachedValue
=
'
-
'
this
.
valueSync
=
''
const
clearCachedValue
=
this
.
__clearCachedValue
=
()
=>
{
this
.
cachedValue
=
''
this
.
cachedValue
=
$event
.
target
.
value
=
''
}
$event
.
target
.
addEventListener
(
'
blur
'
,
clearCachedValue
)
return
...
...
src/platforms/h5/components/system-routes/open-location/index.vue
浏览文件 @
4c96efe7
...
...
@@ -9,7 +9,7 @@
>
<div
class=
"map-move"
@
click=
"
moveToLocation
"
@
click=
"
setCenter(location)
"
>
<i>

</i>
</div>
...
...
@@ -99,6 +99,15 @@ export default {
}
}
},
mounted
()
{
uni
.
getLocation
({
type
:
'
gcj02
'
,
success
:
({
latitude
,
longitude
})
=>
{
this
.
location
.
latitude
=
latitude
this
.
location
.
longitude
=
longitude
}
})
},
methods
:
{
onRegionChange
(
event
)
{
const
centerLocation
=
event
.
detail
.
centerLocation
...
...
@@ -111,23 +120,6 @@ export default {
this
.
center
.
latitude
=
latitude
this
.
center
.
longitude
=
longitude
},
moveToLocation
()
{
uni
.
getLocation
({
type
:
'
gcj02
'
,
success
:
this
.
move
.
bind
(
this
),
fail
:
()
=>
{
// move({
// latitude: 0,
// longitude: 0
// })
}
})
},
move
({
latitude
,
longitude
})
{
this
.
location
.
latitude
=
latitude
this
.
location
.
longitude
=
longitude
this
.
setCenter
({
latitude
,
longitude
})
},
back
()
{
getApp
().
$router
.
back
()
},
...
...
src/platforms/h5/service/api/location/get-location.js
浏览文件 @
4c96efe7
...
...
@@ -6,6 +6,7 @@ import {
getMapInfo
,
translateGeo
}
from
'
../../../helpers/location
'
import
{
loadMaps
}
from
'
../../../view/components/map/maps
'
/**
* 获取定位信息
...
...
@@ -68,6 +69,27 @@ export function getLocation ({
reject
(
new
Error
(
'
network error
'
))
}
})
}
else
if
(
mapInfo
.
type
===
MapType
.
AMAP
)
{
loadMaps
([],
()
=>
{
window
.
AMap
.
plugin
(
'
AMap.Geolocation
'
,
()
=>
{
const
geolocation
=
new
window
.
AMap
.
Geolocation
({
enableHighAccuracy
:
true
,
timeout
:
10000
})
geolocation
.
getCurrentPosition
((
status
,
data
)
=>
{
if
(
status
===
'
complete
'
)
{
resolve
({
latitude
:
data
.
position
.
lat
,
longitude
:
data
.
position
.
lng
,
accuracy
:
data
.
accuracy
})
}
else
{
reject
(
new
Error
(
data
.
message
))
}
})
})
})
}
else
{
reject
(
new
Error
(
'
network error
'
))
}
...
...
src/platforms/h5/view/components/picker/index.vue
浏览文件 @
4c96efe7
...
...
@@ -171,7 +171,7 @@ function getYearStartEnd (props) {
}
}
if
(
props
.
end
)
{
const
_year
=
new
Date
(
props
.
start
).
getFullYear
()
const
_year
=
new
Date
(
props
.
end
).
getFullYear
()
if
(
!
isNaN
(
_year
)
&&
_year
>
end
)
{
end
=
_year
}
...
...
src/platforms/h5/view/components/video/index.vue
浏览文件 @
4c96efe7
...
...
@@ -51,10 +51,14 @@
class="uni-video-control-button"
@click.stop="trigger"
/>
<div
class=
"uni-video-current-time"
>
<div
v-show=
"showProgress"
class=
"uni-video-current-time"
>
{{
currentTime
|
time
}}
</div>
<div
v-show=
"showProgress"
ref=
"progress"
class=
"uni-video-progress-container"
@
click.stop=
"clickProgress($event)"
...
...
@@ -73,7 +77,10 @@
</div>
</div>
</div>
<div
class=
"uni-video-duration"
>
<div
v-show=
"showProgress"
class=
"uni-video-duration"
>
{{
(
duration
||
durationTime
)
|
time
}}
</div>
</div>
...
...
src/platforms/mp-alipay/runtime/api/protocols.js
浏览文件 @
4c96efe7
...
...
@@ -484,6 +484,16 @@ const protocols = { // 需要做转换的 API 列表
}
}
// 钉钉小程序处理
if
(
!
my
.
canIUse
(
'
saveImageToPhotosAlbum
'
))
{
protocols
.
saveImageToPhotosAlbum
=
{
name
:
'
saveImage
'
,
args
:
{
filePath
:
'
url
'
}
}
}
export
{
protocols
,
todos
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录