applyInterview.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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.getInterList();
  53. },
  54. components: {
  55. freeCharge,
  56. },
  57. methods: {
  58. /* 获取列表 */
  59. getInterList() {
  60. Mine.getInterview({
  61. PageSize: this.pageSize,
  62. CurrentIndex: this.page_no,
  63. }).then((res) => {
  64. if (res.Ret === 200) {
  65. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  66. this.totalPage = res.Data.Paging.Pages; //总页数
  67. res.Data.List &&
  68. res.Data.List.forEach((item) => {
  69. item.InterviewTime = item.InterviewTime.substr(0, 3) == "000" ? "" : item.InterviewTime;
  70. });
  71. if (this.page_no === 1) {
  72. this.interViewList = res.Data.List || [];
  73. this.haveData = this.interViewList.length ? true : false;
  74. if (this.refresh) {
  75. uni.stopPullDownRefresh();
  76. this.refresh = false;
  77. }
  78. } else {
  79. this.interViewList = this.interViewList.concat(res.Data.List);
  80. }
  81. }
  82. });
  83. },
  84. // 跳转文章详情
  85. goDetail(id) {
  86. uni.navigateTo({
  87. url: "/pageMy/reportDetail/reportDetail?id=" + id,
  88. });
  89. },
  90. },
  91. /* 触底 */
  92. onReachBottom: Throttle(function () {
  93. if (this.status === "nomore") return;
  94. this.status = "loading";
  95. this.page_no++;
  96. this.getInterList();
  97. }),
  98. /* 下拉刷新 */
  99. onPullDownRefresh: Throttle(function () {
  100. this.page_no = 1;
  101. this.refresh = true;
  102. this.getInterList();
  103. }),
  104. };
  105. </script>
  106. <style lang="scss" scoped>
  107. .applyInterview-container {
  108. background-color: #f7f7f7;
  109. .apply-ul {
  110. padding: 5rpx 0;
  111. .apply-ltem {
  112. display: flex;
  113. align-items: center;
  114. justify-content: space-between;
  115. padding: 30rpx 34rpx;
  116. background: #fff;
  117. margin-bottom: 4rpx;
  118. color: #4a4a4a;
  119. position: relative;
  120. .title,
  121. .desc,
  122. .item-num,
  123. .company,
  124. .view-item {
  125. max-width: 605rpx;
  126. }
  127. .title {
  128. font-size: 34rpx;
  129. }
  130. .desc,
  131. .company {
  132. margin: 20rpx 0 30rpx;
  133. }
  134. .desc,
  135. .view-item {
  136. color: #b2b2b2;
  137. }
  138. .tag {
  139. position: absolute;
  140. right: 0;
  141. top: 0;
  142. }
  143. }
  144. }
  145. }
  146. </style>