From 3ca4592bda7835866119e3b8951d59147c10afa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E5=90=89=E6=AC=A2?= Date: Thu, 15 Mar 2018 11:20:56 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E5=90=AF=E5=8A=A8=E5=B9=BF=E5=91=8A?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/config.js | 5 ++- fangija-zsyf/main.html | 28 ++++++++++++++++ fangija-zsyf/start.html | 71 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 fangija-zsyf/start.html diff --git a/fangija-zsyf/config.js b/fangija-zsyf/config.js index 39a89b6..7016d75 100644 --- a/fangija-zsyf/config.js +++ b/fangija-zsyf/config.js @@ -1,2 +1,5 @@ /**服务端地址**/ -var BASE_PATH = "http://192.168.10.128:8084"; \ No newline at end of file +var BASE_PATH = "http://192.168.10.170:8084"; + +/**是否显示过启动页面**/ +var lauchFlag = false; \ No newline at end of file diff --git a/fangija-zsyf/main.html b/fangija-zsyf/main.html index 5c57c3d..7d36b1e 100644 --- a/fangija-zsyf/main.html +++ b/fangija-zsyf/main.html @@ -44,6 +44,34 @@ //创建子页面,首个选项卡页面显示,其它均隐藏; mui.plusReady(function() { + //检查是否为首次启动 + var showGuide = lauchFlag; + //仅支持竖屏显示 + plus.screen.lockOrientation("portrait-primary"); + if(showGuide) { + //有值,说明已经显示过了,无需显示; + //关闭splash页面; + plus.navigator.closeSplashscreen(); + plus.navigator.setFullscreen(false); + + } else { + //显示启动导航 + mui.openWindow({ + id: 'guide', + url: 'start.html', + styles: { + popGesture: "none" + }, + show: { + aniShow: 'none' + }, + waiting: { + autoShow: false + } + }); + } + + var self = plus.webview.currentWebview(); for (var i = 0; i < 4; i++) { var temp = {}; diff --git a/fangija-zsyf/start.html b/fangija-zsyf/start.html new file mode 100644 index 0000000..8361135 --- /dev/null +++ b/fangija-zsyf/start.html @@ -0,0 +1,71 @@ + + + + + + 掌上有房 + + + + + + + + + + + + + + +
+
+
+ 跳过 5 + + +
+
+
+ + + + + + + + + + + + \ No newline at end of file From d1c3e02ba0f0179d3c041523fac155b1fb5941dd Mon Sep 17 00:00:00 2001 From: "xuhe@fangjia.com" Date: Thu, 15 Mar 2018 11:24:29 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E8=B5=84=E8=AE=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/yfindex.html | 101 +++++++++++++++++++++++++++++++------- 1 file changed, 82 insertions(+), 19 deletions(-) diff --git a/fangija-zsyf/yfindex.html b/fangija-zsyf/yfindex.html index da354ed..533faac 100644 --- a/fangija-zsyf/yfindex.html +++ b/fangija-zsyf/yfindex.html @@ -105,7 +105,7 @@
{{todayDate}}
-
+
@@ -1544,8 +1544,8 @@ function getPosition(){ ); } /* 获取#region字数,截取#region前4字,并添加... */ -city="上海" -init(); +/*city="上海" +init();*/ function init(){ //显示附近地址 var nearAddressParam = address; @@ -1570,7 +1570,6 @@ function init(){ } }) .then(function (response) { - alert("aa"); new Vue({ el: '#baseInfo', data: { @@ -1624,30 +1623,94 @@ function init(){ console.log(error); }); + //资讯列表 - /*axios.get(BASE_PATH+"/rest/news/list", { + axios.get(BASE_PATH+"/rest/news/list", { params: { city: cityParam, page:1 } }) .then(function (response) { - - //附近小区列表 - var html = '
'; - for(var i in response.data.data.dtos){ - html += '
'+response.data.data.dtos[i].name+ - '
'+response.data.data.dtos[i].avgPrice+'元/㎡
'; - } - html += '
'; - $("#nearDistricts").html(html); - $("#nearbyDistrictList").css("width",(7.5*response.data.data.dtos.length)+"rem"); - + var html = ''; + for(var i in response.data.data.list){ + if(response.data.data.list[i].type=="专题"){ + html += '
'+ + ''+ + '
'+ + '
'+response.data.data.list[i].title+'
'+ + ''+ + '
'; + } + /*if(response.data.data.list[i].type=="房源"){ + html += '
'+ + ''+ + '
'+ + '
'+response.data.data.list[i].title+'今日推荐
'+ + '
'+ + '
浦东-周康
'+ + '
'+ + ''+ + '
'; + }*/ + if(response.data.data.list[i].type=="活动"){ + html += '
'+ + ''+ + '
'+ + '
'+response.data.data.list[i].title+'
'+ + ''+ + '
'; + } + /*if(response.data.data.list[i].type=="城市"){ +
+ +
+
+
+
上海
+
+ +
+ }*/ + if(response.data.data.list[i].type=="新闻"){ + html += '
'+ + '
  • '+ + '
    '+ + '
    '+response.data.data.list[i].title+'
    '+ + '
    '+response.data.data.list[i].introduction+'
    '+ + '
    2022人'+ + /*'1245条'+*/ + '
'; + } + if(response.data.data.list[i].type=="投票"){ + html += '
'+response.data.data.list[i].title+ + '
'+ + '同意'+ + '
'+ + '
反对'+ + '
V.S
'; + } + } + $("#todayDate").append(html); }) .catch(function (error) { console.log(error); - });*/ + }); } From 1d7328d60334a9db76e9ec57fae37ea9019233cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E5=90=89=E6=AC=A2?= Date: Thu, 15 Mar 2018 11:58:48 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E6=8E=A8=E9=80=81=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/js/push-common.js | 4 ++-- fangija-zsyf/main.html | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fangija-zsyf/js/push-common.js b/fangija-zsyf/js/push-common.js index fcdcdc4..647943c 100644 --- a/fangija-zsyf/js/push-common.js +++ b/fangija-zsyf/js/push-common.js @@ -25,7 +25,7 @@ document.addEventListener("plusready", function() { }); } else if (payload.type == "2") { plus.ui.alert(title+"\n"+content,function(){ - openUrl(basePath+'/message/openView?url='+payload.url); + openUrl(BASE_PATH+'/message/openView?url='+payload.url); }); } } else { @@ -59,7 +59,7 @@ document.addEventListener("plusready", function() { }); } else if (payload.type == "2") { plus.ui.alert(title+"\n"+content,function(){ - openUrl(basePath+'/message/openView?url='+payload.url); + openUrl(BASE_PATH+'/message/openView?url='+payload.url); }); } }, false); diff --git a/fangija-zsyf/main.html b/fangija-zsyf/main.html index 7d36b1e..0724f32 100644 --- a/fangija-zsyf/main.html +++ b/fangija-zsyf/main.html @@ -29,6 +29,7 @@ + + - + + + + + + + + + \ No newline at end of file From 5e8e88387ae89d1cb4f06406c34e6a31e280ad75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E5=90=89=E6=AC=A2?= Date: Thu, 15 Mar 2018 17:04:30 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E6=8E=A8=E9=80=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/js/push-common.js | 82 +++++++++++++++++++++++++++++----- fangija-zsyf/main.html | 3 +- 2 files changed, 74 insertions(+), 11 deletions(-) diff --git a/fangija-zsyf/js/push-common.js b/fangija-zsyf/js/push-common.js index 647943c..1c9eb7d 100644 --- a/fangija-zsyf/js/push-common.js +++ b/fangija-zsyf/js/push-common.js @@ -3,7 +3,6 @@ * yinjihuan */ document.addEventListener("plusready", function() { - message = document.getElementById("message"); // 监听点击消息事件 plus.push.addEventListener("click", function(msg) { // 判断是从本地创建还是离线推送的消息 @@ -16,13 +15,35 @@ document.addEventListener("plusready", function() { break; default: if (plus.os.name == "Android"){ - payload = JSON.parse(payload); + try { + payload = JSON.parse(payload); + } catch(err) { + + } if (payload.type == "0") { plus.ui.alert(title+"\n"+content); } else if (payload.type == "1") { - plus.ui.alert(title+"\n"+content,function(){ - window.location.href = payload.url; - }); + plus.ui.alert(title+"\n"+content,function(){ + if (payload.url == '/house/index') { + plus.webview.show('yfindex.html'); + } else { + plus.webview.show(BASE_PATH + payload.url); + } + //切换选项卡高亮 + var defaultTab = document.getElementById("defaultTab"); + var quotations = document.getElementById("quotations"); + var selfInfo = document.getElementById("selfInfo"); + defaultTab.classList.remove("mui-active"); + quotations.classList.remove("mui-active"); + selfInfo.classList.remove("mui-active"); + if (payload.url == '/quotations/index') { + quotations.classList.add("mui-active"); + } else if(payload.url == '/selfInfo/index') { + selfInfo.classList.add("mui-active"); + } else { + defaultTab.classList.add("mui-active"); + } + }); } else if (payload.type == "2") { plus.ui.alert(title+"\n"+content,function(){ openUrl(BASE_PATH+'/message/openView?url='+payload.url); @@ -33,11 +54,29 @@ document.addEventListener("plusready", function() { plus.ui.alert(content); } else if (payload.type == "1") { plus.ui.alert(content,function(){ - window.location.href = payload.url; - }); + if (payload.url == '/house/index') { + plus.webview.show('yfindex.html'); + } else { + plus.webview.show(BASE_PATH + payload.url); + } + //切换选项卡高亮 + var defaultTab = document.getElementById("defaultTab"); + var quotations = document.getElementById("quotations"); + var selfInfo = document.getElementById("selfInfo"); + defaultTab.classList.remove("mui-active"); + quotations.classList.remove("mui-active"); + selfInfo.classList.remove("mui-active"); + if (payload.url == '/quotations/index') { + quotations.classList.add("mui-active"); + } else if(payload.url == '/selfInfo/index') { + selfInfo.classList.add("mui-active"); + } else { + defaultTab.classList.add("mui-active"); + } + }); } else if (payload.type == "2") { plus.ui.alert(content,function(){ - openUrl(basePath+'/message/openView?url='+payload.url); + openUrl(BASE_PATH+'/message/openView?url='+payload.url); }); } } @@ -55,7 +94,26 @@ document.addEventListener("plusready", function() { plus.ui.alert(title+"\n"+content); } else if (payload.type == "1") { plus.ui.alert(title+"\n"+content,function(){ - window.location.href = payload.url; + if (payload.url == '/house/index') { + plus.webview.show('yfindex.html'); + } else { + plus.webview.show(BASE_PATH + payload.url); + } + + //切换选项卡高亮 + var defaultTab = document.getElementById("defaultTab"); + var quotations = document.getElementById("quotations"); + var selfInfo = document.getElementById("selfInfo"); + defaultTab.classList.remove("mui-active"); + quotations.classList.remove("mui-active"); + selfInfo.classList.remove("mui-active"); + if (payload.url == '/quotations/index') { + quotations.classList.add("mui-active"); + } else if(payload.url == '/selfInfo/index') { + selfInfo.classList.add("mui-active"); + } else { + defaultTab.classList.add("mui-active"); + } }); } else if (payload.type == "2") { plus.ui.alert(title+"\n"+content,function(){ @@ -63,4 +121,8 @@ document.addEventListener("plusready", function() { }); } }, false); -}, false); \ No newline at end of file +}, false); + +function openUrl(url){ + clicked(url,true); +} \ No newline at end of file diff --git a/fangija-zsyf/main.html b/fangija-zsyf/main.html index 0724f32..5e42f54 100644 --- a/fangija-zsyf/main.html +++ b/fangija-zsyf/main.html @@ -29,7 +29,8 @@ - + + - + +