t-i-banner.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view>
  3. <view class="banner">
  4. <swiper class="box" autoplay circular @animationfinish="animationfinish">
  5. <swiper-item v-for="(item,index) in banner" :key="index" @click="go_link(item.jumpURL)">
  6. <view class="item">
  7. <view class="img">
  8. <image :src="item.imgURL" mode="aspectFill"></image>
  9. </view>
  10. <view class="title">
  11. <view class="text">{{item.title}}</view>
  12. <view class="num">
  13. <!-- — <text> {{index+1}} </text> — -->
  14. <text>{{index+1}} / {{banner.length}}</text>
  15. </view>
  16. </view>
  17. </view>
  18. </swiper-item>
  19. </swiper>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import {goToLink} from "@/common/common.js"
  25. export default {
  26. name:"t-i-banner",
  27. props: [
  28. "banner",
  29. "mine_code"
  30. ],
  31. data() {
  32. return {
  33. }
  34. },
  35. methods:{
  36. go_link(link){
  37. console.log(link)
  38. let item = {
  39. link:link
  40. }
  41. goToLink(item,this.mine_code)
  42. },
  43. animationfinish($event){
  44. this.$emit('change_top_bg_color_img',$event.detail.current)
  45. }
  46. }
  47. }
  48. </script>
  49. <style lang="scss">
  50. .banner{
  51. margin-top: -60rpx;
  52. .box{
  53. width: 750rpx;
  54. height: 430rpx;
  55. .item{
  56. width: 750rpx;
  57. position: relative;
  58. .img{
  59. text-align: center;
  60. image{
  61. width: 700rpx;
  62. height: 400rpx;
  63. border-radius: 20rpx;
  64. }
  65. }
  66. .title{
  67. position: absolute;
  68. left: 0;
  69. bottom: 0;
  70. box-sizing: border-box;
  71. padding: 15rpx 50rpx;
  72. width: 750rpx;
  73. line-height: 1.5;
  74. font-size: 32rpx;
  75. display: flex;
  76. justify-content: space-between;
  77. .text{
  78. width: 520rpx;
  79. color: #FFFFFF;
  80. overflow: hidden;
  81. text-overflow: ellipsis;
  82. white-space: nowrap;
  83. }
  84. .num{
  85. color: #ACB0AC;
  86. text{
  87. // color: #23A2EE;
  88. color: #FFFFFF;
  89. }
  90. }
  91. }
  92. }
  93. }
  94. }
  95. </style>