<template>
<view class="div floor-ad" :style="'height:'+(windowWidth*115/375)+'px'" v-if="ad">
<image mode="aspectFit" class="img" :src="ad.adv_code" @click="goAdUrl(ad)"/>
</view>
</template>

<script>
import { urlencode } from '@/util/common'
export default {
  name: 'IndexFloorAds',
  data () {
    return {
    }
  },
  props: ['ad'],
  computed: {
    windowWidth: function () {
      const res = uni.getSystemInfoSync()
          var width=res.windowWidth
      return width
    },
  },
  methods: {
    goAdUrl (item) {
      uni.navigateTo({url:item.adv_typedate})
    }
  }
}
</script>

<style scoped lang="scss">
.floor-ad{background: #fff;padding-left:$pageSpace;padding-right:$pageSpace;padding-bottom:$modelSpace}
.floor-ad .img{width:100%;border-radius:.4rem;}
</style>
