blob: 5de78b7089d1aa8ec53a9df603838f5c72a231cc [file] [log] [blame]
guangchao.xu070005a2020-12-07 09:56:40 +08001<template>
2 <view class="appointment">
3 <view class="appointment-header" @click="getLocal">
4 <u-image src="./images/app_bannar.png" width="100%" mode="widthFix"></u-image>
5 <u-icon name="map" color="#52B6E6" size="36" :label="local" class="appointment-header-icon"></u-icon>
6 </view>
7 <view class="appointment-search">
8 <u-search placeholder="搜索医院名称" v-model="hospial" :show-action="false" bg-color="#ffffff" @focus="toPath('/pages/sub_medical/hospital')"></u-search>
9 </view>
10 <view class="appointment-record">
11 <u-cell-group>
12 <u-cell-item title="我的挂号记录" value="查看更多" @click="toPath('/pages/sub_medical/record')"></u-cell-item>
13 </u-cell-group>
14 <view class="appointment-record-msg" v-if="record_list.length != 0">
15 <view class="appointment-record-msg-left">
16 <u-image src="/static/images/active/mrlfl.png" width="100" mode="widthFix"></u-image>
17 </view>
18 <view class="appointment-record-msg-center">
19 <view class="appointment-record-msg-center-item">
20 <text class="appointment-record-msg-center-item-title">就诊人员:</text>
21 <text class="appointment-record-msg-center-item-value">李小萌</text>
22 </view>
23 <view class="appointment-record-msg-center-item">
24 <text class="appointment-record-msg-center-item-title">就诊医院:</text>
25 <text class="appointment-record-msg-center-item-value">大理市第二人民医院</text>
26 </view>
27 <view class="appointment-record-msg-center-item">
28 <text class="appointment-record-msg-center-item-title">就诊科室:</text>
29 <text class="appointment-record-msg-center-item-value">普外科</text>
30 </view>
31 <view class="appointment-record-msg-center-item">
32 <text class="appointment-record-msg-center-item-title">就诊时间:</text>
33 <text class="appointment-record-msg-center-item-value">2020-10-27【上午】</text>
34 </view>
35 </view>
36 <view class="appointment-record-msg-right">
37 <text class="appointment-record-msg-status">挂号成功</text>
38 </view>
39 </view>
40 <view class="appointment-record-nomsg" v-else>
41 <text>暂无挂号记录</text>
42 </view>
43 <!-- <view class="appointment-record-btn">
44 <u-button :plain="true" size="mini" type="primary" shape="circle">取消预约</u-button>
45 </view> -->
46 </view>
47 <view class="appointment-hospital">
48 <u-cell-group>
49 <u-cell-item title="本地医院" value="查看更多" @click="toPath('/pages/sub_medical/hospital')"></u-cell-item>
50 </u-cell-group>
51 <view class="appointment-hospital-msg" v-if="hospital_list.length != 0">
52 <view class="appointment-hospital-msg-box" @click="toPath('/pages/sub_medical/outpatient')" v-for="(v,i) in hospital_list" :key="i">
53 <view class="appointment-hospital-msg-left">
54 <u-image :src="v.src" width="100" mode="widthFix"></u-image>
55 </view>
56 <view class="appointment-hospital-msg-right">
57 <view class="appointment-hospital-msg-right-item">
58 <text class="appointment-hospital-msg-right-item-logo">{{v.level}}</text>
59 <text class="appointment-hospital-msg-right-item-value" style="color: #333333;font-size: 32rpx;">{{v.name}}</text>
60 </view>
61 <view class="appointment-hospital-msg-right-item">
62 <text class="appointment-hospital-msg-right-item-title">地理位置:</text>
63 <text class="appointment-hospital-msg-right-item-value">{{v.address}}</text>
64 </view>
65 <view class="appointment-hospital-msg-right-item">
66 <text class="appointment-hospital-msg-right-item-title">门诊时间:</text>
67 <text class="appointment-hospital-msg-right-item-value">{{v.time}}</text>
68 </view>
69 </view>
70 </view>
71 </view>
72 <view class="appointment-hospital-nomsg" v-else>
73 <text>暂无医院数据</text>
74 </view>
75 </view>
76 </view>
77</template>
78
79<script>
80 export default {
81 data() {
82 return {
83 local: '大理',
84 hospial: '',
85 hospital_list:[],
86 record_list:[]
87 }
88 },
89 onLoad() {
90 this.get_hospital_list()
91 this.getLocal()
92 },
93 methods: {
94 getLocal() {
95 let that = this
96 uni.getLocation({
97 type: 'gcj02',
98 geocode: true,
99 success(res) {
100 console.log(res)
101 // #ifdef APP-PLUS
102 that.local = res.address.city
103 // #endif
104 },
105 fail(ret){
106 that.local = '获取位置失败'
107 console.log(ret)
108 }
109 })
110 },
111 get_hospital_list(){
112 let that = this
113 let params = {
114 pageno:1,
115 pagesize:3,
116 name:''
117 }
118 that.$u.get('/medicineapi/hospital/list',params).then(res=>{
119 that.hospital_list = res.data.list
120 console.log(res.data.list)
121 })
122 }
123 }
124 }
125</script>
126
127<style lang="scss" scoped>
128 /deep/.u-btn--primary--plain {
129 background-color: #FFFFFF !important;
130 }
131
132 .u-cell {
133 padding: 30rpx 20rpx;
134 }
135
136 /deep/.u-cell__right-icon-wrap {
137 height: 54rpx;
138 }
139
140 uni-button {
141 margin-left: 0;
142 margin-right: 0;
143 }
144
145 .appointment {
146 font-family: "PingFang-SC-Medium";
147
148 &-header {
149 position: relative;
150
151 &-icon {
152 position: absolute;
153 top: 20rpx;
154 left: 20rpx;
155 }
156 }
157
158 &-search {
159 padding: 30rpx;
160 }
161
162 &-record {
163 background-color: #FFFFFF;
164 &-nomsg{
165 display: flex;
166 justify-content: center;
167 align-items: center;
168 padding: 50rpx 30rpx;
169 }
170
171 &-msg {
172 padding: 30rpx 10rpx;
173 display: flex;
174 justify-content: space-between;
175
176 // align-items: center;
177 &-left {
178 flex: 1;
179 display: flex;
180 justify-content: center;
181 }
182
183 &-center {
184 flex: 3;
185
186 &-item {
187 padding: 0 0 10rpx;
188
189 &-title {
190 color: #909399;
191 }
192 }
193 }
194
195 &-right {
196 display: flex;
197 justify-content: center;
198 flex: 1;
199 color: #3DC64F;
200
201 &-item {}
202 }
203 }
204
205 &-btn {
206 padding: 0rpx 30rpx 30rpx;
207 display: flex;
208 justify-content: flex-end;
209 }
210 }
211
212 &-hospital {
213 background-color: #FFFFFF;
214 margin: 30rpx 0;
215
216 &-nomsg{
217 display: flex;
218 justify-content: center;
219 align-items: center;
220 padding: 50rpx 30rpx;
221 }
222
223 &-msg {
224 &-box {
225 display: flex;
226 justify-content: space-between;
227 padding: 30rpx 10rpx;
228 }
229
230 &-left {
231 flex: 1;
232 display: flex;
233 justify-content: center;
234 }
235
236 &-right {
237 display: flex;
238 flex: 4;
239 flex-direction: column;
240
241 &-item {
242 padding: 0 0 10rpx;
243 display: flex;
244 align-items: center;
245
246 &-logo {
247 display: inline-block;
248 background-color: #17C46F;
249 padding: 4rpx;
250 color: #FFFFFF;
251 font-size: 20rpx;
252 border-radius: 5rpx;
253 margin-right: 10rpx;
254 }
255
256 &-title {
257 display: inline-block;
258 // flex: 1;
259 width: 140rpx;
260 color: #B5B5B5;
261 font-size: 26rpx;
262 }
263
264 &-value {
265 display: inline-block;
266 // flex: 4;
267 color: #B5B5B5;
268 width: 400rpx;
269 white-space: nowrap;
270 text-overflow: ellipsis;
271 overflow: hidden;
272 font-size: 28rpx;
273 }
274 }
275 }
276 }
277 }
278 }
279</style>