鸿宇研学生前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
2.0 KiB

  1. <template>
  2. <view class="card">
  3. <view class="card-header">
  4. <view class="title">{{ data.title }}</view>
  5. <view class="desc">{{ data.createTime }}</view>
  6. </view>
  7. <view class="card-content">
  8. {{ data.content }}
  9. </view>
  10. <view class="card-footer">
  11. <button class="btn">了解详情</button>
  12. </view>
  13. <view v-if="data.new" class="dot"></view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. props: {
  19. data: {
  20. type: Object,
  21. default() {
  22. return {}
  23. }
  24. },
  25. },
  26. methods: {
  27. jumpToDetail() {
  28. this.$utils.navigateTo(`/pages_order/message/index?id=${this.data.id}`)
  29. },
  30. },
  31. }
  32. </script>
  33. <style scoped lang="scss">
  34. .card {
  35. position: relative;
  36. padding: 32rpx 32rpx 0 32rpx;
  37. font-family: PingFang SC;
  38. font-weight: 400;
  39. line-height: 1.4;
  40. background-image: linear-gradient(164deg,#DAF3FF 88rpx, #FBFEFF 176rpx, #FBFEFF);
  41. border: 2rpx solid #FFFFFF;
  42. &-header {
  43. .title {
  44. font-size: 32rpx;
  45. color: #181818;
  46. }
  47. .desc {
  48. margin-top: 4rpx;
  49. font-size: 24rpx;
  50. color: #999999;
  51. }
  52. }
  53. &-content {
  54. margin-top: 16rpx;
  55. font-size: 26rpx;
  56. line-height: 1.7;
  57. color: #666666;
  58. overflow: hidden;
  59. text-overflow: ellipsis;
  60. display:-webkit-box; //作为弹性伸缩盒子模型显示。
  61. -webkit-box-orient:vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
  62. -webkit-line-clamp:4; //显示的行
  63. }
  64. &-footer {
  65. margin-top: 16rpx;
  66. border-top: 2rpx dashed #DADADA;
  67. .btn {
  68. width: 100%;
  69. padding: 16rpx 32rpx;
  70. font-family: PingFang SC;
  71. font-size: 32rpx;
  72. font-weight: 400;
  73. line-height: 1.4;
  74. color: #00A9FF;
  75. box-sizing: border-box;
  76. }
  77. }
  78. .dot {
  79. position: absolute;
  80. top: 12rpx;
  81. right: 12rpx;
  82. width: 16rpx;
  83. height: 16rpx;
  84. background: #F53F3F;
  85. border-radius: 50%;
  86. }
  87. }
  88. </style>