| xqd
@@ -52,6 +52,7 @@ import TabBar from '../../components/TabBar/index'
|
|
|
import NavBar from '../../components/NavBar/index'
|
|
|
import Recent from './components/Recent'
|
|
|
import CheckLogin from '../../components/CheckLogin/index'
|
|
|
+import { mapState } from 'vuex'
|
|
|
export default {
|
|
|
components: { CheckLogin, Recent, NavBar, TabBar, EpisodeBox, SwiperBox },
|
|
|
data() {
|
| xqd
@@ -63,16 +64,24 @@ export default {
|
|
|
3: 'news',
|
|
|
4: 'rank'
|
|
|
},
|
|
|
- homeColumn: []
|
|
|
+ homeColumn: [],
|
|
|
+ parent_id: 0
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
isLogin() {
|
|
|
return this.$api.user.isLogin()
|
|
|
- }
|
|
|
+ },
|
|
|
+ ...mapState({
|
|
|
+ userInfo: seate => seate.user.info
|
|
|
+ })
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
this.isLogin && this.getHomeColumn()
|
|
|
+ this.parent_id = typeof options.user_id !== 'undefined' ? options.user_id : 0
|
|
|
+ if (this.parent_id && !this.userInfo.parent_id) {
|
|
|
+ this.bindParent()
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
handleSearch() {
|
| xqd
@@ -94,7 +103,16 @@ export default {
|
|
|
obj.type = this.homeColumnType[obj.type]
|
|
|
})
|
|
|
})
|
|
|
+ },
|
|
|
+ bindParent() {
|
|
|
+ this.$api.user.bind(this.parent_id).then(res => {
|
|
|
+ console.log('-->bind success')
|
|
|
+ this.$store.dispatch('user/info', res.data)
|
|
|
+ })
|
|
|
}
|
|
|
+ },
|
|
|
+ onShareAppMessage() {
|
|
|
+ return this.$util.shareMessage(this.userInfo)
|
|
|
}
|
|
|
}
|
|
|
</script>
|