index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <view class='product-bg'>
  3. <swiper :indicator-dots="indicatorDots" indicator-active-color="#e93323" :circular="circular"
  4. :interval="interval" :duration="duration">
  5. <block v-for="(item,index) in imgUrls" :key='index'>
  6. <swiper-item>
  7. <image :src="item" class="slide-image" @click='getpreviewImage(item)' mode="aspectFit" />
  8. <!-- <view class="stop" v-if="isType == 2">
  9. <image class="image" src="/static/images/stop.png"></image>
  10. </view> -->
  11. </swiper-item>
  12. </block>
  13. </swiper>
  14. </view>
  15. </template>
  16. <script>
  17. // +----------------------------------------------------------------------
  18. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  19. // +----------------------------------------------------------------------
  20. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  21. // +----------------------------------------------------------------------
  22. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  23. // +----------------------------------------------------------------------
  24. // | Author: CRMEB Team <admin@crmeb.com>
  25. // +----------------------------------------------------------------------
  26. export default {
  27. props: {
  28. imgUrls: {
  29. type: Array,
  30. default: function() {
  31. return [];
  32. }
  33. },
  34. videoline: {
  35. type: String,
  36. value: ""
  37. },
  38. isType: {
  39. type: Number,
  40. default: 1
  41. }
  42. },
  43. data() {
  44. return {
  45. indicatorDots: true,
  46. circular: true,
  47. autoplay: true,
  48. interval: 5000,
  49. duration: 500,
  50. currents: "1",
  51. controls: true,
  52. isPlay: true,
  53. videoContext: ''
  54. };
  55. },
  56. created() {
  57. },
  58. watch: {
  59. },
  60. mounted() {
  61. // #ifndef APP-PLUS
  62. this.videoContext = uni.createVideoContext('myVideo', this);
  63. // #endif
  64. },
  65. methods: {
  66. getpreviewImage: function(item) {
  67. uni.previewImage({
  68. urls: this.imgUrls,
  69. current: item
  70. });
  71. },
  72. change: function(e) {
  73. this.$set(this, 'currents', e.detail.current + 1);
  74. }
  75. }
  76. }
  77. </script>
  78. <style scoped lang="scss">
  79. .product-bg {
  80. width: 710rpx;
  81. height: 710rpx;
  82. position: relative;
  83. }
  84. .product-bg swiper {
  85. width: 100%;
  86. height: 100%;
  87. position: relative;
  88. }
  89. .product-bg .slide-image {
  90. width: 100%;
  91. height: 100%;
  92. border-radius: 16rpx;
  93. }
  94. .product-bg .pages {
  95. position: absolute;
  96. background-color: #fff;
  97. height: 34rpx;
  98. padding: 0 10rpx;
  99. border-radius: 3rpx;
  100. right: 30rpx;
  101. bottom: 30rpx;
  102. line-height: 34rpx;
  103. font-size: 24rpx;
  104. color: #050505;
  105. }
  106. #myVideo {
  107. width: 100%;
  108. height: 100%
  109. }
  110. .product-bg .item {
  111. position: relative;
  112. width: 100%;
  113. height: 100%;
  114. }
  115. .product-bg .item .poster {
  116. position: absolute;
  117. top: 0;
  118. left: 0;
  119. height: 750rpx;
  120. width: 100%;
  121. z-index: 9;
  122. }
  123. .product-bg .item .poster .image {
  124. width: 100%;
  125. height: 100%;
  126. }
  127. .product-bg .item .stop {
  128. position: absolute;
  129. top: 50%;
  130. left: 50%;
  131. width: 136rpx;
  132. height: 136rpx;
  133. margin-top: -68rpx;
  134. margin-left: -68rpx;
  135. z-index: 9;
  136. }
  137. .product-bg .item .stop .image {
  138. width: 100%;
  139. height: 100%;
  140. }
  141. </style>