金诚优选前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
1.5 KiB

4 years ago
  1. <template>
  2. <view class="content" v-if="value && list.length">
  3. <view class="box">
  4. <swiper class="swiper" :circular="true"
  5. indicator-active-color="#0091ff"
  6. :current="current"
  7. :indicator-dots="list.length > 1">
  8. <swiper-item v-for="(item, index) in list" :key="index">
  9. <image class="img" :src="item.image" mode="aspectFill" @click="clickAd(item)"></image>
  10. </swiper-item>
  11. </swiper>
  12. <view class="close" @click="close">
  13. <text class="lf-iconfont icon-cuo1" style="color: #FFFFFF;"></text>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. props: {
  21. value: {
  22. type: Boolean,
  23. default: true
  24. },
  25. list: {
  26. type: Array,
  27. default: []
  28. }
  29. },
  30. data(){
  31. return {
  32. }
  33. },
  34. created(){
  35. },
  36. methods: {
  37. clickAd(item){
  38. this.$url(item.url);
  39. },
  40. close(){
  41. this.$emit('update:value', false);
  42. }
  43. }
  44. }
  45. </script>
  46. <style lang="scss" scoped="scoped">
  47. .content{
  48. width: 100vw;
  49. height: 100vh;
  50. display: flex;
  51. justify-content: center;
  52. align-items: center;
  53. position: fixed;
  54. left: 0;
  55. top: 0;
  56. z-index: 99;
  57. .box{
  58. width: 600rpx;
  59. height: max-content;
  60. .swiper{
  61. width: 600rpx;
  62. height: 840rpx;
  63. .img{
  64. width: 100%;
  65. height: 100%;
  66. }
  67. }
  68. .close{
  69. width: 70rpx;
  70. height: 70rpx;
  71. margin: 34rpx auto 0;
  72. border-radius: 50%;
  73. display: flex;
  74. justify-content: center;
  75. align-items: center;
  76. text{
  77. font-size: 80rpx;
  78. }
  79. }
  80. }
  81. }
  82. </style>