Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增 chooseImage回调函数返回源参数:source #4705

Open
wants to merge 4 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
* 克隆仓库到本地后,执行 ```pnpm install``` 安装开发依赖。

## 开发

* 得先执行一遍`npm run build`把一些共享包给安装了
* 如果安装失败,注意检查一下pnpm的镜像源
* 执行命令编译指定包,如:```npm run build uni-mp-weixin```。
* 执行 ```npm run lint``` 检查代码风格。
* 执行 ```npm run test``` 运行测试。
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ TODOs.md
*.log
.history
scripts/package.json
uniapp-test
2,092 changes: 2,091 additions & 1 deletion packages/uni-app-plus/dist/style.css

Large diffs are not rendered by default.

24,949 changes: 24,948 additions & 1 deletion packages/uni-app-plus/dist/uni-app-view.umd.js

Large diffs are not rendered by default.

19 changes: 17 additions & 2 deletions packages/uni-app-plus/dist/uni.runtime.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,24 @@ function formatApiArgs(args, options) {
}
}
function invokeSuccess(id, name, res) {
return invokeCallback(id, extend((res || {}), { errMsg: name + ':ok' }));
const result = {
errMsg: name + ':ok',
};
//#if _X_
result.errSubject = name;
//#endif
return invokeCallback(id, extend((res || {}), result));
}
function invokeFail(id, name, errMsg, errRes) {
return invokeCallback(id, extend({ errMsg: name + ':fail' + (errMsg ? ' ' + errMsg : '') }, errRes));
const apiErrMsg = name + ':fail' + (errMsg ? ' ' + errMsg : '');
//#if !_X_
delete errRes.errCode;
//#endif
return invokeCallback(id, typeof UniError !== 'undefined'
? typeof errRes.errCode !== 'undefined'
? new UniError(name, errRes.errCode, apiErrMsg)
: new UniError(apiErrMsg, errRes)
: extend({ errMsg: apiErrMsg }, errRes));
}
function beforeInvokeApi(name, args, protocol, options) {
if ((process.env.NODE_ENV !== 'production')) {
Expand Down Expand Up @@ -14957,6 +14971,7 @@ const request = defineTaskApi(API_REQUEST, (args, { resolve, reject }) => {
}
}
if (method !== 'GET' &&
contentType &&
contentType.indexOf('application/json') === 0 &&
isPlainObject(data)) {
data = JSON.stringify(data);
Expand Down
11 changes: 7 additions & 4 deletions packages/uni-app-plus/dist/uni.x.runtime.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -996,13 +996,16 @@ function formatApiArgs(args, options) {
}
}
function invokeSuccess(id2, name, res) {
return invokeCallback(id2, extend(res || {}, {
var result = {
errMsg: name + ":ok"
}));
};
return invokeCallback(id2, extend(res || {}, result));
}
function invokeFail(id2, name, errMsg, errRes) {
return invokeCallback(id2, extend({
errMsg: name + ":fail" + (errMsg ? " " + errMsg : "")
var apiErrMsg = name + ":fail" + (errMsg ? " " + errMsg : "");
delete errRes.errCode;
return invokeCallback(id2, typeof UniError !== "undefined" ? typeof errRes.errCode !== "undefined" ? new UniError(name, errRes.errCode, apiErrMsg) : new UniError(apiErrMsg, errRes) : extend({
errMsg: apiErrMsg
}, errRes));
}
function beforeInvokeApi(name, args, protocol, options) {
Expand Down
2 changes: 1 addition & 1 deletion packages/uni-app-plus/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default defineConfig({
build: {
target: 'es2015',
cssTarget,
minify: 'terser',
minify: false,
cssCodeSplit: false,
lib: {
name: 'uni-app-view',
Expand Down
45 changes: 26 additions & 19 deletions packages/uni-components/src/vue/input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default /*#__PURE__*/ defineBuiltInComponent({
: 0
return AUTOCOMPLETES[index]
})

let pointCount = 0
let cache = ref('')
let resetCache: (() => void) | null
const rootRef: Ref<HTMLElement | null> = ref(null)
Expand All @@ -86,6 +86,30 @@ export default /*#__PURE__*/ defineBuiltInComponent({
input.removeEventListener('blur', resetCache)
resetCache = null
}
//ios 16之后number类型连续输入3个小数点后会自动删除数字
if (
plus.os.version &&
plus.os.name === 'iOS' &&
parseFloat(plus.os.version) >= 16.0
) {
if (cache.value && !state.value && !input.value) {
pointCount = pointCount >= 2 ? pointCount : pointCount + 1
if (cache.value.includes('.')) {
input.value = cache.value
return true
}
return false
}
if (
cache.value.includes('.') &&
state.value == cache.value.slice(0, -1) &&
pointCount >= 2
) {
state.value = input.value = cache.value
return true
}
}
pointCount = 0
if (input.validity && !input.validity.valid) {
if (
((!cache.value || !input.value) &&
Expand All @@ -103,26 +127,9 @@ export default /*#__PURE__*/ defineBuiltInComponent({
}
// 处理小数点
if (cache.value) {
if (cache.value.indexOf('.') !== -1) {
// 删除到小数点时
if (
(event as InputEvent).data !== '.' &&
(event as InputEvent).inputType === 'deleteContentBackward'
) {
const dotIndex = cache.value.indexOf('.')
cache.value =
input.value =
state.value =
cache.value.slice(0, dotIndex)
return true
}
} else if ((event as InputEvent).data === '.') {
if ((event as InputEvent).data === '.') {
// 输入小数点时
cache.value += '.'
resetCache = () => {
cache.value = input.value = cache.value.slice(0, -1)
}
input.addEventListener('blur', resetCache)
return false
}
}
Expand Down
Loading