方案一:
api.showProgress({
title: '上传中...',
text: '先喝杯茶...',
});
api.hideProgress();
方案二:
// 需要在每一个使用的页面加入
apiready = function() {
UILoading = api.require('UILoading');
}
var UILoading;
apiready = function() {
UILoading = api.require('UILoading');
}
// loading
function fnFlower(){
UILoading.flower({
center: {
x: 160,
y: 300
},
size: 30,
fixed: true
}, function(ret){
alert(JSON.stringify(ret));
});
}
function fnKeyFrame(){
UILoading.keyFrame({
rect: {
w: 80,
h: 100
},
styles: {
bg: 'rgba(0,0,0,0.5)',
corner: 5,
interval: 50,
frame:{
w: 80,
h: 80
}
}
}, function(ret){
alert(JSON.stringify(ret));
});
}
function fnCloseFlower(){
UILoading.closeFlower ({
id: 0
});
}
function fnCloseKeyFrame(){
UILoading.closeKeyFrame();
}