IndexFloorAds.vue 785 B

12345678910111213141516171819202122232425262728293031323334
  1. <template>
  2. <view class="div floor-ad" :style="'height:'+(windowWidth*115/375)+'px'" v-if="ad">
  3. <image mode="aspectFit" class="img" :src="ad.adv_code" @click="goAdUrl(ad)"/>
  4. </view>
  5. </template>
  6. <script>
  7. import { urlencode } from '@/util/common'
  8. export default {
  9. name: 'IndexFloorAds',
  10. data () {
  11. return {
  12. }
  13. },
  14. props: ['ad'],
  15. computed: {
  16. windowWidth: function () {
  17. const res = uni.getSystemInfoSync()
  18. var width=res.windowWidth
  19. return width
  20. },
  21. },
  22. methods: {
  23. goAdUrl (item) {
  24. uni.navigateTo({url:item.adv_typedate})
  25. }
  26. }
  27. }
  28. </script>
  29. <style scoped lang="scss">
  30. .floor-ad{background: #fff;padding-left:$pageSpace;padding-right:$pageSpace;padding-bottom:$modelSpace}
  31. .floor-ad .img{width:100%;border-radius:.4rem;}
  32. </style>