banner.vue 819 Bytes
<template>
  <div class="banner">
    <img :src="resource" alt="">
    <div class="link" @click="onClick"></div>
  </div>
</template>

<script>
import {createNamespacedHelpers} from 'vuex';

const {mapState} = createNamespacedHelpers('gain');

export default {
  computed: {
    ...mapState(['resource'])
  },
  methods: {
    onClick() {
      this.$yoho.goNewPage({
        url: 'http://m.yohobuy.com/activity/have-gain/apply?title=有货有赚介绍&openby:yohobuy={"action":"go.h5","params":{"title":"有货有赚介绍","url":"http://m.yohobuy.com/activity/have-gain/apply"}}'
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.banner {
  img {
    position: relative;
    width: 100%;
  }

  .link {
    position: absolute;
    width: 200px;
    height: 200px;
    top: 0;
    right: 0;
  }
}
</style>