<template>
  <div id="detail">
    <admin-frame topType="2" @back="back" :rightArrow="false" :usePage="false" :useNav="false">
      <template v-slot:info>
        <info-1 :info="info"></info-1>
      </template>
    </admin-frame>
  </div>
</template>

<script>
import info1 from './parts/info-1.vue';
import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
import { mapState, createNamespacedHelpers } from 'vuex';
const { mapActions: news } = createNamespacedHelpers('news');
export default {
  name: 'index',
  props: {},
  components: {
    adminFrame,
    info1,
  },
  data: function () {
    return {
      info: {},
    };
  },
  async created() {
    if (this.id) await this.search();
  },
  methods: {
    ...news(['fetch']),
    async search() {
      let res = await this.fetch(this.id);
      if (this.$checkRes(res)) {
        this.$set(this, `info`, res.data);
      }
    },
    // 返回
    back() {
      this.$router.push({ path: '/service/interflow/index' });
    },
  },
  computed: {
    ...mapState(['user']),
    id() {
      return this.$route.query.id;
    },
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  watch: {
    test: {
      deep: true,
      immediate: true,
      handler(val) {},
    },
  },
};
</script>

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