index页面:
//跳转order页面
$('.inOrder').on('tap',function(){
mui.openWindow({
url:'html/order/order.html',
id:'order.html'
})
})
order页面:
<script type="text/javascript">
$('#username').text(localStorage.name);
//启用双击监听
mui.init({
gestureConfig:{
doubletap:true
},
subpages:[{
url:'pullrefresh_sub.html',
id:'pullrefresh_sub.html',
styles:{
top: '45px',
bottom: '0px',
}
}]
});
var contentWebview = null;
document.querySelector('header').addEventListener('doubletap',function () {
if(contentWebview==null){
contentWebview = plus.webview.currentWebview().children()[0];
}
contentWebview.evalJS("mui('#pullrefresh').pullRefresh().scrollTo(0,0,100)");
});
</script>
pullrefresh_sub(下拉容器页面)
<script>
mui.init({
pullRefresh: {
container: '#pullrefresh',
down: {
contentrefresh: '正在更新数据...',
callback: pulldownRefresh
},
}
});
/**
order-form(第二次跳转order的页面)
//跳转order页面
$('#btn').on('tap',function(){
var callBack = function(success){
if(success){
localStorage.removeItem('operationIndex');
sessionStorage.removeItem('statusObj');
mui.toast('保存成功');
mui.openWindow({
url:'../order/order.html',
id:'../order/order.html'
});
}else{
mui.toast('保存失败');
}
}
document.getElementById('iframe').contentWindow.submitForm(_url,callBack);
});
2 个回复
Trust - 少说废话
请上传相关代码。
3***@qq.com (作者)
index页面:
//跳转order页面
$('.inOrder').on('tap',function(){
mui.openWindow({
url:'html/order/order.html',
id:'order.html'
})
})
order页面:
<script type="text/javascript">
$('#username').text(localStorage.name);
//启用双击监听
mui.init({
gestureConfig:{
doubletap:true
},
subpages:[{
url:'pullrefresh_sub.html',
id:'pullrefresh_sub.html',
styles:{
top: '45px',
bottom: '0px',
}
}]
});
pullrefresh_sub(下拉容器页面)
<script>
mui.init({
pullRefresh: {
container: '#pullrefresh',
down: {
contentrefresh: '正在更新数据...',
callback: pulldownRefresh
},
}
});
/**
下拉刷新具体业务实现
*/
function pulldownRefresh() {
setTimeout(function() {
$.ajax({
内容。。。。。。。
});
mui('#pullrefresh').pullRefresh().endPulldownToRefresh()
}, 300);
*/
if (mui.os.plus) {
mui.plusReady(function() {
setTimeout(function() {
mui('#pullrefresh').pullRefresh().pulldownLoading();
}, 1000);
});
} else {
mui.ready(function() {
mui('#pullrefresh').pullRefresh().pulldownLoading();
});
}
</script>
order-form(第二次跳转order的页面)
//跳转order页面
$('#btn').on('tap',function(){
var callBack = function(success){
if(success){
localStorage.removeItem('operationIndex');
sessionStorage.removeItem('statusObj');
mui.toast('保存成功');
mui.openWindow({
url:'../order/order.html',
id:'../order/order.html'
});
}else{
mui.toast('保存失败');
}
}
document.getElementById('iframe').contentWindow.submitForm(_url,callBack);
});
Trust
请直接上传相关文件,方便调试。
2016-07-22 10:37
3***@qq.com (作者)
已经解决,是文件更换路径openWindow id写成路径后跳转不执行,谢谢
2016-07-22 12:02