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
7581526d
Commit
7581526d
authored
Apr 12, 2019
by
Hsinli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add mine
parent
574187ef
Pipeline
#5935
passed with stage
in 5 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
110 additions
and
10 deletions
+110
-10
mine.js
app/controller/house/mine.js
+18
-0
house.js
app/router/house.js
+4
-0
collection.js
app/service/house/collection.js
+4
-5
mine.js
app/service/house/mine.js
+74
-0
order.js
app/service/house/order.js
+4
-5
config.local.js
config/config.local.js
+3
-0
config.prod.js
config/config.prod.js
+3
-0
No files found.
app/controller/house/mine.js
0 → 100644
View file @
7581526d
'use strict'
;
const
Controller
=
require
(
'egg'
).
Controller
;
class
MineController
extends
Controller
{
/**
* 获取我的信息
*/
async
getMineInfo
()
{
const
{
ctx
}
=
this
;
let
ret
=
await
ctx
.
service
.
house
.
mine
.
getMineInfo
();
ctx
.
success
(
ret
);
}
}
module
.
exports
=
MineController
;
app/router/house.js
View file @
7581526d
...
@@ -36,5 +36,9 @@ module.exports = app => {
...
@@ -36,5 +36,9 @@ module.exports = app => {
//足迹
//足迹
router
.
get
(
'/foot_print/list'
,
'house.footPrint.getFootPrintList'
);
//用户浏览记录列表
router
.
get
(
'/foot_print/list'
,
'house.footPrint.getFootPrintList'
);
//用户浏览记录列表
//我的
router
.
get
(
'/mine'
,
'house.mine.getMineInfo'
);
//获取用户的头像昵称和关注等信息
};
};
app/service/house/collection.js
View file @
7581526d
...
@@ -116,12 +116,11 @@ class CollectionService extends Service {
...
@@ -116,12 +116,11 @@ class CollectionService extends Service {
key
:
"userId"
,
key
:
"userId"
,
value
:
ctx
.
userId
,
value
:
ctx
.
userId
,
operator
:
"equal"
operator
:
"equal"
},
{
key
:
"createdAt"
,
value
:
endDate
,
operator
:
"greater"
},
},
// {
// key: "createdAt",
// value: endDate,
// operator: "greater"
// },
],
],
orderConditions
:
[{
orderConditions
:
[{
key
:
'createdAt'
,
key
:
'createdAt'
,
...
...
app/service/house/mine.js
0 → 100644
View file @
7581526d
'use strict'
;
const
Service
=
require
(
'egg'
).
Service
;
class
MineService
extends
Service
{
/**
* 获取我的信息
*/
async
getMineInfo
()
{
const
{
ctx
,
service
}
=
this
;
let
ret
=
{
user
:
{
nickname
:
''
,
avatar
:
''
,
phone
:
''
},
classification
:
{
foot_print
:
{
count
:
0
,
neme
:
'浏览足迹'
},
collection
:
{
count
:
0
,
neme
:
'关注的房产'
},
order
:
{
count
:
0
,
neme
:
'预约记录'
},
}
}
if
(
!
ctx
.
userId
)
{
return
ret
;
}
let
appUserInfo
=
await
this
.
getAppUserInfo
();
let
footPrintList
=
await
service
.
house
.
footPrint
.
getFootPrintList
();
let
collectionList
=
await
service
.
house
.
collection
.
getCollectionList
();
let
orderList
=
await
service
.
house
.
order
.
getOrderList
();
let
phone
=
appUserInfo
.
phone
||
''
;
if
(
phone
.
length
>
0
)
{
phone
=
phone
.
substing
(
0
,
2
)
+
phone
.
substing
(
7
,
10
);
}
ret
.
user
.
nickname
=
appUserInfo
.
nickname
||
''
;
ret
.
user
.
avatar
=
appUserInfo
.
avatar
||
''
;
ret
.
user
.
avatar
=
phone
;
ret
.
classification
.
foot_print
.
count
=
footPrintList
.
count
;
ret
.
classification
.
collection
.
count
=
collectionList
.
count
;
ret
.
classification
.
order
.
count
=
orderList
.
count
;
return
ret
;
}
/**
* 获取用户信息
*/
async
getAppUserInfo
()
{
const
{
ctx
}
=
this
;
let
appUserId
=
ctx
.
appUserId
;
const
result
=
await
ctx
.
helper
.
send_request
(
this
.
config
.
USER_CENTER_API_URI
+
'/v1/appusers/'
+
appUserId
,
{},
{
method
:
'GET'
,
dataType
:
'json'
});
const
ret
=
result
.
status
===
200
?
result
.
data
:
{};
if
(
ret
.
avatar
&&
ret
.
avatar
.
indexOf
(
'http'
)
===
-
1
)
{
ret
.
avatar
=
this
.
config
.
AVATAR_URL
+
ret
.
avatar
;
}
return
ret
;
}
}
module
.
exports
=
MineService
;
app/service/house/order.js
View file @
7581526d
...
@@ -72,12 +72,11 @@ class OrderService extends Service {
...
@@ -72,12 +72,11 @@ class OrderService extends Service {
key
:
"userId"
,
key
:
"userId"
,
value
:
ctx
.
userId
,
value
:
ctx
.
userId
,
operator
:
"equal"
operator
:
"equal"
},
{
key
:
"createdAt"
,
value
:
endDate
,
operator
:
"greater"
},
},
// {
// key: "createdAt",
// value: endDate,
// operator: "greater"
// },
],
],
orderConditions
:
[{
orderConditions
:
[{
key
:
'createdAt'
,
key
:
'createdAt'
,
...
...
config/config.local.js
View file @
7581526d
...
@@ -81,6 +81,9 @@ module.exports = appInfo => {
...
@@ -81,6 +81,9 @@ module.exports = appInfo => {
config
.
HOUSE_SERVICE_API
=
'https://dev-nginx.jianbing.com/house-service'
;
config
.
HOUSE_SERVICE_API
=
'https://dev-nginx.jianbing.com/house-service'
;
config
.
CDN_BASE_URL
=
'https://r.51gjj.com/image/'
;
config
.
CDN_BASE_URL
=
'https://r.51gjj.com/image/'
;
config
.
USER_CENTER_API_URI
=
'https://dev-nginx.jianbing.com/usercenter-service'
;
return
config
;
return
config
;
};
};
config/config.prod.js
View file @
7581526d
...
@@ -59,6 +59,9 @@ module.exports = appInfo => {
...
@@ -59,6 +59,9 @@ module.exports = appInfo => {
config
.
HOUSE_SERVICE_API
=
process
.
env
.
HOUSE_SERVICE_API
;
// 房产
config
.
HOUSE_SERVICE_API
=
process
.
env
.
HOUSE_SERVICE_API
;
// 房产
config
.
USER_CENTER_API_URI
=
process
.
env
.
USER_CENTER_API_URI
;
return
config
;
return
config
;
};
};
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