applyInterview.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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="@/static/img/nodata.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. goDetail(id) {
  85. uni.navigateTo({
  86. url: "/pageMy/reportDetail/reportDetail?id=" + id,
  87. });
  88. },
  89. },
  90. /* 触底 */
  91. onReachBottom: Throttle(function () {
  92. if (this.status === "nomore") return;
  93. this.status = "loading";
  94. this.page_no++;
  95. this.getInterList();
  96. }),
  97. /* 下拉刷新 */
  98. onPullDownRefresh: Throttle(function () {
  99. this.page_no = 1;
  100. this.refresh = true;
  101. this.getInterList();
  102. }),
  103. };
  104. </script>
  105. <style lang="scss" scoped>
  106. .applyInterview-container {
  107. background-color: #f7f7f7;
  108. .apply-ul {
  109. padding: 5rpx 0;
  110. .apply-ltem {
  111. display: flex;
  112. align-items: center;
  113. justify-content: space-between;
  114. padding: 30rpx 34rpx;
  115. background: #fff;
  116. margin-bottom: 4rpx;
  117. color: #4a4a4a;
  118. position: relative;
  119. .title,
  120. .desc,
  121. .item-num,
  122. .company,
  123. .view-item {
  124. max-width: 605rpx;
  125. }
  126. .title {
  127. font-size: 34rpx;
  128. }
  129. .desc,
  130. .company {
  131. margin: 20rpx 0 30rpx;
  132. }
  133. .desc,
  134. .view-item {
  135. color: #b2b2b2;
  136. }
  137. .tag {
  138. position: absolute;
  139. right: 0;
  140. top: 0;
  141. }
  142. }
  143. }
  144. }
  145. </style>