123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490 |
- <template>
- <view>
- <view class="top-fixed">
- <!-- 这里是状态栏 -->
- <view class="status_bar" :style="{height: statusBarHeight}"></view>
- <view class="top-title">在线问诊</view>
- <!-- 搜索框 -->
- <view class="search-cont">
- <view class="inner">
- <image class="icon-search" src="../../static/images/search.png" mode=""></image>
- <input type="text" :value="searchValue" placeholder="输入关键字" placeholder-style="font-size:28rpx;color:#BBBBBB;font-family: PingFang SC;" />
- </view>
- </view>
- </view>
- <!-- 快速问诊、找医生 -->
- <view class="online-inquiry" :style="{marginTop:top}">
- <view class="item" @click="navTo('./postConsult')">
- <image class="bg-img" src="../../static/images/online_treat.png" mode=""></image>
- <view class="inner">
- <text class="title">快速问诊</text>
- <text class="sub-title">智能科室 快速匹配</text>
- <image src="../../static/images/fast_ask.png" mode=""></image>
- </view>
- </view>
- <view class="item" @click="navTo('./doctorList')">
- <image class="bg-img" src="../../static/images/chu_query.png" mode=""></image>
- <view class="inner">
- <text class="title">找医生</text>
- <text class="sub-title">全国60万医生任你选</text>
- <image src="../../static/images/doctor_blue.png" mode=""></image>
- </view>
- </view>
- </view>
- <!-- 专家问诊 -->
- <view class="index-cont" >
- <view class="pub-item">
- <view class="pub-title-box">
- <text class="left">专家问诊</text>
- </view>
- <view class="inner">
- <!-- tab切换 -->
- <view class="pub-tab-box">
- <view class="tab-inner">
- <view
- v-for="(item,index) in orderTypes"
- :key="index"
- :class="item.id == param.orderType?'item cases active':'item cases'"
- @click="orderTypeChange(item)"
- >
- <view class="text">
- {{ item.name }}
- <image v-show="item.id == param.orderType" class="tab-bg" src="../../static/images/tab_bg.png" mode=""></image>
- </view>
- </view>
- </view>
- </view>
- <!-- 案例列表 -->
- <view class="cases-list">
- <view class="item" v-for="(item,index) in list" :key="index">
- <!-- 文字 -->
- <view class="dec-text ellipsis2">{{item.title}}</view>
- <!-- 有图 -->
- <view class="images-box" v-if="item.imgs!=null" >
- <view class="img-item" v-for="(subitem,j) in utils.photosToArr(item.imgs)" @click="showImg(item.imgs)" :key="j">
- <image :src="subitem" mode="aspectFill" ></image>
- </view>
- </view>
- <!-- 医生信息 -->
- <view class="doc-info">
- <view class="head">
- <image :src="item.doctorHeadImg" mode="aspectFill"></image>
- </view>
- <view class="name">{{item.doctorName}}</view>
- <view class="line"></view>
- <view class="posit">
- {{utils.getDictLabelName("doctorPosition",item.doctorPosition)}}
- </view>
- <view class="line"></view>
- <view class="address">{{item.hospitalName}}</view>
- </view>
- <view class="answer-box">
- <!-- 文字回答 -->
- <text class="text-inner" v-if="item.orderType == '1' ">{{item.replyContent}}</text>
- <!-- 语音回答 -->
- <view class="voice-inner" v-if="item.orderType == '2'">
- <free-audio
- startPic='/static/images/play.png'
- endPic='/static/images/pause.png'
- activeColor="#018C39"
- :audioId="'audio'+index"
- :url='item.replyAudioUrl'
- ></free-audio>
- </view>
- </view>
- <view class="read-box">
- <image src="../../static/images/eye.png" mode=""></image>
- <text class="text">{{item.views}}人看过</text>
- </view>
- </view>
-
- </view>
- <Loading :loaded="loaded" :loading="loading"></Loading>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {getDepartmentList,getDoctorCase} from '@/api/doctorOrder.js'
- import Loading from "@/components/Loading";
- import tabBg from "@/static/images/tab_bg.png"
- import freeAudio from '@/components/chengpeng-audio/free-audio.vue'
- export default {
- components: {freeAudio,Loading},
- data() {
- return {
- doctorOrderList:[],
- orderTypes: [{name:'全部',id:0,},{name:'图文',id:1,},{name:'语音',id:2,}],
- top:'0px',
- // 状态栏的高度
- statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
- searchValue: '',
- tabBg: tabBg, // tab切换背景
- current: 0,
- param: {
- orderType:0,
- page: 1,
- pageSize: 10
- },
- list: [],
- loaded: false,
- loading: false
- };
- },
- onShow() {
- var that=this;
- let info = uni.createSelectorQuery().select(".top-fixed");
- info.boundingClientRect(function(data) { //data - 各种参数
- console.log(data.height)
- that.top=data.height+"px";
- }).exec()
- this.getDoctorCase()
- },
- methods:{
- showImg(urls) {
- var imgArr =urls.split(',');
- //预览图片
- uni.previewImage({
- urls: imgArr,
- current: imgArr[0]
- });
- },
- getDoctorCase(){
- let that = this;
- if (that.loaded == true || that.loading == true) return;
- that.loading = true;
- uni.showLoading({
- title:"加载中..."
- })
- getDoctorCase(this.param).then(
- res => {
- that.loading = false;
- that.loaded = res.data.list.length < that.param.pageSize;
- that.param.page = that.param.page + 1;
- that.list.push.apply(that.list, res.data.list);
- uni.hideLoading()
- },
- err => {
- uni.hideLoading()
- uni.showToast({
- title: err.msg ,
- icon: 'none',
- duration: 2000
- });
- }
- );
- },
- orderTypeChange(item) {
- this.param.orderType = item.id;
- this.param.page=1;
- this.list=[];
- this.loaded=false;
- this.loading=false;
- this.getDoctorCase();
- },
- // 访问新页面
- navTo(url){
- uni.navigateTo({
- url: url
- })
- },
- }
- }
- </script>
- <style lang="scss">
- .top-fixed{
- background: #fff;
- width: 100%;
- position: fixed;
- top: 0;
- left: 0;
- z-index: 10;
- }
- .top-title{
- height: 88upx;
- line-height: 88upx;
- font-size: 42upx;
- font-family: Source Han Sans CN;
- font-weight: bold;
- color: #222222;
- padding-left: 41upx;
- background-color: #FFFFFF;
- }
- .search-cont{
- padding: 16upx 30upx;
- background-color: #FFFFFF;
- .inner{
- box-sizing: border-box;
- width: 100%;
- height: 72upx;
- background: #F7F7F7;
- border-radius: 36upx;
- display: flex;
- align-items: center;
- padding: 0 30upx;
- .icon-search{
- width: 28upx;
- height: 28upx;
- margin-right: 20upx;
- }
- input{
- height: 60upx;
- line-height: 60upx;
- flex: 1;
- }
- }
- }
-
- .online-inquiry{
- box-sizing: border-box;
- width: 100%;
- padding: 20upx;
- background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 59%, rgba(255, 255, 255, 0) 100%);
- display: flex;
- justify-content: space-between;
- .item{
- width: 346upx;
- height: 150upx;
- position: relative;
- .bg-img,
- .inner{
- width: 100%;
- height: 100%;
- position: absolute;
- top: 0;
- left: 0;
- z-index: 1;
- }
- .inner{
- box-sizing: border-box;
- z-index: 2;
- display: flex;
- flex-direction: column;
- justify-content: center;
- padding-left: 32upx;
- .title{
- font-size: 30upx;
- line-height: 1;
- font-family: PingFang SC;
- font-weight: bold;
- color: #111111;
- margin-bottom: 20upx;
- }
- .sub-title{
- font-size: 24upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- }
- image{
- width: 80upx;
- height: 90upx;
- position: absolute;
- right: 7upx;
- bottom: 7upx;
- }
- }
- }
- }
-
- .index-cont{
- box-sizing: border-box;
- padding: 0 20upx;
- .pub-item{
- background: #FFFFFF;
- border-radius: 16upx;
- margin-bottom: 20upx;
- .pub-title-box{
- box-sizing: border-box;
- padding: 36upx 30upx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .left{
- font-size: 36upx;
- line-height: 1;
- font-family: PingFang SC;
- font-weight: bold;
- color: #111111;
- }
- .right{
- display: flex;
- align-items: center;
- justify-content: center;
- .text{
- font-size: 26upx;
- line-height: 1;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- margin-right: 10upx;
- }
- image{
- width: 14upx;
- height: 24upx;
- margin-top: 5upx;
- }
- }
- }
- .inner{
- padding: 0 30upx;
- }
- // 健康知识
- .pub-tab-box{
- position: relative;
- .tab-inner{
- padding: 14upx 0 30upx;
- display: flex;
- overflow-x: auto;
- }
- .item{
- font-size: 28upx;
- white-space: nowrap;
- line-height: 1;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- margin-right: 40upx;
- position: relative;
- &:last-child{
- margin-right: 0;
- }
- &.active{
- font-weight: bold;
- color: #333333;
- }
- &.cases{
- margin-right: 60upx;
- }
- .text{
- position: relative;
- z-index: 1;
- }
- .tab-bg{
- width: 72upx;
- height: 28upx;
- position: absolute;
- top: 17upx;
- left: 50%;
- transform: translateX(-36upx);
- z-index: -1;
- }
- }
-
- }
- // 问诊案例
- .cases-list{
- padding-bottom: 10upx;
- .item{
- padding: 30upx 0;
- border-bottom: 1px solid #F0F0F0;
- &:last-child{
- border-bottom: none;
- }
- .dec-text{
- font-size: 32upx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #111111;
- line-height: 48upx;
- }
- .images-box{
- margin-top: 10upx;
- display: flex;
- flex-wrap: wrap;
- .img-item{
- width: 155upx;
- height: 155upx;
- background: #F5F5F5;
- border-radius: 8upx;
- margin: 0 10upx 10upx 0;
- overflow: hidden;
- image{
- width: 100%;
- height: 100%;
- }
- &:nth-child(4n){
- margin-right: 0;
- }
- }
- }
- .doc-info{
- display: flex;
- align-items: center;
- margin: 30upx 0 20upx;
- .head{
- width: 60upx;
- height: 60upx;
- background: #F2F5F9;
- border-radius: 50%;
- margin-right: 20upx;
- overflow: hidden;
- image{
- width: 100%;
- height: 100%;
- }
- }
- .name{
- font-size: 28upx;
- line-height: 1;
- font-family: PingFang SC;
- font-weight: 500;
- color: #111111;
- }
- .line{
- width: 1px;
- height: 22upx;
- background: #DDDDDD;
- margin: 0 16upx;
- }
- .posit,
- .address{
- font-size: 26upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- }
- }
- .answer-box{
- width: 100%;
- // height: 117upx;
- background: #F5F7F7;
- border-radius: 10upx;
- display: flex;
- flex-direction: column;
- justify-content: center;
- .text-inner{
- // height: 84upx;
- font-size: 28upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- line-height: 42upx;
- padding: 15upx;
- }
- }
- .read-box{
- margin-top: 30upx;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- image{
- width: 24upx;
- height: 19upx;
- margin-right: 10upx;
- }
- .text{
- font-size: 24upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- }
- }
- }
- }
- }
- }
- </style>
|