From bcfe75137f5766f4f9d004265b4d5ba063d4d040 Mon Sep 17 00:00:00 2001 From: zongzhimin Date: Sun, 8 Apr 2018 18:16:23 +0800 Subject: [PATCH 01/10] YOUFANG1.1 --- fangija-zsyf/views/user/userInfo.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fangija-zsyf/views/user/userInfo.html b/fangija-zsyf/views/user/userInfo.html index 77394f6..8ad0ed2 100644 --- a/fangija-zsyf/views/user/userInfo.html +++ b/fangija-zsyf/views/user/userInfo.html @@ -146,8 +146,8 @@
-
-
    +
    +
    From 080be4273c580bfe8234efba37e06aa1e4b315fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E5=90=89=E6=AC=A2?= Date: Sun, 8 Apr 2018 19:21:44 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E6=B8=85=E7=A9=BAtoken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/js/login/codeSms.js | 1 + fangija-zsyf/js/login/thirdLogin.js | 1 + fangija-zsyf/main.html | 10 ++++++++++ fangija-zsyf/views/component/component.js | 3 ++- fangija-zsyf/views/component/componenttest.html | 2 +- fangija-zsyf/views/user/bindingMobile.html | 1 + fangija-zsyf/views/user/passLogin.html | 1 + 7 files changed, 17 insertions(+), 2 deletions(-) diff --git a/fangija-zsyf/js/login/codeSms.js b/fangija-zsyf/js/login/codeSms.js index a658db0..03b2c49 100644 --- a/fangija-zsyf/js/login/codeSms.js +++ b/fangija-zsyf/js/login/codeSms.js @@ -77,6 +77,7 @@ $("#login_btn").on("click", function () { // 用户登录成功的TOKEN var data = resData.data; localStorage.setItem("user_token", data.token); + localStorage.setItem("user_token_add_time", new Date().getTime()); $.toast(resData.message); if (data.firstLogin) { // 显示设置密码页面 diff --git a/fangija-zsyf/js/login/thirdLogin.js b/fangija-zsyf/js/login/thirdLogin.js index 689d42b..16f3076 100644 --- a/fangija-zsyf/js/login/thirdLogin.js +++ b/fangija-zsyf/js/login/thirdLogin.js @@ -85,6 +85,7 @@ function login(openid, unionid, accessToken, nickname, headImg, loginFrom, uri) }) }else{ localStorage.setItem("user_token", resData.data); + localStorage.setItem("user_token_add_time", new Date().getTime()); back(); } }else{ diff --git a/fangija-zsyf/main.html b/fangija-zsyf/main.html index 7706ab5..d87198f 100644 --- a/fangija-zsyf/main.html +++ b/fangija-zsyf/main.html @@ -39,6 +39,16 @@ diff --git a/fangija-zsyf/views/user/bindingMobile.html b/fangija-zsyf/views/user/bindingMobile.html index 5772d0b..818bd12 100644 --- a/fangija-zsyf/views/user/bindingMobile.html +++ b/fangija-zsyf/views/user/bindingMobile.html @@ -196,6 +196,7 @@ var vue = new Vue({ if (resData.status) { $.toast(resData.message); localStorage.setItem("user_token", resData.data); + localStorage.setItem("user_token_add_time", new Date().getTime()); back(); } else { $.toast(resData.message); diff --git a/fangija-zsyf/views/user/passLogin.html b/fangija-zsyf/views/user/passLogin.html index 74e84c3..bf9bb1c 100644 --- a/fangija-zsyf/views/user/passLogin.html +++ b/fangija-zsyf/views/user/passLogin.html @@ -131,6 +131,7 @@ new Vue({ // 用户登录成功的TOKEN var token = resData.data; localStorage.setItem("user_token", token); + localStorage.setItem("user_token_add_time", new Date().getTime()); $.toast(resData.message); back(); } else { From 6f70e1de86e6a85354049e58fe9cda637492b298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E5=90=89=E6=AC=A2?= Date: Sun, 8 Apr 2018 19:25:02 +0800 Subject: [PATCH 03/10] add --- fangija-zsyf/views/component/componenttest.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fangija-zsyf/views/component/componenttest.html b/fangija-zsyf/views/component/componenttest.html index 4caa276..4edefa8 100644 --- a/fangija-zsyf/views/component/componenttest.html +++ b/fangija-zsyf/views/component/componenttest.html @@ -6,7 +6,7 @@
    - +
    @@ -14,7 +14,12 @@ From 301cc55b1c352d763cca28627446eb547c133171 Mon Sep 17 00:00:00 2001 From: raoyanhui Date: Sun, 8 Apr 2018 20:21:44 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=88=91=E7=9A=84?= =?UTF-8?q?=E6=88=BF=E4=BA=A7=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/views/house/houseList.html | 258 +++++++++++++++++++----- 1 file changed, 203 insertions(+), 55 deletions(-) diff --git a/fangija-zsyf/views/house/houseList.html b/fangija-zsyf/views/house/houseList.html index 0049a86..5b58a5e 100644 --- a/fangija-zsyf/views/house/houseList.html +++ b/fangija-zsyf/views/house/houseList.html @@ -37,82 +37,39 @@

    我的房产

    - @@ -140,6 +97,197 @@ $.config = {router: false} //初始化init $.init(); +//定义对象 +var baseInfo = new Vue({ + el: '#houseInfo', + data: { + totalPrice : "", + oneYearUpDownRange:"", + oneYearUpDownPrice: "" + } +}) + +var uid = "162167854504869888"; +// 加载flag +var loading = false; + +//分页部分参数定义 +var page; +var pageSize; +var totalPages; +var totalRecords; + +// 上次加载的序号 +var lastIndex; +// 每次加载添加多少条目 +var itemsPerLoad; +// 最多可加载的条目 +var maxItems = 100; + +// 注册'infinite'事件处理函数 +$(document).on('infinite', '.infinite-scroll-bottom', function() { + // 如果正在加载,则退出 + if(loading) return; + // 设置flag + loading = true; + // 模拟1s的加载过程 + setTimeout(function() { + // 重置加载flag + loading = false; + //如果当前页大于等于总页数 + if(page >= totalPages) { + // 加载完毕,则注销无限加载事件,以防不必要的加载 + $.detachInfiniteScroll($('.infinite-scroll')); + // 删除加载提示符 + $('.infinite-scroll-preloader').remove(); + return; + } + //控制查询下一页的数据 + page = page + 1; + selectHouseInfoList(); + //容器发生改变,如果是js滚动,需要刷新滚动 + //$.refreshScroller(); + }, 1000); +}); + +//我的收藏查询请求 +function selectHouseInfoList(){ + axios.get(BASE_PATH + "/rest/index/ourHouseInfoList", + { + params: { + uid: uid, + page: page, + pageSize: pageSize + } + }).then(function (response) { + var resultsMap = response.data.data; + var resultList = resultsMap.houseInfoPageList.list; + var xqOneMonthUpDownRangeMap = resultsMap.xqOneMonthUpDownRangeMap; + var xqPotentialIndexMap = resultsMap.xqPotentialIndexMap; + var houseInfoTotalMap = resultsMap.houseInfoTotalMap; + if(resultList != null && resultList.length == 0){ + // 删除加载提示符 + $('.infinite-scroll-preloader').remove(); + // 加载完毕,则注销无限加载事件,以防不必要的加载 + $.detachInfiniteScroll($('.infinite-scroll')); + return; + } + if(resultsMap.houseInfoPageList.currentPage == resultsMap.houseInfoPageList.totalPages){ + //如果此次查询刚好是page = totalPages + // 删除加载提示符 + $('.infinite-scroll-preloader').remove(); + // 加载完毕,则注销无限加载事件,以防不必要的加载 + $.detachInfiniteScroll($('.infinite-scroll')); + } + //封装list数据 + var dataObj = []; + for(var i in resultList){ + dataObj.push(resultList[i]) + } + // 上次加载的序号 + lastIndex = $('.cardInfo').length; + //每次加载添加多少条目 + itemsPerLoad = resultList.length; + //请求后对page进行赋值 + page = resultsMap.houseInfoPageList.currentPage; + pageSize = resultsMap.houseInfoPageList.limit; + totalPages = resultsMap.houseInfoPageList.totalPages; + totalRecords = resultsMap.houseInfoPageList.totalRecords; + addItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, xqPotentialIndexMap, houseInfoTotalMap); + }).catch(function (error) { + console.log(error); + }); +} + +//界面加载 +$(document).ready(function () { + selectHouseInfoList(); +}); + +/* 分页构造数据 */ +function addItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, xqPotentialIndexMap, houseInfoTotalMap) { + var html = ''; + //控制总产值部分显示 + baseInfo.totalPrice = houseInfoTotalMap["totalPrice"]; + baseInfo.oneYearUpDownRange = Math.abs(houseInfoTotalMap["oneYearUpDownRange"]); + baseInfo.oneYearUpDownPrice = Math.abs(houseInfoTotalMap["oneYearUpDownPrice"]); + if(!isNaN(houseInfoTotalMap["oneYearUpDownRange"])){ + //涨跌幅大于零 + if(parseFloat(houseInfoTotalMap["oneYearUpDownRange"])>=0){ + $('#oneYearUpDownRange').attr("class", "icon icon-arrow-red"); + }else{ + //涨跌幅小于零 + $('#oneYearUpDownRange').attr("class", "icon icon-arrow-green"); + } + } + if(!isNaN(houseInfoTotalMap["oneYearUpDownPrice"])){ + //涨跌幅大于零 + if(parseFloat(houseInfoTotalMap["oneYearUpDownPrice"])>=0){ + $('#oneYearUpDownPrice').attr("class", "icon icon-arrow-red"); + }else{ + //涨跌幅小于零 + $('#oneYearUpDownPrice').attr("class", "icon icon-arrow-green"); + } + } + for(var i in dataObj) { + var result = dataObj[i]; + var tempTotalPrice = result.totalPrice; + //可抵押贷额度 + var tempTotalPricePercent; + //考虑是否为数字,加强逻辑判断 + if(!isNaN(tempTotalPrice)){ + //转换成元,四舍五入 + tempTotalPrice = (parseFloat(tempTotalPrice)/10000).toFixed(2); + tempTotalPricePercent = (parseFloat(tempTotalPrice)*0.7/10000).toFixed(2); + } + html += "
  • "; + html += "
    "; + html += "
    "+result.name+" "+tempTotalPrice+"万"+result.liveStatus+"
    "; + html += "
    "; + //对应城市地区小区30天涨跌幅 + var xqOneMonthUpDownRangeKey = result.city+"-"+result.region +"-"+result.name; + var xqOneMonthUpDownRangeValue = xqOneMonthUpDownRangeMap[xqOneMonthUpDownRangeKey]; + if(!isNaN(xqOneMonthUpDownRangeValue)){ + //涨跌幅大于零 + if(parseFloat(xqOneMonthUpDownRangeValue)>=0){ + html += "
    近30天涨跌幅: "+xqOneMonthUpDownRangeValue+"%
    "; + }else{ + html += "
    近30天涨跌幅: "+Math.abs(xqOneMonthUpDownRangeValue)+"%
    "; + } + }else{ + html += "
    近30天涨跌幅: %
    "; + } + //下跌概率 + var xqPotentialIndexValue = xqPotentialIndexMap[xqOneMonthUpDownRangeKey]; + if(!isNaN(xqPotentialIndexValue)){ + //涨跌幅大于零 + if(parseInt(xqPotentialIndexValue)>=50){ + html += "
    下跌概率: "+xqPotentialIndexValue+"%
    "; + }else{ + html += "
    下跌概率: "+(parseInt(100)-parseInt(xqPotentialIndexValue))+"%
    "; + } + }else{ + html += "
    下跌概率: %
    "; + } + html += "
    抵押可贷额度: "+tempTotalPricePercent+"万
    "; + if(result.level!=null && result.level == 1){ + html += "豪宅级"; + }else if(result.level!=null && result.level == 2){ + html += "公寓级"; + }else if(result.level!=null && result.level == 3){ + html += "平房级"; + }else if(result.level!=null && result.level == 4){ + html += "草屋级"; + }else if(result.level!=null && result.level == 5){ + html += "山洞级"; + }else{ + html += "其他"; + } + html += "立即申请
  • "; + } + $('.infinite-scroll-bottom .list-container').append(html); +} + /* 说明-房产等级 */ $(document).on('click','.alert-text-title', function () { $.alert('房产等级是房屋在城市中的综合评级,由高至低分别为 豪宅、公寓、平房、草屋、山洞共5个级别。', '房产等级'); From eb35a6e132eee8260561eb3f12b8e67703406115 Mon Sep 17 00:00:00 2001 From: raoyanhui Date: Sun, 8 Apr 2018 20:27:44 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B4=B7=E6=AC=BE?= =?UTF-8?q?=E9=A2=9D=E5=BA=A6=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/views/house/houseList.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fangija-zsyf/views/house/houseList.html b/fangija-zsyf/views/house/houseList.html index 5b58a5e..86473c3 100644 --- a/fangija-zsyf/views/house/houseList.html +++ b/fangija-zsyf/views/house/houseList.html @@ -237,13 +237,14 @@ function addItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, xq //考虑是否为数字,加强逻辑判断 if(!isNaN(tempTotalPrice)){ //转换成元,四舍五入 - tempTotalPrice = (parseFloat(tempTotalPrice)/10000).toFixed(2); tempTotalPricePercent = (parseFloat(tempTotalPrice)*0.7/10000).toFixed(2); + tempTotalPrice = (parseFloat(tempTotalPrice)/10000).toFixed(2); } html += "
  • "; html += "
    "; html += "
    "+result.name+" "+tempTotalPrice+"万"+result.liveStatus+"
    "; - html += "
    "; + html += "
    "; + //对应城市地区小区30天涨跌幅 var xqOneMonthUpDownRangeKey = result.city+"-"+result.region +"-"+result.name; var xqOneMonthUpDownRangeValue = xqOneMonthUpDownRangeMap[xqOneMonthUpDownRangeKey]; @@ -257,6 +258,7 @@ function addItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, xq }else{ html += "
    近30天涨跌幅: %
    "; } + //下跌概率 var xqPotentialIndexValue = xqPotentialIndexMap[xqOneMonthUpDownRangeKey]; if(!isNaN(xqPotentialIndexValue)){ @@ -269,7 +271,9 @@ function addItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, xq }else{ html += "
    下跌概率: %
    "; } + html += "
    抵押可贷额度: "+tempTotalPricePercent+"万
    "; + if(result.level!=null && result.level == 1){ html += "豪宅级"; }else if(result.level!=null && result.level == 2){ From db9c0d076ef21faef0f1a66dcc91cf2142aa60bf Mon Sep 17 00:00:00 2001 From: zongzhimin Date: Mon, 9 Apr 2018 10:24:52 +0800 Subject: [PATCH 06/10] YOUFANG1.1.2 --- fangija-zsyf/js/user/myFocus.js | 2 +- fangija-zsyf/views/news/newsDetail.html | 3 - fangija-zsyf/views/rent/rentManager.html | 351 +++++++++++++++++++++++ 3 files changed, 352 insertions(+), 4 deletions(-) create mode 100644 fangija-zsyf/views/rent/rentManager.html diff --git a/fangija-zsyf/js/user/myFocus.js b/fangija-zsyf/js/user/myFocus.js index 00ff2a2..e031456 100644 --- a/fangija-zsyf/js/user/myFocus.js +++ b/fangija-zsyf/js/user/myFocus.js @@ -12,7 +12,7 @@ var mf_curpage = 1; var mf_totalCount = 0; function addEstate(number, lastIndex) { mf_curpage = mf_lastIndex/mf_itemsPerLoad + 1; - axios.get("/myCollection/loadCollections",{params:{pageSize:mf_itemsPerLoad,page:mf_curpage}}).then(function(response){ + axios.get("/rest/myCollection/loadCollections",{params:{pageSize:mf_itemsPerLoad,page:mf_curpage}}).then(function(response){ data = response.data; //data = eval( '(' + data + ')' ); if(data['results']==null || data['results'].length==0) { diff --git a/fangija-zsyf/views/news/newsDetail.html b/fangija-zsyf/views/news/newsDetail.html index be88acb..9925596 100644 --- a/fangija-zsyf/views/news/newsDetail.html +++ b/fangija-zsyf/views/news/newsDetail.html @@ -262,10 +262,7 @@ function addItems(number, lastIndex) { if(!id){ return; } - curpage = lastIndex/itemsPerLoad + 1; - - axios.get("/rest/news/comment", { params: { newsId: id, diff --git a/fangija-zsyf/views/rent/rentManager.html b/fangija-zsyf/views/rent/rentManager.html new file mode 100644 index 0000000..fef22b6 --- /dev/null +++ b/fangija-zsyf/views/rent/rentManager.html @@ -0,0 +1,351 @@ + + + + + +出租管理 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 94d41743c0919f01a7110b62c30c81c89e45df56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E5=90=89=E6=AC=A2?= Date: Mon, 9 Apr 2018 10:50:12 +0800 Subject: [PATCH 07/10] login --- fangija-zsyf/js/login/codeSms.js | 5 +++-- fangija-zsyf/views/user/bindingMobile.html | 2 +- fangija-zsyf/views/user/codeSms.html | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fangija-zsyf/js/login/codeSms.js b/fangija-zsyf/js/login/codeSms.js index 03b2c49..596a7df 100644 --- a/fangija-zsyf/js/login/codeSms.js +++ b/fangija-zsyf/js/login/codeSms.js @@ -70,8 +70,9 @@ $("#login_btn").on("click", function () { $.toast("请同意服务协议"); return false; } - axios.post("/rest/user/smsLogin", {mobile: phoneNum,smsCode:code}) - .then(function (response) { + axios.post("/rest/user/smsLogin", + {mobile: phoneNum,smsCode:code,province:province,city:city,region:region,pushClientId:getPushInfo(),deviceId:plus.device.uuid} + ).then(function (response) { var resData = response.data; if (resData.status) { // 用户登录成功的TOKEN diff --git a/fangija-zsyf/views/user/bindingMobile.html b/fangija-zsyf/views/user/bindingMobile.html index 818bd12..7698f1b 100644 --- a/fangija-zsyf/views/user/bindingMobile.html +++ b/fangija-zsyf/views/user/bindingMobile.html @@ -195,7 +195,7 @@ var vue = new Vue({ var resData = response.data; if (resData.status) { $.toast(resData.message); - localStorage.setItem("user_token", resData.data); + localStorage.setItem("user_token", resData.data.token); localStorage.setItem("user_token_add_time", new Date().getTime()); back(); } else { diff --git a/fangija-zsyf/views/user/codeSms.html b/fangija-zsyf/views/user/codeSms.html index 90092ec..9bf9f75 100644 --- a/fangija-zsyf/views/user/codeSms.html +++ b/fangija-zsyf/views/user/codeSms.html @@ -96,6 +96,7 @@ $.config = {router: false} + From 6845935b21254600a43960000821a519c1c0c0ec Mon Sep 17 00:00:00 2001 From: raoyanhui Date: Mon, 9 Apr 2018 13:03:14 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=20=E6=88=91=E7=9A=84=E6=94=B6=E8=97=8F?= =?UTF-8?q?=E5=92=8C=E6=88=91=E7=9A=84=E6=88=BF=E4=BA=A7=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/js/user/myCollect.js | 11 +- fangija-zsyf/js/user/myHouse.js | 173 ++++++++++++++++++++++++++ fangija-zsyf/views/user/userInfo.html | 107 +++++++--------- 3 files changed, 220 insertions(+), 71 deletions(-) create mode 100644 fangija-zsyf/js/user/myHouse.js diff --git a/fangija-zsyf/js/user/myCollect.js b/fangija-zsyf/js/user/myCollect.js index 3c69504..613345e 100644 --- a/fangija-zsyf/js/user/myCollect.js +++ b/fangija-zsyf/js/user/myCollect.js @@ -1,9 +1,6 @@ var mc_uid = "162167854504869888"; // 加载flag var mc_loading = false; -//空置第一次显示 -var mc_yesterDayDeployFlag = true; - //分页部分参数定义 var mc_page; var mc_pageSize; @@ -85,7 +82,7 @@ function selectNewsCollectList(){ mc_totalPages = response.data.data.totalPages; mc_totalRecords = response.data.data.totalRecords; tab.mc_num = mc_totalRecords; - addItems(mc_itemsPerLoad, mc_lastIndex, dataObj); + mcAddItems(mc_itemsPerLoad, mc_lastIndex, dataObj); }).catch(function (error) { console.log(error); }); @@ -117,13 +114,9 @@ function openNewsView(newId) { } /* 分页构造数据 */ -function addItems(itemsPerLoad, lastIndex, dataObj) { +function mcAddItems(itemsPerLoad, lastIndex, dataObj) { var html = ''; for(var i in dataObj) { - /*if(dataObj[i].yesterDayDeploy && yesterDayDeployFlag) { - yesterDayDeployFlag = false; - html += '
    历史推荐
    '; - }*/ if(dataObj[i].type == "专题") { html += '
    ' + '
    ' + dataObj[i].title + '
    ' + diff --git a/fangija-zsyf/js/user/myHouse.js b/fangija-zsyf/js/user/myHouse.js new file mode 100644 index 0000000..9de6fcc --- /dev/null +++ b/fangija-zsyf/js/user/myHouse.js @@ -0,0 +1,173 @@ +var mh_uid = "162167854504869888"; +// 加载flag +var mh_loading = false; + +//分页部分参数定义 +var mh_page; +var mh_pageSize; +var mh_totalPages; +var mh_totalRecords; + +// 上次加载的序号 +var mh_lastIndex; +// 每次加载添加多少条目 +var mh_itemsPerLoad; +// 最多可加载的条目 +var mh_maxItems = 100; + +//初始化init +$.init(); + +// 注册'infinite'事件处理函数 +/*$(document).on('infinite', '.infinite-scroll-bottom', function() { + // 如果正在加载,则退出 + if(loading) return; + // 设置flag + loading = true; + // 模拟1s的加载过程 + setTimeout(function() { + // 重置加载flag + loading = false; + //如果当前页大于等于总页数 + if(page >= totalPages) { + // 加载完毕,则注销无限加载事件,以防不必要的加载 + $.detachInfiniteScroll($('.infinite-scroll')); + // 删除加载提示符 + $('.infinite-scroll-preloader').remove(); + return; + } + //控制查询下一页的数据 + page = page + 1; + selectHouseInfoList(); + //容器发生改变,如果是js滚动,需要刷新滚动 + //$.refreshScroller(); + }, 1000); +});*/ + +//我的收藏查询请求 +function selectHouseInfoList(){ + axios.get(BASE_PATH + "/rest/index/ourHouseInfoList", + { + params: { + uid: mh_uid, + page: mh_page, + pageSize: mh_pageSize + } + }).then(function (response) { + var resultsMap = response.data.data; + var resultList = resultsMap.houseInfoPageList.list; + var xqOneMonthUpDownRangeMap = resultsMap.xqOneMonthUpDownRangeMap; + var xqPotentialIndexMap = resultsMap.xqPotentialIndexMap; + var houseInfoTotalMap = resultsMap.houseInfoTotalMap; + if(resultList != null && resultList.length == 0){ + // 删除加载提示符 + $('#loadTip1').remove(); + //$('.infinite-scroll-preloader').remove(); + // 加载完毕,则注销无限加载事件,以防不必要的加载 + //$.detachInfiniteScroll($('.infinite-scroll')); + return; + } + if(resultsMap.houseInfoPageList.currentPage == resultsMap.houseInfoPageList.totalPages){ + //如果此次查询刚好是page = totalPages + // 删除加载提示符 + $('#loadTip1').remove(); + //$('.infinite-scroll-preloader').remove(); + // 加载完毕,则注销无限加载事件,以防不必要的加载 + //$.detachInfiniteScroll($('.infinite-scroll')); + } + //封装list数据 + var dataObj = []; + for(var i in resultList){ + dataObj.push(resultList[i]) + } + // 上次加载的序号 + mh_lastIndex = $('.cardInfo').length; + //每次加载添加多少条目 + mh_itemsPerLoad = resultList.length; + //请求后对page进行赋值 + mh_page = resultsMap.houseInfoPageList.currentPage; + mh_pageSize = resultsMap.houseInfoPageList.limit; + mh_totalPages = resultsMap.houseInfoPageList.totalPages; + mh_totalRecords = resultsMap.houseInfoPageList.totalRecords; + tab.mh_num = mh_totalRecords; + mhAddItems(mh_itemsPerLoad, mh_lastIndex, dataObj, xqOneMonthUpDownRangeMap, xqPotentialIndexMap, houseInfoTotalMap); + }).catch(function (error) { + console.log(error); + }); +} + +//界面加载 +$(document).ready(function () { + selectHouseInfoList(); +}); + +/* 分页构造数据 */ +function mhAddItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, xqPotentialIndexMap, houseInfoTotalMap) { + var html = ''; + for(var i in dataObj) { + var result = dataObj[i]; + var tempTotalPrice = result.totalPrice; + //可抵押贷额度 + var tempTotalPricePercent; + //考虑是否为数字,加强逻辑判断 + if(!isNaN(tempTotalPrice)){ + //转换成元,四舍五入 + tempTotalPricePercent = (parseFloat(tempTotalPrice)*0.7/10000).toFixed(2); + tempTotalPrice = (parseFloat(tempTotalPrice)/10000).toFixed(2); + } + html += "
  • "; + html += "
    "; + html += "
    "+result.name+" "+tempTotalPrice+"万"+result.liveStatus+"
    "; + html += "
    "; + + //对应城市地区小区30天涨跌幅 + var xqOneMonthUpDownRangeKey = result.city+"-"+result.region +"-"+result.name; + var xqOneMonthUpDownRangeValue = xqOneMonthUpDownRangeMap[xqOneMonthUpDownRangeKey]; + if(!isNaN(xqOneMonthUpDownRangeValue)){ + //涨跌幅大于零 + if(parseFloat(xqOneMonthUpDownRangeValue)>=0){ + html += "
    近30天涨跌幅: "+xqOneMonthUpDownRangeValue+"%
    "; + }else{ + html += "
    近30天涨跌幅: "+Math.abs(xqOneMonthUpDownRangeValue)+"%
    "; + } + }else{ + html += "
    近30天涨跌幅: %
    "; + } + + //下跌概率 + var xqPotentialIndexValue = xqPotentialIndexMap[xqOneMonthUpDownRangeKey]; + if(!isNaN(xqPotentialIndexValue)){ + //涨跌幅大于零 + if(parseInt(xqPotentialIndexValue)>=50){ + html += "
    下跌概率: "+xqPotentialIndexValue+"%
    "; + }else{ + html += "
    下跌概率: "+(parseInt(100)-parseInt(xqPotentialIndexValue))+"%
    "; + } + }else{ + html += "
    下跌概率: %
    "; + } + + html += "
    抵押可贷额度: "+tempTotalPricePercent+"万
    "; + + if(result.level!=null && result.level == 1){ + html += "豪宅级"; + }else if(result.level!=null && result.level == 2){ + html += "公寓级"; + }else if(result.level!=null && result.level == 3){ + html += "平房级"; + }else if(result.level!=null && result.level == 4){ + html += "草屋级"; + }else if(result.level!=null && result.level == 5){ + html += "山洞级"; + }else{ + html += "其他"; + } + html += "立即申请
  • "; + } + $('#myhouse').append(html); +} + +/* 说明-房产等级 */ +$(document).on('click','.alert-text-title', function () { + $.alert('房产等级是房屋在城市中的综合评级,由高至低分别为 豪宅、公寓、平房、草屋、山洞共5个级别。', '房产等级'); +}); \ No newline at end of file diff --git a/fangija-zsyf/views/user/userInfo.html b/fangija-zsyf/views/user/userInfo.html index 8ad0ed2..bdd7a49 100644 --- a/fangija-zsyf/views/user/userInfo.html +++ b/fangija-zsyf/views/user/userInfo.html @@ -48,7 +48,7 @@
    -

    137****6586
    土豪

    +

    137****6586

    @@ -73,7 +73,7 @@
    - 房产(3) + 房产({{mh_num}}) 关注({{mf_num}}) 收藏({{mc_num}}) 消息(2) @@ -81,70 +81,30 @@
    + - +
    +
    +
      @@ -212,6 +172,7 @@ $.config = {router: false} + From 331ea61c2a1e46e2aea23e2a47b6a3117aca17c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E5=90=89=E6=AC=A2?= Date: Mon, 9 Apr 2018 13:18:51 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E5=A4=84=E7=90=86=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E7=99=BB=E5=BD=95=E6=98=B5=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/js/login/thirdLogin.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/fangija-zsyf/js/login/thirdLogin.js b/fangija-zsyf/js/login/thirdLogin.js index 16f3076..9c548bc 100644 --- a/fangija-zsyf/js/login/thirdLogin.js +++ b/fangija-zsyf/js/login/thirdLogin.js @@ -72,7 +72,28 @@ function userinfo(a){ }); } +function utf16toEntities(str) { + var patt = /[\ud800-\udbff][\udc00-\udfff]/g; // 检测utf16字符正则 + str = str.replace(patt, function(char) { + var H, L, code; + if (char.length === 2) { + H = char.charCodeAt(0); + // 取出高位 + L = char.charCodeAt(1); + // 取出低位 + code = (H - 0xD800) * 0x400 + 0x10000 + L - 0xDC00; + //转换算法 + return "&#" + code + ";"; + } else { + return char; + } + }); + return str; +} + + function login(openid, unionid, accessToken, nickname, headImg, loginFrom, uri) { + nickname = utf16toEntities(nickname) axios.post(uri, {loginFrom:loginFrom,openid:openid, unionid:unionid, accessToken: accessToken, nickname:nickname,headImg:headImg}) .then(function (response) { $.hidePreloader(); From 5b020dbcffb67048eaf627925be3d974e398feef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B9=E5=90=89=E6=AC=A2?= Date: Mon, 9 Apr 2018 13:39:07 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=8A=A0loding?= =?UTF-8?q?=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/js/login/codeSms.js | 45 ++++++++++++---------- fangija-zsyf/views/user/bindingMobile.html | 3 ++ fangija-zsyf/views/user/passLogin.html | 3 ++ fangija-zsyf/views/user/updatePass.html | 3 ++ 4 files changed, 34 insertions(+), 20 deletions(-) diff --git a/fangija-zsyf/js/login/codeSms.js b/fangija-zsyf/js/login/codeSms.js index 596a7df..c02fb57 100644 --- a/fangija-zsyf/js/login/codeSms.js +++ b/fangija-zsyf/js/login/codeSms.js @@ -70,28 +70,33 @@ $("#login_btn").on("click", function () { $.toast("请同意服务协议"); return false; } + plus.nativeUI.showWaiting(); axios.post("/rest/user/smsLogin", {mobile: phoneNum,smsCode:code,province:province,city:city,region:region,pushClientId:getPushInfo(),deviceId:plus.device.uuid} ).then(function (response) { - var resData = response.data; - if (resData.status) { - // 用户登录成功的TOKEN - var data = resData.data; - localStorage.setItem("user_token", data.token); - localStorage.setItem("user_token_add_time", new Date().getTime()); - $.toast(resData.message); - if (data.firstLogin) { - // 显示设置密码页面 - clicked('../user/updatePass.html',true,false,{},{},function(){ - back(); - }) - } else { - back(); - } - - } else { - $.toast(resData.message); - } - }) + var resData = response.data; + if (resData.status) { + // 用户登录成功的TOKEN + var data = resData.data; + localStorage.setItem("user_token", data.token); + localStorage.setItem("user_token_add_time", new Date().getTime()); + $.toast(resData.message); + if (data.firstLogin) { + // 显示设置密码页面 + clicked('../user/updatePass.html',true,false,{},{},function(){ + back(); + }) + } else { + back(); + } + + } else { + $.toast(resData.message); + } + plus.nativeUI.closeWaiting(); + }).catch(function (error) { + $.toast(error); + plus.nativeUI.closeWaiting(); + }); } }); diff --git a/fangija-zsyf/views/user/bindingMobile.html b/fangija-zsyf/views/user/bindingMobile.html index 7698f1b..6c112ab 100644 --- a/fangija-zsyf/views/user/bindingMobile.html +++ b/fangija-zsyf/views/user/bindingMobile.html @@ -176,6 +176,7 @@ var vue = new Vue({ // 绑定手机 binding: function() { if (this.checkMobile() && this.checkSmsCode()) { + plus.nativeUI.showWaiting(); axios.post("/rest/user/bindMobile", { mobile:this.mobile, smsCode:this.smsCode, @@ -201,9 +202,11 @@ var vue = new Vue({ } else { $.toast(resData.message); } + plus.nativeUI.closeWaiting(); }) .catch(function (error) { $.toast(error); + plus.nativeUI.closeWaiting(); }); } } diff --git a/fangija-zsyf/views/user/passLogin.html b/fangija-zsyf/views/user/passLogin.html index bf9bb1c..1f3f3a4 100644 --- a/fangija-zsyf/views/user/passLogin.html +++ b/fangija-zsyf/views/user/passLogin.html @@ -124,6 +124,7 @@ new Vue({ $.toast("请输入密码"); return; } + plus.nativeUI.showWaiting(); axios.post("/rest/user/passLogin", {mobile:this.mobile, pass: $.md5(this.pass), pushClientId:getPushInfo()}) .then(function (response) { var resData = response.data; @@ -137,9 +138,11 @@ new Vue({ } else { $.toast(resData.message); } + plus.nativeUI.closeWaiting(); }) .catch(function (error) { $.toast(error); + plus.nativeUI.closeWaiting(); }); } }, diff --git a/fangija-zsyf/views/user/updatePass.html b/fangija-zsyf/views/user/updatePass.html index ed87ad8..c3c8256 100644 --- a/fangija-zsyf/views/user/updatePass.html +++ b/fangija-zsyf/views/user/updatePass.html @@ -115,6 +115,7 @@ new Vue({ $.toast("请输入6位以上数字或字母"); return; } + plus.nativeUI.showWaiting(); axios.post("/rest/user/upass", {newPass: $.md5(this.pass)}) .then(function (response) { var resData = response.data; @@ -124,9 +125,11 @@ new Vue({ } else { $.toast(resData.message); } + plus.nativeUI.closeWaiting(); }) .catch(function (error) { $.toast(error); + plus.nativeUI.closeWaiting(); }); }, /* 密码显示&隐藏 */