guangchao.xu | 070005a | 2020-12-07 09:56:40 +0800 | [diff] [blame] | 1 | <template> |
| 2 | <view class="outpatient"> |
| 3 | <view class="outpatient-headerbox"> |
| 4 | <view class="outpatient-header"> |
| 5 | <view class="outpatient-header-img"> |
| 6 | <u-image src="/static/images/active/mrlfl.png" width="120" mode="widthFix"></u-image> |
| 7 | </view> |
| 8 | <view class="outpatient-header-msg"> |
| 9 | <text class="outpatient-header-msg-title">大理市第一人民医院</text> |
| 10 | <text class="outpatient-header-msg-logo">三甲</text> |
| 11 | <text class="outpatient-header-msg-to">热门科室:皮肤科、普外科</text> |
| 12 | </view> |
| 13 | </view> |
| 14 | <u-icon name="map" color="#52B6E6" size="36" :label="local" class="outpatient-headerbox-icon" label-color="#A1A1A1"></u-icon> |
| 15 | <u-icon name="clock" color="#52B6E6" size="36" :label="time" class="outpatient-headerbox-icon" label-color="#A1A1A1"></u-icon> |
| 16 | <u-icon name="phone" color="#52B6E6" size="36" :label="tel" class="outpatient-headerbox-icon" label-color="#A1A1A1"></u-icon> |
| 17 | </view> |
| 18 | <view class="outpatient-search"> |
| 19 | <u-search placeholder="搜索科室名称" v-model="part" :show-action="false" bg-color="#ffffff"></u-search> |
| 20 | </view> |
| 21 | <view class="outpatient-kinds"> |
| 22 | <view class="outpatient-kinds-left"> |
| 23 | <scroll-view scroll-y="true" class="scrollView" :style="{height:height+'px'}"> |
| 24 | <view class="outpatient-kinds-left-item"> |
| 25 | <view class="outpatient-kinds-left-item-line"> </view> |
| 26 | <u-cell-item title="全部" :arrow="false" bg-color="#ffffff" :title-style="style"></u-cell-item> |
| 27 | </view> |
| 28 | </scroll-view> |
| 29 | </view> |
| 30 | <view class="outpatient-kinds-right"> |
| 31 | <scroll-view scroll-y="true" class="scrollView" :style="{height:height+'px'}"> |
| 32 | <view class="outpatient-kinds-right-item" @click="toPath('/pages/sub_medical/queryDate')"> |
| 33 | <u-cell-item title="心内科" :arrow="false"></u-cell-item> |
| 34 | </view> |
| 35 | <view class="outpatient-kinds-right-item"> |
| 36 | <u-cell-item title="心内科" :arrow="false"></u-cell-item> |
| 37 | </view> |
| 38 | <view class="outpatient-kinds-right-item"> |
| 39 | <u-cell-item title="心内科" :arrow="false"></u-cell-item> |
| 40 | </view> |
| 41 | <view class="outpatient-kinds-right-item"> |
| 42 | <u-cell-item title="心内科" :arrow="false"></u-cell-item> |
| 43 | </view> |
| 44 | <view class="outpatient-kinds-right-item"> |
| 45 | <u-cell-item title="心内科" :arrow="false"></u-cell-item> |
| 46 | </view> |
| 47 | </scroll-view> |
| 48 | </view> |
| 49 | </view> |
| 50 | </view> |
| 51 | </template> |
| 52 | |
| 53 | <script> |
| 54 | export default { |
| 55 | data() { |
| 56 | return { |
| 57 | local: '云南省大理市下关泰安路36号', |
| 58 | time: '上午8:00-11:30;下午14:00-17:30 周六、日照常。', |
| 59 | tel: '021-3123320', |
| 60 | part: '', |
| 61 | height: '', |
| 62 | style: { |
| 63 | color: '#40AFE3', |
| 64 | fontWeight: 'bold' |
| 65 | } |
| 66 | } |
| 67 | }, |
| 68 | onLoad() { |
| 69 | this.getSrcollViewHeight() |
| 70 | }, |
| 71 | methods: { |
| 72 | getSrcollViewHeight() { |
| 73 | let winHeight |
| 74 | let that = this |
| 75 | uni.getSystemInfo({ |
| 76 | success: function(res) { |
| 77 | winHeight = res.windowHeight |
| 78 | } |
| 79 | }); |
| 80 | //console.log(winHeight) |
| 81 | const query = uni.createSelectorQuery().in(that); |
| 82 | query.select('.outpatient-search').boundingClientRect(data => { |
| 83 | console.log(data) |
| 84 | if (!data) { |
| 85 | setTimeout(() => { |
| 86 | that.getSrcollViewHeight() |
| 87 | }, 10) |
| 88 | return |
| 89 | } |
| 90 | that.height = winHeight - data.top - data.height |
| 91 | // that.height = (data.bottom - data.height)*2 |
| 92 | }).exec(); |
| 93 | }, |
| 94 | } |
| 95 | } |
| 96 | </script> |
| 97 | |
| 98 | <style lang="scss" scoped> |
| 99 | .u-cell{ |
| 100 | padding: 20rpx 32rpx; |
| 101 | } |
| 102 | .outpatient { |
| 103 | font-family: "PingFang-SC-Medium"; |
| 104 | |
| 105 | &-headerbox { |
| 106 | background-color: #FFFFFF; |
| 107 | padding: 30rpx 20rpx; |
| 108 | |
| 109 | &-icon { |
| 110 | margin-bottom: 10rpx; |
| 111 | font-size: 28rpx; |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | &-header { |
| 116 | display: flex; |
| 117 | align-items: center; |
| 118 | margin-bottom: 30rpx; |
| 119 | |
| 120 | &-img { |
| 121 | justify-content: center; |
| 122 | |
| 123 | } |
| 124 | |
| 125 | &-msg { |
| 126 | margin-left: 20rpx; |
| 127 | display: flex; |
| 128 | flex-direction: column; |
| 129 | |
| 130 | &-title { |
| 131 | font-size: 32rpx; |
| 132 | } |
| 133 | |
| 134 | &-logo { |
| 135 | display: inline-block; |
| 136 | background-color: #17C46F; |
| 137 | padding: 4rpx; |
| 138 | width: 80rpx; |
| 139 | color: #FFFFFF; |
| 140 | text-align: center; |
| 141 | font-size: 20rpx; |
| 142 | border-radius: 5rpx; |
| 143 | margin: 10rpx 0; |
| 144 | } |
| 145 | |
| 146 | &-to { |
| 147 | color: #A1A1A1; |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | } |
| 152 | |
| 153 | &-search { |
| 154 | padding: 30rpx; |
| 155 | } |
| 156 | &-kinds { |
| 157 | display: flex; |
| 158 | &-left { |
| 159 | flex: 1; |
| 160 | &-item { |
| 161 | display: flex; |
| 162 | background-color: #FFFFFF; |
| 163 | &-line { |
| 164 | width: 10rpx; |
| 165 | height: 110rpx; |
| 166 | background-color: #40AFE3; |
| 167 | } |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | &-right { |
| 172 | flex: 3; |
| 173 | background-color: #FFFFFF; |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | } |
| 178 | </style> |