<template>
  <div id="partyHome" class="app">
    <van-image
      class="bannerImage"
      :src="require('../../assets/image/partySchool.jpg')"
    />
    <van-cell-group>
      <van-cell
        title="两学一做"
        @click="() => toUrl('0', '两学一做')"
        clickable
        is-link
      />
      <van-cell
        title="党建视频"
        @click="() => toUrl('1', '党建视频')"
        clickable
        is-link
      />
      <van-cell
        title="党规党章"
        @click="() => toUrl('2', '党规党章')"
        clickable
        is-link
      />
      <van-cell
        title="党史精辟"
        @click="() => toUrl('3', '党史精辟')"
        clickable
        is-link
      />
      <van-cell
        title="党课学习"
        @click="() => toStudy('8', '党课学习')"
        clickable
        is-link
      />
    </van-cell-group>
  </div>
</template>

<script>
import {
  Image as VanImage,
  Cell as vanCell,
  CellGroup as vanCellGroup
} from "vant";
import "vant/lib/image/style";
import "vant/lib/cell-group/style";
import "vant/lib/cell/style";

export default {
  name: "app",
  data: function() {
    return {};
  },
  methods: {
    toUrl(id, title) {
      console.log("跳转专题", id);
      window.parent
        ? (window.parent.location.href =
            "./special.html?id=" + id + "&name=" + title)
        : (location.href = "./special.html?id=" + id + "&name=" + title);
    },
    toStudy(id, title) {
      console.log("跳转专题");
      window.parent
        ? (window.parent.location.href =
            "./partyStudy.html?id=" + id + "&name=" + title)
        : (location.href = "./partyStudy.html?id=" + id + "&name=" + title);
    }
  },
  mounted() {},
  beforeDestroy: function() {},
  components: { VanImage, vanCellGroup, vanCell }
};
</script>
<style lang="scss">
#partyHome {
  width: 100%;
  height: 100%;
  img {
    width: 100%;
  }
}
</style>
