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
3b706e0c
Commit
3b706e0c
authored
Apr 15, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://t-git.51gjj.com/fangbin/51business
parents
b5311abb
e13f3b99
Pipeline
#5974
passed with stage
in 2 seconds
Changes
4
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
23 deletions
+17
-23
new_house.js
app/controller/house/new_house.js
+12
-19
house.js
app/router/house.js
+0
-1
mine.js
app/service/house/mine.js
+5
-3
new_house.js
app/service/house/new_house.js
+0
-0
No files found.
app/controller/house/new_house.js
View file @
3b706e0c
...
...
@@ -3,22 +3,6 @@
const
Controller
=
require
(
'egg'
).
Controller
;
class
NewHouseController
extends
Controller
{
/**
* 新房列表
* 全部all 在售sale 最近开盘open 优惠favourtable 首页home
*/
async
getNewHouseListByType
()
{
const
{
ctx
}
=
this
;
let
inputParams
=
ctx
.
params
;
const
rule
=
{
type
:
{
type
:
'string'
,
required
:
true
},
};
ctx
.
validate
(
rule
,
inputParams
);
const
ret
=
await
ctx
.
service
.
house
.
newHouse
.
getNewHouseListByType
(
inputParams
.
type
);
ctx
.
success
(
ret
);
}
/**
* 根据筛选条件获得新房列表
*/
...
...
@@ -26,16 +10,25 @@ class NewHouseController extends Controller {
const
{
ctx
}
=
this
;
let
inputParams
=
ctx
.
request
.
body
;
const
rule
=
{
page
:
{
type
:
'string'
,
required
:
false
},
//页面
page_size
:
{
type
:
'string'
,
required
:
false
},
//条数
area_code
:
{
type
:
'string'
,
required
:
false
},
//区域
unit_price
:
{
type
:
'object'
,
required
:
false
},
//价格
total_price
:
{
type
:
'object'
,
required
:
false
},
//总价
area
:
{
type
:
'object'
,
required
:
false
},
//面积
house_type
:
{
type
:
'string'
,
required
:
false
},
//房型
page
:
{
type
:
'string'
,
required
:
false
},
//页面
page_size
:
{
type
:
'string'
,
required
:
false
},
//条数
//通过type选择指定内容 全部all 在售sale 最近开盘open 优惠favourtable 首页home,和上面的筛选项互斥
type
:
{
type
:
'string'
,
required
:
false
},
//
};
ctx
.
validate
(
rule
,
inputParams
);
const
ret
=
await
ctx
.
service
.
house
.
newHouse
.
getNewHouseList
(
inputParams
);
let
ret
=
{};
if
(
inputParams
.
hasOwnProperty
(
'type'
)
&&
inputParams
.
type
!==
''
)
{
ret
=
await
ctx
.
service
.
house
.
newHouse
.
getNewHouseListByType
(
inputParams
);
}
else
{
ret
=
await
ctx
.
service
.
house
.
newHouse
.
getNewHouseList
(
inputParams
);
}
ctx
.
success
(
ret
);
}
...
...
app/router/house.js
View file @
3b706e0c
...
...
@@ -17,7 +17,6 @@ module.exports = app => {
//新房
router
.
get
(
'/new_house/list/:type'
,
'house.newHouse.getNewHouseListByType'
);
//某个指定列表
router
.
post
(
'/new_house/list'
,
'house.newHouse.getNewHouseList'
);
//根据条件筛选列表
router
.
get
(
'/new_house/:id'
,
'house.newHouse.getNewHouse'
);
//新房具体信息
router
.
get
(
'/new_house_type/:id'
,
'house.newHouse.getNewHouseType'
);
//新房户型
...
...
app/service/house/mine.js
View file @
3b706e0c
...
...
@@ -10,6 +10,7 @@ class MineService extends Service {
async
getMineInfo
()
{
const
{
ctx
,
service
}
=
this
;
let
ret
=
{
login
:
false
,
user
:
{
nickname
:
''
,
avatar
:
''
,
...
...
@@ -18,15 +19,15 @@ class MineService extends Service {
classification
:
{
foot_print
:
{
count
:
0
,
n
e
me
:
'浏览足迹'
n
a
me
:
'浏览足迹'
},
collection
:
{
count
:
0
,
n
e
me
:
'关注的房产'
n
a
me
:
'关注的房产'
},
order
:
{
count
:
0
,
n
e
me
:
'预约记录'
n
a
me
:
'预约记录'
},
}
}
...
...
@@ -42,6 +43,7 @@ class MineService extends Service {
if
(
phone
.
length
>
0
)
{
phone
=
phone
.
substing
(
0
,
2
)
+
phone
.
substing
(
7
,
10
);
}
ret
.
login
=
true
;
ret
.
user
.
nickname
=
appUserInfo
.
nickname
||
''
;
ret
.
user
.
avatar
=
appUserInfo
.
avatar
||
''
;
ret
.
user
.
avatar
=
phone
;
...
...
app/service/house/new_house.js
View file @
3b706e0c
This diff is collapsed.
Click to expand it.
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