commonItems.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="harder_box">
  3. <view class="box_banner">
  4. <view class="box_item">
  5. <view @click="detailsBtn(index)" class="banner_item" v-for="(item, index) in projectList" :key="item.index">
  6. <view class="banner_bgimg">
  7. <view class="banner_img">
  8. <image class="img" :src="item.image" mode="aspectFill"></image>
  9. </view>
  10. </view>
  11. <view class="item_tit">{{ item.title }}</view>
  12. </view>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. name: 'commonItems',
  20. props: {
  21. projectList: {
  22. type: Array,
  23. default: null
  24. },
  25. titList: {
  26. type: Array,
  27. default: null
  28. }
  29. },
  30. data() {
  31. return {
  32. };
  33. },
  34. onLoad() {
  35. console.log(this.titList, 555);
  36. },
  37. methods: {
  38. detailsBtn(i) {
  39. uni.navigateTo({
  40. url: `/pages/index2/fY_xiangQing/xiangMuXQ?id=${this.projectList[i].id}`
  41. });
  42. }
  43. }
  44. };
  45. </script>
  46. <style>
  47. .harder_box {
  48. position: relative;
  49. z-index: 1;
  50. width: 100%;
  51. height: 25vh;
  52. }
  53. .img {
  54. width: 100%;
  55. height: 100%;
  56. border-radius: 5px 25px 5px 25px;
  57. box-shadow: 0 3px 6px rgba(0, 0, 0, 0.56), -3px 0 6px rgba(0, 0, 0, 0.26);
  58. }
  59. .img::before {
  60. content: '';
  61. position: absolute;
  62. top: 0;
  63. left: 0;
  64. width: 100%;
  65. height: 100%;
  66. box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), -3px 0 6px rgba(0, 0, 0, 0.16);
  67. z-index: -1;
  68. }
  69. .box_banner {
  70. width: 82%;
  71. aspect-ratio: 10/1;
  72. /* height: 28%; */
  73. margin: auto;
  74. }
  75. .banner_img {
  76. position: absolute;
  77. top: 6%;
  78. left: 5%;
  79. width: 90%;
  80. height: 75%;
  81. }
  82. .banner_bgimg {
  83. position: relative;
  84. width: 100%;
  85. height: 100%;
  86. background: url('../../static/img/bg_logo.png') no-repeat center;
  87. background-size: 100% 100%;
  88. }
  89. .box_item {
  90. width: 100%;
  91. height: 100%;
  92. display: flex;
  93. flex-wrap: wrap;
  94. }
  95. .banner_item {
  96. width: 23%;
  97. height: 120%;
  98. margin-bottom: 2%;
  99. position: relative;
  100. margin-left: 2%;
  101. }
  102. .item_tit {
  103. width: 90%;
  104. position: absolute;
  105. top: 83%;
  106. left: 5%;
  107. text-align: center;
  108. z-index: 1;
  109. font-size: 10px;
  110. color: #fbfcdc;
  111. /* text-shadow: 0px 4px 0px #8e5938; */
  112. }
  113. </style>