From 8983c5d315d239370f9857894dd67b734db3cef1 Mon Sep 17 00:00:00 2001 From: zongzhimin Date: Wed, 11 Apr 2018 16:43:18 +0800 Subject: [PATCH] =?UTF-8?q?YOUFANG=20=E6=88=BF=E4=BA=A7=E8=A1=8C=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/component/myFocusComponent.js | 1 - fangija-zsyf/views/house/houseDetail.html | 73 ++++++++++++------- 2 files changed, 48 insertions(+), 26 deletions(-) diff --git a/fangija-zsyf/views/component/myFocusComponent.js b/fangija-zsyf/views/component/myFocusComponent.js index 494f152..cbf3222 100644 --- a/fangija-zsyf/views/component/myFocusComponent.js +++ b/fangija-zsyf/views/component/myFocusComponent.js @@ -57,7 +57,6 @@ Vue.component('my_focus',{ myFocusDatas.myFocusList = response.data.data; } }).catch(function(error){ - //alert(2) console.log(error) }) } diff --git a/fangija-zsyf/views/house/houseDetail.html b/fangija-zsyf/views/house/houseDetail.html index 13e3e89..f368943 100644 --- a/fangija-zsyf/views/house/houseDetail.html +++ b/fangija-zsyf/views/house/houseDetail.html @@ -692,6 +692,32 @@ $(document).on("click",".open-about01", function () { markFocus(); $.popup(".popup-about01"); }); +/* 定位城市 */ +$("body").on("click", ".letter a", function () { + var s = $(this).html(); + $(".popup-about01 .content").scrollTop(0); + $(".popup-about01 .content").scrollTop($("#" + s + "1").offset().top - 106); +}); +$("#tabCity1 .content-block01").scroll(function () { + $("#tabCity1 .content-block01 .letter").css("position","absolute"); + $("#tabCity1 .content-block01 .letter").css("top", 85 - $("#cityContainer").position().top); +}); + +/* 获取城市 */ +$(".popup-about01 .cityGPS").on("click", function () { + $("#input_city").val($(this).find("p").text()); + $(".cityChoice a").text($(this).find("p").text()); + $(".popup-about01 p").removeClass("active"); +}); +$(".popup-about01 p").on("click", function () { + $("#input_city").val($(this).text()); + $(".cityChoice a").text($(this).text()); + $(".popup-about01 p").removeClass("active"); + $(this).addClass("active"); + var city = $(this).text() + addFocus(city) +}); + //$(document).on("click",".open-about01", function () { // markFocus(); // $.popup(".popup-about01"); @@ -728,37 +754,34 @@ function markFocus(){ console.log(error) }) } -/* 定位城市 */ -$("body").on("click", ".letter a", function () { - var s = $(this).html(); - $(".popup-about01 .content").scrollTop(0); - $(".popup-about01 .content").scrollTop($("#" + s + "1").offset().top - 106); -}); -$("#tabCity1 .content-block01").scroll(function () { - $("#tabCity1 .content-block01 .letter").css("position","absolute"); - $("#tabCity1 .content-block01 .letter").css("top", 85 - $("#cityContainer").position().top); -}); -/* 获取城市 */ -$(".popup-about01 .cityGPS").on("click", function () { - $("#input_city").val($(this).find("p").text()); - $(".cityChoice a").text($(this).find("p").text()); - $(".popup-about01 p").removeClass("active"); - alert(1) -}); -$(".popup-about01 p").on("click", function () { - $("#input_city").val($(this).text()); - $(".cityChoice a").text($(this).text()); - $(".popup-about01 p").removeClass("active"); - $(this).addClass("active"); - var city = $(this).text() +function addFocus(city){ axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){ + //reloadMyFocus() }).catch(function(error){ console.log(error) }) - alert(2) -}); +} +//重新加载我的关注 +function reloadMyFocus(){ + if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){ + $("#myFocusFirstPage").hide() + $("#myFocus").hide(); + }else{ + axios.get("/rest/quotations/userCollectCityInfo").then(function(response){ + if(response.data.data.length==0){ + alert("aa"); + $("#myFocusFirstPage").hide(); + $("#myFocus").hide(); + }else{ + myFocusDatas.myFocusList = response.data.data; + } + }).catch(function(error){ + console.log(error) + }) + } +}