blob: 7cf850de79cc12e4ea353575815e8e2d1d7f5a06 [file] [log] [blame]
guangchao.xu070005a2020-12-07 09:56:40 +08001<template>
2 <view class="hospital">
3 <view class="hospital-search">
4 <u-search placeholder="搜索医院名称" v-model="hospial" :show-action="false" bg-color="#ffffff" :focus="isFocus" @search="get_hospital_list"></u-search>
5 </view>
6 <view class="hospital-drop">
7 <view class="hospital-drop-item">
8 <u-dropdown border-bottom class="drop">
9 <u-dropdown-item v-model="value1" title="医院排序" :options="options1"></u-dropdown-item>
10 </u-dropdown>
11 </view>
12 </view>
13 <view class="hospital-ul">
14 <view class="hospital-ul-noitem" v-if="hospital_list.length == 0">
15 <text>{{notice}}</text>
16 </view>
17 <view class="hospital-ul-item" v-else >
18 <view class="hospital-ul-item-box" v-for="(v,i) in hospital_list" :key="i">
19 <view class="hospital-ul-item-left">
20 <u-image :src="v.src" width="100" mode="widthFix"></u-image>
21 </view>
22 <view class="hospital-ul-item-right">
23 <view class="hospital-ul-item-right-item">
24 <text class="hospital-ul-item-right-item-logo">{{v.level}}</text>
25 <text class="hospital-ul-item-right-item-value" style="color: #333333;font-size: 32rpx;">{{v.name}}</text>
26 </view>
27 <view class="hospital-ul-item-right-item">
28 <text class="hospital-ul-item-right-item-title">地理位置:</text>
29 <text class="hospital-ul-item-right-item-value">{{v.address}}</text>
30 </view>
31 <view class="hospital-ul-item-right-item">
32 <text class="hospital-ul-item-right-item-title">门诊时间:</text>
33 <text class="hospital-ul-item-right-item-value">{{v.time}}</text>
34 </view>
35 </view>
36 </view>
37 </view>
38
39 </view>
40 </view>
41</template>
42
43<script>
44 export default {
45 data() {
46 return {
47 isFocus: true,
48 hospial: '',
49 value1: 1,
50 options1: [{
51 label: '默认排序',
52 value: 1,
53 }],
54 hospital_list: [],
55 notice:'暂无数据'
56 }
57 },
58 onLoad() {
59
60 },
61 methods: {
62 get_hospital_list() {
63 let that = this
64 let name = that.hospial
65 let params = {
66 pageno: 1,
67 pagesize: 10,
68 name: name
69 }
guangchao.xu50e42382021-01-04 17:53:47 +080070 that.$u.get('/medicalapi/hospital/list', params).then(res => {
guangchao.xu070005a2020-12-07 09:56:40 +080071 that.hospital_list = res.data.list
72 that.notice = '没有搜索到此关键词'
73 console.log(res.data.list)
74 })
75 }
76 }
77 }
78</script>
79
80<style lang="scss" scoped>
81 .drop {
82 /deep/.u-dropdown__menu__item {
83 padding: 0 30rpx;
84 justify-content: flex-start;
85 }
86 }
87
88 .hospital {
89 font-family: "PingFang-SC-Medium";
90
91 &-search {
92 padding: 30rpx;
93 }
94
95 &-drop {
96 background-color: #FFFFFF;
97
98 &-item {}
99 }
100
101 &-ul {
102 background-color: #FFFFFF;
103
104 &-noitem {
105 display: flex;
106 justify-content: center;
107 padding: 50rpx 30rpx;
108 align-items: center;
109 }
110
111 &-item {
112 &-box {
113 display: flex;
114 justify-content: space-between;
115 padding: 30rpx 10rpx;
116 }
117
118 &-left {
119 flex: 1;
120 display: flex;
121 justify-content: center;
122 }
123
124 &-right {
125 display: flex;
126 flex: 4;
127 flex-direction: column;
128
129 &-item {
130 padding: 0 0 10rpx;
131 display: flex;
132 align-items: center;
133
134 &-logo {
135 display: inline-block;
136 background-color: #17C46F;
137 padding: 4rpx;
138 color: #FFFFFF;
139 font-size: 20rpx;
140 border-radius: 5rpx;
141 margin-right: 10rpx;
142 }
143
144 &-title {
145 display: inline-block;
146 // flex: 1;
147 width: 140rpx;
148 color: #B5B5B5;
149 font-size: 26rpx;
150 }
151
152 &-value {
153 display: inline-block;
154 // flex: 4;
155 color: #B5B5B5;
156 width: 400rpx;
157 white-space: nowrap;
158 text-overflow: ellipsis;
159 overflow: hidden;
160 font-size: 28rpx;
161 }
162 }
163 }
164 }
165 }
166 }
167</style>