Merge branch 'YOUFANGAPP1.1' of 192.168.0.27:dev0/youfang-app into YOUFANGAPP1.1
This commit is contained in:
@@ -12,7 +12,7 @@ var mf_curpage = 1;
|
|||||||
var mf_totalCount = 0;
|
var mf_totalCount = 0;
|
||||||
function addEstate(number, lastIndex) {
|
function addEstate(number, lastIndex) {
|
||||||
mf_curpage = mf_lastIndex/mf_itemsPerLoad + 1;
|
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 = response.data;
|
||||||
//data = eval( '(' + data + ')' );
|
//data = eval( '(' + data + ')' );
|
||||||
if(data['results']==null || data['results'].length==0) {
|
if(data['results']==null || data['results'].length==0) {
|
||||||
|
|||||||
@@ -37,82 +37,39 @@
|
|||||||
</button>
|
</button>
|
||||||
<h1 class="title">我的房产</h1>
|
<h1 class="title">我的房产</h1>
|
||||||
</header>
|
</header>
|
||||||
<div class="content">
|
<div class="content infinite-scroll infinite-scroll-bottom">
|
||||||
<div class="card cardPrice cardPrice01">
|
<div class="card cardPrice cardPrice01" id="houseInfo">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span>房产总值</span>
|
<span>房产总值</span>
|
||||||
<a class="button theme" href="#">添加房产</a>
|
<a class="button theme" href="#">添加房产</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<div class="card-content-inner">5000<span>万</span></div>
|
<div class="card-content-inner">{{totalPrice}}<span>万</span></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
<span>
|
<span>
|
||||||
<em><strong>11.84</strong>%<i class="icon icon-arrow-red"></i></em>
|
<em><strong>{{oneYearUpDownRange}}</strong>%<i id ="oneYearUpDownRange" class="icon icon-arrow-red"></i></em>
|
||||||
<label>近1年涨跌幅</label>
|
<label>近1年涨跌幅</label>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<em><strong>41.45</strong>万<i class="icon icon-arrow-red"></i></em>
|
<em><strong>{{oneYearUpDownPrice}}</strong>万<i id="oneYearUpDownPrice" class="icon icon-arrow-red"></i></em>
|
||||||
<label>近1年升值额</label>
|
<label>近1年升值额</label>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<em><strong>12</strong><i class="icon icon-arrow-red"></i></em>
|
<em><strong>待定</strong><i class="icon icon-arrow-red"></i></em>
|
||||||
<label>资产排名</label>
|
<label>资产排名</label>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="list-block media-list">
|
<div class="list-block media-list">
|
||||||
<ul>
|
<ul class="list-container">
|
||||||
<li>
|
<!-- 动态拼接内容 -->
|
||||||
<a href="#" class="item-content">
|
|
||||||
<div class="item-inner">
|
|
||||||
<div class="item-title-row">
|
|
||||||
<div class="item-title">龙盛佳苑 <em>391万</em><span class="tag"><small>空置</small></span></div>
|
|
||||||
</div>
|
|
||||||
<div class="item-subtitle">
|
|
||||||
<div>近30天涨跌幅: <em class="down">3.37%<i class="icon icon-arrow-green"></i></em></div>
|
|
||||||
<div>下跌概率: <em class="down">12%<i class="icon icon-arrow-green"></i></em></div>
|
|
||||||
<div>抵押可贷额度: <em style="color:#EB5F34;">391万</em></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
<a class="add alert-text-title"><i class="icon icon-houseLevel"></i>公寓</a>
|
|
||||||
<a class="button theme add add01 add01a" href="#">立即申请</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="item-content">
|
|
||||||
<div class="item-inner">
|
|
||||||
<div class="item-title-row">
|
|
||||||
<div class="item-title">龙盛佳苑 <em>391万</em><span class="tag"><small>空置</small></span></div>
|
|
||||||
</div>
|
|
||||||
<div class="item-subtitle">
|
|
||||||
<div>近30天涨跌幅: <em class="down">3.37%<i class="icon icon-arrow-green"></i></em></div>
|
|
||||||
<div>下跌概率: <em class="down">12%<i class="icon icon-arrow-green"></i></em></div>
|
|
||||||
<div>抵押可贷额度: <em style="color:#EB5F34;">391万</em></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
<a class="add alert-text-title"><i class="icon icon-houseLevel"></i>公寓</a>
|
|
||||||
<a class="button theme add add01 add01a" href="#">立即申请</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" class="item-content">
|
|
||||||
<div class="item-inner">
|
|
||||||
<div class="item-title-row">
|
|
||||||
<div class="item-title">龙盛佳苑 <em>391万</em><span class="tag"><small>空置</small></span></div>
|
|
||||||
</div>
|
|
||||||
<div class="item-subtitle">
|
|
||||||
<div>近30天涨跌幅: <em class="down">3.37%<i class="icon icon-arrow-green"></i></em></div>
|
|
||||||
<div>下跌概率: <em class="down">12%<i class="icon icon-arrow-green"></i></em></div>
|
|
||||||
<div>抵押可贷额度: <em style="color:#EB5F34;">391万</em></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
<a class="add alert-text-title"><i class="icon icon-houseLevel"></i>公寓</a>
|
|
||||||
<a class="button theme add add01 add01a" href="#">立即申请</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 分页加载效果, 默认不显示, 和 加载loading页区分开-->
|
||||||
|
<div class="infinite-scroll-preloader">
|
||||||
|
<div class="preloader"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -140,6 +97,201 @@ $.config = {router: false}
|
|||||||
//初始化init
|
//初始化init
|
||||||
$.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)){
|
||||||
|
//转换成元,四舍五入
|
||||||
|
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>";
|
||||||
|
}
|
||||||
|
$('.infinite-scroll-bottom .list-container').append(html);
|
||||||
|
}
|
||||||
|
|
||||||
/* 说明-房产等级 */
|
/* 说明-房产等级 */
|
||||||
$(document).on('click','.alert-text-title', function () {
|
$(document).on('click','.alert-text-title', function () {
|
||||||
$.alert('房产等级是房屋在城市中的综合评级,由高至低分别为 豪宅、公寓、平房、草屋、山洞共5个级别。', '房产等级');
|
$.alert('房产等级是房屋在城市中的综合评级,由高至低分别为 豪宅、公寓、平房、草屋、山洞共5个级别。', '房产等级');
|
||||||
|
|||||||
@@ -262,10 +262,7 @@ function addItems(number, lastIndex) {
|
|||||||
if(!id){
|
if(!id){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
curpage = lastIndex/itemsPerLoad + 1;
|
curpage = lastIndex/itemsPerLoad + 1;
|
||||||
|
|
||||||
|
|
||||||
axios.get("/rest/news/comment", {
|
axios.get("/rest/news/comment", {
|
||||||
params: {
|
params: {
|
||||||
newsId: id,
|
newsId: id,
|
||||||
|
|||||||
@@ -0,0 +1,351 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<title>出租管理</title>
|
||||||
|
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
|
||||||
|
<link rel="shortcut icon" href="/favicon.ico">
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.css">
|
||||||
|
<link rel="stylesheet" href="../../css/main.css">
|
||||||
|
<link rel="stylesheet" href="../../css/city.css">
|
||||||
|
<link rel="stylesheet" href="../../css/theme-orange.css">
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.picker-item{padding:0 1rem;font-size:18px;}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="page-group">
|
||||||
|
<div class="page page-current">
|
||||||
|
<header class="bar bar-nav">
|
||||||
|
<button class="button button-link button-nav pull-left" onclick="history.go(-1)">
|
||||||
|
<span class="icon icon-left"></span>
|
||||||
|
</button>
|
||||||
|
<h1 class="title">出租管理</h1>
|
||||||
|
</header>
|
||||||
|
<div class="content" id="edit">
|
||||||
|
<div class="list-block media-list">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a class="item-link item-content">
|
||||||
|
<div class="item-inner">
|
||||||
|
<div class="item-title-row">
|
||||||
|
<div class="item-title">起租日期</div>
|
||||||
|
<div class="item-after">
|
||||||
|
<input type="text" id="input_time01" class="textAlignLeft" v-bind:value="leaseStartDate" placeholder="请选择起租日期" readonly>
|
||||||
|
<input type="hidden" id="nowDay" name="nowDay" v-bind:value="nowDay">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a class="item-link item-content">
|
||||||
|
<div class="item-inner">
|
||||||
|
<div class="item-title-row">
|
||||||
|
<div class="item-title">到期日期</div>
|
||||||
|
<div class="item-after">
|
||||||
|
<input type="text" id="input_time02" class="textAlignLeft" v-bind:value="leaseEndDate" placeholder="请选择到期日期" readonly>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a class="item-link item-content">
|
||||||
|
<div class="item-inner">
|
||||||
|
<div class="item-title-row">
|
||||||
|
<div class="item-title">收租周期</div>
|
||||||
|
<div class="item-after">
|
||||||
|
<input type="text" id="input_cycle" class="textAlignLeft" v-bind:value="cycle" value="1 月 /次" readonly>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a class="item-link item-content">
|
||||||
|
<div class="item-inner item-inner01">
|
||||||
|
<div class="item-title-row">
|
||||||
|
<div class="item-title">每期租金</div>
|
||||||
|
<div class="item-after">
|
||||||
|
<input type="number" id="input_rent01" class="textAlignLeft" v-bind:value="rent" placeholder="请输入每期租金">
|
||||||
|
<label>元</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a class="item-link item-content">
|
||||||
|
<div class="item-inner">
|
||||||
|
<div class="item-title-row">
|
||||||
|
<div class="item-title">下次收租日期</div>
|
||||||
|
<div class="item-after">
|
||||||
|
<input type="text" id="input_time03" class="textAlignLeft textAlignLeft01" v-bind:value="lastRentDate" placeholder="请选择下次收租日期" readonly>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="content-block">
|
||||||
|
<p><a class="button button-big button-fill theme" id="confirm_btn">确定</a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="http://g.alicdn.com/sj/lib/zepto/zepto.js" charset="utf-8"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
/* 关闭路由,以实现不同页面之间的相互跳转(仅开发环境需要) */
|
||||||
|
Zepto = $
|
||||||
|
$.config = {router: false}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="../../js/light7.js" charset="utf-8"></script>
|
||||||
|
<script type="text/javascript" src="../../js/cn.js" charset="utf-8"></script>
|
||||||
|
<script type="text/javascript" src="../../js/vue.js"></script>
|
||||||
|
<script src="../../config.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/common.js" ></script>
|
||||||
|
<script type="text/javascript" src="../../js/axios.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../../js/axiosPlugin.js"></script>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 获取周期 1-30
|
||||||
|
function getnumber(){
|
||||||
|
var data = new Array();
|
||||||
|
for(var i=1;i<31;i++){
|
||||||
|
data.push(i);
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
///* 错误提示 */
|
||||||
|
//$("#confirm_btn").on("click", function () {
|
||||||
|
// var a = $("#input_time01").val();
|
||||||
|
// var b = $("#input_time02").val();
|
||||||
|
// var c = $("#input_rent01").val();
|
||||||
|
// var d = $("#input_time03").val();
|
||||||
|
// if(a == ""){
|
||||||
|
// $.toast("请选择起租日期");
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// else if(b == ""){
|
||||||
|
// $.toast("请选择到期日期");
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// else if(c == ""){
|
||||||
|
// $.toast("请输入每期租金");
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// else if(d == ""){
|
||||||
|
// $.toast("请选择下次收租日期");
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
//});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
var edit = new Vue({
|
||||||
|
el:"#edit",
|
||||||
|
data:{liveStatus:"",leaseStartDate:"",leaseEndDate:"",lastRentDate:"",nowDay:"",rent:"",cycle:""}
|
||||||
|
});
|
||||||
|
function getNowFormatDate(time) {
|
||||||
|
if(typeof(time)=="undefined"||time==null){
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
var date = new Date(time)
|
||||||
|
var seperator1 = "-";
|
||||||
|
var year = date.getFullYear();
|
||||||
|
var month = date.getMonth() + 1;
|
||||||
|
var strDate = date.getDate();
|
||||||
|
if (month >= 1 && month <= 9) {
|
||||||
|
month = "0" + month;
|
||||||
|
}
|
||||||
|
if (strDate >= 0 && strDate <= 9) {
|
||||||
|
strDate = "0" + strDate;
|
||||||
|
}
|
||||||
|
var currentdate = year + seperator1 + month + seperator1 + strDate;
|
||||||
|
return currentdate;
|
||||||
|
}
|
||||||
|
var id="165878889770385408"
|
||||||
|
$(function (){
|
||||||
|
//var self = plus.webview.currentWebview();
|
||||||
|
// id = self.newsId;
|
||||||
|
axios.get('/rest/rent/queryHouseRent',{params:{id:id}}).then(function(response){
|
||||||
|
var data = response.data.data.houses;
|
||||||
|
$.each(data,function(i){
|
||||||
|
var active = "";
|
||||||
|
var houseRoomNum = "";
|
||||||
|
if(this.id == id){
|
||||||
|
active = "active"
|
||||||
|
}
|
||||||
|
if(this.houseRoomNum){
|
||||||
|
houseRoomNum = '<small>'+this.houseRoomNum+'</small>';
|
||||||
|
}
|
||||||
|
$("#titleList").append('<a v-bind:val="'+this.id+'" class="tab-link button '+active+'">'+
|
||||||
|
'<label>'+this.name+'</label>'+houseRoomNum+'</a>')
|
||||||
|
$(".buttons-tab01 a").click(function(){
|
||||||
|
var id = $(this).attr("val")
|
||||||
|
window.location.href = "index?id="+id;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
var houseInfo = response.data.data.houseInfo;
|
||||||
|
edit.liveStatus=houseInfo.liveStatus;
|
||||||
|
edit.leaseStartDate=getNowFormatDate(houseInfo.leaseStartDate);
|
||||||
|
edit.leaseEndDate = getNowFormatDate(houseInfo.leaseEndDate);
|
||||||
|
edit.lastRentDate = getNowFormatDate(houseInfo.lastRentDate);
|
||||||
|
edit.nowDay = getNowFormatDate(response.data.data.nowDay);
|
||||||
|
edit.rent = houseInfo.rent;
|
||||||
|
edit.cycle = response.data.data.cycle;
|
||||||
|
/* 选择-起租日期 */
|
||||||
|
$("#input_time01").datetimePicker({
|
||||||
|
toolbarTemplate: '<header class="bar bar-nav bar-nav01 bar-nav01a">\
|
||||||
|
<button class="button button-link pull-right close-picker">确定</button>\
|
||||||
|
<h1 class="title">起租日期</h1>\
|
||||||
|
</header>'
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 选择-到期日期 */
|
||||||
|
$("#input_time02").datetimePicker({
|
||||||
|
toolbarTemplate: '<header class="bar bar-nav bar-nav01 bar-nav01a">\
|
||||||
|
<button class="button button-link pull-right close-picker">确定</button>\
|
||||||
|
<h1 class="title">到期日期</h1>\
|
||||||
|
</header>'
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 选择-下次收租日期 */
|
||||||
|
$("#input_time03").datetimePicker({
|
||||||
|
toolbarTemplate: '<header class="bar bar-nav bar-nav01 bar-nav01a">\
|
||||||
|
<button class="button button-link pull-right close-picker">确定</button>\
|
||||||
|
<h1 class="title">下次收租日期</h1>\
|
||||||
|
</header>'
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 选择-收租周期 */
|
||||||
|
$("#input_cycle").picker({
|
||||||
|
toolbarTemplate: '<header class="bar bar-nav bar-nav01 bar-nav01a">\
|
||||||
|
<button class="button button-link pull-right close-picker">确定</button>\
|
||||||
|
<h1 class="title">收租周期</h1>\
|
||||||
|
</header>',
|
||||||
|
cols: [
|
||||||
|
{
|
||||||
|
textAlign: 'center',
|
||||||
|
values: getnumber()
|
||||||
|
},
|
||||||
|
{
|
||||||
|
textAlign: 'center',
|
||||||
|
values: ["年", "季", "月"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
textAlign: 'center',
|
||||||
|
values: ["/次"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}).catch(function(error){
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
})
|
||||||
|
/* 编辑状态-确定 */
|
||||||
|
$(document).on('click','#confirm_btn', function () {
|
||||||
|
|
||||||
|
// var status = $('#input_status').val();
|
||||||
|
var status = "出租";
|
||||||
|
var rent_start = $('#input_time01').val();
|
||||||
|
var rent_end = $('#input_time02').val();
|
||||||
|
var rent_cycle = $('#input_cycle').val();
|
||||||
|
var rent_price = $('#input_rent01').val();
|
||||||
|
var next_rent = $('#input_time03').val();
|
||||||
|
var nowDay = $('#nowDay').val();
|
||||||
|
d = {
|
||||||
|
"id":id,
|
||||||
|
"liveStatus": status,
|
||||||
|
"leaseStartDate":rent_start,
|
||||||
|
"leaseEndDate":rent_end,
|
||||||
|
"rent":rent_price,
|
||||||
|
"lastRentDate":next_rent
|
||||||
|
};
|
||||||
|
|
||||||
|
if (status == "出租" )
|
||||||
|
{
|
||||||
|
if (rent_price == "") {
|
||||||
|
$.toast("请输入每期租金");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(rent_start == ""){
|
||||||
|
$.toast("请选择起租日期");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(rent_end == ""){
|
||||||
|
$.toast("请选择到期日期");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(next_rent == ""){
|
||||||
|
$.toast("请选择下次收租日期");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(rent_cycle == ""){
|
||||||
|
$.toast("请选择收租周期");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Number(rent_price)<100 || Number(rent_price)>200000){
|
||||||
|
$.toast("租金范围100-200000元");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(parseInt(rent_price)<Number(rent_price)){
|
||||||
|
$.toast("租金请输入整数");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(rent_end<nowDay){
|
||||||
|
$.toast("到期日期不能早于今天");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rent_start > rent_end) {
|
||||||
|
$.toast("到期日期必须晚于起租日期");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (next_rent > rent_end) {
|
||||||
|
$.toast("收租日期不能晚于到期日期");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(next_rent<nowDay){
|
||||||
|
$.toast("下次收租日期不能早于今天");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (rent_cycle != ""){
|
||||||
|
var a = rent_cycle.split(" ");
|
||||||
|
var b = a[1].split("/");
|
||||||
|
d["rentCycle"] = a[0];
|
||||||
|
d["rentCycleUnit"] = b[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
axios.post("/rest/rent/changeStatus",d).then(function(response){
|
||||||
|
//$.toast(response.data.data);
|
||||||
|
console.log(1);
|
||||||
|
}).catch(function(error){
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user