Commit 57c4d679 authored by Hsinli's avatar Hsinli

adddd

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