<template>
  <div class="type-box">
    <back-bar title="群类型设置" v-if="meechatType=='h5'">
      <el-button type="primary" class="btn-comfirm">{{$t('public.complete')}}</el-button>
    </back-bar>
    <div class="box-hd" v-else>
      <h2>群类型设置</h2>
    </div>
    <div class="box-bd">
      <div class="type">
        <div class="type-hd">
          公开群
          <label role="radio" class="el-radio is-checked">
            <span class="el-radio__input is-checked">
              <span class="el-radio__inner"></span>
              <input v-model="groupType" type="radio" name="type" class="el-radio__original" value="1">
            </span>
          </label>
        </div>
        <div class="type-bd">
          公开群会在搜索结果或推荐群组中显示，并且群聊信
          息公开，所有人可见；新成员入群不需验证
        </div>
      </div>
      <div class="type">
        <div class="type-hd">
          私密群
          <label role="radio" class="el-radio is-checked">
            <span class="el-radio__input is-checked">
              <span class="el-radio__inner"></span>
              <input v-model="groupType" type="radio" name="type" class="el-radio__original" value="2">
            </span>
          </label>
        </div>
        <div class="type-bd">
          私密群不会再搜索结果或搜索群组中显示，并且群聊
          信息公开，所有人可见；新成员入群不需要验证
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Vue from 'vue'
import backBar from '@/components/backBar'
import { getMeechatType } from '@/util/util'
import { Radio } from 'element-ui'

Vue.component(Radio.name, Radio)

export default {
  components: {
    backBar
  },
  data () {
    return {
      groupType: '1',
      meechatType: getMeechatType()
    }
  },
  methods: {
    changeType () {
      console.log('changeType', this.groupType)
    }
  }
}
</script>

<style lang="scss" scoped>
.type-box {
  font-size: 14px;
  width: 294px;
  text-align: left;
}
.box-hd {
  h2 {
    color: #333333;
    font-weight: 700;
    text-align: center;
  }
}

.type {
  font-size: 14px;
  color: #999;
  line-height: 20px;
  border-top: 1px solid #eeeeee;
  padding: 10px 0;
  &:first-child {
    border: none;
  }
}
.type-hd {
  display: flex;
  justify-content: space-between;
  color: #333;
  padding-bottom: 10px;
}
.el-radio__label {
  display: none;
}
</style>
