Skip to content

Commit

Permalink
Merge pull request #89 from Sopt-Bridge/master
Browse files Browse the repository at this point in the history
master
  • Loading branch information
sangnyyy committed Jul 13, 2018
2 parents 826da2b + 128e5d6 commit 5981bc0
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 22 deletions.
14 changes: 7 additions & 7 deletions src/components/Modal/Subscribe-modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</div>
<div class="smcb-card-subBtn" @click="subClick">
<button class="Subcribe-bodyBtn">
<img :src="subNomarlBtn" width="35px" alt="">
<img :src="subActivelBtn" width="35px" alt="">
<!-- <div>Subscribe</div> -->
</button>
</div>
Expand Down Expand Up @@ -56,11 +56,12 @@ export default {
computed: {
...mapGetters(['getrecommendHashList','getHashlist']),
subscirbe() {
if (this.subBool) {
return subActivelBtn
} else if (!this.subBool) {
return subNomarlBtn
}
// if (this.subBool) {
// return subActivelBtn
// } else if (!this.subBool) {
// return subNomarlBtn
// }
return subActivelBtn
}
},
components: {
Expand Down Expand Up @@ -145,7 +146,6 @@ export default {
}
}
}
&-subBtn {}
}
}
Expand Down
40 changes: 29 additions & 11 deletions src/pages/Subscribe/Subscribe.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@

<v-card>
<v-list-tile class="menu-list-item">
<v-list-tile-title>
<v-list-tile-title @clikc="sorting(0)">
Upload data
</v-list-tile-title>
</v-list-tile>
<v-list-tile class="menu-list-item">
<v-list-tile class="menu-list-item" @clikc="sorting(2)">
<v-list-tile-title>
View count
</v-list-tile-title>
Expand All @@ -81,7 +81,6 @@
</template>

<script>
import VideoCard from '../../components/Card/VideoCard.vue';
import subscribeModal from '../../components/Modal/Subscribe-modal.vue'
import moreMenu from '../../components/Card/Home-cardMore.vue'
Expand All @@ -104,7 +103,6 @@ export default {
slidesPerView: 4,
spaceBeetween: 15,
lazy: true
},
swiperOption2: {
slidesPerView: 4,
Expand All @@ -114,7 +112,8 @@ export default {
subFilter,
cardItem: null,
noImg: noImg,
hashtagName: "#BTS"
hashtagName: "#SEVENTEEN",
sortType: 0
}
},
computed: {
Expand All @@ -135,28 +134,47 @@ export default {
...mapGetters(['getHashlist', 'getHashContentlist'])
},
methods: {
...mapActions(['asyncSetHashlist', 'asyncSetHashContentlist']),
changeHashName(hashName) {
this.hashtagName = hashName;
this.asyncSetHashContentlist(hashName);
let data = {
hashName: this.hashtagName,
pageIdx: 0,
sortType: this.sortType
}
this.asyncSetHashContentlist(data);
},
subClick() {
this.subBool = !this.subBool;
},
...mapActions(['asyncSetHashlist', 'asyncSetHashContentlist'])
sorting(type) {
console.log(type);
this.sortType = type;
let data = {
hashName: this.hashtagName,
pageIdx: 0,
sortType: this.sortType
}
this.asyncSetHashContentlist(data);
},
},
components: {
'video-card': VideoCard,
'subscribe-modal': subscribeModal,
'more-menu': moreMenu
},
mounted() {
this.asyncSetHashContentlist('#DRAMA');
created() {
let data = {
hashName: this.hashtagName,
pageIdx: 0,
sortType: this.sortType
}
this.asyncSetHashContentlist(data);
this.asyncSetHashlist({
pageIdx: 0,
userIdx: 1
});
this.hashtagName = this.getHashlist[0].hashName;
}
}
</script>
Expand Down
8 changes: 4 additions & 4 deletions src/store/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,19 @@ export const subscribeAction = {
asyncSetHashContentlist({
commit
}, payload) {
// let data = payload;
var config = {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
}
};
let data = {
hashName : payload,
hashName : payload.hashName,
pageIdx : 0,
sortType : 0
sortType : payload.sortType
}
console.log('asyncSetHashContentlist');
axios.post(api + '/subscribe/hashcontentlist', data,config).then(res => {
axios.post(api + '/subscribe/hashcontentlist', data).then(res => {
console.log('axios.post. hashContentlist')
commit('setHashContentlist', res.data.data[0].contents_list);
})
},
Expand Down
2 changes: 2 additions & 0 deletions src/store/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ Vue.use(Vuex);

export default new Vuex.Store({
state: Object.assign({}, homeState, searchState, requestState, commentState, replyState, libarayState, subscribeState, contentsState, writeState),

getters: Object.assign({}, homeGetters, searchGetters, requestGetters, commentGetters, replyGetters, libraryGetters, subscribeGetters, contentsGetters,writeGetters),
mutations: Object.assign({}, homeMutations, searchMutations, requestMutations, commentMutations, replyMutations, libraryMutatoins, subscribeMutations, contentsMutation,writeMutations),
actions: Object.assign({}, homeAction, searchAction, requestAction, commentAction, replyAction, libraryAction, subscribeAction, contentsAction,writeAction)


});

0 comments on commit 5981bc0

Please sign in to comment.