

<template>
  <div class="wrap" :style="wrapStyle" @click="onClick">
    <div class="lc-result" :style="{paddingTop: setPaddingTop }">
      <image class="result-image"
             :aria-hidden="true"
             :src="icon"></image>
      <div class="result-content">
        <text class="content-title">{{title}}</text>
        <text class="content-desc">{{desc}}</text>
      </div>
    </div>
  </div>
</template>

<style scoped>
  .wrap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }

  .lc-result {
    width: 750px;
    flex: 1;
    align-items: center;
    background-color: #f2f3f4;
  }

  .result-image {
    width: 184px;
    height: 184px;
  }

  .result-content {
    margin-top: 60px;
    align-items: center;
  }

  .content-title {
    height: 42px;
    line-height: 42px;
    text-align: center;
    font-size: 34px;
    color: #4A4A4A;
  }

  .content-desc {
    margin-top: 32px;
    color: #787878;
    font-size: 26px;
  }
</style>

<script>
  export default {
    props: {
      icon: {
        type: String,
      },
      title: {
        type: String,
      },
      desc:{
        type:String
      },
      wrapStyle: Object,
      paddingTop: {
        type: [Number, String],
        default: 232
      }
    },
    computed: {
      setPaddingTop () {
        const paddingTop = this.paddingTop;
        return `${paddingTop}px`
      }
    },
    methods: {
      handleTouchEnd (e) {
        // web上面有点击穿透问题
        const { platform } = weex.config.env;
        platform === 'Web' && e.preventDefault && e.preventDefault();
      },
      onClick () {
        const { title, desc } = this;
        this.$emit('onResultClick', {title,desc})
      }
    }
  };
</script>
