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
fb065616
Commit
fb065616
authored
Jun 12, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://t-git.51gjj.com/fangbin/51business
parents
20146049
3d37542f
Pipeline
#8797
passed with stage
in 13 seconds
Changes
8
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
63 additions
and
31 deletions
+63
-31
product.js
app/controller/gjj/product.js
+24
-22
context.js
app/extend/context.js
+30
-0
product.js
app/router/product.js
+1
-1
product.js
app/service/gjj/product.js
+0
-0
collection.js
app/service/house/v2/collection.js
+1
-1
new_house.js
app/service/house/v2/new_house.js
+3
-3
order.js
app/service/house/v2/order.js
+1
-1
config.local.js
config/config.local.js
+3
-3
No files found.
app/controller/gjj/product.js
View file @
fb065616
...
...
@@ -3,30 +3,32 @@
const
Controller
=
require
(
'egg'
).
Controller
;
class
ProductController
extends
Controller
{
// 筛选项列表
async
getOptionProducts
()
{
// 筛选项列表
async
getOptionProducts
()
{
const
{
ctx
}
=
this
;
const
type
=
ctx
.
params
.
type
||
'credit'
;
const
{
ctx
}
=
this
;
const
type
=
ctx
.
params
.
type
||
'credit'
;
const
keys
=
ctx
.
query
.
keys
?
eval
(
ctx
.
query
.
keys
)
:
[];
const
results
=
await
ctx
.
service
.
gjj
.
product
.
getRecommendOptions
(
type
,
keys
);
let
suit_options
;
let
credit_loans
=
[];
let
common_loans
=
[];
let
common_credits
=
[];
if
(
type
==
'loan'
)
{
suit_options
=
await
ctx
.
service
.
gjj
.
product
.
getLoanChannelSuitOptions
();
if
(
suit_options
)
{
results
.
unshift
(
suit_options
);
}
credit_loans
=
await
ctx
.
service
.
gjj
.
product
.
getAllProductsByType
(
1
);
common_loans
=
await
ctx
.
service
.
gjj
.
product
.
getAllProductsByType
(
4
);
}
else
{
common_credits
=
await
ctx
.
service
.
gjj
.
product
.
getAllProductsByType
(
3
);
}
ctx
.
success
({
results
:
results
,
credit_loans
:
credit_loans
,
common_loans
:
common_loans
,
common_credits
:
common_credits
});
const
keys
=
ctx
.
query
.
keys
?
ctx
.
query
.
keys
.
split
(
','
)
:
[];
const
results
=
await
ctx
.
service
.
gjj
.
product
.
getRecommendOptions
(
type
,
keys
);
let
suit_options
;
let
credit_loans
=
[];
let
common_loans
=
[];
let
common_credits
=
[];
let
credit_cards
=
[];
if
(
type
===
'loan'
)
{
suit_options
=
await
ctx
.
service
.
gjj
.
product
.
getLoanChannelSuitOptions
();
if
(
suit_options
)
{
results
.
unshift
(
suit_options
);
}
credit_loans
=
await
ctx
.
service
.
gjj
.
product
.
getAllProductsByType
(
1
);
common_loans
=
await
ctx
.
service
.
gjj
.
product
.
getAllProductsByType
(
4
);
}
else
{
credit_cards
=
await
ctx
.
service
.
gjj
.
product
.
getAllProductsByType
(
2
);
common_credits
=
await
ctx
.
service
.
gjj
.
product
.
getAllProductsByType
(
3
);
}
ctx
.
success
({
results
,
credit_loans
,
common_loans
,
common_credits
,
credit_cards
});
}
}
module
.
exports
=
ProductController
;
app/extend/context.js
View file @
fb065616
...
...
@@ -39,6 +39,36 @@ module.exports = {
}
},
isEmpty
(
data
)
{
const
type
=
typeof
(
data
);
let
ret
=
false
;
switch
(
type
)
{
case
'undefined'
:
ret
=
true
;
break
;
case
'string'
:
ret
=
!
(
data
.
length
>
0
);
break
;
case
'number'
:
ret
=
!
(
data
>
0
);
break
;
case
'boolean'
:
ret
=
false
;
break
;
case
'object'
:
// 判断是否为数组
if
(
data
instanceof
Array
)
{
ret
=
!
(
data
.
length
>
0
);
}
else
{
ret
=
JSON
.
stringify
(
data
)
===
'{}'
||
!
data
;
}
break
;
default
:
break
;
}
return
ret
;
},
login
(
params
)
{
const
{
cookies
,
session
}
=
this
;
const
moment
=
require
(
'moment'
);
...
...
app/router/product.js
View file @
fb065616
...
...
@@ -4,6 +4,6 @@ module.exports = app => {
const
router
=
app
.
router
.
namespace
(
app
.
config
.
projectRootPath
+
'/product'
);
router
.
get
(
'/recommend/channel/options/:type'
,
'gjj.product.getOptionProducts'
);
//
router
.
get
(
'
third_options'
,
'
/recommend/channel/options/:type'
,
'gjj.product.getOptionProducts'
);
//
};
app/service/gjj/product.js
View file @
fb065616
This diff is collapsed.
Click to expand it.
app/service/house/v2/collection.js
View file @
fb065616
...
...
@@ -136,7 +136,7 @@ class CollectionService extends Service {
name
:
retList
[
j
].
name
,
address
:
retList
[
j
].
address
,
tags
:
retList
[
j
].
tags
?
eval
(
retList
[
j
].
tags
)
:
[],
image
:
'https://r.51gjj.com/'
+
retList
[
j
].
image
,
image
:
retList
[
j
].
image
,
area
:
type
===
1
?
Number
(
retList
[
j
].
house_area
)
:
''
,
price
:
type
===
1
?
([
''
,
0
].
includes
(
Number
(
retList
[
j
].
reference_avg_price
))
?
'--'
:
Number
(
retList
[
j
].
reference_avg_price
))
:
Number
(
retList
[
j
].
price
),
type
:
type
===
1
?
'new_house'
:
'rental_house'
,
...
...
app/service/house/v2/new_house.js
View file @
fb065616
...
...
@@ -74,7 +74,7 @@ class NewHouseService extends Service {
for
(
let
i
in
newHouseImages
)
{
let
image
=
{
id
:
newHouseImages
[
i
].
id
,
path
:
'https://r.51gjj.com/'
+
newHouseImages
[
i
].
path
,
path
:
newHouseImages
[
i
].
path
,
description
:
newHouseImages
[
i
].
description
,
}
images
.
push
(
image
);
...
...
@@ -302,7 +302,7 @@ class NewHouseService extends Service {
new_house_id
:
data
.
new_house_id
,
type
:
data
.
type
,
//类型,如三居、四居
house_type
:
houseType
[
data
.
house_type
]
||
''
,
image
:
'https://r.51gjj.com/'
+
data
.
image
,
image
:
data
.
image
,
apartment
:
data
.
apartment
,
//户型,如4室2厅3卫
sale_type
:
saleType
[
data
.
sale_type
]
||
''
,
area
:
Number
(
data
.
area
),
//面积
...
...
@@ -403,7 +403,7 @@ class NewHouseService extends Service {
name
:
newHouseList
.
rows
[
i
].
name
,
address
:
newHouseList
.
rows
[
i
].
address
,
tags
:
newHouseList
.
rows
[
i
].
tags
?
eval
(
newHouseList
.
rows
[
i
].
tags
)
:
[],
image
:
'https://r.51gjj.com/'
+
newHouseList
.
rows
[
i
].
image
,
image
:
newHouseList
.
rows
[
i
].
image
,
price
:
Number
(
newHouseList
.
rows
[
i
].
reference_avg_price
)
===
0
?
'--'
:
Number
(
newHouseList
.
rows
[
i
].
reference_avg_price
),
corner
:
newHouseList
.
rows
[
i
].
cornerMarker
,
};
...
...
app/service/house/v2/order.js
View file @
fb065616
...
...
@@ -91,7 +91,7 @@ class OrderService extends Service {
name
:
retList
[
j
].
name
,
address
:
retList
[
j
].
address
,
tags
:
retList
[
j
].
tags
?
eval
(
retList
[
j
].
tags
)
:
[],
image
:
'https://r.51gjj.com/'
+
retList
[
j
].
image
,
image
:
retList
[
j
].
image
,
area
:
type
===
1
?
Number
(
retList
[
j
].
house_area
)
:
''
,
price
:
type
===
1
?
(
Number
(
retList
[
j
].
reference_avg_price
)
===
0
?
'--'
:
Number
(
retList
[
j
].
reference_avg_price
))
:
Number
(
retList
[
j
].
price
),
time
:
moment
().
format
(
'YYYY-MM-DD'
)
===
moment
(
orderList
[
j
].
order_at
).
format
(
'YYYY-MM-DD'
)
?
'今天'
:
moment
(
orderList
[
j
].
order_at
).
format
(
'YYYY-MM-DD'
),
...
...
config/config.local.js
View file @
fb065616
...
...
@@ -90,13 +90,13 @@ module.exports = appInfo => {
};
config
.
PHP_URL
=
'https://kaifa.jianbing.com'
;
config
.
NODE_URL
=
'https://
dev
-nginx.jianbing.com/user_api/v1'
;
config
.
NODE_BASE_URL
=
'https://
dev
-nginx.jianbing.com'
;
config
.
NODE_URL
=
'https://
uat
-nginx.jianbing.com/user_api/v1'
;
config
.
NODE_BASE_URL
=
'https://
uat
-nginx.jianbing.com'
;
config
.
HOUSE_SERVICE_API
=
'https://uat-nginx.jianbing.com/house-service'
;
config
.
CDN_BASE_URL
=
'https://r.51gjj.com/image/'
;
config
.
USER_CENTER_API_URI
=
'https://
dev
-nginx.jianbing.com/usercenter-service'
;
config
.
USER_CENTER_API_URI
=
'https://
uat
-nginx.jianbing.com/usercenter-service'
;
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