Merge branch 'YOUFANGAPP1.1' of 192.168.0.27:dev0/youfang-app into YOUFANGAPP1.1
This commit is contained in:
@@ -693,7 +693,7 @@ input::-webkit-input-placeholder{
|
|||||||
.topic .topicContent .topicContent_center div .icon.icon-menu04a{background:url(../images/icon-menu04a.png) no-repeat center center;background-size:100%;}
|
.topic .topicContent .topicContent_center div .icon.icon-menu04a{background:url(../images/icon-menu04a.png) no-repeat center center;background-size:100%;}
|
||||||
.topic .topicContent .topicContent_center div .icon.icon-menu05a{background:url(../images/icon-menu05a.png) no-repeat center center;background-size:100%;}
|
.topic .topicContent .topicContent_center div .icon.icon-menu05a{background:url(../images/icon-menu05a.png) no-repeat center center;background-size:100%;}
|
||||||
|
|
||||||
.topic .topicContent .topicContent_center.home div{width:25%;border-left:none;}
|
.topic .topicContent .topicContent_center.home div{width:33%;border-left:none;}
|
||||||
|
|
||||||
.topic .topicContent .topicContent_center.home div .icon{width:45px;height:45px;display:block;margin:0 auto;}
|
.topic .topicContent .topicContent_center.home div .icon{width:45px;height:45px;display:block;margin:0 auto;}
|
||||||
.topic .topicContent .topicContent_center.home div .icon.icon-home01{background:url(../images/icon-home01.png) no-repeat center center;background-size:100%;}
|
.topic .topicContent .topicContent_center.home div .icon.icon-home01{background:url(../images/icon-home01.png) no-repeat center center;background-size:100%;}
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
@@ -3,7 +3,6 @@
|
|||||||
* yinjihuan
|
* yinjihuan
|
||||||
*/
|
*/
|
||||||
document.addEventListener("plusready", function() {
|
document.addEventListener("plusready", function() {
|
||||||
message = document.getElementById("message");
|
|
||||||
// 监听点击消息事件
|
// 监听点击消息事件
|
||||||
plus.push.addEventListener("click", function(msg) {
|
plus.push.addEventListener("click", function(msg) {
|
||||||
// 判断是从本地创建还是离线推送的消息
|
// 判断是从本地创建还是离线推送的消息
|
||||||
@@ -16,13 +15,35 @@ document.addEventListener("plusready", function() {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (plus.os.name == "Android"){
|
if (plus.os.name == "Android"){
|
||||||
payload = JSON.parse(payload);
|
try {
|
||||||
|
payload = JSON.parse(payload);
|
||||||
|
} catch(err) {
|
||||||
|
|
||||||
|
}
|
||||||
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.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") {
|
} else if (payload.type == "2") {
|
||||||
plus.ui.alert(title+"\n"+content,function(){
|
plus.ui.alert(title+"\n"+content,function(){
|
||||||
openUrl(BASE_PATH+'/message/openView?url='+payload.url);
|
openUrl(BASE_PATH+'/message/openView?url='+payload.url);
|
||||||
@@ -33,11 +54,29 @@ document.addEventListener("plusready", function() {
|
|||||||
plus.ui.alert(content);
|
plus.ui.alert(content);
|
||||||
} else if (payload.type == "1") {
|
} else if (payload.type == "1") {
|
||||||
plus.ui.alert(content,function(){
|
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") {
|
} else if (payload.type == "2") {
|
||||||
plus.ui.alert(content,function(){
|
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);
|
plus.ui.alert(title+"\n"+content);
|
||||||
} else if (payload.type == "1") {
|
} else if (payload.type == "1") {
|
||||||
plus.ui.alert(title+"\n"+content,function(){
|
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") {
|
} else if (payload.type == "2") {
|
||||||
plus.ui.alert(title+"\n"+content,function(){
|
plus.ui.alert(title+"\n"+content,function(){
|
||||||
@@ -64,3 +122,7 @@ document.addEventListener("plusready", function() {
|
|||||||
}
|
}
|
||||||
}, false);
|
}, false);
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
|
function openUrl(url){
|
||||||
|
clicked(url,true);
|
||||||
|
}
|
||||||
@@ -29,7 +29,8 @@
|
|||||||
</nav>
|
</nav>
|
||||||
<script src="js/mui.min.js"></script>
|
<script src="js/mui.min.js"></script>
|
||||||
<script src="config.js"></script>
|
<script src="config.js"></script>
|
||||||
<script src="js/push-common.js"></script>
|
<script src="js/common.js"></script>
|
||||||
|
<script src="js/push-common.js"></script>
|
||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
document.getElementById("quotations").setAttribute("href", BASE_PATH + '/quotations/index');
|
document.getElementById("quotations").setAttribute("href", BASE_PATH + '/quotations/index');
|
||||||
document.getElementById("selfInfo").setAttribute("href", BASE_PATH + '/selfInfo/index');
|
document.getElementById("selfInfo").setAttribute("href", BASE_PATH + '/selfInfo/index');
|
||||||
|
|||||||
@@ -0,0 +1,95 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<title>年底额度紧张 广州部分银行首套房贷利率上浮20%</title>
|
||||||
|
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
|
||||||
|
<link rel="shortcut icon" href="/favicon.ico">
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.css">
|
||||||
|
<link rel="stylesheet" href="css/main.css">
|
||||||
|
<link rel="stylesheet" href="css/theme-blue.css">
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="page-group">
|
||||||
|
<div class="page page-current">
|
||||||
|
<header class="bar bar-nav">
|
||||||
|
<button class="button button-link button-nav pull-left" onclick="history.go(-1)">
|
||||||
|
<span class="icon icon-left"></span>
|
||||||
|
</button>
|
||||||
|
<button class="button button-link button-nav pull-right open-popover">
|
||||||
|
<span class="icon icon-path"></span>
|
||||||
|
</button>
|
||||||
|
<h1 class="title"></h1>
|
||||||
|
</header>
|
||||||
|
<div class="content contentText">
|
||||||
|
<div class="content-padded">
|
||||||
|
<h1 id="title"></h1>
|
||||||
|
<p><small id="source">来源:腾讯新闻</small><small style="float:right;" id="visit_count"><i class="icon icon-eye"></i></small><br><small id="create_time">2018-03-11</small></p>
|
||||||
|
<div id="content">
|
||||||
|
<p>最新发布的10月房贷报告显示,银行方面,年内额度依旧紧张,随着房屋租赁市场发展,购房贷款需求量降低,银行压力或将得到缓解。其中,广州首套房贷款平均利率为5.31%,相当于基准1.08倍,二套房贷款平均利率为5.58%。在融360监测的23家银行中,1家银行停贷,无银行提供利率优惠,仅有2家银行执行基准利率。执行基准利率上浮5%和10%的银行分别为9家和8家,上浮20%的银行有3家。</p>
|
||||||
|
<img src="images/infoDetailImg.png">
|
||||||
|
<p>有不完全调查显示,进入四季度以来,大部分银行仍面临额度不充裕问题,放款时间由以往的几周到一个月,延长到2-3个月不等,部分银行房贷业务受额度影响已进入排队等候办理状态,少数银行分支行暂停新增房贷业务受理。</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="popover">
|
||||||
|
<div class="popover-angle"></div>
|
||||||
|
<div class="popover-inner">
|
||||||
|
<div class="list-block">
|
||||||
|
<ul>
|
||||||
|
<li><a href="01_index.html" class="list-button item-link external">首页</a></li>
|
||||||
|
<li><a href="02_quotation01_country.html" class="list-button item-link external">行情</a></li>
|
||||||
|
<li><a href="01_index01_myHouse02_inputInfo.html" class="list-button item-link external">评估</a></li>
|
||||||
|
<li><a href="05_mine01_index.html" class="list-button item-link external">我的</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="http://g.alicdn.com/sj/lib/zepto/zepto.js" charset="utf-8"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
/* 关闭路由,以实现不同页面之间的相互跳转(仅开发环境需要) */
|
||||||
|
Zepto = $
|
||||||
|
$.config = {router: false}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="js/light7.js" charset="utf-8"></script>
|
||||||
|
<script type="text/javascript" src="js/cn.js" charset="utf-8"></script>
|
||||||
|
<script>
|
||||||
|
$(function(){
|
||||||
|
$.ajax({
|
||||||
|
type : 'get',
|
||||||
|
url :"http://192.168.10.161:8084/rest/news/detail",
|
||||||
|
data:{newsId:'180721562428616704'},
|
||||||
|
dataType:'json',
|
||||||
|
async:true,
|
||||||
|
success:function(result){
|
||||||
|
if(result.code==200){
|
||||||
|
data = result.data
|
||||||
|
$("#title").text(data.title)
|
||||||
|
$("#source").text(data.source==null?"":"来源:"+data.source)
|
||||||
|
$("#visit_count").append(data.visitCount)
|
||||||
|
$("#create_time").text(data.createTime)
|
||||||
|
$("#content").html(data.content)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error:function(){
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+253
-101
@@ -48,6 +48,7 @@
|
|||||||
<span>
|
<span>
|
||||||
<i class="icon icon-address01"></i>
|
<i class="icon icon-address01"></i>
|
||||||
<input type="text" id="region" v-model="region" readonly="readonly">
|
<input type="text" id="region" v-model="region" readonly="readonly">
|
||||||
|
<input type="hidden" id="region_copy" v-model="region" readonly="readonly">
|
||||||
<i class="icon icon-down"></i>
|
<i class="icon icon-down"></i>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -93,10 +94,10 @@
|
|||||||
<i class="icon icon-home03"></i>
|
<i class="icon icon-home03"></i>
|
||||||
<span>房价查询</span>
|
<span>房价查询</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="open-about02">
|
<!--<div class="open-about02">
|
||||||
<i class="icon icon-home04"></i>
|
<i class="icon icon-home04"></i>
|
||||||
<span>房租查询</span>
|
<span>房租查询</span>
|
||||||
</div>
|
</div>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -105,6 +106,9 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="content-block-title" style="font-size:1.5rem;" id="todayDate">{{todayDate}}</div>
|
<div class="content-block-title" style="font-size:1.5rem;" id="todayDate">{{todayDate}}</div>
|
||||||
|
<div id="newsList">
|
||||||
|
|
||||||
|
</div>
|
||||||
<!--<div class="card cardInfo cardInfo01">
|
<!--<div class="card cardInfo cardInfo01">
|
||||||
<img src="images/cardInfoImg01.png">
|
<img src="images/cardInfoImg01.png">
|
||||||
<div class="cardInfoMask"></div>
|
<div class="cardInfoMask"></div>
|
||||||
@@ -187,7 +191,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>-->
|
</div>-->
|
||||||
|
<!-- 加载提示符 -->
|
||||||
|
<div class="infinite-scroll-preloader">
|
||||||
|
<div class="preloader"></div>
|
||||||
|
</div>
|
||||||
<div class="selectContainer dn">
|
<div class="selectContainer dn">
|
||||||
<div class="selectBox row">
|
<div class="selectBox row">
|
||||||
<div class="region col-25 theme"><a>区域</a><i class="icon icon-down"></i></div>
|
<div class="region col-25 theme"><a>区域</a><i class="icon icon-down"></i></div>
|
||||||
@@ -1547,8 +1554,17 @@ function getPosition(){
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
/* 获取#region字数,截取#region前4字,并添加... */
|
/* 获取#region字数,截取#region前4字,并添加... */
|
||||||
/*city="上海"
|
city="上海"
|
||||||
init();*/
|
init();
|
||||||
|
var baseInfo = new Vue({
|
||||||
|
el: '#baseInfo',
|
||||||
|
data: {
|
||||||
|
region : "",
|
||||||
|
topMonth:"",
|
||||||
|
momAvgPrice: "",
|
||||||
|
momRate: ""
|
||||||
|
}
|
||||||
|
})
|
||||||
function init(){
|
function init(){
|
||||||
//显示附近地址
|
//显示附近地址
|
||||||
var nearAddressParam = address;
|
var nearAddressParam = address;
|
||||||
@@ -1573,24 +1589,21 @@ function init(){
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
new Vue({
|
baseInfo.region = response.data.data.region;
|
||||||
el: '#baseInfo',
|
baseInfo.topMonth = response.data.data.topMonth;
|
||||||
data: {
|
baseInfo.momAvgPrice = response.data.data.momAvgPrice;
|
||||||
region: response.data.data.region,
|
baseInfo.momRate = response.data.data.momRate;
|
||||||
topMonth:response.data.data.topMonth,
|
regionChange(response.data.data.region);
|
||||||
momAvgPrice: response.data.data.momAvgPrice,
|
|
||||||
momRate: response.data.data.momRate
|
new Vue({
|
||||||
}
|
|
||||||
})
|
|
||||||
new Vue({
|
|
||||||
el: '#todayDate',
|
el: '#todayDate',
|
||||||
data: {
|
data: {
|
||||||
todayDate:response.data.data.todayDate
|
todayDate : response.data.data.todayDate
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
$("#region").picker({
|
$("#region").picker({
|
||||||
toolbarTemplate: '<header class="bar bar-nav bar-nav01 bar-nav01c">\
|
toolbarTemplate: '<header class="bar bar-nav bar-nav01 bar-nav01c">\
|
||||||
<button class="button button-link pull-right close-picker">确定</button>\
|
<button class="button button-link pull-right close-picker" id="regionStatusButton">确定</button>\
|
||||||
<h1 class="title">选择区域</h1>\
|
<h1 class="title">选择区域</h1>\
|
||||||
</header>',
|
</header>',
|
||||||
cols: [
|
cols: [
|
||||||
@@ -1600,7 +1613,7 @@ function init(){
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
regionChange();
|
|
||||||
|
|
||||||
if(response.data.data.dtos.length==0){
|
if(response.data.data.dtos.length==0){
|
||||||
$("#nearAddress").css("display",none);
|
$("#nearAddress").css("display",none);
|
||||||
@@ -1619,107 +1632,246 @@ function init(){
|
|||||||
html += '</div>';
|
html += '</div>';
|
||||||
$("#nearDistricts").html(html);
|
$("#nearDistricts").html(html);
|
||||||
$("#nearbyDistrictList").css("width",(7.5*response.data.data.dtos.length)+"rem");
|
$("#nearbyDistrictList").css("width",(7.5*response.data.data.dtos.length)+"rem");
|
||||||
|
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
alert(error)
|
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
|
initNews();
|
||||||
|
}
|
||||||
|
function initNews(){
|
||||||
//资讯列表
|
//资讯列表
|
||||||
axios.get(BASE_PATH+"/rest/news/list", {
|
axios.get(BASE_PATH+"/rest/news/list", {
|
||||||
params: {
|
params: {
|
||||||
city: cityParam,
|
city: $("input_city").val(),
|
||||||
page:1
|
page:1
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
var html = '';
|
dataObj = response.data.data.list;
|
||||||
for(var i in response.data.data.list){
|
lastIndex = 0;
|
||||||
if(response.data.data.list[i].type=="专题"){
|
addItems(itemsPerLoad, 0)
|
||||||
html += '<div class="card cardInfo cardInfo01">'+
|
if(dataObj.length>5){
|
||||||
'<img src='+response.data.data.list[i].coverImg+'>'+
|
$(".infinite-scroll-preloader").show();
|
||||||
'<div class="cardInfoMask"></div>'+
|
}else{
|
||||||
'<div class="card-header">'+response.data.data.list[i].title+'</div>'+
|
$(".infinite-scroll-preloader").hide();
|
||||||
'<div class="card-footer">'+
|
}
|
||||||
'<span style="margin-right:1.5rem;">'+
|
lastIndex = $('.cardInfo').length;
|
||||||
'<i class="icon icon-praise-white"></i>2022人'+
|
|
||||||
'</span>'+
|
|
||||||
/*'<span><i class="icon icon-comments-white"></i>1245条</span>'+*/
|
|
||||||
'</div>'+
|
|
||||||
'</div>';
|
|
||||||
}
|
|
||||||
/*if(response.data.data.list[i].type=="房源"){
|
|
||||||
html += '<div class="card cardInfo cardInfo01 cardInfo01a">'+
|
|
||||||
'<img src='+response.data.data.list[i].coverImg+'>'+
|
|
||||||
'<div class="cardInfoMask"></div>'+
|
|
||||||
'<div class="card-header">'+response.data.data.list[i].title+'<span>今日推荐</span></div>'+
|
|
||||||
'<div class="card-content">'+
|
|
||||||
'<div class="card-content-inner"><span>浦东-周康</span></div>'+
|
|
||||||
'</div>'+
|
|
||||||
'<div class="card-footer">'+
|
|
||||||
'<span><em><strong>75000</strong>元/㎡</em></span>'+
|
|
||||||
'<span class="tag"><small>在售</small><small>住宅</small><small>轨交房</small><small>学区</small><small>旅游城市</small></span>'+
|
|
||||||
'</div>'+
|
|
||||||
'</div>';
|
|
||||||
}*/
|
|
||||||
if(response.data.data.list[i].type=="活动"){
|
|
||||||
html += '<div class="card cardInfo cardInfo01 cardInfo01b">'+
|
|
||||||
'<img src='+response.data.data.list[i].coverImg+'>'+
|
|
||||||
'<div class="cardInfoMask"></div>'+
|
|
||||||
'<div class="card-header">'+response.data.data.list[i].title+'</div>'+
|
|
||||||
'<div class="card-footer">'+
|
|
||||||
'<span>'+
|
|
||||||
response.data.data.list[i].introduction+
|
|
||||||
'</span>'+
|
|
||||||
'</div>'+
|
|
||||||
'</div>';
|
|
||||||
}
|
|
||||||
/*if(response.data.data.list[i].type=="城市"){
|
|
||||||
<div class="card cardInfo cardInfo01 cardInfo01a">
|
|
||||||
<img src="images/cardInfoImg04.png">
|
|
||||||
<div class="cardInfoMask"></div>
|
|
||||||
<div class="card-header"></div>
|
|
||||||
<div class="card-content">
|
|
||||||
<div class="card-content-inner"><span style="font-size:2rem;line-height:2rem;font-weight:bold;">上海</span></div>
|
|
||||||
</div>
|
|
||||||
<div class="card-footer">
|
|
||||||
<span><em style="color:#666;">潜力指数:<strong>80</strong></em></span>
|
|
||||||
<span class="tag"><small>一线</small><small>魔都</small><small>古城</small><small>文明城</small><small>旅游城市</small></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}*/
|
|
||||||
if(response.data.data.list[i].type=="新闻"){
|
|
||||||
html += '<div class="card cardInfo cardInfo02"><div class="card-content"><div class="list-block media-list">'+
|
|
||||||
'<ul><li class="item-content"><div class="item-media">'+
|
|
||||||
'<img src='+response.data.data.list[i].coverImg+'></div><div class="item-inner">'+
|
|
||||||
'<div class="item-title-row"><div class="item-title">'+response.data.data.list[i].title+'</div></div>'+
|
|
||||||
'<div class="item-subtitle"><font>'+response.data.data.list[i].introduction+'</font></div>'+
|
|
||||||
'<div class="item-subtitle"><span style="margin-right:0.75rem;"><i class="icon icon-praise-grey"></i>2022人</span>'+
|
|
||||||
/*'<span><i class="icon icon-comments-grey"></i>1245条</span>'+*/
|
|
||||||
'</div></div></li></ul></div></div></div>';
|
|
||||||
}
|
|
||||||
if(response.data.data.list[i].type=="投票"){
|
|
||||||
html += '<div class="card cardInfo cardInfo03"><div class="card-header">'+response.data.data.list[i].title+
|
|
||||||
'</div><div class="card-content"><div class="card-content-inner row"><div class="vote01 col-50">'+
|
|
||||||
'<i class="icon icon-light-grey icon-light-red"></i><span>同意</span>'+
|
|
||||||
'<font style="width:62%;"></font><label>198票 62%</label></div>'+
|
|
||||||
'<div class="vote02 col-50"><i class="icon icon-light-grey"></i><span>反对</span>'+
|
|
||||||
'<font style="width:38%;"></font><label>121票 38%</label></div><em>V.S</em></div></div></div>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$("#todayDate").append(html);
|
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
console.log(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();
|
||||||
|
}
|
||||||
|
})*/
|
||||||
|
$("body").delegate("#regionStatusButton", "click", function () {
|
||||||
|
var region_copy = $("#region_copy").val();
|
||||||
|
var value = $(".picker-selected").text();
|
||||||
|
if(region_copy != value && value!="" && value!=null){
|
||||||
|
changeRegion();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$("body").delegate(".icon-light-red", "click", function () {
|
||||||
|
var id = $(this).attr("data-val");
|
||||||
|
doVote(id,0);
|
||||||
|
});
|
||||||
|
|
||||||
|
$("body").delegate(".icon-light-grey", "click", function () {
|
||||||
|
var id = $(this).attr("data-val");
|
||||||
|
doVote(id,1);
|
||||||
|
});
|
||||||
|
function doVote(id,flag){
|
||||||
|
axios.get(BASE_PATH+"/rest/news/vote", {
|
||||||
|
params: {
|
||||||
|
newsId: id,
|
||||||
|
type:flag
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(function (response) {
|
||||||
|
$("#newsList").html('');
|
||||||
|
initNews();
|
||||||
|
})
|
||||||
|
.catch(function (error) {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function regionChange(){
|
function changeRegion(){
|
||||||
var text = $("#region").val();
|
axios.get(BASE_PATH+"/houseApi/home", {
|
||||||
var length = $("#region").val().length;
|
params: {
|
||||||
|
city: $("#input_city").text(),
|
||||||
|
region:$("#region").val(),
|
||||||
|
lat:0,
|
||||||
|
lng:0
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(function (response) {
|
||||||
|
baseInfo.region = response.data.data.region;
|
||||||
|
baseInfo.topMonth = response.data.data.topMonth;
|
||||||
|
baseInfo.momAvgPrice = response.data.data.momAvgPrice;
|
||||||
|
baseInfo.momRate = response.data.data.momRate;
|
||||||
|
regionChange(response.data.data.region);
|
||||||
|
$("#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("<div style='text-align: center; line-height: 3rem;'></div>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var html = '';
|
||||||
|
for(var i in dataObj){
|
||||||
|
if(i>=lastIndex){
|
||||||
|
if((dataObj.length<lastIndex + number) || (i < lastIndex + number)){
|
||||||
|
if(dataObj[i].type=="专题"){
|
||||||
|
html += '<div class="card cardInfo cardInfo01">'+
|
||||||
|
'<img src='+dataObj[i].coverImg+'>'+
|
||||||
|
'<div class="cardInfoMask"></div>'+
|
||||||
|
'<div class="card-header">'+dataObj[i].title+'</div>'+
|
||||||
|
'<div class="card-footer">'+
|
||||||
|
'<span style="margin-right:1.5rem;">'+
|
||||||
|
'<i class="icon icon-praise-white"></i>'+dataObj[i].visitCount+'人'+
|
||||||
|
'</span>'+
|
||||||
|
/*'<span><i class="icon icon-comments-white"></i>1245条</span>'+*/
|
||||||
|
'</div>'+
|
||||||
|
'</div>';
|
||||||
|
}
|
||||||
|
/*if(dataObj[i].type=="房源"){
|
||||||
|
html += '<div class="card cardInfo cardInfo01 cardInfo01a">'+
|
||||||
|
'<img src='+dataObj[i].coverImg+'>'+
|
||||||
|
'<div class="cardInfoMask"></div>'+
|
||||||
|
'<div class="card-header">'+dataObj[i].title+'<span>今日推荐</span></div>'+
|
||||||
|
'<div class="card-content">'+
|
||||||
|
'<div class="card-content-inner"><span>浦东-周康</span></div>'+
|
||||||
|
'</div>'+
|
||||||
|
'<div class="card-footer">'+
|
||||||
|
'<span><em><strong>75000</strong>元/㎡</em></span>'+
|
||||||
|
'<span class="tag"><small>在售</small><small>住宅</small><small>轨交房</small><small>学区</small><small>旅游城市</small></span>'+
|
||||||
|
'</div>'+
|
||||||
|
'</div>';
|
||||||
|
}*/
|
||||||
|
if(dataObj[i].type=="活动"){
|
||||||
|
html += '<div class="card cardInfo cardInfo01 cardInfo01b">'+
|
||||||
|
'<img src='+dataObj[i].coverImg+'>'+
|
||||||
|
'<div class="cardInfoMask"></div>'+
|
||||||
|
'<div class="card-header">'+dataObj[i].title+'</div>'+
|
||||||
|
'<div class="card-footer">'+
|
||||||
|
'<span>'+
|
||||||
|
dataObj[i].introduction+
|
||||||
|
'</span>'+
|
||||||
|
'</div>'+
|
||||||
|
'</div>';
|
||||||
|
}
|
||||||
|
/*if(dataObj[i].type=="城市"){
|
||||||
|
<div class="card cardInfo cardInfo01 cardInfo01a">
|
||||||
|
<img src="images/cardInfoImg04.png">
|
||||||
|
<div class="cardInfoMask"></div>
|
||||||
|
<div class="card-header"></div>
|
||||||
|
<div class="card-content">
|
||||||
|
<div class="card-content-inner"><span style="font-size:2rem;line-height:2rem;font-weight:bold;">上海</span></div>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
<span><em style="color:#666;">潜力指数:<strong>80</strong></em></span>
|
||||||
|
<span class="tag"><small>一线</small><small>魔都</small><small>古城</small><small>文明城</small><small>旅游城市</small></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}*/
|
||||||
|
if(dataObj[i].type=="新闻"){
|
||||||
|
html += '<div class="card cardInfo cardInfo02"><div class="card-content"><div class="list-block media-list">'+
|
||||||
|
'<ul><li class="item-content"><div class="item-media">'+
|
||||||
|
'<img src='+dataObj[i].coverImg+'></div><div class="item-inner">'+
|
||||||
|
'<div class="item-title-row"><div class="item-title">'+dataObj[i].title+'</div></div>'+
|
||||||
|
'<div class="item-subtitle"><font>'+dataObj[i].introduction+'</font></div>'+
|
||||||
|
'<div class="item-subtitle"><span style="margin-right:0.75rem;"><i class="icon icon-praise-grey"></i>'+dataObj[i].visitCount+'人</span>'+
|
||||||
|
/*'<span><i class="icon icon-comments-grey"></i>1245条</span>'+*/
|
||||||
|
'</div></div></li></ul></div></div></div>';
|
||||||
|
}
|
||||||
|
if(dataObj[i].type=="投票"){
|
||||||
|
var voteFavorCount = dataObj[i].voteFavorCount;
|
||||||
|
var voteNoFavorCount = dataObj[i].voteNoFavorCount;
|
||||||
|
var voteFavorCountRate = (voteFavorCount/(voteFavorCount+voteNoFavorCount)).toFixed(2);
|
||||||
|
var voteNoFavorCountRate = 1-voteFavorCountRate;
|
||||||
|
html += '<div class="card cardInfo cardInfo03"><div class="card-header">'+dataObj[i].title+
|
||||||
|
'</div><div class="card-content"><div class="card-content-inner row"><div class="vote01 col-50">'+
|
||||||
|
'<i class="icon icon-light-red" data-val="'+dataObj[i].id+'"></i><span>同意</span>'+
|
||||||
|
'<font style="width:'+voteFavorCountRate*100+'%;"></font><label>'+voteFavorCount+'票 '+voteFavorCountRate*100+'%</label></div>'+
|
||||||
|
'<div class="vote02 col-50"><i class="icon icon-light-grey" data-val="'+dataObj[i].id+'"></i><span>反对</span>'+
|
||||||
|
'<font style="width:'+voteNoFavorCountRate*100+'%;"></font><label>'+voteNoFavorCount+'票 '+voteNoFavorCountRate*100+'%</label></div><em>V.S</em></div></div></div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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(region){
|
||||||
|
var text = region;
|
||||||
|
var length = region.length;
|
||||||
var textStr = "";
|
var textStr = "";
|
||||||
if(length > 4){
|
if(length > 4){
|
||||||
textStr = text.substr(0,4);
|
textStr = text.substr(0,4);
|
||||||
|
|||||||
Reference in New Issue
Block a user