Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Athena
Project
Project
Details
Activity
Releases
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
华国豪
Athena
Commits
1cab2ce5
Commit
1cab2ce5
authored
Apr 08, 2020
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改排序
parent
fd0ebf28
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
HotelList.vue
src/components/Hotel/HotelList.vue
+20
-1
No files found.
src/components/Hotel/HotelList.vue
View file @
1cab2ce5
...
...
@@ -756,7 +756,7 @@
searchMealType
:
[],
//饮食条件搜索
searchMinRate
:
''
,
//最小金额
searchMaxRate
:
''
,
//最大金额
sort
:
0
sort
:
1
},
//是否显示日期范围
isShowTime
:
true
,
...
...
@@ -1190,6 +1190,19 @@
})
}
this
.
dataList2
=
ourHotelList
.
concat
(
this
.
dataList
);
this
.
dataList2
.
forEach
(
x
=>
{
if
(
isNaN
(
x
.
reviewRating
)){
x
.
reviewRating
=
0
}
})
//按价格升序
if
(
this
.
msg
.
sort
==
2
){
this
.
dataList2
.
sort
(
this
.
getSortFun
(
'asc'
,
'lowrateBySetCurrency'
));
}
//按照星级降序
if
(
this
.
msg
.
sort
==
1
){
this
.
dataList2
.
sort
(
this
.
getSortFun
(
'desc'
,
'reviewRating'
));
}
let
jalanTotalCount
=
0
;
if
(
res
.
data
.
data
.
parmResult
&&
res
.
data
.
data
.
parmResult
.
numberOfResultMatched
)
{
jalanTotalCount
=
res
.
data
.
data
.
parmResult
.
numberOfResultMatched
;
...
...
@@ -1281,6 +1294,12 @@
//获取价格
getPrice
(
price
)
{
return
Math
.
ceil
(
price
/
this
.
JapanIncrease
);
},
//数组排序
getSortFun
(
order
,
sortBy
)
{
var
ordAlpah
=
(
order
==
'asc'
)
?
'>'
:
'<'
;
var
sortFun
=
new
Function
(
'a'
,
'b'
,
'return a.'
+
sortBy
+
ordAlpah
+
'b.'
+
sortBy
+
'?1:-1'
);
return
sortFun
;
}
}
};
...
...
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