group-item.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class="group-item" @click="showGroupInfo()">
  3. <view class="avatar">
  4. <image class="head-image" :src="group.headImage" lazy-load="true" mode="aspectFill"></image>
  5. </view>
  6. <view class="text">
  7. <view>{{ group.remark}}</view>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. name: "group-item",
  14. data() {
  15. return {}
  16. },
  17. methods:{
  18. showGroupInfo(){
  19. uni.navigateTo({
  20. url:"/pages/group/group-info?id="+this.group.id
  21. })
  22. },
  23. },
  24. props: {
  25. group: {
  26. type: Object
  27. }
  28. }
  29. }
  30. </script>
  31. <style scope lang="scss">
  32. .group-item {
  33. height: 120rpx;
  34. display: flex;
  35. margin-bottom: 1rpx;
  36. position: relative;
  37. padding-left: 30rpx;
  38. align-items: center;
  39. padding-right: 10rpx;
  40. background-color: white;
  41. white-space: nowrap;
  42. &:hover {
  43. background-color: #eeeeee;
  44. }
  45. .avatar {
  46. display: flex;
  47. justify-content: center;
  48. align-items: center;
  49. width: 100rpx;
  50. height: 100rpx;
  51. .head-image{
  52. width: 100%;
  53. height: 100%;
  54. border-radius: 10%;
  55. border: #eeeeee solid 1px;
  56. }
  57. }
  58. .text {
  59. font-size: 36rpx;
  60. margin-left: 30rpx;
  61. flex: 1;
  62. display: flex;
  63. flex-direction: column;
  64. justify-content: space-around;
  65. height: 100%;
  66. flex-shrink: 0;
  67. overflow: hidden;
  68. }
  69. }
  70. </style>