Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
51business
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
方斌
51business
Commits
57c4d679
Commit
57c4d679
authored
Apr 12, 2019
by
Hsinli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adddd
parent
f74f2f65
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
11 deletions
+23
-11
new_house.js
app/service/house/new_house.js
+23
-11
No files found.
app/service/house/new_house.js
View file @
57c4d679
...
...
@@ -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
,
//面积
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment