myAskPage.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. </view>
  24. </template>
  25. <script>
  26. import { User } from "@/config/api.js";
  27. import freeCharge from "@/components/freeCharge";
  28. export default {
  29. components: {
  30. freeCharge,
  31. },
  32. data() {
  33. return {
  34. askList: [],
  35. haveData: true,
  36. };
  37. },
  38. methods: {
  39. async getAsk() {
  40. const res = await User.getAskList();
  41. if (res.Ret === 200) {
  42. this.haveData = res.Data.List ? true : false;
  43. this.askList = res.Data.List || [];
  44. }
  45. },
  46. goDetail(item) {
  47. item.AskType == "Activity"
  48. ? uni.navigateTo({
  49. url: "/activityPages/activityDetail/activityDetail?id=" + item.ReportOrActivityId,
  50. })
  51. : uni.navigateTo({
  52. url: "/pageMy/reportDetail/reportDetail?id=" + item.ReportOrActivityId,
  53. });
  54. },
  55. },
  56. onLoad() {
  57. this.$store.commit("setRouterActivity", "活动提问");
  58. this.$store.commit("setRouterReport", "活动提问");
  59. this.getAsk();
  60. },
  61. };
  62. </script>
  63. <style lang="scss" scoped>
  64. .ask-container {
  65. background: #f7f7f7;
  66. padding: 20rpx 30rpx;
  67. .collect-item {
  68. padding: 30rpx 30rpx;
  69. color: #333333;
  70. font-size: 28rpx;
  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: 24rpx;
  81. color: #999;
  82. }
  83. .item-content-text {
  84. color: #3385ff;
  85. }
  86. }
  87. .item-title {
  88. padding-top: 20rpx;
  89. border-top: 2px dashed #dcdfe6;
  90. }
  91. .time {
  92. text-align: right;
  93. font-size: 22rpx;
  94. color: #999;
  95. }
  96. }
  97. </style>