1. 程式人生 > >apicloud實現APP首次下載安裝開啟的引導頁面

apicloud實現APP首次下載安裝開啟的引導頁面

引導頁由 guide_win.html 和 guide_frm.html 兩部分組成。

     第一部分:guide_win.html

apiready = function() { 
api.parseTapmode(); 
var showGuide = $api.getStorage('showGuide'); 
//判斷條件 
if (!showGuide) { 
openGuide();//首次下載安裝操作 
  } else { 
openWelcome();//不是首次操作 
} 
} 
//開啟引導頁 
function openGuide() { 
api.openFrame({ 
name: 'guide_frm', 
url: './guide_frm.html', 
bounces: false, 
rect: { 
x: 0, 
y: 0, 
w: 'auto', 
h: 'auto' 
} 
});
} 
//開啟啟動頁 
function openWelcome() { 
api.openWin({ 
name: 'welcomePage_win', 
url: './welcomePage.html', 
slidBackEnabled: false 
}); 
}
   第二部分:guide_frm.html
$('#letGo').on('click', function() {
    $api.setStorage('showGuide', '1');//設定值
    api.openWin({
        name: 'welcomePage_win',
        url: './welcomePage.html',
        slidBackEnabled: false
    });
})