t-i-banner - 标题与图片分离的备份.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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="item.id" @click="go_link(item.jumpURL)">
  6. <view class="item">
  7. <view class="img">
  8. <image :src="item.imgURL"></image>
  9. </view>
  10. <view class="title">
  11. <view>{{item.title}}</view>
  12. <view class="num">
  13. — <text> {{index+1}} </text> —
  14. </view>
  15. </view>
  16. </view>
  17. </swiper-item>
  18. </swiper>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. name:"t-i-banner",
  25. props: [
  26. "banner",
  27. "mine_code"
  28. ],
  29. data() {
  30. return {
  31. }
  32. },
  33. methods:{
  34. go_link(link){
  35. console.log(link)
  36. // 二维码
  37. if (link.indexOf("pageId") != -1 && link.indexOf("app:") == -1) {
  38. let pageId = ""
  39. function GetQueryString(name) {
  40. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  41. var r = link.match(reg);
  42. if (r != null) return unescape(r[2]);
  43. return null;
  44. }
  45. console.log(GetQueryString("pageId"))
  46. if (GetQueryString("pageId")) {
  47. pageId = GetQueryString("pageId")
  48. } else {
  49. pageId = link.split('=')[1]
  50. }
  51. uni.navigateTo({
  52. url: "../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  53. })
  54. }// h5
  55. if (link.indexOf("pageId") == -1 && link.indexOf("app:") == -1) {
  56. console.log("H5")
  57. uni.navigateTo({
  58. url:"../../index/h5/h5?url=" + link
  59. })
  60. }
  61. },
  62. animationfinish($event){
  63. this.$emit('change_top_bg_color_img',$event.detail.current)
  64. }
  65. }
  66. }
  67. </script>
  68. <style lang="scss">
  69. .banner{
  70. margin-top: -60rpx;
  71. .box{
  72. width: 750rpx;
  73. height: 620rpx;
  74. .item{
  75. width: 750rpx;
  76. .img{
  77. text-align: center;
  78. image{
  79. width: 700rpx;
  80. height: 485rpx;
  81. border-radius: 20rpx;
  82. }
  83. }
  84. .title{
  85. box-sizing: border-box;
  86. padding: 0 25rpx;
  87. width: 750rpx;
  88. height: 130rpx;
  89. line-height: 1.5;
  90. font-size: 32rpx;
  91. position: relative;
  92. .num{
  93. position: absolute;
  94. bottom: 35rpx;
  95. right: 25rpx;
  96. color: #ACB0AC;
  97. text{
  98. color: #23A2EE;
  99. }
  100. }
  101. }
  102. }
  103. }
  104. }
  105. </style>