123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- <template>
- <mescroll-uni ref="mescrollRef" :top="positionTop" left="" @init="mescrollInit" @down="downCallback"
- @up="upCallback" :down="downOption" :up="upOption" style="left: 100px;">
- <view class="content">
- <!-- 搜索 -->
- <!-- <view>
- <u-search v-model="keyword" wrap-bg-color="transparent" bg-color="#ffffff" :disabled="false" :height="54"
- shape="square" @search="searchTalents"></u-search>
- </view> -->
- <!-- 列表 -->
- <view class="talents-item m-t-16" v-for="(item, index) in talentsList" :key="index">
- <!-- 人才 -->
- <router-link :to="{ path: '/pages/talents/detail', query: { id: item.id }}">
- <view class="flex row-between">
- <text
- style="width: 12rpx;height: 12rpx;background: #DD4250;border-radius: 50%; margin-right: 20rpx;"></text>
- <view class="flex-1 bold">{{ item.title }}</view>
- <view class="p-l-20 p-r-20 primary" v-if="item.position">
- {{ item.position }}
- </view>
- </view>
- <!-- 内容 -->
- <view style="font-size: 24rpx;">
- <view class="flex row-between m-t-16">
- <view class="line-2 flex-1" v-if="item.chain">产业链:{{ item.chain }}</view>
- <view class="flex" @tap.stop="makePhoneCall(item.tel)">
- <u-icon name="phone-fill" color="#DD4250" size="28"></u-icon>
- <view class="m-l-20">{{ phoneNumHide(item.tel) }}</view>
- </view>
- </view>
- <view class="m-t-16" v-if="item.company">单位:{{ item.company }}</view>
- <view class="m-t-16" v-if="item.module == 'base'">负责人:{{ item.principal }}</view>
- <view class="m-t-16" v-if="item.module == 'pedigreeCompany'">法人:{{ item.principal }}</view>
- <view class="m-t-16" v-if="item.module == 'firm'">秘书长:{{ item.principal }}</view>
- <view class="m-t-16 line-2">
- <text v-if="item.module == 'talent'">研究领域:</text>
- <text v-else-if="item.module == 'base'">基地特色:</text>
- <text v-else-if="item.module == 'university' || item.module == 'association'">研究方向:</text>
- <text v-else-if="item.module == 'fund'">投资产业领域:</text>
- <text v-else-if="item.module == 'pedigreeCompany'">主要产品:</text>
- <text v-else-if="item.module == 'pedigree'">个人简介:</text>
- <text v-else>简介:</text>
- <text>{{ item.description }}</text>
- </view>
- <view class="flex m-t-16 p-t-16" style="border-top: 2rpx solid #DEDEDE;;">
- <u-icon name="map-fill" color="#DD4250" size="28"></u-icon>
- <view class="m-l-10">{{ item.city }}{{ item.address }}</view>
- </view>
- </view>
- </router-link>
- </view>
- </view>
- <loading-view v-if="showLoading" background-color="transparent" :size="50"></loading-view>
- </mescroll-uni>
- </template>
- <script>
- import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
- import MescrollMoreItemMixin from "@/components/mescroll-uni/mixins/mescroll-more-item.js";
- import {
- getTalentsFootprintList
- } from '@/api/app';
- export default {
- mixins: [MescrollMixin, MescrollMoreItemMixin],
- data() {
- return {
- statusBarHeight: 0,
- talentsList: [],
- downOption: {
- // use: false,
- auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
- },
- upOption: {
- auto: true, // 不自动加载
- noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
- empty: {
- icon: '/static/images/order_null.png',
- tip: '暂无数据~', // 提示
- fixed: true,
- top: '100rpx'
- }
- },
- showLoading: false
- };
- },
- props: {
- },
- created() {
- uni.$on("refreshTalentsFootprintList", (params) => {
- this.refresh()
- })
- uni.getSystemInfo({
- success: (res) => {
- this.statusBarHeight = res.statusBarHeight;
- }
- });
- },
- destroyed() {
- uni.$off("refreshTalentsFootprintList")
- },
- computed: {
- positionTop() {
- return (this.statusBarHeight)
- },
- phoneNumHide(tel) {
- return (tel) => {
- return tel.substring(0, 3) + '****' + tel.substring(7);
- }
- },
- },
- methods: {
- refresh() {
- this.mescroll.resetUpScroll()
- },
- makePhoneCall(tel) {
- if (tel) {
- uni.makePhoneCall({
- phoneNumber: tel
- });
- }
- },
- searchTalents() {
- let {
- keyword
- } = this;
- if (!keyword) {
- this.$toast({
- title: '请输入关键字'
- })
- return;
- }
- this.downCallback();
- },
- upCallback(page) {
- let pageNum = page.num; // 页码, 默认从1开始
- let pageSize = page.size; // 页长, 默认每页10条
- getTalentsFootprintList({
- page_size: pageSize,
- page_no: pageNum
- }).then(({
- data,
- _meta
- }) => {
- let curPageData = data;
- let curPageLen = curPageData.length;
- let hasNext = _meta.pageCount > _meta.currentPage;
- if (page.num == 1) this.talentsList = [];
- this.talentsList = this.talentsList.concat(curPageData);
- this.mescroll.endSuccess(curPageLen, hasNext);
- })
- }
- },
- };
- </script>
- <style lang="scss" scoped>
- // /deep/ .mescroll-uni-fixed {
- // left: 250rpx !important;
- // }
- .content {
- padding: 16rpx;
- }
- .u-search {
- padding: 0;
- }
- .talents-item {
- background: #FFFFFF;
- box-shadow: 0rpx 8rpx 16rpx 2rpx rgba(0, 0, 0, 0.03);
- border-radius: 12rpx 12rpx 12rpx 12rpx;
- padding: 24rpx 16rpx;
- font-size: 28rpx;
- }
- .u-content {}
- </style>
|