-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d52f9e
commit 6538247
Showing
11 changed files
with
259 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<template> | ||
<div class="reviewItem"> | ||
<router-link | ||
:to="`/review/${review.id}`" | ||
> | ||
<h3>{{ review.title }}</h3> | ||
<div class="authorDetail"> | ||
<strong>{{ review.author.name }}</strong> | ||
<star | ||
:average="average" | ||
:length="0.24" | ||
/> | ||
</div> | ||
<p>{{ review.summary }}</p> | ||
</router-link> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import Star from './Star'; | ||
export default { | ||
name: 'ReviewItem', | ||
components: { | ||
Star, | ||
}, | ||
props: ['review'], | ||
computed: { | ||
average() { | ||
const { value, max } = this.review.rating; | ||
return (value / max * 10); // eslint-disable-line | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
.reviewItem { | ||
padding: 0.2rem 0.36rem 0.3rem; | ||
} | ||
h3 { | ||
color: #494949; | ||
font-weight: 500; | ||
font-size: 0.34rem; | ||
line-height: 1.41; | ||
margin-bottom: 0.12rem; | ||
} | ||
strong { | ||
color: #494949; | ||
font-size: 0.24rem; | ||
margin-right: 0.04rem; | ||
} | ||
.authorDetail { | ||
display: flex; | ||
align-items: center; | ||
} | ||
p { | ||
color: #aaa; | ||
font-size: 0.24rem; | ||
line-height: 1.5; | ||
margin-top: 0.1rem; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,6 @@ | |
<script> | ||
export default { | ||
name: 'Template', | ||
data() { | ||
return { | ||
msg: 'template', | ||
}; | ||
}, | ||
}; | ||
</script> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<template> | ||
<div class="comments"> | ||
comments | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'Comments', | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<template> | ||
<div class="review"> | ||
Review | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'Review', | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<template> | ||
<div class="reviews"> | ||
Reviews | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'Reviews', | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Comments from '../../containers/Comments'; | ||
import store from '../../store'; | ||
import * as types from '../../store/mutation-types'; | ||
|
||
export default { | ||
path: '/comments/:currentMovieId', | ||
component: Comments, | ||
beforeEnter: (to, before, next) => { | ||
document.title = '短评 - 电影 - 豆瓣'; | ||
store.commit(types.LOADING_FLAG, false); | ||
next(); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Review from '../../containers/Review'; | ||
import store from '../../store'; | ||
import * as types from '../../store/mutation-types'; | ||
|
||
export default { | ||
path: '/review/:currentReviewId', | ||
component: Review, | ||
beforeEnter: (to, before, next) => { | ||
document.title = '影评 - 电影 - 豆瓣'; | ||
store.commit(types.LOADING_FLAG, false); | ||
next(); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Reviews from '../../containers/Reviews'; | ||
import store from '../../store'; | ||
import * as types from '../../store/mutation-types'; | ||
|
||
export default { | ||
path: '/reviews/:currentMovieId', | ||
component: Reviews, | ||
beforeEnter: (to, before, next) => { | ||
document.title = '影评 - 电影 - 豆瓣'; | ||
store.commit(types.LOADING_FLAG, false); | ||
next(); | ||
}, | ||
}; |
Oops, something went wrong.