<template>
  <div class="wrapper">
    <div class="box">
      <img src="https://www.smart-zj.cn:55901/imagems/43697fbf-73b5-4bc8-a751-5c7a08b58452.jpg" class="icon"
        @click="jump('1')" />
      <p class="title">办电镇合意</p>
    </div>
    <div class="box">
      <img src="https://www.smart-zj.cn:55901/image/wangshangguowang.png" class="icon" @click="jump('2')" />
      <p class="title">供电服务</p>
    </div>
  </div>
</template>

<script>
import axios from 'axios'

export default {
  data() {
    return {
      userInfo: {},
    };
  },
  methods: {
    jump(type) {
      if (type === "1") {
        axios({
          url: 'https://wx.suywater.info/wx-zhy/system/wxIntegrat/queryOpenLink',
          method: 'post',
          headers: {
            'Content-Type': "application/json",
          },
          responseType: 'json'
        }).then((res) => {
          if (res.data.data) {
            window.location.href = res.data.data
          } else {
            this.$dialog.confirm({
              message: "请稍后重试",
              showCancelButton: false,
            })
          }
        }).catch(() => {
          this.$dialog.confirm({
            message: "请稍后重试",
            showCancelButton: false,
          })
        })
      } else if (type === "2") {
        window.location.href =
          `https://wsgwzw.jsnyyw.cn:18443/sgcc/zhenjiang/#/`
      }
    },
  },
  mounted() {
  },
  created() {
  },
};
</script>

<style lang="stylus" scoped>
.wrapper {
  padding 20px 30px;
  display: flex;
  flex-wrap: wrap;
  background-color: #FFF;

  .box {
    width 33%;
    height 160px;
    display flex;
    flex-direction column
    align-items center;
    justify-content center

    .icon {
      width 80px;
      height 80px
    }

    .title {
      font-size: 24px;
      margin-top: 16px;
      color: #333333;
    }
  }
}
</style>
