提交 a126d33e 编写于 作者: M mahaifeng

[activity-callback]修改示例代码,添加pageroute

上级 0877c9e2
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
const cb = (ret : PrivacyOption) => { const cb = (ret : PrivacyOption) => {
console.log('privacyStateCallBackTest->' + ret.isAgree) console.log('privacyStateCallBackTest->' + ret.isAgree)
if (ret.isAgree==isAgree) { if (ret.isAgree == isAgree) {
uni.showToast({ uni.showToast({
title: '测试通过' title: '测试通过'
}) })
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
UTSAndroid.setPrivacyAgree(isAgree) UTSAndroid.setPrivacyAgree(isAgree)
UTSAndroid.offPrivacyAgreeChange(cb) UTSAndroid.offPrivacyAgreeChange(cb)
setTimeout(function () { setTimeout(function () {
console.log('privacyStateCallBackTest->false' ) console.log('privacyStateCallBackTest->false')
UTSAndroid.setPrivacyAgree(false) UTSAndroid.setPrivacyAgree(false)
}, 5000); }, 5000);
...@@ -325,14 +325,17 @@ ...@@ -325,14 +325,17 @@
let nextLineFlag = that.cbText + '\n' let nextLineFlag = that.cbText + '\n'
that.cbText = nextLineFlag 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 UTSAcvitiyLifeCycleCallback())
this.callback.push(new UTSActivityWindowCallback()) this.callback.push(new UTSActivityWindowCallback())
this.callback.push(new UTSAcvitiyKeyEventCallback()) this.callback.push(new UTSAcvitiyKeyEventCallback())
this.callback.push(new UTSActivityCallback()) this.callback.push(new UTSActivityCallback(), page.route)
this.callback.push(new UTSActivityComponentCallback()) this.callback.push(new UTSActivityComponentCallback())
this.callback.forEach((value) => { this.callback.forEach((value) => {
if (value instanceof UTSAcvitiyLifeCycleCallback) { if (value instanceof UTSAcvitiyLifeCycleCallback) {
UTSAndroid.onActivityCallback(value) UTSAndroid.onActivityCallback(value,page.route)
} }
if (value instanceof UTSActivityWindowCallback) { if (value instanceof UTSActivityWindowCallback) {
UTSAndroid.onActivityCallback(value) UTSAndroid.onActivityCallback(value)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册