<template>
  <div class="wrap">
    <div class="actions">
      <p class="page-name">页面设置/{{ columnName }}</p>
      <div>
        <el-button type="primary" @click="preview">预览</el-button>
        <el-button @click="save(0)">保存为草稿</el-button>
        <el-button type="primary" @click="save(1)">发布</el-button>
        <el-button @click="back">放弃编辑</el-button>
      </div>
    </div>

    <div class="modules">
      <div class="relative">
        <div class="single-banner single-banner-overview">
          <img class="banner-img" :src="modules[0].form.pic" alt="">
          <div class="texts">
            <h6 class="banner-title">{{ modules[0].form.title }}</h6>
          </div>
        </div>
        <div class="cover" @click="toSet(0)">点击更换banner与链接</div>
      </div>

      <ul class="tabs wow fadeInLeft">
        <template v-for="(item, i) in tabs">
          <li :class="{ active: i == active }" :key="i" @click="tabChange(i)">{{ item }}</li>
        </template>
      </ul>

      <div class="tab-content">
        <div class="c-wrap">
          <div v-html="modules[1].form.des"></div>
          <div class="cover" style="min-height: 300px;" @click="toSet(1)">点击更换描述</div>
        </div>
      </div>
    </div>

    <Module ref="module" :data.sync="curData" :visible.sync="diaVisible" @moduleSubmit="moduleSubmit" />
  </div>
</template>

<script>
import mixins from '@/mixins/page'
import Modules from '@/const/modules'
export default {
  mixins: [mixins],
  data () {
    return {
      modules: Modules.overviewLocation,
      active: 0,
      tabs: ['地理位置']
    }
  },
  mounted () { },
  methods: {
    // tab回调
    tabChange (i) {
      this.active = i
    },
  }
};
</script>

<style lang="scss" scoped>
@import "../../../styles/page/page.scss";

.wrap {
  background: url(../../../assets/images/survey1.png) (0 559px)/auto no-repeat,
    url(../../../assets/images/survey2.png) (bottom right)/auto no-repeat;
}

.tabs {
  display: flex;
  justify-content: center;
  box-shadow: 0px 2px 10px 0px rgba(223, 223, 223, 0.28);

  li {
    padding: 25px 19px;
    margin: 0 10px;
    font-size: 22px;
    color: #333;
    border-bottom: 4px solid transparent;
    text-shadow: 0px 2px 14px rgba(167, 167, 167, 0.26);
    cursor: pointer;

    &.active {
      color: #1583FF;
      border-bottom-color: #1583FF;
    }
  }
}

.tab-content {
  width: 1000px;
  padding: 77px 0;
  margin: 0 auto;
}

.video {
  width: 100%;
  margin-bottom: 55px;
}

.text {
  font-size: 18px;
  color: #020202;
  line-height: 32px;
}
</style>