<template>
  <div>
    <!--标题-->
    <div class="top-bar">
      <div @click="_back">
        <img src="../../../../static/image/back.png">
      </div>
      <div>{{title}}</div>
      <div @click="_save">完成</div>
    </div>
    <!--提示信息-->
    <div class="result-cont" style="margin-top: 60px">
      <div class="phone_edit">
        <group>
          <x-input title="联系QQ" v-model="qq" placeholder="请输入联系QQ"></x-input>
        </group>
      </div>
    </div>
  </div>
</template>

<script>
  import {XInput, Group} from 'vux'
  import Global from '../../../api/config'

  export default {
    components: {
      XInput,
      Group,
    },
    data() {
      return {
        title: '修改联系QQ',
        id: this.$route.query.id,
        qq: this.$route.query.data.qq,
      }
    },
    methods: {
      //保存信息
      _save() {
        if (this.qq) {
          let data = {
            qq: this.qq
          };
          this.$store.dispatch('SystemManage/userEdit', {id: this.id, obj: data}).then(() => {
            if (this.$store.state.SystemManage.success) {
              this._back();
            }
          });
        } else {
          this._msg('QQ不能为空！');
        }
      },
      //提示
      _msg(msg) {
        this.$vux.toast.show({
          type: 'text',
          width: '10em',
          text: msg,
          time: 1000
        });
      },
      _back() {
        this.$router.go(-1);
      },
    }
  }
</script>
