applyInterview.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. <Loading />
  23. </view>
  24. </template>
  25. <script>
  26. import { Mine } from "@/config/api.js";
  27. import { Throttle } from "@/config/util.js";
  28. import freeCharge from "@/components/freeCharge";
  29. export default {
  30. data() {
  31. return {
  32. refresh: false, //正在下拉
  33. status: "loadmore",
  34. pageSize: 10,
  35. page_no: 1,
  36. haveData: true,
  37. loadText: {
  38. loadmore: "上拉加载更多",
  39. loading: "加载中",
  40. nomore: "已经到底了",
  41. },
  42. interViewList: [],
  43. applyStatus: new Map([
  44. ["待访谈", "error"],
  45. ["待邀请", "primary"],
  46. ["已完成", "success"],
  47. ["已取消", "info"],
  48. ]),
  49. totalPage: "",
  50. };
  51. },
  52. onLoad() {
  53. this.getInterList();
  54. },
  55. onShow() {
  56. this.$store.commit("setRouterReport", "访谈申请");
  57. },
  58. components: {
  59. freeCharge,
  60. },
  61. methods: {
  62. /* 获取列表 */
  63. getInterList() {
  64. Mine.getInterview({
  65. PageSize: this.pageSize,
  66. CurrentIndex: this.page_no,
  67. }).then((res) => {
  68. if (res.Ret === 200) {
  69. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  70. this.totalPage = res.Data.Paging.Pages; //总页数
  71. res.Data.List &&
  72. res.Data.List.forEach((item) => {
  73. item.InterviewTime = item.InterviewTime.substr(0, 3) == "000" ? "" : item.InterviewTime;
  74. });
  75. if (this.page_no === 1) {
  76. this.interViewList = res.Data.List || [];
  77. this.haveData = this.interViewList.length ? true : false;
  78. if (this.refresh) {
  79. uni.stopPullDownRefresh();
  80. this.refresh = false;
  81. }
  82. } else {
  83. this.interViewList = this.interViewList.concat(res.Data.List);
  84. }
  85. }
  86. });
  87. },
  88. // 跳转文章详情
  89. goDetail(id) {
  90. uni.navigateTo({
  91. url: "/pageMy/reportDetail/reportDetail?id=" + id,
  92. });
  93. },
  94. },
  95. /* 触底 */
  96. onReachBottom: Throttle(function () {
  97. if (this.status === "nomore") return;
  98. this.status = "loading";
  99. this.page_no++;
  100. this.getInterList();
  101. }),
  102. /* 下拉刷新 */
  103. onPullDownRefresh: Throttle(function () {
  104. this.page_no = 1;
  105. this.refresh = true;
  106. this.getInterList();
  107. }),
  108. };
  109. </script>
  110. <style lang="scss" scoped>
  111. .applyInterview-container {
  112. background-color: $uni-bg-color;
  113. .apply-ul {
  114. padding: 5rpx 0;
  115. .apply-ltem {
  116. display: flex;
  117. align-items: center;
  118. justify-content: space-between;
  119. padding: 30rpx 34rpx;
  120. background: #fff;
  121. margin-bottom: 4rpx;
  122. color: #4a4a4a;
  123. position: relative;
  124. .title,
  125. .desc,
  126. .item-num,
  127. .company,
  128. .view-item {
  129. max-width: 605rpx;
  130. }
  131. .title {
  132. font-size: 34rpx;
  133. }
  134. .desc,
  135. .company {
  136. margin: 20rpx 0 30rpx;
  137. }
  138. .desc,
  139. .view-item {
  140. color: #b2b2b2;
  141. }
  142. .tag {
  143. position: absolute;
  144. right: 0;
  145. top: 0;
  146. }
  147. }
  148. }
  149. }
  150. </style>