<template>
  <view class='detail'>
    <component :is="componentType"></component>
  </view>
</template>

<script>
import JoinHall from './component/hall';
import JoinGame from './component/game';
import JoinTown from './component/town';

export default {
  data() {
    return {
      type: '1'
    }
  },
  components: {
    JoinHall,
    JoinGame,
    JoinTown
  },
  computed: {
    componentType() {
      if (this.type == 1) {
        return 'join-hall'
      } else if (this.type == 2) {
        return 'join-game'
      } else if (this.type == 3) {
        return 'join-town'
      }
      return ''
    }
  },

  onLoad(options) {
    this.type = options.type
    let title = '逻辑狗思维体育馆';
    if (this.type == 1) {
      title = '逻辑狗思维体育馆'
    } else if (this.type == 2) {
      title = '思维芯教室'
    } else if (this.type == 3) {
      title = '逻辑狗探索小镇'
    } else {
      title = '逻辑狗思维体育馆';
    }
    uni.setNavigationBarTitle({
      title: title
    });
  },

  onShow() {

  },

  methods: {

  }

}
</script>

<style lang="scss" scoped>
</style>

