|

楼主 |
发表于 2018-12-1 11:03:24
|
显示全部楼层
我看到仿淘宝的index.w是这样写的,
var Model = function() {
this.callParent();
var shellImpl = new ShellImpl(this, {
"contentsXid" : "pages",
"pageMappings" : {
"main" : {
url : require.toUrl('./main.w')
},
"list" : {
url : require.toUrl('./list.w')
},
"class" : {
url : require.toUrl('./class.w')
},
"detail" : {
url : require.toUrl('./detail.w')
},
"search" : {
url : require.toUrl('./search.w')
},
"cart" : {
url : require.toUrl('./cart.w')
},
"order" : {
url : require.toUrl('./order.w')
},
"success" : {
url : require.toUrl('./success.w')
}
}
});
//shellImpl.setIsSinglePage(true);
shellImpl.useDefaultExitHandler = false;
CommonUtils.attachDoubleClickExitApp(function() {
var isHomePage = shellImpl.pagesComp.contents[0].innerContainer.getInnerModel().comp('contents2').getActiveIndex() == 0;
if (shellImpl.pagesComp.getActiveIndex() === 0 && isHomePage) {
return true;
}
return false;
});
};
可是该怎么用,连个注释都没有 |
|