myAskPage.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <view class="container ask-container">
  3. <view v-if="haveData">
  4. <view class="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>{{ 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: #f7f7f7;
  67. padding: 20rpx 30rpx;
  68. .collect-item {
  69. padding: 30rpx 30rpx;
  70. color: #333333;
  71. font-size: 28rpx;
  72. background: #fff;
  73. margin-bottom: 20rpx;
  74. }
  75. .item-row {
  76. font-size: 28rpx;
  77. color: #333;
  78. margin-bottom: 20rpx;
  79. border-radius: 4rpx;
  80. .item-content-title {
  81. font-size: 24rpx;
  82. color: #999;
  83. }
  84. .item-content-text {
  85. color: #3385ff;
  86. }
  87. }
  88. .item-title {
  89. padding-top: 20rpx;
  90. border-top: 2px dashed #dcdfe6;
  91. }
  92. .time {
  93. text-align: right;
  94. font-size: 22rpx;
  95. color: #999;
  96. }
  97. }
  98. </style>