diff --git a/pages/SyntaxCase/utsAndroid.uvue b/pages/SyntaxCase/utsAndroid.uvue index e41d4cc9d439c96d863560a586879c9c5f0b2b46..8cdeac60ef3d8d441e0660327ad5cc697c70d42d 100644 --- a/pages/SyntaxCase/utsAndroid.uvue +++ b/pages/SyntaxCase/utsAndroid.uvue @@ -41,19 +41,6 @@ - - - - - 点击注册activity 回调方法后,可以手动切换其他APP再返回,可在控制台和界面观察事件日志 - - - - - {{ cbText }} - - - @@ -102,16 +89,10 @@ data() { return { text: '', - cbText: '', selectImage: '', - callback: [] as Any[] } }, unmounted() { - // #ifdef APP-ANDROID - this.unRegActivityCallback() - // #endif - }, onLoad: function () { // #ifdef APP-ANDROID @@ -321,67 +302,6 @@ }) }, // #endif - // #ifdef APP-ANDROID - // #ifdef UNI-APP-X - activityCallback() { - var that = this - onCallbackChange(function (eventLog : string) { - // 展示捕捉到的声明周期日志 - let nextLine = that.cbText + eventLog - that.cbText = nextLine - let nextLineFlag = that.cbText + '\n' - that.cbText = nextLineFlag - }) - let index = getCurrentPages().length - 1 - let page = getCurrentPages()[index] - console.log('page route=' + page.route) - this.callback.push(new UTSAcvitiyLifeCycleCallback()) - this.callback.push(new UTSActivityWindowCallback()) - this.callback.push(new UTSAcvitiyKeyEventCallback()) - this.callback.push(new UTSActivityCallback(), page.route) - this.callback.push(new UTSActivityComponentCallback()) - this.callback.forEach((value) => { - if (value instanceof UTSAcvitiyLifeCycleCallback) { - UTSAndroid.onActivityCallback(value,page.route) - } - if (value instanceof UTSActivityWindowCallback) { - UTSAndroid.onActivityCallback(value) - } - if (value instanceof UTSAcvitiyKeyEventCallback) { - UTSAndroid.onActivityCallback(value) - } - if (value instanceof UTSActivityCallback) { - UTSAndroid.onActivityCallback(value) - } - if (value instanceof UTSActivityComponentCallback) { - UTSAndroid.onActivityCallback(value) - } - - }) - }, - unRegActivityCallback() { - this.callback.forEach((value) => { - - if (value instanceof UTSAcvitiyLifeCycleCallback) { - UTSAndroid.offActivityCallback(value) - } - if (value instanceof UTSActivityWindowCallback) { - UTSAndroid.offActivityCallback(value) - } - if (value instanceof UTSAcvitiyKeyEventCallback) { - UTSAndroid.offActivityCallback(value) - } - if (value instanceof UTSActivityCallback) { - UTSAndroid.offActivityCallback(value) - } - if (value instanceof UTSActivityComponentCallback) { - UTSAndroid.offActivityCallback(value) - } - }) - } - // #endif - // #endif - }, } diff --git a/pages/SystemAPI/SystemAPI.uvue b/pages/SystemAPI/SystemAPI.uvue index c187377a948ce56f7ca54f9a8c7570bcedfe054e..a331d379fe12182fc7847800363b04c4ddf404d9 100644 --- a/pages/SystemAPI/SystemAPI.uvue +++ b/pages/SystemAPI/SystemAPI.uvue @@ -20,7 +20,20 @@