talents-list.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <mescroll-uni ref="mescrollRef" :top="positionTop" left="" @init="mescrollInit" @down="downCallback"
  3. @up="upCallback" :down="downOption" :up="upOption" style="left: 100px;">
  4. <view class="content">
  5. <!-- 列表 -->
  6. <view class="talents-item m-t-16" v-for="(item, index) in talentsList" :key="index">
  7. <!-- 人才 -->
  8. <router-link :to="{ path: '/pages/talents/detail', query: { id: item.id }}">
  9. <view class="flex row-between flex-wrap">
  10. <view class="flex flex-1">
  11. <text
  12. style="width: 12rpx;height: 12rpx;background: #DD4250;border-radius: 50%; margin-right: 20rpx;"></text>
  13. <view class="bold">{{ item.title }}</view>
  14. <view class=""><u-tag :text="item.module" type="error" size="mini" shape="circleRight" />
  15. </view>
  16. </view>
  17. <view class="flex-none p-l-10 p-r-20 primary" v-if="item.position">
  18. {{ item.position }}
  19. </view>
  20. </view>
  21. <!-- 内容 -->
  22. <view style="font-size: 24rpx;">
  23. <view class="flex row-between m-t-16">
  24. <view class="line-2 flex-1" v-if="item.chain">产业链:{{ item.chain }}</view>
  25. <view class="flex" @tap.stop="makePhoneCall(item.tel)">
  26. <u-icon name="phone-fill" color="#DD4250" size="28"></u-icon>
  27. <view class="m-l-20">{{ phoneNumHide(item.tel) }}</view>
  28. </view>
  29. </view>
  30. <view class="m-t-16" v-if="item.company">单位:{{ item.company }}</view>
  31. <view class="m-t-16" v-if="item.module == 'base'">负责人:{{ item.principal }}</view>
  32. <view class="m-t-16" v-if="item.module == 'pedigreeCompany'">法人:{{ item.principal }}</view>
  33. <view class="m-t-16" v-if="item.module == 'firm'">秘书长:{{ item.principal }}</view>
  34. <view class="m-t-16 line-2">
  35. <text v-if="item.module == 'talent'">研究领域:</text>
  36. <text v-else-if="item.module == 'base'">基地特色:</text>
  37. <text v-else-if="item.module == 'university' || item.module == 'association'">研究方向:</text>
  38. <text v-else-if="item.module == 'fund'">投资产业领域:</text>
  39. <text v-else-if="item.module == 'pedigreeCompany'">主要产品:</text>
  40. <text v-else-if="item.module == 'pedigree'">个人简介:</text>
  41. <text v-else>简介:</text>
  42. <text>{{ item.description }}</text>
  43. </view>
  44. <view class="flex m-t-16 p-t-16" style="border-top: 2rpx solid #DEDEDE;;">
  45. <u-icon name="map-fill" color="#DD4250" size="28"></u-icon>
  46. <view class="m-l-10">{{ item.city }}{{ item.address }}</view>
  47. </view>
  48. </view>
  49. </router-link>
  50. </view>
  51. </view>
  52. <loading-view v-if="showLoading" background-color="transparent" :size="50"></loading-view>
  53. </mescroll-uni>
  54. </template>
  55. <script>
  56. import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
  57. import MescrollMoreItemMixin from "@/components/mescroll-uni/mixins/mescroll-more-item.js";
  58. import {
  59. getTalentsList
  60. } from '@/api/app';
  61. export default {
  62. mixins: [MescrollMixin, MescrollMoreItemMixin],
  63. data() {
  64. return {
  65. statusBarHeight: 0,
  66. talentsList: [],
  67. downOption: {
  68. // use: false,
  69. auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
  70. },
  71. upOption: {
  72. auto: true, // 不自动加载
  73. noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
  74. empty: {
  75. icon: '/static/images/order_null.png',
  76. tip: '暂无数据~', // 提示
  77. fixed: true,
  78. top: '100rpx'
  79. }
  80. },
  81. showLoading: false,
  82. params_cid: this.cid,
  83. params_top: this.top,
  84. params_chain: this.chain
  85. };
  86. },
  87. props: {
  88. cid: {
  89. type: Number
  90. },
  91. chain: {
  92. type: String
  93. },
  94. top: {
  95. type: Number
  96. },
  97. },
  98. created() {
  99. uni.$on("refreshTalentsList", (params) => {
  100. this.params_cid = params.cid;
  101. this.params_chain = params.chain;
  102. this.params_top = params.top;
  103. console.log(params)
  104. this.refresh()
  105. })
  106. uni.getSystemInfo({
  107. success: (res) => {
  108. this.statusBarHeight = res.statusBarHeight;
  109. }
  110. });
  111. },
  112. destroyed() {
  113. uni.$off("refreshTalentsList")
  114. },
  115. computed: {
  116. positionTop() {
  117. return this.top
  118. // return (this.statusBarHeight + 360)
  119. },
  120. phoneNumHide(tel) {
  121. return (tel) => {
  122. return tel.substring(0, 3) + '****' + tel.substring(7);
  123. }
  124. },
  125. },
  126. methods: {
  127. refresh() {
  128. this.mescroll.resetUpScroll()
  129. },
  130. makePhoneCall(tel) {
  131. if (tel) {
  132. uni.makePhoneCall({
  133. phoneNumber: tel
  134. });
  135. }
  136. },
  137. upCallback(page) {
  138. let pageNum = page.num; // 页码, 默认从1开始
  139. let pageSize = page.size; // 页长, 默认每页10条
  140. let {
  141. params_cid,
  142. params_chain
  143. } = this;
  144. getTalentsList({
  145. page_size: pageSize,
  146. page_no: pageNum,
  147. cid: params_cid,
  148. chain: params_chain
  149. }).then(({
  150. data,
  151. _meta
  152. }) => {
  153. let curPageData = data;
  154. let curPageLen = curPageData.length;
  155. let hasNext = _meta.pageCount > _meta.currentPage;
  156. if (page.num == 1) this.talentsList = [];
  157. this.talentsList = this.talentsList.concat(curPageData);
  158. this.mescroll.endSuccess(curPageLen, hasNext);
  159. })
  160. }
  161. },
  162. };
  163. </script>
  164. <style lang="scss" scoped>
  165. /deep/ .mescroll-uni-fixed {
  166. left: 250rpx !important;
  167. }
  168. .content {
  169. padding: 16rpx;
  170. }
  171. .u-search {
  172. padding: 0;
  173. }
  174. .talents-item {
  175. background: #FFFFFF;
  176. box-shadow: 0rpx 8rpx 16rpx 2rpx rgba(0, 0, 0, 0.03);
  177. border-radius: 12rpx 12rpx 12rpx 12rpx;
  178. padding: 24rpx 16rpx;
  179. font-size: 28rpx;
  180. }
  181. .u-content {}
  182. </style>