Merge branch 'YOUFANGAPP1.1' of 192.168.0.27:dev0/youfang-app into YOUFANGAPP1.1
This commit is contained in:
@@ -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();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 += '<div class="content-block-title recommend" style="border-top:solid 0.5rem #f3f3f3;">历史推荐</div>';
|
||||
}*/
|
||||
if(dataObj[i].type == "专题") {
|
||||
html += '<div class="card cardInfo cardInfo01" onclick="openNewsView(\'' + dataObj[i].id + '\')">' +
|
||||
'<div class="card-header">' + dataObj[i].title + '</div>' +
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 += "<li><a href='#' class='item-content'>";
|
||||
html += "<div class='item-inner'><div class='item-title-row'>";
|
||||
html += "<div class='item-title'>"+result.name+" <em>"+tempTotalPrice+"万</em><span class='tag'><small>"+result.liveStatus+"</small></span></div>";
|
||||
html += "</div><div class='item-subtitle'>";
|
||||
|
||||
//对应城市地区小区30天涨跌幅
|
||||
var xqOneMonthUpDownRangeKey = result.city+"-"+result.region +"-"+result.name;
|
||||
var xqOneMonthUpDownRangeValue = xqOneMonthUpDownRangeMap[xqOneMonthUpDownRangeKey];
|
||||
if(!isNaN(xqOneMonthUpDownRangeValue)){
|
||||
//涨跌幅大于零
|
||||
if(parseFloat(xqOneMonthUpDownRangeValue)>=0){
|
||||
html += "<div>近30天涨跌幅: <em class='up'>"+xqOneMonthUpDownRangeValue+"%<i class='icon icon-arrow-red'></i></em></div>";
|
||||
}else{
|
||||
html += "<div>近30天涨跌幅: <em class='down'>"+Math.abs(xqOneMonthUpDownRangeValue)+"%<i class='icon icon-arrow-green'></i></em></div>";
|
||||
}
|
||||
}else{
|
||||
html += "<div>近30天涨跌幅: <em class='down'> %<i class='icon icon-arrow-green'></i></em></div>";
|
||||
}
|
||||
|
||||
//下跌概率
|
||||
var xqPotentialIndexValue = xqPotentialIndexMap[xqOneMonthUpDownRangeKey];
|
||||
if(!isNaN(xqPotentialIndexValue)){
|
||||
//涨跌幅大于零
|
||||
if(parseInt(xqPotentialIndexValue)>=50){
|
||||
html += "<div>下跌概率: <em class='up'>"+xqPotentialIndexValue+"%<i class='icon icon-arrow-red'></i></em></div>";
|
||||
}else{
|
||||
html += "<div>下跌概率: <em class='down'>"+(parseInt(100)-parseInt(xqPotentialIndexValue))+"%<i class='icon icon-arrow-green'></i></em></div>";
|
||||
}
|
||||
}else{
|
||||
html += "<div>下跌概率: <em class='down'> %<i class='icon icon-arrow-green'></i></em></div>";
|
||||
}
|
||||
|
||||
html += "<div>抵押可贷额度: <em style='color:#EB5F34;'>"+tempTotalPricePercent+"万</em></div></div></div></a>";
|
||||
|
||||
if(result.level!=null && result.level == 1){
|
||||
html += "<a class='add alert-text-title'><i class='icon icon-houseLevel'></i>豪宅级</a>";
|
||||
}else if(result.level!=null && result.level == 2){
|
||||
html += "<a class='add alert-text-title'><i class='icon icon-houseLevel'></i>公寓级</a>";
|
||||
}else if(result.level!=null && result.level == 3){
|
||||
html += "<a class='add alert-text-title'><i class='icon icon-houseLevel'></i>平房级</a>";
|
||||
}else if(result.level!=null && result.level == 4){
|
||||
html += "<a class='add alert-text-title'><i class='icon icon-houseLevel'></i>草屋级</a>";
|
||||
}else if(result.level!=null && result.level == 5){
|
||||
html += "<a class='add alert-text-title'><i class='icon icon-houseLevel'></i>山洞级</a>";
|
||||
}else{
|
||||
html += "<a class='add alert-text-title'><i class='icon icon-houseLevel'></i>其他</a>";
|
||||
}
|
||||
html += "<a class='button theme add add01 add01a' href='#'>立即申请</a></li>";
|
||||
}
|
||||
$('#myhouse').append(html);
|
||||
}
|
||||
|
||||
/* 说明-房产等级 */
|
||||
$(document).on('click','.alert-text-title', function () {
|
||||
$.alert('房产等级是房屋在城市中的综合评级,由高至低分别为 豪宅、公寓、平房、草屋、山洞共5个级别。', '房产等级');
|
||||
});
|
||||
Reference in New Issue
Block a user