speaker.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template name="dever-speaker">
  2. <view class="grace-swiper-msg">
  3. <view class="grace-swiper-msg-icon" :class="[iconClass]" :style="{color:iconColor}"></view>
  4. <swiper :display-multiple-items="display" :vertical="vertical" autoplay="true" circular="true" :interval="interval" :style="{height:height}">
  5. <swiper-item v-for="(item, index) in msgs" :key="index" :style="{height:height}">
  6. <view class="grace-space-between grace-flex-vcenter margin-bottom-xs">
  7. <view>
  8. <text class="grace-icons icon-arrow-right text-sblue"></text>
  9. <text class="text-sm">{{item.name}}</text>
  10. </view>
  11. <view class="text-sm text-gray">{{item.date}}</view>
  12. </view>
  13. </swiper-item>
  14. </swiper>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. props: {
  20. msgs : {
  21. type : Array,
  22. default : function(){return [];}
  23. },
  24. iconClass : {
  25. type : String,
  26. default : ""
  27. },
  28. iconColor : {
  29. type : String,
  30. default : "#3688FF"
  31. },
  32. interval : {
  33. type : Number,
  34. default: 3000
  35. },
  36. vertical : {
  37. type : Boolean,
  38. default : true
  39. },
  40. fontSize : {
  41. type : String,
  42. default : "26rpx"
  43. },
  44. fontColor : {
  45. type : String,
  46. default : "#333333"
  47. },
  48. fontWeight : {
  49. type : String,
  50. default : ""
  51. },
  52. height:{
  53. type : String,
  54. default : "60rpx"
  55. },
  56. display:{
  57. type : Number,
  58. default: 1
  59. }
  60. }
  61. }
  62. </script>
  63. <style scoped>
  64. .grace-swiper-msg{width:100%; display:flex; flex-wrap:nowrap; align-items:center;}
  65. .grace-swiper-msg-icon{margin-right:16rpx; display:inline-block; flex-shrink:0;}
  66. .grace-swiper-msg swiper{width:100%; height:60rpx; overflow:hidden;}
  67. .grace-swiper-msg swiper-item{overflow:hidden;}
  68. .grace-swiper-msg navigator{line-height:60rpx; overflow:hidden;}
  69. </style>