Banner.vue 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <view style="margin: 0 auto;" :style="{ width: modelData.style === 2 ? '710rpx' : '750rpx' }">
  3. <u-swiper
  4. :height="modelData.style === 2 ? '300' : '350'"
  5. :interval="modelData.interval * 1000"
  6. :list="modelData.bannerList"
  7. name="img"
  8. :autoplay="modelData.autoplay"
  9. :effect3d="false"
  10. bg-color="transparent"
  11. :border-radius="modelData.style === 2 ? '24' : '0'"
  12. @click="navTo"
  13. ></u-swiper>
  14. <NoLoginTip @cancel="cancelTip" :show="loginTip" v-if="loginTip" />
  15. </view>
  16. </template>
  17. <script>
  18. import NoLoginTip from '../../NoLoginTip.vue';
  19. export default {
  20. components: {
  21. NoLoginTip
  22. },
  23. props: {
  24. modelData: {
  25. type: Object,
  26. default: () => {
  27. return {};
  28. }
  29. }
  30. },
  31. data() {
  32. return {
  33. loginTip: false
  34. };
  35. },
  36. methods: {
  37. cancelTip() {
  38. this.loginTip = false;
  39. },
  40. navTo(index) {
  41. if (!this.$common.isLogin()) {
  42. this.loginTip = true;
  43. } else {
  44. this.goPage(this.modelData.bannerList[index].url, this.modelData.bannerList[index].switchTab);
  45. }
  46. }
  47. }
  48. };
  49. </script>
  50. <style scoped lang="scss"></style>