diff --git a/fangija-zsyf/css/main.css b/fangija-zsyf/css/main.css index b75d3ca..d926112 100644 --- a/fangija-zsyf/css/main.css +++ b/fangija-zsyf/css/main.css @@ -738,7 +738,7 @@ input::-webkit-input-placeholder{ .topic .topicContent .topicContent_bottom p em{color:#F18D00;font-size:0.8rem;} .topic .topicContent .topicContent_bottom p a{float:right;color:#333;} .topic .topicContent .topicContent_bottom font{width:100%;height:16px;background:#eee;border-radius:50px;display:block;margin-top:-10px;} -.topic .topicContent .topicContent_bottom font i{display:block;height:16px;background:#45b9fc;border:solid 3px #eee;border-radius:50px;} +.topic .topicContent .topicContent_bottom font i{display:block;height:10px;background:#F18D00;border:solid 1px #e7e7e7;border-radius:50px;} .topic .topicContent .topicContent_bottom .rankingNote{overflow:hidden;display:block;height:26px;} .topic .topicContent .topicContent_bottom .rankingNote span{font-size:0.65rem;line-height:26px;color:#999;} .topic .topicContent .topicContent_bottom .rankingNote span.rankingNoteLeft{float:left;} diff --git a/fangija-zsyf/js/login/codeSms.js b/fangija-zsyf/js/login/codeSms.js index 03b2c49..c02fb57 100644 --- a/fangija-zsyf/js/login/codeSms.js +++ b/fangija-zsyf/js/login/codeSms.js @@ -70,27 +70,33 @@ $("#login_btn").on("click", function () { $.toast("请同意服务协议"); return false; } - axios.post("/rest/user/smsLogin", {mobile: phoneNum,smsCode:code}) - .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); - } - }) + 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); + } + plus.nativeUI.closeWaiting(); + }).catch(function (error) { + $.toast(error); + plus.nativeUI.closeWaiting(); + }); } }); 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(); 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/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/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/evaluate/evaluateList.html b/fangija-zsyf/views/evaluate/evaluateList.html index 2956840..1fb4c7c 100644 --- a/fangija-zsyf/views/evaluate/evaluateList.html +++ b/fangija-zsyf/views/evaluate/evaluateList.html @@ -92,7 +92,7 @@ $.init() $(document).on('click','.open-vertical-modal', function () { //获取对应
  • 栏目存储的houseinfo id var id = $(this).attr("id"); - var houseStatus = $(this).attr("houseStatus"); + var houseStatus = 0; $.modal({ title: '房产用途', verticalButtons: true, diff --git a/fangija-zsyf/views/house/add.html b/fangija-zsyf/views/house/add.html index 5014f09..6a4162f 100644 --- a/fangija-zsyf/views/house/add.html +++ b/fangija-zsyf/views/house/add.html @@ -1575,14 +1575,20 @@ function addEvaluation(){ address:$("input[name=address]").val(), estateType:$("#input_houseType").val(), loudongName:$("#input_building").val(), - floorName:$("input[name=floorName]").val(), - floors:$("#input_floor").val(), + floorName:$("#input_floor").val(), area:$("#input_area").val() } }) .then(function (response) { if(response.data.data!=null && response.data.data.success){ - alert("添加成功!"); + var id = response.data.data.id; + mui.openWindow({ + url: 'detail.html', + id:'detail.html', + extras:{ + id:id + } + }); }else{ $.toast(response.data.message); } diff --git a/fangija-zsyf/views/house/detail.html b/fangija-zsyf/views/house/detail.html index 6990a30..0a2ef42 100644 --- a/fangija-zsyf/views/house/detail.html +++ b/fangija-zsyf/views/house/detail.html @@ -3,7 +3,7 @@ -龙盛佳苑 + @@ -28,6 +28,7 @@ .cardPrice01 .card-footer span label{display:inline-block;} .cardPrice01 .card-footer span em{display:inline-block;color:#F18D00;} .cardPrice01 .card-footer span em strong{font-size:0.8rem;} + .list-block .item-title small label{color: #999;font-size: 0.7rem;} @@ -35,12 +36,12 @@
    -
    +
    - -

    龙盛佳苑

    +

    {{name}}

    @@ -49,29 +50,29 @@
    -
    龙盛佳苑上海-静安
    +
    {{name}}{{cityRegion}}
    -
    2室1厅  60m  1/6层
    +
      {{area}}m  
    - 自住 + {{liveStatus}}
  • 房屋估价 - 公寓 + {{estatetype}}
    -
    391万
    +
    {{Math.round(totalPrice/10000)}}万
    @@ -97,38 +98,6 @@ -
    -
    -
    -
      -
    • -
      -
      目前状态
      -
      出租
      -
      -
    • -
    • -
      -
      出租日期
      -
      2018/02/01 - 2018/07/31
      -
      -
    • -
    • -
      -
      每期租金
      -
      5,000元 (1月/次)
      -
      -
    • -
    • -
      -
      下次收租
      -
      3月1日
      -
      -
    • -
    -
    -
    -
    @@ -136,13 +105,58 @@
  • 市场交易活跃度
    -
    较差
    +
    + 很差 +
    +
    + 较差 +
    +
    + 良好 +
    +
    + 很好 +
  • 小区潜力指数
    -
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  • @@ -151,20 +165,20 @@
    -
    龙盛佳苑在上海市:
    +
    {{name}}在{{city}}市:
    -

    涨幅(近12个月)超过了69.7%的住宅

    - +

    涨幅(近12个月)超过了{{roseRanking}}%的住宅

    + 0%100%
    -

    均价超过了64.14%的住宅

    -
    +

    均价超过了{{avgpriceRanking}}%的住宅

    +
    - 65,241元/㎡ + {{price}}元/㎡
    - - 相对最低
    9,290元/㎡
    相对最高
    194,953元/㎡
    + + 相对最低
    {{minSellPrice}}元/㎡
    相对最高
    {{maxSellPrice}}元/㎡
    @@ -200,33 +214,15 @@
    -
    +
    小区本月租金
      -
    • +
    • -
      一居室
      -
      1729-3228 元/月
      -
      -
    • -
    • -
      -
      二居室
      -
      2355-3974 元/月
      -
      -
    • -
    • -
      -
      三居室
      -
      2772-4990 元/月
      -
      -
    • -
    • -
      -
      四居室
      -
      3987-6449 元/月
      +
      {{rentRoom.houseType}}居室
      +
      {{Math.round(rentRoom.avgPrice*0.75)}}-{{Math.round(rentRoom.avgPrice*1.4)}} 元/月
    @@ -276,25 +272,98 @@ Zepto = $ $.config = {router: false} - + - + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fangija-zsyf/views/user/bindingMobile.html b/fangija-zsyf/views/user/bindingMobile.html index 818bd12..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, @@ -195,15 +196,17 @@ 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 { $.toast(resData.message); } + plus.nativeUI.closeWaiting(); }) .catch(function (error) { $.toast(error); + plus.nativeUI.closeWaiting(); }); } } 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} + 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(); }); }, /* 密码显示&隐藏 */ 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} +