From a3243aa08c9d7090a396f049925b8f1dcbd08ca3 Mon Sep 17 00:00:00 2001 From: qiang Date: Wed, 20 Nov 2019 20:47:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20v3-app=20cover-image=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=94=AF=E6=8C=81=E4=BA=8B=E4=BB=B6=EF=BC=9Aload?= =?UTF-8?q?=E3=80=81error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/view/mixins/keyboard.js | 17 ++-- .../view/components/cover-image/index.vue | 79 ++++++++++++++++++- .../app-plus/view/components/map/index.vue | 1 + src/shared/index.js | 5 +- 4 files changed, 85 insertions(+), 17 deletions(-) diff --git a/src/core/view/mixins/keyboard.js b/src/core/view/mixins/keyboard.js index aa8a35749..ce9e8f0f0 100644 --- a/src/core/view/mixins/keyboard.js +++ b/src/core/view/mixins/keyboard.js @@ -1,3 +1,7 @@ +import { + plusReady +} from 'uni-shared' + function hideKeyboard () { document.activeElement.blur() } @@ -34,15 +38,6 @@ export default { this.onKeyboardHide() }, methods: { - plusReady (callback) { - if (!callback) { - return - } - if (window.plus) { - return callback() - } - document.addEventListener('plusready', callback) - }, initKeyboard (el) { el.addEventListener('focus', () => { UniViewJSBridge.subscribe('hideKeyboard', hideKeyboard) @@ -52,12 +47,12 @@ export default { el.addEventListener('blur', this.onKeyboardHide) }, showSoftKeybord () { - this.plusReady(() => { + plusReady(() => { plus.key.showSoftKeybord() }) }, setSoftinputTemporary () { - this.plusReady(() => { + plusReady(() => { var currentWebview = plus.webview.currentWebview() var style = currentWebview.getStyle() || {} if (style.softinputMode === 'adjustResize') { diff --git a/src/platforms/app-plus/view/components/cover-image/index.vue b/src/platforms/app-plus/view/components/cover-image/index.vue index 89af7ccca..5646e8916 100644 --- a/src/platforms/app-plus/view/components/cover-image/index.vue +++ b/src/platforms/app-plus/view/components/cover-image/index.vue @@ -1,6 +1,7 @@