my-reply-card.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <div class="card">
  3. <CardBox style="padding: 15px 20px" :btnList="btnList" v-on="$listeners">
  4. <div class="header">
  5. <CardHeader
  6. :avatar="userInfo.headimg"
  7. :name="userInfo.name"
  8. :time="info.create_at"
  9. :btnList="[]"
  10. />
  11. </div>
  12. <div class="content">
  13. <CardContent :content="`@${info.user_name}:${info.content}`" />
  14. </div>
  15. <div class="target" @click="$emit('handleToDetail')">
  16. <CardContent
  17. style="margin-bottom: 10px"
  18. :content="`@${info.parent_comment.name}:${info.parent_comment.content}`"
  19. />
  20. <CardCoverDetail
  21. :info="{
  22. app_logo: info.parent_comment.app_logo,
  23. app_name: info.parent_comment.app_name,
  24. cover: info.parent_comment.cover,
  25. title: info.parent_comment.title,
  26. series_title: info.parent_comment.series_title,
  27. ...info,
  28. }"
  29. :num_icon="require('@/assets/icon/eye.png')"
  30. />
  31. </div>
  32. </CardBox>
  33. </div>
  34. </template>
  35. <script>
  36. import CardBox from "../card-module/card-box.vue";
  37. import CardHeader from "../card-module/card-header.vue";
  38. import CardContent from "../card-module/card-content.vue";
  39. import CardCoverDetail from "../card-module/card-cover-detail.vue";
  40. export default {
  41. name: "MyReplyCard",
  42. components: { CardBox, CardHeader, CardContent, CardCoverDetail },
  43. props: {
  44. info: {
  45. type: Object,
  46. },
  47. manageType: {
  48. type: Boolean,
  49. default: false,
  50. },
  51. },
  52. data() {
  53. return {};
  54. },
  55. computed: {
  56. btnList() {
  57. let arr = ["del"];
  58. return this.manageType ? [] : arr;
  59. },
  60. userInfo() {
  61. return this.$store.state.userInfo;
  62. },
  63. },
  64. };
  65. </script>
  66. <style lang="scss" scoped>
  67. .card {
  68. width: 100%;
  69. height: 100%;
  70. .content {
  71. margin: 10px 0;
  72. }
  73. .target {
  74. background: #f4f4f4;
  75. width: calc(100% - 20px);
  76. padding: 10px;
  77. }
  78. }
  79. </style>