diff --git a/fangija-zsyf/fangija-zsyf/index.html b/fangija-zsyf/fangija-zsyf/index.html
new file mode 100644
index 0000000..a9d1c8d
--- /dev/null
+++ b/fangija-zsyf/fangija-zsyf/index.html
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/fangija-zsyf/images/icon-address03.png b/fangija-zsyf/images/icon-address03.png
new file mode 100644
index 0000000..1cc4d39
Binary files /dev/null and b/fangija-zsyf/images/icon-address03.png differ
diff --git a/fangija-zsyf/images/icon-clear.png b/fangija-zsyf/images/icon-clear.png
new file mode 100644
index 0000000..495cb32
Binary files /dev/null and b/fangija-zsyf/images/icon-clear.png differ
diff --git a/fangija-zsyf/js/district-search.js b/fangija-zsyf/js/district-search.js
new file mode 100644
index 0000000..e69de29
diff --git a/fangija-zsyf/js/searchDistrict-app.js b/fangija-zsyf/js/searchDistrict-app.js
index 8a0fc78..5a54d6a 100644
--- a/fangija-zsyf/js/searchDistrict-app.js
+++ b/fangija-zsyf/js/searchDistrict-app.js
@@ -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 = $('')
- $(data).each(function () {
- var li = $('- ').attr("data-region", this.district).attr("data-name", this.name).attr("data-addr", this.address).attr("data-cityAddress", this.city)
- li.append('')
- 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 = '
'
+ var histories = [];
$(history).each(function(){
- ul += '';
+ var map={city:this.city, region:this.district, name:this.name};
+ histories.push(map)
+ })
+ new Vue({
+ el: '#districtList',
+ data: {
+ histories: histories
+ }
})
- ul += '
'
- $('#districtList').empty().html(ul)
}else{
- $("#districtList").empty();
+ $(".historyList #districtList").empty();
}
}
diff --git a/fangija-zsyf/views/news/newsDetail.html b/fangija-zsyf/views/news/newsDetail.html
new file mode 100644
index 0000000..ed5e7cb
--- /dev/null
+++ b/fangija-zsyf/views/news/newsDetail.html
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file