Commit 57c4d679 authored by Hsinli's avatar Hsinli

adddd

parent f74f2f65
...@@ -27,9 +27,10 @@ class NewHouseService extends Service { ...@@ -27,9 +27,10 @@ class NewHouseService extends Service {
ctx.failed('error list type'); ctx.failed('error list type');
} }
let newHouseList = []; let newHouseList = [];
let condition = {};
if (type === 'home') { if (type === 'home') {
//为您推荐只展示50条在售楼盘的数据,根据排序序号取数,数字小的排在前面,数字一样的情况下根据时间逆序排列,时间也一样的情况下随机排列; //为您推荐只展示50条在售楼盘的数据,根据排序序号取数,数字小的排在前面,数字一样的情况下根据时间逆序排列,时间也一样的情况下随机排列;
let condition = { condition = {
pageSize: 50, pageSize: 50,
orderConditions: [{ orderConditions: [{
key: 'orderNum', key: 'orderNum',
...@@ -40,33 +41,44 @@ class NewHouseService extends Service { ...@@ -40,33 +41,44 @@ class NewHouseService extends Service {
orderSequence: 'desc', orderSequence: 'desc',
},] },]
}; };
newHouseList = await this.getNewHouseByFilter(condition);
} else if (type === 'all') { } else if (type === 'all') {
condition = {
orderConditions: [{
key: 'saleType',
orderSequence: 'desc',
},]
};
} else if (type === 'sale') { } else if (type === 'sale') {
//点击在售楼盘进入列表页面且只展示当前销售状态为在售的楼盘
condition = {
queryConditions: [{
key: "saleType",
value: '3',
operator: "equal"
}],
};
} else if (type === 'open') { } else if (type === 'open') {
//只展示最近三个月内开盘的楼盘,往前追溯三个月,列表单次加载30条楼盘数据,滑到底部再次加载30条 //只展示最近三个月内开盘的楼盘,往前追溯三个月,列表单次加载30条楼盘数据,滑到底部再次加载30条
let endDate = moment().subtract(30, 'days').format('YYYY-MM-DD HH:mm:ss'); let endDate = moment().subtract(30, 'days').format('YYYY-MM-DD HH:mm:ss');
let condition = { condition = {
queryConditions: [{ queryConditions: [{
key: "openDate", key: "openDate",
value: endDate, value: endDate,
operator: "greater" operator: "greater"
}], }],
}; };
newHouseList = await this.getNewHouseByFilter(condition);
} else if (type === 'favourable') { } else if (type === 'favourable') {
//点击优惠好盘只展示有优惠的楼盘,列表单次加载30条楼盘数据,滑到底部再次加载30条 //点击优惠好盘只展示有优惠的楼盘,列表单次加载30条楼盘数据,滑到底部再次加载30条
let condition = { condition = {
queryConditions: [{ queryConditions: [{
key: "favourableInfo", key: "favourableInfo",
value: false, value: false,
operator: "isnull" operator: "isnull"
}], }],
}; };
newHouseList = await this.getNewHouseByFilter(condition);
} }
newHouseList = await this.getNewHouseByFilter(condition);
return newHouseList; return newHouseList;
} }
...@@ -162,6 +174,7 @@ class NewHouseService extends Service { ...@@ -162,6 +174,7 @@ class NewHouseService extends Service {
const saleType = { 0: '未开售', 1: '售罄', 2: '预售', 3: '在售' }; const saleType = { 0: '未开售', 1: '售罄', 2: '预售', 3: '在售' };
const decorationType = { 1: '毛坯', 2: '简装', 3: '精装' } const decorationType = { 1: '毛坯', 2: '简装', 3: '精装' }
const archType = { 1: '板楼', 2: '塔楼' }; const archType = { 1: '板楼', 2: '塔楼' };
const houseType = { 1: '住宅', 2: '公寓' };
let ret = {}; let ret = {};
if (Object.keys(data).length > 0) { if (Object.keys(data).length > 0) {
ret.basic = { ret.basic = {
...@@ -172,7 +185,7 @@ class NewHouseService extends Service { ...@@ -172,7 +185,7 @@ class NewHouseService extends Service {
favourable_info: data.favourableInfo,//优惠 favourable_info: data.favourableInfo,//优惠
reference_avg_price: data.referenceAvgPrice,//均价 reference_avg_price: data.referenceAvgPrice,//均价
reference_total_price: data.referenceTotalPrice,//总价 reference_total_price: data.referenceTotalPrice,//总价
property_type: '',//物业类型 property_type: houseType[data.houseType],//物业类型
} }
ret.info = { ret.info = {
...@@ -188,7 +201,7 @@ class NewHouseService extends Service { ...@@ -188,7 +201,7 @@ class NewHouseService extends Service {
basic: { basic: {
reference_avg_price: data.referenceAvgPrice,//均价 reference_avg_price: data.referenceAvgPrice,//均价
tags: data.tags.split(','),//项目特色 tags: data.tags.split(','),//项目特色
property_type: '',//物业类型 property_type: houseType[data.houseType],//物业类型
property_right_years: data.residential.propertyRightYears,//产权年限 property_right_years: data.residential.propertyRightYears,//产权年限
build_type: archType[data.residential.ArchType],//建筑类型 1 板楼 2塔楼' build_type: archType[data.residential.ArchType],//建筑类型 1 板楼 2塔楼'
decoration: decorationType[data.decorationType],//装修情况,1 毛坯,2简装,3精装 decoration: decorationType[data.decorationType],//装修情况,1 毛坯,2简装,3精装
...@@ -289,7 +302,6 @@ class NewHouseService extends Service { ...@@ -289,7 +302,6 @@ class NewHouseService extends Service {
newHouseId: data.newHouseId, newHouseId: data.newHouseId,
type: data.type,//类型,如三居、四居 type: data.type,//类型,如三居、四居
image: data.image, image: data.image,
house_type: data.houseType,//住宅类型,如住宅,公寓
apartment: data.apartment,//户型,如4室2厅3卫 apartment: data.apartment,//户型,如4室2厅3卫
sale_type: saleType[data.saleType], sale_type: saleType[data.saleType],
area: data.area,//面积 area: data.area,//面积
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment