新增支持室号输入
This commit is contained in:
+23
@@ -13,6 +13,7 @@ import com.fangjia.open.APIConstant;
|
||||
import com.fangjia.open.compatible.model.JsonModel;
|
||||
import com.fangjia.open.dto.DistrictHouseDtao;
|
||||
import com.fangjia.open.interceptors.AuthenticationBean;
|
||||
import com.fangjia.open.model.AddesssMatchModel;
|
||||
import com.fangjia.open.model.BaseModel;
|
||||
import com.fangjia.open.model.weixin.EvaluationModel;
|
||||
import com.fangjia.open.model.weixin.PropertyEvaluationModel;
|
||||
@@ -91,6 +92,27 @@ public class CcbRentController {
|
||||
return result;
|
||||
}
|
||||
|
||||
public Object matchAction(AddesssMatchModel model) {
|
||||
String result = null;
|
||||
HttpRequest httpRequest = new HttpRequest();
|
||||
try {
|
||||
Map<String, String> headers = new HashMap<String, String>();
|
||||
// &__refresh_cache=1 刷新缓存
|
||||
String url = "http://open.fangjia.com/address/match?token=" + APIConstant.SUPER_USER_TOKEN;
|
||||
Map<String, String> params = org.apache.commons.beanutils.BeanUtils.describe(model);
|
||||
result = httpRequest.post(url, params, headers,"UTF-8");
|
||||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
} catch (HttpRequestException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Object evaluateRentAction(com.fangjia.open.model.PropertyEvaluationModel model, HttpServletRequest request)throws NumberFormatException, IllegalAccessException {
|
||||
String result = null;
|
||||
HttpRequest httpRequest = new HttpRequest();
|
||||
@@ -191,6 +213,7 @@ public class CcbRentController {
|
||||
districtPriceMap.put("fitment", evaluation.getFitment());
|
||||
districtPriceMap.put("buildYear",district.getFinishBuildingDate());
|
||||
districtPriceMap.put("hasLift",hasLift);
|
||||
districtPriceMap.put("room", room);
|
||||
|
||||
Integer startPrice = (int)(evaluation.getTotalPrice() - evaluation.getTotalPrice()*0.2);
|
||||
Integer endPrice = (int)(evaluation.getTotalPrice() + evaluation.getTotalPrice()*0.2);
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
<div class="p">
|
||||
<b>详细地址</b>:<span name="address"></span><br/>
|
||||
<b>楼盘名称</b>:<span name="name"></span><br/>
|
||||
<b>室号</b>:<span name="room"></span><br/>
|
||||
<b>室号</b>:<span name="roomNumber"></span><br/>
|
||||
<b>朝向</b>:<span name="direction"></span><br/>
|
||||
<b>建筑面积</b>:<span name="size"></span>平米<br/>
|
||||
<b>所在楼层</b>:<span name="floor"></span> 层(共<span name="height"></span>层)<br/>
|
||||
@@ -205,7 +205,7 @@
|
||||
$("#download").css('color', 'blue')
|
||||
let chartImgUrl = $('#chartImgUrl').val();
|
||||
window.location.href = "download?city="+params.city+"&district="+params.district+"&name="+params.name+"&address="+params.address+"&size="+params.size+"&floor="+params.floor
|
||||
+"&height="+params.height+"&room="+params.room+"&hall="+params.hall+"&toilet="+params.toilet+"&direction="+params.direction+"&fitment="+params.fitment+"&chartImgUrl=" + chartImgUrl + "&hasLift=" + (params.hasLift == 'true' ? '有' : '无');
|
||||
+"&height="+params.height+"&room="+params.roomNumber+"&hall="+params.hall+"&toilet="+params.toilet+"&direction="+params.direction+"&fitment="+params.fitment+"&chartImgUrl=" + chartImgUrl + "&hasLift=" + (params.hasLift == 'true' ? '有' : '无');
|
||||
});
|
||||
|
||||
// 后台传参过来用
|
||||
@@ -222,11 +222,13 @@
|
||||
'toilet': sessionStorage.toilet,
|
||||
'direction': sessionStorage.direction,
|
||||
'fitment': sessionStorage.fitment,
|
||||
'hasLift': sessionStorage.hasLift
|
||||
'hasLift': sessionStorage.hasLift,
|
||||
'roomNumber': sessionStorage.roomNumber
|
||||
};
|
||||
|
||||
function init() {
|
||||
$('span[name="hasLift"]').text(params.hasLift == 'true' ? '有' : '无')
|
||||
$('span[name="roomNumber"]').text(params.roomNumber != '' ? params.roomNumber + '室' : '')
|
||||
|
||||
$.ajax({
|
||||
// 注意需要加..
|
||||
@@ -246,7 +248,7 @@
|
||||
$('span[name="totalPriceUpper"]').text(result.totalPriceUpper)
|
||||
|
||||
// 房产状况
|
||||
$('span[name="room"]').text(result.room)
|
||||
//$('span[name="room"]').text(result.room)
|
||||
$('span[name="floor"]').text(result.floor)
|
||||
$('span[name="buildYear"]').text(result.buildYear)
|
||||
$('span[name="direction"]').text(result.direction)
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
</tr>
|
||||
<tr class="tdbg">
|
||||
<td class="textTd">室号</td>
|
||||
<td class="textRight1"><#if result.room??>${result.room}</#if></td>
|
||||
<td class="textRight1"><#if result.room??>${result.room + '室'}</#if></td>
|
||||
<td class="textTd">朝向</td>
|
||||
<td class="textRight2" colspan="3"><#if result.direction??>${result.direction}</#if></td>
|
||||
</tr>
|
||||
|
||||
@@ -40,8 +40,9 @@
|
||||
<div class="item-inner">
|
||||
<div class="item-title label">地址:</div>
|
||||
<div class="item-input">
|
||||
<input type="text" placeholder="请输入小区名或地址" id="districtSearch" name="name" class="search_input" required>
|
||||
<input type="hidden" name="address" />
|
||||
<input type="text" placeholder="请输入小区名或地址" id="districtSearch" name="address" class="search_input" required>
|
||||
<input type="hidden" name="name" />
|
||||
<input type="hidden" name="roomNumber" />
|
||||
</div>
|
||||
<!-- 区域 -->
|
||||
<input value="" name="district" type="hidden" required>
|
||||
@@ -166,6 +167,7 @@
|
||||
sessionStorage.district = $('input[name="district"]').val()
|
||||
sessionStorage.address = $('input[name="address"]').val()
|
||||
sessionStorage.size = $('input[name="size"]').val()
|
||||
sessionStorage.roomNumber = $('input[name="roomNumber"]').val()
|
||||
sessionStorage.room = $('input[name="room"]').val()
|
||||
sessionStorage.hall = $('input[name="hall"]').val()
|
||||
sessionStorage.toilet = $('input[name="toilet"]').val()
|
||||
@@ -222,11 +224,11 @@
|
||||
var fieldVal = $.trim(input.val())
|
||||
if (input.attr("required") && fieldVal == "") {
|
||||
if (input.attr("name").indexOf("district") != -1) {
|
||||
$.toast("请选择输入地址时提示的小区")
|
||||
|
||||
} else {
|
||||
$.toast(fieldName + "不能为空");
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
if (input.attr("type") == 'number' && fieldVal != "") {
|
||||
if (input.attr("name").indexOf("size") != -1) {
|
||||
@@ -253,7 +255,6 @@
|
||||
$.toast("楼层不能大于楼高");
|
||||
return
|
||||
}
|
||||
storeSession()
|
||||
|
||||
if($("#houseHight").val() && parseFloat($("#houseHight").val())>=60){
|
||||
$.toast("请输入合理的楼层数");
|
||||
@@ -262,42 +263,31 @@
|
||||
$("#evaluateBtn").prop("disabled", true)
|
||||
|
||||
// 用户输入可能为地址,需要匹配,在估价
|
||||
// let city = $('input[name="city"]').val()
|
||||
// let address = $('input[name="address"]').val()
|
||||
//
|
||||
// $.ajax({
|
||||
// // 注意需要加..
|
||||
// url: '../address/match',
|
||||
// data: {'city': city, 'address': address},
|
||||
// dataType: "json",
|
||||
// type: "post",
|
||||
// success: function (data) {
|
||||
// debugger
|
||||
// if (data.code == 200) {
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
let city = $('input[name="city"]').val()
|
||||
let address = $('input[name="address"]').val()
|
||||
|
||||
$.ajax({
|
||||
// 注意需要加..
|
||||
url: '../ccbRent/evaluateRent',
|
||||
data:$("#evaluateForm").serialize(),
|
||||
dataType:"json",
|
||||
type:"post",
|
||||
success:function(data){
|
||||
if(data.code == 200){
|
||||
window.location.href = "report?address=" + data.result.address + "&totalPrice=" + data.result.totalPrice
|
||||
}else{
|
||||
$.toast("估价失败,请重新评估");
|
||||
$("#evaluateBtn").prop("disabled", false)
|
||||
if ($('input[name="district"]').val() == '') {
|
||||
$.ajax({
|
||||
// 注意需要加..
|
||||
url: '../ccbRent/match',
|
||||
data: {'city': city, 'address': address},
|
||||
dataType: "json",
|
||||
type: "post",
|
||||
success: function (data) {
|
||||
if (data.code == 200) {
|
||||
let result = data.result
|
||||
$('input[name="name"]').val(result.name)
|
||||
$('input[name="district"]').val(result.district)
|
||||
$('input[name="roomNumber"]').val(result.searchAddress.orgRoomNumber)
|
||||
evaluateRent()
|
||||
} else {
|
||||
$.toast("估价失败,暂不支持该小区估价");
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
//$.toast("服务器异常,请重新评估");
|
||||
$("#evaluateBtn").prop("disabled", false)
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
evaluateRent()
|
||||
}
|
||||
})
|
||||
// 选择操作-房型-室
|
||||
$(document).on('click', '.create-actions01-now', function () {
|
||||
@@ -326,6 +316,30 @@
|
||||
$.actions(groups);
|
||||
});
|
||||
|
||||
let evaluateRent = function() {
|
||||
$.ajax({
|
||||
// 注意需要加..
|
||||
url: '../ccbRent/evaluateRent',
|
||||
data:$("#evaluateForm").serialize(),
|
||||
dataType:"json",
|
||||
type:"post",
|
||||
success:function(data){
|
||||
if(data.code == 200){
|
||||
let name = $('input[name="name"]').val()
|
||||
let roomNumber = $('input[name="roomNumber"]').val()
|
||||
window.location.href = "report?address=" + data.result.address + "&totalPrice=" + data.result.totalPrice
|
||||
storeSession()
|
||||
}else{
|
||||
$.toast("估价失败,请重新评估");
|
||||
$("#evaluateBtn").prop("disabled", false)
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
//$.toast("服务器异常,请重新评估");
|
||||
$("#evaluateBtn").prop("disabled", false)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 选择操作-装修情况
|
||||
$(document).on('click', '.create-actions05-now', function () {
|
||||
|
||||
@@ -28,6 +28,8 @@ $(function () {
|
||||
success: function (data) {
|
||||
if(data && data.length == 0){
|
||||
if ($("#t").val() == "c") {
|
||||
$('input[name="name"]').val('')
|
||||
$('input[name="district"]').val('')
|
||||
$("#searchSpan ul").empty()
|
||||
return ;
|
||||
} else {
|
||||
@@ -56,7 +58,7 @@ $(function () {
|
||||
location.href = "districtDetail?id=" + id+"&city="+city
|
||||
} else if ($("#t").val() == "c") {
|
||||
$('#districtSearch').val(name)
|
||||
$('input[name="address"]').val(addr)
|
||||
$('input[name="name"]').val(name)
|
||||
$('input[name="district"]').val(region)
|
||||
$("#searchSpan ul").empty()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user