From 2e39c5799af3952b283b1e9be52175436454a46e Mon Sep 17 00:00:00 2001 From: "xuhe@fangjia.com" Date: Thu, 15 Mar 2018 14:49:51 +0800 Subject: [PATCH 1/4] aa --- fangija-zsyf/yfindex.html | 277 +++++++++++++++++++++++++++----------- 1 file changed, 196 insertions(+), 81 deletions(-) diff --git a/fangija-zsyf/yfindex.html b/fangija-zsyf/yfindex.html index 533faac..f7e4b94 100644 --- a/fangija-zsyf/yfindex.html +++ b/fangija-zsyf/yfindex.html @@ -48,6 +48,7 @@ + @@ -105,6 +106,9 @@
{{todayDate}}
+
+ +
- + +
+
+
@@ -1587,7 +1594,7 @@ function init(){ }) $("#region").picker({ toolbarTemplate: '
\ - \ + \

选择区域

\
', cols: [ @@ -1598,7 +1605,7 @@ function init(){ ] }); regionChange(); - + if(response.data.data.dtos.length==0){ $("#nearAddress").css("display",none); $("#nearDistricts").css("display",none); @@ -1619,11 +1626,9 @@ function init(){ }) .catch(function (error) { - alert(error) console.log(error); }); - //资讯列表 axios.get(BASE_PATH+"/rest/news/list", { params: { @@ -1632,88 +1637,198 @@ function init(){ } }) .then(function (response) { - 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); + dataObj = response.data.data.list; + lastIndex = 0; + addItems(itemsPerLoad, 0) + if(dataObj.length>5){ + $(".infinite-scroll-preloader").show(); + }else{ + $(".infinite-scroll-preloader").hide(); + } + lastIndex = $('.cardInfo').length; }) .catch(function (error) { console.log(error); }); - } +$("#region").click(function(e){ + $(document).click(function(e){ + alert($("#region").val()); + var region_copy = $("#region_copy").val(); + var value = $(".picker-selected").text(); + if(region_copy != value && value!="" && value!=null){ + alert($("#region").val()); + changeRegion(); + } + }) +}) + +$("#regionStatusButton").click(function(e){ + var region_copy = $("#region_copy").val(); + var value = $(".picker-selected").text(); + alert($("#region").val()); + if(region_copy != value && value!="" && value!=null){ + alert($("#region").val()); + changeRegion(); + } +}) + + +function changeRegion(){ + axios.get(BASE_PATH+"/houseApi/home", { + params: { + city: $("#input_city").text(), + region:$("#region").val(), + lat:0, + lng:0 + } + }) + .then(function (response) { + new Vue({ + el: '#baseInfo', + data: { + region: response.data.data.region, + topMonth:response.data.data.topMonth, + momAvgPrice: response.data.data.momAvgPrice, + momRate: response.data.data.momRate + } + }) + $("#region_copy").val(response.data.data.region); + }) + .catch(function (error) { + console.log(error); + }); +} +/* 页面底部无限加载事件 */ +$.init(); +var loading = false; +// 最多可加载的条目 +var maxItems = 60; +// 每次加载添加多少条目 +var itemsPerLoad = 5; +var dataObj = {}; +function addItems(number, lastIndex) { + // 生成新条目的HTML + if(dataObj.length == 0) { + // 加载完毕,则注销无限加载事件,以防不必要的加载 + $.detachInfiniteScroll($('.infinite-scroll')); + // 删除加载提示符 + $('.infinite-scroll-preloader').remove(); + $('.infinite-scroll-bottom .list-container ul ').html("
"); + return; + } + var html = ''; + for(var i in dataObj){ + if(i>=lastIndex){ + if((dataObj.length'+ + '
'+ + '
'+dataObj[i].title+'
'+ + ''+ + '
'; + } + /*if(dataObj[i].type=="房源"){ + html += '
'+ + ''+ + '
'+ + '
'+dataObj[i].title+'今日推荐
'+ + '
'+ + '
浦东-周康
'+ + '
'+ + ''+ + '
'; + }*/ + if(dataObj[i].type=="活动"){ + html += '
'+ + ''+ + '
'+ + '
'+dataObj[i].title+'
'+ + ''+ + '
'; + } + /*if(dataObj[i].type=="城市"){ +
+ +
+
+
+
上海
+
+ +
+ }*/ + if(dataObj[i].type=="新闻"){ + html += '
'+ + '
  • '+ + '
    '+ + '
    '+dataObj[i].title+'
    '+ + '
    '+dataObj[i].introduction+'
    '+ + '
    '+dataObj[i].visitCount+'人'+ + /*'1245条'+*/ + '
'; + } + if(dataObj[i].type=="投票"){ + html += '
'+dataObj[i].title+ + '
'+ + '同意'+ + '
'+ + '
反对'+ + '
V.S
'; + } + } + } + } + if(dataObj.length<=(lastIndex + number)){ + $(".infinite-scroll-preloader").hide(); + } + // 添加新条目 + if(lastIndex == 0){ + $("#newsList").html(html); + }else{ + $('#newsList').append(html); + } + } + +// 上次加载的序号 + +var lastIndex = 5; + +// 注册'infinite'事件处理函数 +$(document).on('infinite', '.infinite-scroll-bottom',function() { + // 如果正在加载,则退出 + if (loading) return; + // 设置flag + loading = true; + + // 模拟1s的加载过程 + setTimeout(function() { + // 重置加载flag + loading = false; + // 添加新条目 + addItems(itemsPerLoad, lastIndex); + // 更新最后加载的序号 + lastIndex = $('.cardInfo').length; + }, 500); +}); + function regionChange(){ var text = $("#region").val(); var length = $("#region").val().length; From 20d5aea8a654f6abd653b5b8da664da342f8fce3 Mon Sep 17 00:00:00 2001 From: zongzhimin Date: Thu, 15 Mar 2018 15:25:32 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=9C=89=E6=88=BF1.1=20=E8=B5=84=E8=AE=AF?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/images/icon-eye.png | Bin 0 -> 1214 bytes fangija-zsyf/newsDetail.html | 95 +++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 fangija-zsyf/images/icon-eye.png create mode 100644 fangija-zsyf/newsDetail.html diff --git a/fangija-zsyf/images/icon-eye.png b/fangija-zsyf/images/icon-eye.png new file mode 100644 index 0000000000000000000000000000000000000000..8d00c3ad87b8239d43cb98664b510d4604af20b5 GIT binary patch literal 1214 zcmV;v1VQ_WP)!h<0!gHFamk7$?8I3*&-N%oN3@B99D)1a?H*^WU^PtTlOF87e* zI2%Re(spdB5z!9TrS@O;29B_+YVt9%+CO}YOQy-;%Mqn z6h#-OX}U{9mNz0Hc|1+iPe_IUekXZenxte{(|JZ28Mr<+~oWI2PD%*#9qc+trpdwY9V#c}*8 z$=Q>2BJx{4pI=cZ6uxa0`Y4LdNs{Cv0Bajy6Ovn%Qro9Qar}oUiq<7bvI{^*gK!U% zTkhMHA#}Z3t)V)k2;RC!}Gk&^>i9zZW57$O>2gH)%X2} zNlLXd?N1nnw*%M-z`iGqL~OeUL2$Z;FOobcB2yw+Gk#WU{dk?IR4RoeRYsa$)>=PO zbtnwORRF#OkZ)!nB7H#+6zcjg3=acXl5xODk|dp7U0uIgj4@`5h&-KDcOvpc5Cl(I zhrS1}Fbhm_w^C|@#Z)Sl^W!)kXw=pdYJt2E*W?&tFkF(AIkc!A#DI7$)}y72o&mE@-TL1t6 literal 0 HcmV?d00001 diff --git a/fangija-zsyf/newsDetail.html b/fangija-zsyf/newsDetail.html new file mode 100644 index 0000000..120df3d --- /dev/null +++ b/fangija-zsyf/newsDetail.html @@ -0,0 +1,95 @@ + + + + + +年底额度紧张 广州部分银行首套房贷利率上浮20% + + + + + + + + + + + + + +
+
+
+ + +

+
+
+
+

+

来源:腾讯新闻
2018-03-11

+
+

最新发布的10月房贷报告显示,银行方面,年内额度依旧紧张,随着房屋租赁市场发展,购房贷款需求量降低,银行压力或将得到缓解。其中,广州首套房贷款平均利率为5.31%,相当于基准1.08倍,二套房贷款平均利率为5.58%。在融360监测的23家银行中,1家银行停贷,无银行提供利率优惠,仅有2家银行执行基准利率。执行基准利率上浮5%和10%的银行分别为9家和8家,上浮20%的银行有3家。

+ +

有不完全调查显示,进入四季度以来,大部分银行仍面临额度不充裕问题,放款时间由以往的几周到一个月,延长到2-3个月不等,部分银行房贷业务受额度影响已进入排队等候办理状态,少数银行分支行暂停新增房贷业务受理。

+
+
+
+
+
+
+
+
+ +
+
+
+
+ + + + + + + + + + \ 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 3/4] =?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 @@ - + +