applyInterview.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <view class="container applyInterview-container">
  3. <view class="apply-ul" v-if="haveData">
  4. <view class="apply-ltem" v-for="(item, index) in interViewList" :key="index" @click="goDetail(item.ArticleId)">
  5. <view class="item-left">
  6. <text class="title text_twoLine">{{ item.Title }}</text>
  7. <text class="text_twoLine desc">{{ item.Body }}</text>
  8. <text class="item-num" v-if="item.ExpertNumber">专家编号{{ item.ExpertNumber }}</text>
  9. <view class="company text_twoLine" v-if="item.ExpertBackground">{{ item.ExpertBackground }}</view>
  10. <text class="view-item" v-if="item.InterviewTime">访谈时间:{{ item.InterviewTime }}</text>
  11. </view>
  12. <u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
  13. <u-tag :text="item.Status" :type="applyStatus.get(item.Status)" mode="plain" class="tag" />
  14. </view>
  15. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" v-if="totalPage > 1" />
  16. </view>
  17. <view class="nodata" v-else>
  18. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
  19. <text>暂时没有访谈申请的内容</text>
  20. </view>
  21. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
  22. </view>
  23. </template>
  24. <script>
  25. import { Mine } from "@/config/api.js";
  26. import { Throttle } from "@/config/util.js";
  27. import freeCharge from "@/components/freeCharge";
  28. export default {
  29. data() {
  30. return {
  31. refresh: false, //正在下拉
  32. status: "loadmore",
  33. pageSize: 10,
  34. page_no: 1,
  35. haveData: true,
  36. loadText: {
  37. loadmore: "上拉加载更多",
  38. loading: "加载中",
  39. nomore: "已经到底了",
  40. },
  41. interViewList: [],
  42. applyStatus: new Map([
  43. ["待访谈", "error"],
  44. ["待邀请", "primary"],
  45. ["已完成", "success"],
  46. ["已取消", "info"],
  47. ]),
  48. totalPage: "",
  49. };
  50. },
  51. onLoad() {
  52. this.$store.commit("setRouterReport", "访谈申请");
  53. this.getInterList();
  54. },
  55. components: {
  56. freeCharge,
  57. },
  58. methods: {
  59. /* 获取列表 */
  60. getInterList() {
  61. Mine.getInterview({
  62. PageSize: this.pageSize,
  63. CurrentIndex: this.page_no,
  64. }).then((res) => {
  65. if (res.Ret === 200) {
  66. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  67. this.totalPage = res.Data.Paging.Pages; //总页数
  68. res.Data.List &&
  69. res.Data.List.forEach((item) => {
  70. item.InterviewTime = item.InterviewTime.substr(0, 3) == "000" ? "" : item.InterviewTime;
  71. });
  72. if (this.page_no === 1) {
  73. this.interViewList = res.Data.List || [];
  74. this.haveData = this.interViewList.length ? true : false;
  75. if (this.refresh) {
  76. uni.stopPullDownRefresh();
  77. this.refresh = false;
  78. }
  79. } else {
  80. this.interViewList = this.interViewList.concat(res.Data.List);
  81. }
  82. }
  83. });
  84. },
  85. // 跳转文章详情
  86. goDetail(id) {
  87. uni.navigateTo({
  88. url: "/pageMy/reportDetail/reportDetail?id=" + id,
  89. });
  90. },
  91. },
  92. /* 触底 */
  93. onReachBottom: Throttle(function () {
  94. if (this.status === "nomore") return;
  95. this.status = "loading";
  96. this.page_no++;
  97. this.getInterList();
  98. }),
  99. /* 下拉刷新 */
  100. onPullDownRefresh: Throttle(function () {
  101. this.page_no = 1;
  102. this.refresh = true;
  103. this.getInterList();
  104. }),
  105. };
  106. </script>
  107. <style lang="scss" scoped>
  108. .applyInterview-container {
  109. background-color: #f7f7f7;
  110. .apply-ul {
  111. padding: 5rpx 0;
  112. .apply-ltem {
  113. display: flex;
  114. align-items: center;
  115. justify-content: space-between;
  116. padding: 30rpx 34rpx;
  117. background: #fff;
  118. margin-bottom: 4rpx;
  119. color: #4a4a4a;
  120. position: relative;
  121. .title,
  122. .desc,
  123. .item-num,
  124. .company,
  125. .view-item {
  126. max-width: 605rpx;
  127. }
  128. .title {
  129. font-size: 34rpx;
  130. }
  131. .desc,
  132. .company {
  133. margin: 20rpx 0 30rpx;
  134. }
  135. .desc,
  136. .view-item {
  137. color: #b2b2b2;
  138. }
  139. .tag {
  140. position: absolute;
  141. right: 0;
  142. top: 0;
  143. }
  144. }
  145. }
  146. }
  147. </style>