Skip to content

Commit

Permalink
update top250
Browse files Browse the repository at this point in the history
  • Loading branch information
baowei committed Mar 16, 2017
1 parent aa30d60 commit 3d62055
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/components/top250.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
return {}
},
mounted () {
this.$store.commit('PAGE_START', {start: 8})
this.$store.dispatch('loadingtop250')
},
components: {
Expand Down
5 changes: 3 additions & 2 deletions store/moving/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ export const actions = {
* @param commit
* @param state
*/
loadingtop250({commit}){
utils.get('/movie/top250', {}).then(res => {
loadingtop250({commit, state}){
console.log('start:'+state.start)
utils.get('/movie/top250', {start:state.start,count:7}).then(res => {
console.log(res)
commit('LOAD_TOP250', {ranking250: res});
commit('MOVING_LOADING', {loading: false});
Expand Down
3 changes: 3 additions & 0 deletions store/moving/getters.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,8 @@ export const getters = {
},
ranking250: state => {
return state.ranking250
},
start: state => {
return state.start
}
}
3 changes: 2 additions & 1 deletion store/moving/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const state = {
searchLoading: true,
upcomBody: {},
ranking250:{},
city: '杭州'
city: '杭州',
start:0
}

export default {
Expand Down
3 changes: 3 additions & 0 deletions store/moving/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export const mutations = {
[types.LOAD_TOP250] (state, {ranking250}){
state.ranking250 = ranking250
},
[types.PAGE_START] (state, {start}){
state.start = start
},
[types.SEARCH_TEXT] (state, {searchText}){
state.searchText = searchText
},
Expand Down
1 change: 1 addition & 0 deletions store/moving/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ export const UP_COMING = 'UP_COMING'
export const LOAD_TOP250='LOAD_TOP250'
export const SEARCH_TEXT = 'SEARCH_TEXT'
export const SEARCH_LIST = 'SEARCH_LIST'
export const PAGE_START='PAGE_START'

0 comments on commit 3d62055

Please sign in to comment.