Merge branch 'YOUFANGAPP1.1' of 192.168.0.27:dev0/youfang-app into YOUFANGAPP1.1
Conflicts: fangija-zsyf/config.js fangija-zsyf/yfindex.html
This commit is contained in:
@@ -1,2 +1,6 @@
|
|||||||
/**服务端地址**/
|
/**服务端地址**/
|
||||||
var BASE_PATH = "http://192.168.10.53:8084";
|
var BASE_PATH = "http://192.168.10.128:8084";
|
||||||
|
//var BASE_PATH = "http://192.168.10.53:8084";
|
||||||
|
//var BASE_PATH = "http://192.168.10.170:8084";
|
||||||
|
/**是否显示过启动页面**/
|
||||||
|
var lauchFlag = false;
|
||||||
@@ -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,16 +15,38 @@ 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(basePath+'/message/openView?url='+payload.url);
|
openUrl(BASE_PATH+'/message/openView?url='+payload.url);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -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,12 +94,35 @@ 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(){
|
||||||
openUrl(basePath+'/message/openView?url='+payload.url);
|
openUrl(BASE_PATH+'/message/openView?url='+payload.url);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, false);
|
}, false);
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
|
function openUrl(url){
|
||||||
|
clicked(url,true);
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
var versionUpdate = function(){
|
||||||
|
var isAndroid = isAndroidUser();
|
||||||
|
plus.runtime.getProperty(plus.runtime.appid, function(inf) {
|
||||||
|
var localVersion =inf.version;
|
||||||
|
var curVersion = versionInfo();
|
||||||
|
if(parseFloat(localVersion)<curVersion.version){
|
||||||
|
plus.nativeUI.alert( curVersion.updateDesc,
|
||||||
|
function(){
|
||||||
|
if(isAndroid){
|
||||||
|
downApp()
|
||||||
|
}else{
|
||||||
|
plus.nativeUI.showWaiting("版本更新中...");
|
||||||
|
var url='https://itunes.apple.com/cn/app/id1341557643?mt=8';
|
||||||
|
plus.runtime.openURL(url);
|
||||||
|
}
|
||||||
|
}, "发现新版本", "立即升级"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
//判断是不是安卓系统
|
||||||
|
var isAndroidUser = function(){
|
||||||
|
var osName = plus.os.name;
|
||||||
|
var isAndroid = true;
|
||||||
|
if(osName=="Android") {
|
||||||
|
isAndroid= true;
|
||||||
|
}else{
|
||||||
|
isAndroid= false;
|
||||||
|
}
|
||||||
|
return isAndroid;
|
||||||
|
}
|
||||||
|
//判断是否需要安装
|
||||||
|
var versionInfo = function(){
|
||||||
|
var flag = null;
|
||||||
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url:BASE_PATH+"/rest/version/info",
|
||||||
|
dataType:'json',
|
||||||
|
async : false,
|
||||||
|
success: function(data) {
|
||||||
|
if(data.status){
|
||||||
|
flag = data.data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
//下载后安装
|
||||||
|
var downApp =function(){
|
||||||
|
var url="http://app.fangjia.com/download/youfang.apk"; // 下载文件地址
|
||||||
|
plus.nativeUI.showWaiting("下载wgt文件...");
|
||||||
|
var dtask = plus.downloader.createDownload( url, {}, function ( d, status ) {
|
||||||
|
if ( status == 200 ) { // 下载成功
|
||||||
|
installWgt(d.filename)
|
||||||
|
} else {//下载失败
|
||||||
|
alert( "Download failed: " + status );
|
||||||
|
}
|
||||||
|
plus.nativeUI.closeWaiting()
|
||||||
|
});
|
||||||
|
dtask.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
//安装
|
||||||
|
function installWgt(path){
|
||||||
|
plus.nativeUI.showWaiting("安装wgt文件...");
|
||||||
|
plus.runtime.install(path,{},function(){
|
||||||
|
plus.nativeUI.closeWaiting();
|
||||||
|
plus.nativeUI.alert("应用资源更新完成!",function(){
|
||||||
|
plus.runtime.restart();
|
||||||
|
});
|
||||||
|
},function(e){
|
||||||
|
plus.nativeUI.closeWaiting();
|
||||||
|
plus.nativeUI.alert("安装wgt文件失败["+e.code+"]:"+e.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -29,6 +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/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');
|
||||||
@@ -44,6 +46,34 @@
|
|||||||
|
|
||||||
//创建子页面,首个选项卡页面显示,其它均隐藏;
|
//创建子页面,首个选项卡页面显示,其它均隐藏;
|
||||||
mui.plusReady(function() {
|
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();
|
var self = plus.webview.currentWebview();
|
||||||
for (var i = 0; i < 4; i++) {
|
for (var i = 0; i < 4; i++) {
|
||||||
var temp = {};
|
var temp = {};
|
||||||
|
|||||||
@@ -1476,6 +1476,15 @@
|
|||||||
"priority": 15
|
"priority": 15
|
||||||
},
|
},
|
||||||
"main.html": {
|
"main.html": {
|
||||||
|
"resources": [
|
||||||
|
"yfindex.html"
|
||||||
|
],
|
||||||
|
"refer": [
|
||||||
|
"start.html"
|
||||||
|
],
|
||||||
|
"priority": 0
|
||||||
|
},
|
||||||
|
"error.html": {
|
||||||
"resources": [
|
"resources": [
|
||||||
"yfindex.html"
|
"yfindex.html"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<title>掌上有房</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="css/sm.css">
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/mui.min.css"/>
|
||||||
|
<link rel="stylesheet" href="css/main.css">
|
||||||
|
<link rel="stylesheet" href="css/theme-blue.css">
|
||||||
|
<script src="config.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="page-group">
|
||||||
|
<div class="page page-current">
|
||||||
|
<div class="content contentStart">
|
||||||
|
<a class="time" onclick="skip()">跳过 <span id="time">5</span></a>
|
||||||
|
<img src="images/start.png">
|
||||||
|
<div class="content-block">
|
||||||
|
<p><a onclick="clicked(BASE_PATH+'/fsh/form',true);" class="button button-big button-fill button-round theme" id="test_btn">立即测试<i class="mui-icon mui-icon-arrowright"></i></a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="js/zepto.js" charset="utf-8"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
/* 关闭路由,以实现不同页面之间的相互跳转(仅开发环境需要) */
|
||||||
|
Zepto = $
|
||||||
|
$.config = {router: false}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="js/common.js" charset="utf-8"></script>
|
||||||
|
<script src="js/mui.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
mui.plusReady(function() {
|
||||||
|
|
||||||
|
});
|
||||||
|
/* 5s倒计时后跳转页面 */
|
||||||
|
function run(){
|
||||||
|
var time = document.getElementById("time");
|
||||||
|
if(time.innerHTML == 0){
|
||||||
|
lauchFlag = true;
|
||||||
|
plus.navigator.setFullscreen(false);
|
||||||
|
plus.webview.currentWebview().close();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
time.innerHTML = time.innerHTML * 1 - 1;
|
||||||
|
}
|
||||||
|
window.setInterval("run();", 1000);
|
||||||
|
|
||||||
|
function skip() {
|
||||||
|
lauchFlag = true;
|
||||||
|
plus.navigator.setFullscreen(false);
|
||||||
|
plus.webview.currentWebview().close();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+260
-42
@@ -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,7 +106,10 @@
|
|||||||
|
|
||||||
</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 class="card cardInfo cardInfo01">
|
<div id="newsList">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!--<div class="card cardInfo cardInfo01">
|
||||||
<img src="images/cardInfoImg01.png">
|
<img src="images/cardInfoImg01.png">
|
||||||
<div class="cardInfoMask"></div>
|
<div class="cardInfoMask"></div>
|
||||||
<div class="card-header">限购先售的时间,适合买房吗?</div>
|
<div class="card-header">限购先售的时间,适合买房吗?</div>
|
||||||
@@ -186,8 +190,11 @@
|
|||||||
<em>V.S</em>
|
<em>V.S</em>
|
||||||
</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>
|
||||||
@@ -1418,11 +1425,13 @@ $.config = {router: false}
|
|||||||
<script type='text/javascript' src="https://unpkg.com/axios/dist/axios.min.js"></script>
|
<script type='text/javascript' src="https://unpkg.com/axios/dist/axios.min.js"></script>
|
||||||
<script type='text/javascript' src='js/city-app.js?version=${version!}' charset='utf-8'></script>
|
<script type='text/javascript' src='js/city-app.js?version=${version!}' charset='utf-8'></script>
|
||||||
<script type='text/javascript' src='js/searchDistrict-app.js?' charset='utf-8'></script>
|
<script type='text/javascript' src='js/searchDistrict-app.js?' charset='utf-8'></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var jQuery = $;
|
var jQuery = $;
|
||||||
$.config = {router: false}
|
$.config = {router: false}
|
||||||
</script>
|
</script>
|
||||||
<script type='text/javascript' src='js/jquery.cookie.js?version=${version!}' charset='utf-8'></script>
|
<script type='text/javascript' src='js/jquery.cookie.js?version=${version!}' charset='utf-8'></script>
|
||||||
|
<script type="text/javascript" src="js/updateVersion/updateVersion.js" charset='utf-8'></script>
|
||||||
<script>
|
<script>
|
||||||
String.prototype.endWith = function(str) {
|
String.prototype.endWith = function(str) {
|
||||||
var reg = new RegExp(str + "$");
|
var reg = new RegExp(str + "$");
|
||||||
@@ -1448,6 +1457,7 @@ document.addEventListener('plusready', onPlusReady, false);
|
|||||||
//扩展API加载完毕,现在可以正常调用扩展API
|
//扩展API加载完毕,现在可以正常调用扩展API
|
||||||
function onPlusReady(){
|
function onPlusReady(){
|
||||||
getPosition();
|
getPosition();
|
||||||
|
versionUpdate();
|
||||||
}
|
}
|
||||||
// 获取当前用户位置
|
// 获取当前用户位置
|
||||||
function getPosition(){
|
function getPosition(){
|
||||||
@@ -1495,6 +1505,15 @@ 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;
|
||||||
@@ -1519,25 +1538,21 @@ function init(){
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
alert("aa");
|
baseInfo.region = response.data.data.region;
|
||||||
new Vue({
|
baseInfo.topMonth = response.data.data.topMonth;
|
||||||
el: '#baseInfo',
|
baseInfo.momAvgPrice = response.data.data.momAvgPrice;
|
||||||
data: {
|
baseInfo.momRate = response.data.data.momRate;
|
||||||
region: response.data.data.region,
|
regionChange(response.data.data.region);
|
||||||
topMonth:response.data.data.topMonth,
|
|
||||||
momAvgPrice: response.data.data.momAvgPrice,
|
new Vue({
|
||||||
momRate: response.data.data.momRate
|
|
||||||
}
|
|
||||||
})
|
|
||||||
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: [
|
||||||
@@ -1547,8 +1562,8 @@ 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);
|
||||||
$("#nearDistricts").css("display",none);
|
$("#nearDistricts").css("display",none);
|
||||||
@@ -1566,43 +1581,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) {
|
||||||
|
dataObj = response.data.data.list;
|
||||||
//附近小区列表
|
lastIndex = 0;
|
||||||
var html = '<div class="cardNearbyWin" id="nearbyDistrictList">';
|
addItems(itemsPerLoad, 0)
|
||||||
for(var i in response.data.data.dtos){
|
if(dataObj.length>5){
|
||||||
html += '<div class="card cardNearby"><div class="card-header">'+response.data.data.dtos[i].name+
|
$(".infinite-scroll-preloader").show();
|
||||||
'</div><div class="card-content"><div class="card-content-inner">'+response.data.data.dtos[i].avgPrice+'元/㎡</div></div><div class="card-footer">'+
|
}else{
|
||||||
'距您'+response.data.data.dtos[i].distance+'m</div></div>';
|
$(".infinite-scroll-preloader").hide();
|
||||||
}
|
}
|
||||||
html += '</div>';
|
lastIndex = $('.cardInfo').length;
|
||||||
$("#nearDistricts").html(html);
|
|
||||||
$("#nearbyDistrictList").css("width",(7.5*response.data.data.dtos.length)+"rem");
|
|
||||||
|
|
||||||
})
|
})
|
||||||
.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