applyInterview.vue 3.5 KB

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