aa
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 527 B |
@@ -1,35 +1,57 @@
|
||||
var xhr;
|
||||
var searchDistVue = new Vue({
|
||||
el: '#searchList',
|
||||
data: {
|
||||
searchDistricts: []
|
||||
}
|
||||
})
|
||||
$("#districtName").bind("input propertychange keyup" , function () {
|
||||
var keyword = $(this).val()
|
||||
if(xhr){
|
||||
xhr.abort()
|
||||
}
|
||||
if(keyword == ""){
|
||||
$('#districtList').empty()
|
||||
// $('.searchList #searchList').empty()
|
||||
return
|
||||
}
|
||||
xhr = $.ajax({
|
||||
url:'../auto/district',
|
||||
data:{keywords : keyword, cityName:$("#input_city").text(),max:20},
|
||||
dataType:'json',
|
||||
success:function (data){
|
||||
$('#searchHistoryDiv').hide();
|
||||
if(data.length == 0){
|
||||
$("#notFound").show()
|
||||
$('#districtList').empty();
|
||||
}else{
|
||||
$("#notFound").hide()
|
||||
var html = $('<ul>')
|
||||
$(data).each(function () {
|
||||
var li = $('<li>').attr("data-region", this.district).attr("data-name", this.name).attr("data-addr", this.address).attr("data-cityAddress", this.city)
|
||||
li.append('<a class="item-link item-content close-popup"><div class="item-inner"><div class="item-title-row"><div class="item-title">' + this.name + '<br><small>' + this.city + this.district + this.address + '</small></div></div></div></a>')
|
||||
html.append(li)
|
||||
})
|
||||
$('#districtList').empty().html(html)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
axios.get(BASE_PATH+"/rest/districts/search", {
|
||||
params: {
|
||||
keywords : keyword,
|
||||
cityName:$("#input_city").text(),
|
||||
max:20
|
||||
}
|
||||
}).then(function (response) {
|
||||
|
||||
var datas = response.data.data
|
||||
|
||||
$('.hotList').hide();
|
||||
$('.historyList').hide();
|
||||
if(datas == null || datas.length == 0){
|
||||
$("#notFound").show()
|
||||
searchDistVue.$data.searchDistricts = []
|
||||
//$('.searchList #searchList').empty();
|
||||
}else{
|
||||
|
||||
console.log(keyword +" "+datas.length);
|
||||
$("#notFound").hide()
|
||||
var dists = [];
|
||||
for(var i in datas){
|
||||
var o = datas[i]
|
||||
var map={city:o.city, region:o.district, name:o.name,address:o.address};
|
||||
dists.push(map);
|
||||
}
|
||||
|
||||
//searchDistVue.$set("searchDistricts") = dists;
|
||||
searchDistVue.$data.searchDistricts=dists
|
||||
$('.searchList').show();
|
||||
}
|
||||
}).catch(function (error) {
|
||||
alert(error)
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
function saveHistory(district) {
|
||||
var history = recover()
|
||||
@@ -66,24 +88,66 @@ $("body").delegate(".open-about02", "click", function () {
|
||||
$.toast("请选择城市")
|
||||
return false;
|
||||
}
|
||||
$('#searchHistoryDiv').show();
|
||||
$('.historyList').show();
|
||||
$("#notFound").hide();
|
||||
$('.hotList').show();
|
||||
$('.searchList').hide();
|
||||
addHotDistricts($("#input_city").val());
|
||||
addHistory();
|
||||
$.popup(".popup-about02")
|
||||
$("input").blur()
|
||||
});
|
||||
});
|
||||
|
||||
//添加热门小区
|
||||
function addHotDistricts(cityParam){
|
||||
axios.get(BASE_PATH+"/rest/districts/hotDistricts", {
|
||||
params: {
|
||||
city: cityParam,
|
||||
top:6
|
||||
}
|
||||
}).then(function (response) {
|
||||
|
||||
var datas = response.data.data
|
||||
if(datas.length>0){
|
||||
var dists = [];
|
||||
for(var i in datas){
|
||||
|
||||
var o = datas[i]
|
||||
var map={city:o.city, region:o.region, name:o.name};
|
||||
dists.push(map);
|
||||
}
|
||||
|
||||
new Vue({
|
||||
el: '#hotList',
|
||||
data: {
|
||||
hotDists: dists
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}).catch(function (error) {
|
||||
alert(error)
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
function addHistory(){
|
||||
var history = recover()
|
||||
if(history.length>0){
|
||||
var ul = '<ul>'
|
||||
var histories = [];
|
||||
$(history).each(function(){
|
||||
ul += '<li data-region="'+this.district+'" data-cityAddress="'+this.city+'" data-name="'+this.name+'" data-addr="'+this.address+'"><a class="item-link item-content close-popup"><div class="item-inner"><div class="item-title-row"><div class="item-title"><font>'+this.name+'</font><br><small>'+this.city+this.district+this.address+'</small></div></div></div></a></li>';
|
||||
var map={city:this.city, region:this.district, name:this.name};
|
||||
histories.push(map)
|
||||
})
|
||||
new Vue({
|
||||
el: '#districtList',
|
||||
data: {
|
||||
histories: histories
|
||||
}
|
||||
})
|
||||
ul += '</ul>'
|
||||
$('#districtList').empty().html(ul)
|
||||
|
||||
}else{
|
||||
$("#districtList").empty();
|
||||
$(".historyList #districtList").empty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title id="title2"></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" href="../../css/main.css">
|
||||
<link rel="stylesheet" href="../../css/theme-blue.css">
|
||||
<link rel="stylesheet" href="../../css/mui.min.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="back(),plus.nativeUI.closeWaiting();">
|
||||
<span class="mui-icon mui-icon mui-icon-arrowleft"></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"></small></p>
|
||||
<div id="content">
|
||||
</div>
|
||||
</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/light7.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="../../js/cn.js" charset="utf-8"></script>
|
||||
<script src="../../config.js"></script>
|
||||
<script type="text/javascript" src="../../js/common.js" ></script>
|
||||
<script>
|
||||
document.addEventListener('plusready', onPlusReady, false);
|
||||
function onPlusReady() {
|
||||
var self = plus.webview.currentWebview();
|
||||
var id = self.newsId;
|
||||
$.ajax({
|
||||
type : 'get',
|
||||
url : BASE_PATH + "/rest/news/detail",
|
||||
data:{newsId:id},
|
||||
dataType:'json',
|
||||
async:true,
|
||||
success:function(result){
|
||||
if(result.code==200){
|
||||
data = result.data
|
||||
$("#title").text(data.title)
|
||||
$("#title2").text(data.title)
|
||||
$("#source").text(data.source==null?"":"来源:"+data.source)
|
||||
$("#visit_count").append(data.visitCount)
|
||||
var date = new Date(data.createTime)
|
||||
var dateStr = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()
|
||||
$("#create_time").text(dateStr)
|
||||
$("#content").html(data.content)
|
||||
}
|
||||
},
|
||||
error:function(){
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user