addmenDetail.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <view class="center">
  3. <!-- <view class="bg"><image :src="src" mode=""></image></view> -->
  4. <!-- <view class="title">{{ title }}</view> -->
  5. <view v-html="synopsis" class="content">{{ synopsis }}</view>
  6. </view>
  7. </template>
  8. <script>
  9. import { details } from '@/api/index.js';
  10. export default {
  11. data() {
  12. return {
  13. src: '',
  14. title: '',
  15. synopsis: '',
  16. time: ''
  17. };
  18. },
  19. onLoad(option) {
  20. this.loadData(option.id);
  21. },
  22. methods: {
  23. async loadData(id) {
  24. let obj = this;
  25. details({}, id).then(e => {
  26. console.log(e);
  27. if (e.data.cid == '2') {
  28. uni.setNavigationBarTitle({
  29. title: '消息详情'
  30. });
  31. }
  32. if (e.data.cid == '1') {
  33. uni.setNavigationBarTitle({
  34. title: '加盟信息详情'
  35. });
  36. }
  37. obj.src = e.data.image_input[0];
  38. obj.title = e.data.title;
  39. obj.synopsis = e.data.content;
  40. obj.time = e.data.add_time;
  41. });
  42. }
  43. }
  44. };
  45. </script>
  46. <style lang="scss">
  47. .center {
  48. height: 100%;
  49. }
  50. .bg {
  51. width: 100%;
  52. height: 474rpx;
  53. image {
  54. width: 100%;
  55. height: 100%;
  56. }
  57. }
  58. .title {
  59. width: 90%;
  60. margin: 0 auto;
  61. font-size: 40rpx;
  62. font-weight: 500;
  63. color: #171313;
  64. text-overflow: -o-ellipsis-lastline;
  65. overflow: hidden;
  66. display: -webkit-box;
  67. -webkit-line-clamp: 2;
  68. -webkit-box-orient: vertical;
  69. }
  70. .time {
  71. width: 90%;
  72. margin: 0 auto;
  73. margin-top: 16rpx;
  74. font-size: 24rpx;
  75. font-weight: 500;
  76. color: #656b6c;
  77. }
  78. .content {
  79. width: 90%;
  80. margin: 0 auto;
  81. padding-top: 20rpx;
  82. // margin-top: 20rpx;
  83. font-size: 32rpx;
  84. font-weight: 500;
  85. color: #777777;
  86. }
  87. /deep/ .content {
  88. img {
  89. width: 100%;
  90. height: 100%;
  91. }
  92. }
  93. </style>