推送提示修改
This commit is contained in:
@@ -32,7 +32,9 @@ document.addEventListener("plusready", function() {
|
|||||||
if (payload.type == "0") {
|
if (payload.type == "0") {
|
||||||
plus.ui.alert(title+"\n"+content);
|
plus.ui.alert(title+"\n"+content);
|
||||||
} else if (payload.type == "1") {
|
} else if (payload.type == "1") {
|
||||||
plus.ui.alert(title+"\n"+content,function(){
|
|
||||||
|
plus.nativeUI.confirm(content, function(e){
|
||||||
|
if (e.index==0) {
|
||||||
if(plus.webview.getWebviewById('H5693FF3D')==null){
|
if(plus.webview.getWebviewById('H5693FF3D')==null){
|
||||||
plus.webview.show(plus.webview.getWebviewById("HBuilder"));
|
plus.webview.show(plus.webview.getWebviewById("HBuilder"));
|
||||||
}else{
|
}else{
|
||||||
@@ -48,16 +50,24 @@ document.addEventListener("plusready", function() {
|
|||||||
current.classList.remove('mui-active');
|
current.classList.remove('mui-active');
|
||||||
defaultTab.classList.add('mui-active');
|
defaultTab.classList.add('mui-active');
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
}, title, ["查看","忽略"] );
|
||||||
|
|
||||||
|
|
||||||
} else if (payload.type == "2") {
|
} else if (payload.type == "2") {
|
||||||
if (payload.url.startWith("http")) {
|
if (payload.url.startWith("http")) {
|
||||||
plus.ui.alert(title+"\n"+content,function(){
|
|
||||||
|
plus.nativeUI.confirm(content, function(e){
|
||||||
|
if (e.index==0) {
|
||||||
clicked('views/webview_embed.html', true,false,{},{url:payload.url})
|
clicked('views/webview_embed.html', true,false,{},{url:payload.url})
|
||||||
});
|
}
|
||||||
|
}, title, ["查看","忽略"] );
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 处理打开app中的二级页面,一级页面在type=1中已经处理了,如果有http的地址就是打开外部页面
|
// 处理打开app中的二级页面,一级页面在type=1中已经处理了,如果有http的地址就是打开外部页面
|
||||||
// 否则就是打开app内部页面
|
// 否则就是打开app内部页面
|
||||||
plus.ui.alert(content,function(){
|
plus.nativeUI.confirm(content, function(e){
|
||||||
|
if (e.index==0) {
|
||||||
var url = payload.url;
|
var url = payload.url;
|
||||||
var sindex = url.indexOf('?') == -1 ? url.length : url.indexOf('?');
|
var sindex = url.indexOf('?') == -1 ? url.length : url.indexOf('?');
|
||||||
var openUrl = url.substring(0, sindex);
|
var openUrl = url.substring(0, sindex);
|
||||||
@@ -73,14 +83,17 @@ document.addEventListener("plusready", function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
clicked(openUrl,true,false,{},jsonData)
|
clicked(openUrl,true,false,{},jsonData)
|
||||||
});
|
}
|
||||||
|
}, title, ["查看","忽略"] );
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (payload.type == "0") {
|
if (payload.type == "0") {
|
||||||
plus.ui.alert(content);
|
plus.ui.alert(content);
|
||||||
} else if (payload.type == "1") {
|
} else if (payload.type == "1") {
|
||||||
plus.ui.alert(title+"\n"+content,function(){
|
plus.nativeUI.confirm(content, function(e){
|
||||||
|
if (e.index==0) {
|
||||||
if(plus.webview.getWebviewById('H5693FF3D')==null){
|
if(plus.webview.getWebviewById('H5693FF3D')==null){
|
||||||
plus.webview.show(plus.webview.getWebviewById("HBuilder"));
|
plus.webview.show(plus.webview.getWebviewById("HBuilder"));
|
||||||
}else{
|
}else{
|
||||||
@@ -96,16 +109,23 @@ document.addEventListener("plusready", function() {
|
|||||||
current.classList.remove('mui-active');
|
current.classList.remove('mui-active');
|
||||||
defaultTab.classList.add('mui-active');
|
defaultTab.classList.add('mui-active');
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
}, title, ["查看","忽略"] );
|
||||||
|
|
||||||
} else if (payload.type == "2") {
|
} else if (payload.type == "2") {
|
||||||
if (payload.url.startWith("http")) {
|
if (payload.url.startWith("http")) {
|
||||||
plus.ui.alert(content,function(){
|
|
||||||
|
plus.nativeUI.confirm(content, function(e){
|
||||||
|
if (e.index==0) {
|
||||||
clicked('views/webview_embed.html', true,false,{},{url:payload.url})
|
clicked('views/webview_embed.html', true,false,{},{url:payload.url})
|
||||||
});
|
}
|
||||||
|
}, title, ["查看","忽略"] );
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 处理打开app中的二级页面,一级页面在type=1中已经处理了,如果有http的地址就是打开外部页面
|
// 处理打开app中的二级页面,一级页面在type=1中已经处理了,如果有http的地址就是打开外部页面
|
||||||
// 否则就是打开app内部页面
|
// 否则就是打开app内部页面
|
||||||
plus.ui.alert(content,function(){
|
plus.nativeUI.confirm(content, function(e){
|
||||||
|
if (e.index==0) {
|
||||||
var url = payload.url;
|
var url = payload.url;
|
||||||
var sindex = url.indexOf('?') == -1 ? url.length : url.indexOf('?');
|
var sindex = url.indexOf('?') == -1 ? url.length : url.indexOf('?');
|
||||||
var openUrl = url.substring(0, sindex);
|
var openUrl = url.substring(0, sindex);
|
||||||
@@ -121,7 +141,9 @@ document.addEventListener("plusready", function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
clicked(openUrl,true,false,{},jsonData)
|
clicked(openUrl,true,false,{},jsonData)
|
||||||
});
|
}
|
||||||
|
}, title, ["查看","忽略"] );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -143,7 +165,9 @@ document.addEventListener("plusready", function() {
|
|||||||
if (payload.type == "0") {
|
if (payload.type == "0") {
|
||||||
plus.ui.alert(title+"\n"+content);
|
plus.ui.alert(title+"\n"+content);
|
||||||
} else if (payload.type == "1") {
|
} else if (payload.type == "1") {
|
||||||
plus.ui.alert(title+"\n"+content,function(){
|
|
||||||
|
plus.nativeUI.confirm(content, function(e){
|
||||||
|
if (e.index==0) {
|
||||||
if (payload.url == '/house/index') {
|
if (payload.url == '/house/index') {
|
||||||
plus.webview.show('yfindex.html');
|
plus.webview.show('yfindex.html');
|
||||||
} else {
|
} else {
|
||||||
@@ -164,16 +188,12 @@ document.addEventListener("plusready", function() {
|
|||||||
} else {
|
} else {
|
||||||
defaultTab.classList.add("mui-active");
|
defaultTab.classList.add("mui-active");
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
}, title, ["查看","忽略"] );
|
||||||
|
|
||||||
} else if (payload.type == "2") {
|
} else if (payload.type == "2") {
|
||||||
if (payload.url.startWith("http")) {
|
plus.nativeUI.confirm(content, function(e){
|
||||||
plus.ui.alert(content,function(){
|
if (e.index==0) {
|
||||||
clicked('views/webview_embed.html', true,false,{},{url:payload.url})
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// 处理打开app中的二级页面,一级页面在type=1中已经处理了,如果有http的地址就是打开外部页面
|
|
||||||
// 否则就是打开app内部页面
|
|
||||||
plus.ui.alert(content,function(){
|
|
||||||
var url = payload.url;
|
var url = payload.url;
|
||||||
var sindex = url.indexOf('?') == -1 ? url.length : url.indexOf('?');
|
var sindex = url.indexOf('?') == -1 ? url.length : url.indexOf('?');
|
||||||
var openUrl = url.substring(0, sindex);
|
var openUrl = url.substring(0, sindex);
|
||||||
@@ -189,8 +209,9 @@ document.addEventListener("plusready", function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
clicked(openUrl,true,false,{},jsonData)
|
clicked(openUrl,true,false,{},jsonData)
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
}, title, ["查看","忽略"] );
|
||||||
|
|
||||||
}
|
}
|
||||||
}, false);
|
}, false);
|
||||||
}, false);
|
}, false);
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ var versionInfo = function(){
|
|||||||
//下载后安装
|
//下载后安装
|
||||||
var downApp = function(){
|
var downApp = function(){
|
||||||
var url="http://app.fangjia.com/download/youfang.apk"; //下载文件地址
|
var url="http://app.fangjia.com/download/youfang.apk"; //下载文件地址
|
||||||
plus.nativeUI.showWaiting("下载apk文件...");
|
plus.nativeUI.showWaiting("版本更新中...");
|
||||||
var dtask = plus.downloader.createDownload( url, {}, function ( d, status ) {
|
var dtask = plus.downloader.createDownload( url, {}, function ( d, status ) {
|
||||||
if (status == 200) {
|
if (status == 200) {
|
||||||
//下载成功
|
//下载成功
|
||||||
|
|||||||
Reference in New Issue
Block a user