ENH: Delete JS Timer, avoid Call Api Frequently
JIRA: none Change-Id: I01624276b1d946cff222365c5bbe8ea012941f61
This commit is contained in:
parent
e447ef5256
commit
a75bf84828
|
@ -2,10 +2,8 @@
|
||||||
|
|
||||||
var m_HotModelList=null;
|
var m_HotModelList=null;
|
||||||
var m_ForUModelList=null;
|
var m_ForUModelList=null;
|
||||||
var timer_CheckNetwork_HotModel=null;
|
|
||||||
|
|
||||||
var m_MakerlabList=null;
|
var m_MakerlabList=null;
|
||||||
var timer_CheckNetwork_Makerlab=null;
|
|
||||||
|
|
||||||
function OnHomeInit()
|
function OnHomeInit()
|
||||||
{
|
{
|
||||||
|
@ -137,12 +135,6 @@ function HandleStudio( pVal )
|
||||||
else if( strCmd=="modelmall_model_advise_get")
|
else if( strCmd=="modelmall_model_advise_get")
|
||||||
{
|
{
|
||||||
//alert('hot');
|
//alert('hot');
|
||||||
if( timer_CheckNetwork_HotModel!=null )
|
|
||||||
{
|
|
||||||
clearInterval(timer_CheckNetwork_HotModel);
|
|
||||||
timer_CheckNetwork_HotModel=null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( m_HotModelList!=null && pVal['hits'].length>0 )
|
if( m_HotModelList!=null && pVal['hits'].length>0 )
|
||||||
{
|
{
|
||||||
let SS1=JSON.stringify(pVal['hits']);
|
let SS1=JSON.stringify(pVal['hits']);
|
||||||
|
@ -158,12 +150,6 @@ function HandleStudio( pVal )
|
||||||
else if( strCmd=="modelmall_model_customized_get")
|
else if( strCmd=="modelmall_model_customized_get")
|
||||||
{
|
{
|
||||||
//alert('For U');
|
//alert('For U');
|
||||||
if( timer_CheckNetwork_HotModel!=null )
|
|
||||||
{
|
|
||||||
clearInterval(timer_CheckNetwork_HotModel);
|
|
||||||
timer_CheckNetwork_HotModel=null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( m_ForUModelList!=null && pVal['hits'].length>0 )
|
if( m_ForUModelList!=null && pVal['hits'].length>0 )
|
||||||
{
|
{
|
||||||
let SS1=JSON.stringify(pVal['hits']);
|
let SS1=JSON.stringify(pVal['hits']);
|
||||||
|
@ -178,12 +164,6 @@ function HandleStudio( pVal )
|
||||||
}
|
}
|
||||||
else if(strCmd=='homepage_makerlab_get')
|
else if(strCmd=='homepage_makerlab_get')
|
||||||
{
|
{
|
||||||
if( timer_CheckNetwork_Makerlab!=null )
|
|
||||||
{
|
|
||||||
clearInterval(timer_CheckNetwork_Makerlab);
|
|
||||||
timer_CheckNetwork_Makerlab=null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( m_MakerlabList!=null && pVal['list'].length>0 )
|
if( m_MakerlabList!=null && pVal['list'].length>0 )
|
||||||
{
|
{
|
||||||
let SS1=JSON.stringify(pVal['list']);
|
let SS1=JSON.stringify(pVal['list']);
|
||||||
|
@ -225,6 +205,12 @@ function OnBoardChange( strMenu )
|
||||||
$('#HomeFullArea').css('display','inline');
|
$('#HomeFullArea').css('display','inline');
|
||||||
$('#RecentFileArea').css('display','none');
|
$('#RecentFileArea').css('display','none');
|
||||||
$('#WikiGuideBoard').css('display','none');
|
$('#WikiGuideBoard').css('display','none');
|
||||||
|
|
||||||
|
if( (m_HotModelList==null || m_HotModelList.length==0) && (m_ForUModelList==null || m_ForUModelList.length==0))
|
||||||
|
SendMsg_GetStaffPick();
|
||||||
|
|
||||||
|
if( m_MakerlabList==null || m_MakerlabList.length==0 )
|
||||||
|
SendMsg_GetMakerlabList();
|
||||||
}
|
}
|
||||||
else if(strMenu=='recent')
|
else if(strMenu=='recent')
|
||||||
{
|
{
|
||||||
|
@ -468,8 +454,6 @@ function SendMsg_GetMakerlabList()
|
||||||
SendWXMessage( JSON.stringify(tSend) );
|
SendWXMessage( JSON.stringify(tSend) );
|
||||||
|
|
||||||
setTimeout("SendMsg_GetMakerlabList()",3600*1000*6);
|
setTimeout("SendMsg_GetMakerlabList()",3600*1000*6);
|
||||||
if(timer_CheckNetwork_Makerlab==null)
|
|
||||||
timer_CheckNetwork_Makerlab=setInterval("SendMsg_GetMakerlabList()",60*1000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function SwitchContent(strMenu)
|
function SwitchContent(strMenu)
|
||||||
|
@ -599,8 +583,6 @@ function SendMsg_GetStaffPick()
|
||||||
SendWXMessage( JSON.stringify(tSend) );
|
SendWXMessage( JSON.stringify(tSend) );
|
||||||
|
|
||||||
setTimeout("SendMsg_GetStaffPick()",3600*1000*6);
|
setTimeout("SendMsg_GetStaffPick()",3600*1000*6);
|
||||||
if(timer_CheckNetwork_HotModel==null)
|
|
||||||
timer_CheckNetwork_HotModel=setInterval("SendMsg_GetStaffPick()",60*1000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ExNumber( number )
|
function ExNumber( number )
|
||||||
|
|
Loading…
Reference in New Issue