在APICloud创建了应用之后,应用的包结构如下图所示:
其中“”和 “” 必须包含,其它均为可选。“”是配置文件,“”是启动页面,“icon”为图标文件目录,“launch”为启动图片目录
actionSheet底部弹出框:
({
title: '底部弹出框测试',
cancelTitle: '这里是取消按钮',
destructiveTitle: '红色警告按钮',
buttons: ['1','2','3']
},function(ret,err){
({
msg: '你刚点击了'+
});
});
confirm对话框:
({
title: 'testtitle',
msg: 'testmsg',
buttons:[ '确定', '取消']
},function(ret,err){
if( == 1){
({msg: '点击了确定'});
}
});
alert对话框:
({
title: 'testtitle',
msg: 'testmsg',
buttons:[ '确定']
},function(ret,err){
if( == 1){
({msg: '点击了确定'});
}
});
prompt带输入框的对话框
({
buttons:['确定', '取消']
},function(ret,err){
if( == 1){
({msg:});
}
});
ajax:异步请求
({
url: 'http://192.168.1.101:3101/upLoad',
method: 'post',
cache: false,
timeout: 30,
dataType: 'json',
returnAll:false,
data:{
values: {name: 'haha'},
files: {file: 'fs://'}
}
},function(ret,err){
if (ret) {
var urlJson = (ret);
({msg: urlJson});
}else {
({
msg:('错误码:'++';错误信息:'++'网络状态码:'+)
});
};
});
animation动画:
({
name: 'page1',//子窗口名称
delay: 1000,
duration: 3000,
curve: 'easeIn',//动画曲线类型
repeatCount: 2,
autoreverse: true,//一次动画结束后是否自动反转动画
alpha: 0.6,
translation:{//平移参数
x: 0,//x轴上的平移距离
y: 100,
z: 0
},
scale:{
x: 1.2,//<span style="font-family: Arial, Helvetica, sans-serif;">x轴上的放大倍率</span>
y: 1,
z: 1
},
rotation:{
degree:45,//旋转角度
x: 0,
y: 0,
z: 1
}
}, function() {
({msg: '动画结束'});
});
bringFrameToFront:调整子窗口到前面
({
from:'page1',
to:'page2'
});
call:拨打电话
({
type: 'tel_prompt',
number: '10086'
});
cancelDownload:取消文件下载
var url = '/2013/photo/1401/DAimG_2014011335974260TA24.rar';
({
url: url
});
closeFrame:关闭子窗口
({
name: 'page2'
});
closeFrameGroup:关闭窗口组
({
name: 'group1'
});
download文件下载:
var url = '/2013/photo/1401/DAimG_2014011335974260TA24.rar';
({
url: url,
savePath: 'fs://',//下载后的保存路径,如果为空会自动创建保存路径
report: true,//是否上报
cache: true,//是否缓存
allowResume:true//是否支持断点续传
},function(ret,err){
if (ret) {
var value = ('文件大小:'++';下载进度:'++';下载状态'++'存储路径: '+);
} else{
var value = ;
};
});
execScript在指定窗口中执行脚本:
({
name: 'page1',
script: 'exec();'//执行的JS方法
});
getLocation获取位置信息
(
function(ret, err){
if(){
var lat = ;//纬度
var lon = ;//经度
var t = ; //更新时间
var str = '经度:'+ lon +'<br>';
str += '纬度:'+ lat +'<br>';
str += '更新时间:'+ t +'<br>';
} else{
({msg:});
}
}
);
getPicture获取图片:
({
sourceType: 'library',//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">图片源类型</span>
encodingType: 'png',//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">编码格式</span>
mediaValue: 'pic',//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">媒体类型</span>
destinationType: 'url',//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">返回数据类型</span>
allowEdit: true,//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">是否可以编辑</span>
quality: 50,//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">图片质量</span>
targetWidth:100,//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">压缩后的图片宽度</span>
targetHeight:100,//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">压缩后的图片高度</span>
saveToPhotoAlbum: false//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">是否保存到相册</span>
}, function(ret, err){
if (ret) {
({msg:});
} else{
({msg:});
};
});
mail发送邮件:
var recip = 'test@';
var sub = '邮件测试';
var body = '这是一封测试用的邮件';
var attach = 'widget://';
({
recipients: [recip],//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">收件人</span>
subject: sub,//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">邮件主题</span>
body: body,//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">邮件内容</span>
attachments: [attach]//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">附件地址</span>
}, function(ret, err){
if(){
({
msg: '发送成功'
});
} else{
({
msg: '发送失败'
});
}
});
openApp打开手机上的其他应用:
({//此方法只使用与Android应用
androidPkg: '',//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">目标应用的包名或action(Android平台使用)</span>
mimeType: 'text/html',//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">指定目标应用的响应数据类型</span>
uri: ''//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">指定目标应用响应的uri</span>
},function(ret,err){
var msg = (ret);
({
title: 'openApp',
msg: msg,
buttons: ['确定']
});
});
openFrame打开子窗口:
({
name: 'page2',//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">窗口名字</span>
url: './',//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">请求地址</span>
rect:{//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">窗口区域</span>
x:0,
y:0,
w:320,
h:480
},
pageParam: {name: 'test'},//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">页面参数</span>
bounces: true,//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">页面是否弹动</span>
opaque: false,//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">页面是否不透明</span>
bgColor: 'rgba(0,0,0,0)',//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">背景色</span>
vScrollBarEnabled:true,//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">是否显示垂直滚动条</span>
hScrollBarEnabled:true//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">是否显示<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">水平</span>滚动条</span>
});
openFrameGroup打开窗口组:
({
name: 'group1',
background:'#fff',
scrollEnabled:false,
rect:{x:0, y:0, w:320, h:240},
index:0,//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">默认显示的页面索引</span>
frames://<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">子窗口数组</span>
[{
name: 'frame1',
url: '',
pageParam:{},
bounces:true,
opaque:true,
bgColor: '#fff',
vScrollBarEnabled:true,
hScrollBarEnabled:false
},{
name: 'frame2',
url: '',
pageParam:{},
bounces:true,
opaque:true,
bgColor: '#fff',
vScrollBarEnabled:true,
hScrollBarEnabled:false
}]
}, function(ret, err){
var name = ;
var index = ;
});
openPicker打开时间选择器:
({
type: 'date_time',//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">拾取器类型</span>
date: '2014-05-01 12:30',//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">时间格式化字符串,格式yyyy-MM-dd HH:mm</span>
title:'选择时间'//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">标题</span>
},function(ret,err){
var year = ;
var month = ;
var day = ;
var hour = ;
var minute = ;
if (type == 'date') {
var value = year+'年'+month+'月'+day+'日';
} else if (type == 'time') {
var value = hour+'时'+minute+'分';
} else if (type == 'date_time') {
var value = year+'年'+month+'月'+day+'日'+hour+'时'+minute+'分';
}
});
openSlidLayout打开侧滑式布局:
({
type: 'all',//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">侧滑类型(left:左侧滑、right:右侧滑、all:左右侧滑)</span>
leftEdge:80,//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">左侧滑时,侧滑window停留时露出的宽度</span>
rightEdge:60,
fixedPane: {//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">底部固定层window</span>
name: 'frame1',
url: '',
bgColor: '#fff',
bounces:true,
opaque:true,
vScrollBarEnabled:true,
hScrollBarEnabled:false
},
slidPane: {
name: 'frame1',
url: '',
bgColor: '#fff',
bounces:true,
opaque:true,
vScrollBarEnabled:true,
hScrollBarEnabled:false
}
}, function(ret){
var type = ;
if (type == 'left') {
} else {
}
});
openSlidPane侧滑:
({
type: 'left'//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">侧滑类型,left或right,不能为空</span>
});
openWidget打开Widget:
({
id: 'UZ00000001',
animation: {
type: 'flip',
subType: 'from_bottom',
duration: 500
}
}, function(ret, err){
if(ret){
} else{
({msg:});
}
});
openWin打开窗口,如果窗口已存在,则会把窗口显示到最前面:
({
name: 'page1',
url: './',
pageParam: {name: 'test'},
bounces: true,
opaque: false,
bgColor: 'rgba(0,0,0,0)',
vScrollBarEnabled:true,
hScrollBarEnabled:true,
animation: {
type: 'flip',
subType: 'from_bottom',
duration: 500
}
});
parseTapmode解析元素tapmode属性,优化点击事件处理
api .parseTapmode () ;
readFile读取文本文件:
({
path:'fs://'
}, function(ret, err){
if(){
({msg:});//data<span style="color: rgb(147, 161, 161); font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; line-height: 18.571428298950195px; white-space: pre-wrap; background-color: rgb(238, 238, 238);">文件内容</span>
} else{
({
msg: '错误码: '++'错误信息'+<span style="color: rgb(42, 161, 152); font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; line-height: 18.571428298950195px; white-space: pre-wrap; background-color: rgb(238, 238, 238);">//</span><span style="font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif;">msg:</span><span style="color: rgb(42, 161, 152); font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; line-height: 18.571428298950195px; white-space: pre-wrap; background-color: rgb(238, 238, 238);">错误描述</span>
});
}
});
refreshHeaderLoadDone通知顶部刷新数据加载完毕
();
removeEventListener删除事件:
({
name: 'online'
});
sendFrameToBack调整子窗口到后面:
({//调整page1到page2的后面即将page2放在最page1上
from: 'page1',
to: 'page2'//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">窗口名字,指定时调整窗口到此窗口后面,否则调整到最后面</span>
});
setFrameAttr设置子窗口属性:
({
name: 'page2',
rect:{
x:0,
y:0,
w:320,
h:480
},
bounces: true,
opaque: true,
bgColor: '#fff',
vScrollBarEnabled:true,
hScrollBarEnabled:true
});
setFrameGroupAttr设置窗口组属性:
({
name: 'group1',
hidden:true
});
setFrameGroupIndex设置窗口组当前可见子窗口:
({
name: 'group1',
index:2,//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">子窗口索引</span>
scroll:true//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">是否平滑滚动至目标窗口</span>
});
setFullScreen设置是否全屏:
({fullScreen:true});
setRefreshHeaderInfo显示顶部刷新:
({
visible: true,
loadingImg: 'widget://image/',//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">刷新图片地址</span>
bgColor: '#ccc',
textColor: '#fff',
textDown: '下拉刷新...',//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">下拉文字描述</span>
textUp: '松开刷新...',//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">松开时文字描述</span>
showTime: true//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">是否显示更新时间</span>
}, function(ret, err){
});
showFloatBox展示一个悬浮框,浮动在屏幕上,点击时关闭当前widget:
({
iconPath: 'widget://image/',//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">展示在悬浮框中的图片地址</span>
duration: 3000//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">自动消隐时长。在该时长内不发生触摸悬浮框行为,悬浮框自动消隐至半透状态</span>
});
showProgress显示进度提示框:
({
style: 'default',
animationType: 'fade',
title: '努力加载中...',
text: '先喝杯茶...',
modal: false//<span style="color: rgb(128, 128, 128); font-family: ff-tisa-web-pro-1, ff-tisa-web-pro-2, 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'Hiragino Sans GB', 'Hiragino Sans GB W3', 'WenQuanYi Micro Hei', sans-serif; font-size: 14px; line-height: 20px;">是否模态</span>
});
writeFile写入文件:
({
path: 'fs://',
data: 'writeFile测试内容'
}, function(ret, err){
var status = ;
if(status){
({msg:'写入文件成功'});
} else{
({msg:});
}
});
removeLaunchView移除启动图。若里面配置autoLaunch为false,则启动图不会自动消失,直到调用此方法移除。
();