myAskPage.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view class="container ask-container">
  3. <view v-if="haveData">
  4. <view class="global_card_content collect-item" v-for="(item, index) in askList" :key="index" @click="goDetail(item)">
  5. <view class="item-row">
  6. <text class="item-content-title">问题内容:</text>
  7. <text class="global_title">{{ item.Content }}</text>
  8. </view>
  9. <view class="item-title">
  10. <view class="item-row">
  11. <text class="item-content-title">相关{{ item.AskType == "Activity" ? "活动" : "报告" }}:</text>
  12. <text class="item-content-text">{{ item.Title }}</text>
  13. </view>
  14. </view>
  15. <text class="time">{{ 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. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
  23. <Loading />
  24. </view>
  25. </template>
  26. <script>
  27. import { User } from "@/config/api.js";
  28. import freeCharge from "@/components/freeCharge";
  29. export default {
  30. components: {
  31. freeCharge,
  32. },
  33. data() {
  34. return {
  35. askList: [],
  36. haveData: true,
  37. };
  38. },
  39. methods: {
  40. async getAsk() {
  41. const res = await User.getAskList();
  42. if (res.Ret === 200) {
  43. this.haveData = res.Data.List ? true : false;
  44. this.askList = res.Data.List || [];
  45. }
  46. },
  47. goDetail(item) {
  48. item.AskType == "Activity"
  49. ? uni.navigateTo({
  50. url: "/activityPages/activityDetail/activityDetail?id=" + item.ReportOrActivityId,
  51. })
  52. : uni.navigateTo({
  53. url: "/pageMy/reportDetail/reportDetail?id=" + item.ReportOrActivityId,
  54. });
  55. },
  56. },
  57. onLoad() {
  58. this.$store.commit("setRouterActivity", "活动提问");
  59. this.$store.commit("setRouterReport", "活动提问");
  60. this.getAsk();
  61. },
  62. };
  63. </script>
  64. <style lang="scss" scoped>
  65. .ask-container {
  66. background: $uni-bg-color;
  67. padding: 20rpx 30rpx;
  68. .collect-item {
  69. border-top: 4rpx solid #376cbb;
  70. padding: 30rpx 30rpx;
  71. background: #fff;
  72. margin-bottom: 20rpx;
  73. }
  74. .item-row {
  75. font-size: 28rpx;
  76. color: #333;
  77. margin-bottom: 20rpx;
  78. border-radius: 4rpx;
  79. .item-content-title {
  80. font-size: 28rpx;
  81. color: #999;
  82. line-height: 36rpx;
  83. margin-bottom: 10rpx;
  84. }
  85. .item-content-text {
  86. font-weight: 500;
  87. color: $uni-color-new;
  88. }
  89. }
  90. .item-title {
  91. padding-top: 20rpx;
  92. }
  93. .time {
  94. text-align: right;
  95. font-size: 22rpx;
  96. color: #999;
  97. }
  98. }
  99. </style>