Skip to content

Commit 5981bc0

Browse files
authored
Merge pull request #89 from Sopt-Bridge/master
master
2 parents 826da2b + 128e5d6 commit 5981bc0

File tree

4 files changed

+42
-22
lines changed

4 files changed

+42
-22
lines changed

src/components/Modal/Subscribe-modal.vue

+7-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</div>
2222
<div class="smcb-card-subBtn" @click="subClick">
2323
<button class="Subcribe-bodyBtn">
24-
<img :src="subNomarlBtn" width="35px" alt="">
24+
<img :src="subActivelBtn" width="35px" alt="">
2525
<!-- <div>Subscribe</div> -->
2626
</button>
2727
</div>
@@ -56,11 +56,12 @@ export default {
5656
computed: {
5757
...mapGetters(['getrecommendHashList','getHashlist']),
5858
subscirbe() {
59-
if (this.subBool) {
60-
return subActivelBtn
61-
} else if (!this.subBool) {
62-
return subNomarlBtn
63-
}
59+
// if (this.subBool) {
60+
// return subActivelBtn
61+
// } else if (!this.subBool) {
62+
// return subNomarlBtn
63+
// }
64+
return subActivelBtn
6465
}
6566
},
6667
components: {
@@ -145,7 +146,6 @@ export default {
145146
}
146147
}
147148
}
148-
&-subBtn {}
149149
}
150150
}
151151

src/pages/Subscribe/Subscribe.vue

+29-11
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@
5151

5252
<v-card>
5353
<v-list-tile class="menu-list-item">
54-
<v-list-tile-title>
54+
<v-list-tile-title @clikc="sorting(0)">
5555
Upload data
5656
</v-list-tile-title>
5757
</v-list-tile>
58-
<v-list-tile class="menu-list-item">
58+
<v-list-tile class="menu-list-item" @clikc="sorting(2)">
5959
<v-list-tile-title>
6060
View count
6161
</v-list-tile-title>
@@ -81,7 +81,6 @@
8181
</template>
8282

8383
<script>
84-
8584
import VideoCard from '../../components/Card/VideoCard.vue';
8685
import subscribeModal from '../../components/Modal/Subscribe-modal.vue'
8786
import moreMenu from '../../components/Card/Home-cardMore.vue'
@@ -104,7 +103,6 @@ export default {
104103
slidesPerView: 4,
105104
spaceBeetween: 15,
106105
lazy: true
107-
108106
},
109107
swiperOption2: {
110108
slidesPerView: 4,
@@ -114,7 +112,8 @@ export default {
114112
subFilter,
115113
cardItem: null,
116114
noImg: noImg,
117-
hashtagName: "#BTS"
115+
hashtagName: "#SEVENTEEN",
116+
sortType: 0
118117
}
119118
},
120119
computed: {
@@ -135,28 +134,47 @@ export default {
135134
...mapGetters(['getHashlist', 'getHashContentlist'])
136135
},
137136
methods: {
137+
...mapActions(['asyncSetHashlist', 'asyncSetHashContentlist']),
138138
changeHashName(hashName) {
139139
this.hashtagName = hashName;
140-
this.asyncSetHashContentlist(hashName);
140+
let data = {
141+
hashName: this.hashtagName,
142+
pageIdx: 0,
143+
sortType: this.sortType
144+
}
145+
this.asyncSetHashContentlist(data);
141146
},
142-
143147
subClick() {
144148
this.subBool = !this.subBool;
145149
},
146-
...mapActions(['asyncSetHashlist', 'asyncSetHashContentlist'])
150+
sorting(type) {
151+
console.log(type);
152+
this.sortType = type;
153+
let data = {
154+
hashName: this.hashtagName,
155+
pageIdx: 0,
156+
sortType: this.sortType
157+
}
158+
this.asyncSetHashContentlist(data);
159+
},
147160
},
148161
components: {
149162
'video-card': VideoCard,
150163
'subscribe-modal': subscribeModal,
151164
'more-menu': moreMenu
152165
},
153-
mounted() {
154-
this.asyncSetHashContentlist('#DRAMA');
166+
created() {
167+
let data = {
168+
hashName: this.hashtagName,
169+
pageIdx: 0,
170+
sortType: this.sortType
171+
}
172+
this.asyncSetHashContentlist(data);
155173
this.asyncSetHashlist({
156174
pageIdx: 0,
157175
userIdx: 1
158176
});
159-
177+
this.hashtagName = this.getHashlist[0].hashName;
160178
}
161179
}
162180
</script>

src/store/action.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,19 @@ export const subscribeAction = {
113113
asyncSetHashContentlist({
114114
commit
115115
}, payload) {
116-
// let data = payload;
117116
var config = {
118117
headers: {
119118
'Content-Type': 'application/x-www-form-urlencoded',
120119
}
121120
};
122121
let data = {
123-
hashName : payload,
122+
hashName : payload.hashName,
124123
pageIdx : 0,
125-
sortType : 0
124+
sortType : payload.sortType
126125
}
127126
console.log('asyncSetHashContentlist');
128-
axios.post(api + '/subscribe/hashcontentlist', data,config).then(res => {
127+
axios.post(api + '/subscribe/hashcontentlist', data).then(res => {
128+
console.log('axios.post. hashContentlist')
129129
commit('setHashContentlist', res.data.data[0].contents_list);
130130
})
131131
},

src/store/store.js

+2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ Vue.use(Vuex);
4949

5050
export default new Vuex.Store({
5151
state: Object.assign({}, homeState, searchState, requestState, commentState, replyState, libarayState, subscribeState, contentsState, writeState),
52+
5253
getters: Object.assign({}, homeGetters, searchGetters, requestGetters, commentGetters, replyGetters, libraryGetters, subscribeGetters, contentsGetters,writeGetters),
5354
mutations: Object.assign({}, homeMutations, searchMutations, requestMutations, commentMutations, replyMutations, libraryMutatoins, subscribeMutations, contentsMutation,writeMutations),
5455
actions: Object.assign({}, homeAction, searchAction, requestAction, commentAction, replyAction, libraryAction, subscribeAction, contentsAction,writeAction)
5556

57+
5658
});

0 commit comments

Comments
 (0)