impl pop self

This commit is contained in:
王劲鹏 2021-06-10 11:27:33 +08:00 committed by osborn
parent 38f761aad7
commit ab0ab98aaa

View File

@ -75,7 +75,21 @@ void DoricNavigatorPlugin::pop(QString jsValueString, QString callbackId) {
DoricThreadMode::JS); DoricThreadMode::JS);
} }
void DoricNavigatorPlugin::popSelf(QString jsValueString, QString callbackId) {} void DoricNavigatorPlugin::popSelf(QString jsValueString, QString callbackId) {
getContext()->getDriver()->asyncCall(
[this] {
QObject *window = getContext()->getQmlEngine()->rootObjects().at(0);
QMetaObject::invokeMethod(window, "navigatorPop");
},
DoricThreadMode::UI);
getContext()->getDriver()->asyncCall(
[this, callbackId] {
QVariantList args;
DoricPromise::resolve(getContext(), callbackId, args);
},
DoricThreadMode::JS);
}
void DoricNavigatorPlugin::popToRoot(QString jsValueString, void DoricNavigatorPlugin::popToRoot(QString jsValueString,
QString callbackId) {} QString callbackId) {}