footprint-list.vue 5.3 KB

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