myAskPage.vue 2.4 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>问题内容:</text>
  7. <text>{{ item.Content }}</text>
  8. </view>
  9. <view class="item-title">
  10. <view class="item-row">
  11. <text>相关{{ item.AskType == "Activity" ? "活动" : "报告" }}:</text>
  12. <text class="title">{{ item.Title }}</text>
  13. </view>
  14. <u-icon class="ico" name="arrow-right" color="#BDBDBD" size="34"></u-icon>
  15. </view>
  16. <text class="time">提问时间: {{ item.CreateTime }}</text>
  17. </view>
  18. </view>
  19. <view class="nodata" v-else>
  20. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
  21. <text>暂时没有提问的内容</text>
  22. </view>
  23. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree"/>
  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.getAsk();
  59. },
  60. };
  61. </script>
  62. <style lang="scss" scoped>
  63. .ask-container {
  64. background: #f7f7f7;
  65. padding-top: 10rpx;
  66. .collect-item {
  67. padding: 30rpx 30rpx 20rpx 34rpx;
  68. color: #333333;
  69. font-size: 30rpx;
  70. background: #fff;
  71. margin-bottom: 10rpx;
  72. }
  73. .item-row {
  74. :first-child {
  75. flex-shrink: 0;
  76. padding-right: 10rpx;
  77. }
  78. display: flex;
  79. }
  80. .item-title {
  81. display: flex;
  82. justify-content: space-between;
  83. align-items: center;
  84. margin: 30rpx 0;
  85. font-size: 28rpx;
  86. .ico {
  87. width: 16px;
  88. }
  89. .title {
  90. color: #2c83ff;
  91. }
  92. }
  93. .time {
  94. font-size: 24rpx;
  95. }
  96. }
  97. </style>