提交
This commit is contained in:
195
pages/talents/detail.vue
Normal file
195
pages/talents/detail.vue
Normal file
@@ -0,0 +1,195 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<z-nav-bar title="医生主页" bgColor="#5188e5" fontColor="#fff"></z-nav-bar>
|
||||
<view class="taihu_wrap" v-if="status">
|
||||
<view class="taihu_infor">
|
||||
<image :src="taihuTalent.icon" class="infor_image" mode="aspectFit"></image>
|
||||
<view class="infor_right">
|
||||
<view class="infor_top">
|
||||
<text class="infor_name">{{taihuTalent.name}}</text>
|
||||
<text class="infor_title">{{taihuTalent.title}}</text>
|
||||
</view>
|
||||
<view class="infor_con">
|
||||
<text v-for="item in label" :key="item">{{item}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="taihu_common">
|
||||
<text>介绍</text>
|
||||
{{taihuTalent.introduce}}
|
||||
</view>
|
||||
<view class="taihu_common">
|
||||
<text>业务专长</text>
|
||||
{{taihuTalent.specialty}}
|
||||
</view>
|
||||
<view class="taihu_common">
|
||||
<text>出诊信息</text>
|
||||
{{taihuTalent.clinic}}
|
||||
</view>
|
||||
<view class="taihu_common">
|
||||
<text>预约信息</text>
|
||||
<span style="white-space: pre-line;">{{taihuTalent.reservation.replace('电话预约:', '电话预约:\n')}}</span>
|
||||
</view>
|
||||
<view class="taihu_common">
|
||||
<text>太湖证书</text>
|
||||
<view class="certificate-list" v-if="certificates.length>0">
|
||||
<view class="list_block" v-for="(item,index) in displayedCertificates" :key="index" @click="showImg(item.certificateUrl)">
|
||||
{{item.title}}
|
||||
</view>
|
||||
|
||||
<view v-if="shouldShowToggle" class="toggle-btn" @click="toggleShow">
|
||||
{{ showAll ? '收起' : '查看更多' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="certificate-list" v-else>暂无</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import $http from "@/config/requestConfig.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id: null,
|
||||
taihuTalent: {},
|
||||
label: [], //标签
|
||||
certificates: [], //证书
|
||||
status: false,
|
||||
showAll: false, //是否显示全部
|
||||
defaultShowCount: 5 //默认显示条数
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
displayedCertificates() {
|
||||
if (this.showAll) {
|
||||
return this.certificates
|
||||
} else {
|
||||
return this.certificates.slice(0, this.defaultShowCount)
|
||||
}
|
||||
},
|
||||
shouldShowToggle() {
|
||||
return this.certificates.length > this.defaultShowCount
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.id = e.id;
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
//获取数据
|
||||
getData() {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
})
|
||||
this.$http.request({
|
||||
url: 'common/taihuTalent/taihuTalentInfo',
|
||||
method: "POST",
|
||||
data: {
|
||||
id: this.id
|
||||
},
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then(res=> {
|
||||
if (res.code==0) {
|
||||
uni.hideLoading();
|
||||
this.status = true;
|
||||
this.taihuTalent = res.taihuTalent;
|
||||
this.label = res.label;
|
||||
this.certificates = res.certificates;
|
||||
}
|
||||
});
|
||||
},
|
||||
//点击展示全部
|
||||
toggleShow() {
|
||||
this.showAll = !this.showAll
|
||||
},
|
||||
//展示图片
|
||||
showImg(data){
|
||||
let url = '';
|
||||
if(data){
|
||||
url = data.split(',')[0];
|
||||
uni.previewImage({
|
||||
urls: [url],
|
||||
current: 0
|
||||
});
|
||||
}else{
|
||||
this.$commonJS.showToast("暂无证书图片");
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '@/static/mixin.scss';
|
||||
.content{
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background-color: #fff;
|
||||
}
|
||||
.taihu_wrap{
|
||||
padding: 30rpx 30rpx 50rpx;
|
||||
}
|
||||
.taihu_infor{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-bottom: 10rpx;
|
||||
}
|
||||
.infor_image{
|
||||
display: block;
|
||||
width: 180rpx;
|
||||
height: 220rpx;
|
||||
}
|
||||
.infor_right{
|
||||
width: calc(100% - 220rpx);
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
.infor_top{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.infor_name{
|
||||
font-size: 38rpx;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
.infor_title{
|
||||
font-size: 34rpx;
|
||||
color: #999;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
.infor_con{
|
||||
padding-top: 20rpx;
|
||||
|
||||
text{
|
||||
display: block;
|
||||
font-size: 30rpx;
|
||||
line-height: 34rpx;
|
||||
padding: 8rpx 0;
|
||||
color: $themeColor;
|
||||
}
|
||||
}
|
||||
.taihu_common{
|
||||
margin-top: 30rpx;
|
||||
font-size: 30rpx;
|
||||
line-height: 46rpx;
|
||||
|
||||
text{
|
||||
font-size: 38rpx;
|
||||
padding-right: 15rpx;
|
||||
font-weight: bold;
|
||||
color: $themeColor;
|
||||
}
|
||||
}
|
||||
.list_block{
|
||||
padding-top: 5rpx;
|
||||
}
|
||||
.toggle-btn{
|
||||
color: $themeColor;
|
||||
}
|
||||
</style>
|
||||
124
pages/talents/index.vue
Normal file
124
pages/talents/index.vue
Normal file
@@ -0,0 +1,124 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<z-nav-bar title="太湖英才" bgColor="#5188e5" fontColor="#fff"></z-nav-bar>
|
||||
<view class="talents_list">
|
||||
<view class="talents_item" v-for="(item,index) in list" :key="index" @click="goToDetail(item.id)">
|
||||
<image :src="item.icon" class="item_image" mode="aspectFit"></image>
|
||||
<view class="item_right">
|
||||
<view class="item_top">
|
||||
<text class="item_name">{{item.name}}</text>
|
||||
<text class="item_title">{{item.title}}</text>
|
||||
</view>
|
||||
<text class="item_con">{{item.introduce}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<z-navigation></z-navigation>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import $http from "@/config/requestConfig.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
name: '',
|
||||
region: '',
|
||||
list: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
uni.hideTabBar();
|
||||
this.getData();
|
||||
},
|
||||
onShow() {
|
||||
uni.removeStorageSync('homeParams');
|
||||
},
|
||||
methods: {
|
||||
//获取数据
|
||||
getData() {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
})
|
||||
this.$http.request({
|
||||
url: 'common/taihuTalent/getTaihuTalents',
|
||||
method: "POST",
|
||||
data: {
|
||||
name: this.name,
|
||||
region: this.region
|
||||
},
|
||||
header: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then(res=> {
|
||||
uni.hideLoading();
|
||||
if (res.list&&res.list.length>0) {
|
||||
this.list = res.list;
|
||||
}
|
||||
});
|
||||
},
|
||||
//详情
|
||||
goToDetail(id){
|
||||
uni.navigateTo({
|
||||
url: '/pages/talents/detail?id='+id,
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '@/static/mixin.scss';
|
||||
.content{
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background-color: #fff;
|
||||
}
|
||||
.talents_list{
|
||||
margin: 20rpx 30rpx;
|
||||
}
|
||||
.talents_item{
|
||||
border: 1rpx solid $themeColor;
|
||||
border-radius: 15rpx;
|
||||
margin-bottom: 20rpx;
|
||||
padding: 25rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.item_image{
|
||||
display: block;
|
||||
width: 160rpx;
|
||||
height: 200rpx;
|
||||
}
|
||||
.item_right{
|
||||
width: calc(100% - 200rpx);
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
.item_top{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.item_name{
|
||||
font-size: 34rpx;
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
.item_title{
|
||||
font-size: 32rpx;
|
||||
color: #999;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
.item_con{
|
||||
font-size: 30rpx;
|
||||
color: #666;
|
||||
margin-top: 10rpx;
|
||||
line-height: 40rpx;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user