e-browse - 副本.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <view class="browse">
  3. <view class="title">浏览记录</view>
  4. <view class="list">
  5. <view class="item" v-for="(item,index) in browse" :key="index">
  6. <view class="img">
  7. <view v-if="item.img == '' || item.img == 'none'">
  8. <image :src="item.img" mode=""></image>
  9. </view>
  10. <view v-else>
  11. <view class="img_tip" :style="{backgroundColor:bgColor[index]}">
  12. {{item.name.split('').pop()}}
  13. </view>
  14. </view>
  15. </view>
  16. <view class="name">{{item.name}}</view>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. props:[
  24. "browse",
  25. "bgColor"
  26. ],
  27. data() {
  28. return {
  29. };
  30. }
  31. }
  32. </script>
  33. <style lang="scss">
  34. .browse{
  35. margin-top: 20px;
  36. margin-bottom: 40px;
  37. .title {
  38. line-height: 30px;
  39. border-left: 4px solid #009FE8;
  40. border-radius: 4px;
  41. padding-left: 10px;
  42. margin-bottom: 10px;
  43. }
  44. .list{
  45. overflow: hidden;
  46. .item{
  47. float: left;
  48. width: 140rpx;
  49. text-align: center;
  50. margin-bottom: 10px;
  51. .img{
  52. margin: 0 auto;
  53. margin-bottom: 5px;
  54. width: 120rpx;
  55. height: 120rpx;
  56. border-radius: 50%;
  57. overflow: hidden;
  58. image{
  59. width: 120rpx;
  60. height: 120rpx;
  61. }
  62. .img_tip{
  63. width: 120rpx;
  64. height: 120rpx;
  65. // background-color: skyblue;
  66. text-align: center;
  67. line-height: 120rpx;
  68. color: #FFFFFF;
  69. }
  70. }
  71. .name{
  72. width: 140rpx;
  73. white-space: nowrap;
  74. overflow: hidden;
  75. text-overflow: ellipsis;
  76. }
  77. }
  78. }
  79. }
  80. </style>