0
我想在用户首次登录时使用$ ionicPopup作为快速教程屏幕。登录后他们再也不需要看到消息。我一直无法找到任何有关如何在Ionic Framework中执行此操作的示例。
这里是我到目前为止的代码,我将它放在$ timeout函数()中,以便可以设置超时。
$超时(函数(){VAR = myPopup $ ionicPopup.show({
template: '<h4 class="ion-ios-search-strong"> Choose a store</h4></br><h4 class="ion-coffee"> Select a drink</h4></br><h4 class="ion-wrench"> Customize your coffee</h4></br><h4 class="ion-card"> Pay from your phone</h4></br><h4 class="ion-happy-outline"> Your coffee is ready</h4></br>',
title: 'How to use Joe',
// subTitle: 'Your coffee is a few taps away',
scope: $scope,
buttons: [
{ text: 'Got it!' },
]
});
myPopup.then(function(res) {
console.log('Tapped!', res);
});
},5000);
或者您可以将firstTime存储在localstorage中并从那里检查 – Antonis
这不会持久,并且每当启动应用程序时,firstTime始终为false。使用localStorage作为@Antonis建议是一种方式去 – Ladmerc
谢谢,我更新了我的答案。 –