apicloud模块开发设计规范-原生代码案例,示例代码中各种代码的位置放哪?
var NVTabBarAnimation = api.require('NVTabBarAnimation'); NVTabBarAnimation.open({ styles: { bg: '#fff', h: 58, dividingLine: { width: 0.5, color: '#ccc' }, badge: { bgColor: '#f45815', numColor: '#fff', size: 7.0 } }, items: [{ w: api.winWidth / 5.0, bg: { marginB: 0, image: 'rgba(0,0,0,0)', }, icon: { normal: 'widget://res/NVTabBarAnimation/1.png', highlight: 'widget://res/NVTabBarAnimation/11.png', rect: { w: 25.0, h: 25.0, x: 0, y: 0, }, }, animationIcons: { paths: ['widget://res/NVTabBarAnimation/1.png', 'widget://res/NVTabBarAnimation/2.png', 'widget://res/NVTabBarAnimation/3.png'], rect: { w: 25.0, h: 25.0, x: 0, y: 0 }, interval: 300 }, title: { text: '首页', size: 12.0, normal: '#696969', selected: '#ff0', marginB: 6.0, ttf: 'Alkatip Basma Tom' }, rect: { w: api.winWidth / 5.0, x: 0, y: 0, }, }, { w: api.winWidth / 5.0, bg: { marginB: 0, image: 'rgba(0,0,0,0)', }, icon: { normal: 'widget://res/NVTabBarAnimation/2.png', highlight: 'widget://res/NVTabBarAnimation/22.png', rect: { w: 25.0, h: 25.0, x: 0, y: 0, }, }, animationIcons: { paths: ['widget://res/NVTabBarAnimation/1.png', 'widget://res/NVTabBarAnimation/2.png', 'widget://res/NVTabBarAnimation/3.png'], rect: { w: 25.0, h: 25.0, x: 0, y: 0 }, interval: 300 }, title: { text: '商圈', size: 12.0, normal: '#696969', selected: '#ff0', marginB: 6.0, ttf: 'Alkatip Basma Tom' }, rect: { w: api.winWidth / 5.0, x: 0, y: 0, }, }, { w: api.winWidth / 5.0, bg: { marginB: 0, image: 'rgba(0,0,0,0)', }, icon: { normal: 'widget://res/NVTabBarAnimation/3.png', highlight: 'widget://res/NVTabBarAnimation/33.png', rect: { w: 25.0, h: 25.0, x: 0, y: 0, }, }, animationIcons: { paths: ['widget://res/NVTabBarAnimation/1.png', 'widget://res/NVTabBarAnimation/2.png', 'widget://res/NVTabBarAnimation/3.png'], rect: { w: 25.0, h: 25.0, x: 0, y: 0 }, interval: 300 }, title: { text: '地图', size: 12.0, normal: '#696969', selected: '#ff0', marginB: 6.0, ttf: 'Alkatip Basma Tom' }, rect: { w: api.winWidth / 5.0, x: 0, y: 0, }, }, { w: api.winWidth / 5.0, bg: { marginB: 0, image: 'rgba(0,0,0,0)', }, icon: { normal: 'widget://res/NVTabBarAnimation/4.png', highlight: 'widget://res/NVTabBarAnimation/44.png', rect: { w: 25.0, h: 25.0, x: 0, y: 0, }, }, animationIcons: { paths: ['widget://res/NVTabBarAnimation/1.png', 'widget://res/NVTabBarAnimation/2.png', 'widget://res/NVTabBarAnimation/3.png'], rect: { w: 25.0, h: 25.0, x: 0, y: 0 }, interval: 300 }, title: { text: '广场', size: 12.0, normal: '#696969', selected: '#ff0', marginB: 6.0, ttf: 'Alkatip Basma Tom' }, rect: { w: api.winWidth / 5.0, x: 0, y: 0, }, }, { w: api.winWidth / 5.0, bg: { marginB: 0, image: 'rgba(0,0,0,0)', }, icon: { normal: 'widget://res/NVTabBarAnimation/5.png', highlight: 'widget://res/NVTabBarAnimation/55.png', rect: { w: 25.0, h: 25.0, x: 0, y: 0, }, }, animationIcons: { paths: ['widget://res/NVTabBarAnimation/1.png', 'widget://res/NVTabBarAnimation/2.png', 'widget://res/NVTabBarAnimation/3.png'], rect: { w: 25.0, h: 25.0, x: 0, y: 0 }, interval: 300 }, title: { text: '我的', size: 12.0, normal: '#696969', selected: '#ff0', marginB: 6.0, ttf: 'Alkatip Basma Tom' }, rect: { w: api.winWidth / 5.0, x: 0, y: 0, }, }], selectedIndex: 0 }, function(ret, err) { if (ret && ret.eventType == "click") { api.alert({msg: JSON.stringify(ret)}); } });
中的var NVTabBarAnimation = api.require('NVTabBarAnimation');放在script里吗?
能详细说明一下这个示例代码具体放在哪吗?
|