myLeavingMessage.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <view class="container my-message">
  3. <view v-if="haveData">
  4. <view class="global_card_content collect-item" v-for="(item, index) in messageList" :key="index" @click="goDetail(item)">
  5. <view class="item-row">
  6. <text class="item-content-title">留言内容:</text>
  7. <text>{{ item.Content }}</text>
  8. </view>
  9. <view class="item-title">
  10. <view class="item-row">
  11. <text class="item-content-title">留言对象:</text>
  12. <text class="item-content-text">{{ item.Title }}</text>
  13. </view>
  14. </view>
  15. <text class="time">{{ dateFormatterHandler(item.CreateTime) }}</text>
  16. </view>
  17. </view>
  18. <view class="nodata" v-else>
  19. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
  20. <text>暂时没有留言的内容</text>
  21. </view>
  22. <Loading />
  23. </view>
  24. </template>
  25. <script>
  26. import { User } from "@/config/api.js";
  27. import { dateFormatter } from "@/config/util.js";
  28. export default {
  29. data() {
  30. return {
  31. messageList: [],
  32. haveData: true,
  33. };
  34. },
  35. methods: {
  36. // 获取数据
  37. async getList() {
  38. const res = await User.commentListMessage();
  39. if (res.Ret === 200) {
  40. this.messageList = res.Data.List || [];
  41. this.haveData = this.messageList.length ? true : false;
  42. }
  43. },
  44. // 去往详情
  45. goDetail(item) {
  46. this.$store.commit("setRouterActivity", "我的留言");
  47. this.$store.commit("setRouterReport", "我的留言");
  48. if (item.IsRoadShow) {
  49. //跳转路演精华
  50. uni.navigateTo({
  51. url: "/reportPages/roadEssence/roadEssence?id=" + item.ArticleId,
  52. });
  53. } else if (item.RedirectType == 1) {
  54. uni.navigateTo({
  55. url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId,
  56. });
  57. } else if (item.RedirectType == 2) {
  58. uni.navigateTo({
  59. url: "/activityPages/activityDetail/activityDetail?id=" + item.ActivityId,
  60. });
  61. } else {
  62. uni.navigateTo({
  63. url: "/reportPages/IndustryReport/IndustryReport?id=" + item.IndustryId,
  64. });
  65. }
  66. },
  67. // 处理时间
  68. dateFormatterHandler(val) {
  69. return dateFormatter(val, true);
  70. },
  71. },
  72. onLoad() {
  73. this.getList();
  74. },
  75. };
  76. </script>
  77. <style lang="scss" scoped>
  78. .my-message {
  79. background: $uni-bg-color;
  80. padding: 20rpx 30rpx;
  81. .collect-item {
  82. border-top: 4rpx solid #376cbb;
  83. padding: 30rpx 30rpx;
  84. background: #fff;
  85. margin-bottom: 20rpx;
  86. }
  87. .item-row {
  88. font-size: 28rpx;
  89. color: #333;
  90. margin-bottom: 20rpx;
  91. border-radius: 4rpx;
  92. .item-content-title {
  93. font-size: 28rpx;
  94. color: #999;
  95. line-height: 36rpx;
  96. margin-bottom: 10rpx;
  97. }
  98. .item-content-text {
  99. font-weight: 500;
  100. color: $uni-color-new;
  101. }
  102. }
  103. .item-title {
  104. padding-top: 20rpx;
  105. }
  106. .time {
  107. text-align: right;
  108. font-size: 22rpx;
  109. color: #999;
  110. }
  111. }
  112. </style>