guangchao.xu | 070005a | 2020-12-07 09:56:40 +0800 | [diff] [blame] | 1 | <template> |
| 2 | <view class="chatDetails" @touchmove.stop.prevent="moveHandle"> |
| 3 | <view class="chatDetails-header"> |
| 4 | <view class="chatDetails-header-title"> |
| 5 | 今天有去苍山的吗?一起拼个车呗!仅限女生哦,小姐姐快来联系我吧~ |
| 6 | </view> |
| 7 | <view class="chatDetails-header-avatar"> |
| 8 | <u-avatar :src="avatar" size="110"></u-avatar> |
| 9 | <view class="chatDetails-header-avatar-desc"> |
| 10 | <text class="chatDetails-header-avatar-desc-name">李萌萌</text> |
| 11 | <text class="chatDetails-header-avatar-desc-date">3小时前</text> |
| 12 | </view> |
| 13 | </view> |
| 14 | <view class="chatDetails-header-con"> |
| 15 | 今天下午1点到4点,有没有小伙伴想去苍山的啊?有的话我们就一起呗,路上有个陪伴,还能多认识一些小伙伴对不对呀,限女生哦~有一起拼车的小姐姐们记得找我哦! |
| 16 | </view> |
| 17 | </view> |
| 18 | <view class="chatDetails-line"></view> |
| 19 | <scroll-view :scroll-y="true" :style="{height:height+'px'}" class="scrollView"> |
| 20 | <view class="chatDetails-items"> |
| 21 | <view class="chatDetails-items-desc"> |
| 22 | <view class="chatDetails-items-desc-left"> |
| 23 | <u-avatar :src="avatar" size="112"></u-avatar> |
| 24 | </view> |
| 25 | <view class="chatDetails-items-desc-right"> |
| 26 | <view class="chatDetails-items-desc-right-author"> |
| 27 | <text class="chatDetails-items-desc-right-author-name">刘壮壮</text> |
| 28 | <view class="chatDetails-items-desc-right-author-sup"> |
| 29 | <text>166</text> |
| 30 | <u-icon name="thumb-up-fill" color="#8A8A8A" size="26"></u-icon> |
| 31 | </view> |
| 32 | </view> |
| 33 | <view class="chatDetails-items-desc-right-date">1小时前</view> |
| 34 | <view class="chatDetails-items-desc-right-desc">男生就没有机会了吗?嘤嘤嘤~~~</view> |
| 35 | </view> |
| 36 | </view> |
| 37 | </view> |
| 38 | <view class="chatDetails-items"> |
| 39 | <view class="chatDetails-items-desc"> |
| 40 | <view class="chatDetails-items-desc-left"> |
| 41 | <u-avatar :src="avatar" size="112"></u-avatar> |
| 42 | </view> |
| 43 | <view class="chatDetails-items-desc-right"> |
| 44 | <view class="chatDetails-items-desc-right-author"> |
| 45 | <text class="chatDetails-items-desc-right-author-name">刘壮壮</text> |
| 46 | <view class="chatDetails-items-desc-right-author-sup"> |
| 47 | <text>166</text> |
| 48 | <u-icon name="thumb-up-fill" color="#8A8A8A" size="26"></u-icon> |
| 49 | </view> |
| 50 | </view> |
| 51 | <view class="chatDetails-items-desc-right-date">1小时前</view> |
| 52 | <view class="chatDetails-items-desc-right-desc">男生就没有机会了吗?嘤嘤嘤~~~</view> |
| 53 | </view> |
| 54 | </view> |
| 55 | </view> |
| 56 | <view class="chatDetails-items"> |
| 57 | <view class="chatDetails-items-desc"> |
| 58 | <view class="chatDetails-items-desc-left"> |
| 59 | <u-avatar :src="avatar" size="112"></u-avatar> |
| 60 | </view> |
| 61 | <view class="chatDetails-items-desc-right"> |
| 62 | <view class="chatDetails-items-desc-right-author"> |
| 63 | <text class="chatDetails-items-desc-right-author-name">刘壮壮</text> |
| 64 | <view class="chatDetails-items-desc-right-author-sup"> |
| 65 | <text>166</text> |
| 66 | <u-icon name="thumb-up-fill" color="#8A8A8A" size="26"></u-icon> |
| 67 | </view> |
| 68 | </view> |
| 69 | <view class="chatDetails-items-desc-right-date">1小时前</view> |
| 70 | <view class="chatDetails-items-desc-right-desc">男生就没有机会了吗?嘤嘤嘤~~~</view> |
| 71 | </view> |
| 72 | </view> |
| 73 | </view> |
| 74 | <view class="chatDetails-items"> |
| 75 | <view class="chatDetails-items-desc"> |
| 76 | <view class="chatDetails-items-desc-left"> |
| 77 | <u-avatar :src="avatar" size="112"></u-avatar> |
| 78 | </view> |
| 79 | <view class="chatDetails-items-desc-right"> |
| 80 | <view class="chatDetails-items-desc-right-author"> |
| 81 | <text class="chatDetails-items-desc-right-author-name">刘壮壮</text> |
| 82 | <view class="chatDetails-items-desc-right-author-sup"> |
| 83 | <text>166</text> |
| 84 | <u-icon name="thumb-up-fill" color="#8A8A8A" size="26"></u-icon> |
| 85 | </view> |
| 86 | </view> |
| 87 | <view class="chatDetails-items-desc-right-date">1小时前</view> |
| 88 | <view class="chatDetails-items-desc-right-desc">男生就没有机会了吗?嘤嘤嘤~~~</view> |
| 89 | </view> |
| 90 | </view> |
| 91 | </view> |
| 92 | </scroll-view> |
| 93 | <view class="chatDetails-bottom"> |
| 94 | <u-icon name="chat" color="#999999" size="44"></u-icon> |
| 95 | <text class="chatDetails-bottom-num">12</text> |
| 96 | <view class="chatDetails-bottom-ipt"> |
| 97 | <u-search placeholder="说点什么吧" v-model="val" :show-action="false"></u-search> |
| 98 | </view> |
| 99 | <u-icon name="thumb-up" color="#999999" size="44"></u-icon> |
| 100 | <u-button size="mini" :custom-style="chatDetailsBottomBtn">发送</u-button> |
| 101 | </view> |
| 102 | </view> |
| 103 | </template> |
| 104 | |
| 105 | <script> |
| 106 | export default { |
| 107 | data() { |
| 108 | return { |
| 109 | avatar: "", |
| 110 | val: "", |
| 111 | height: "", |
| 112 | chatDetailsBottomBtn:{ |
| 113 | color: '#ffffff', |
| 114 | backgroundColor: '#30A8E1', |
| 115 | borderRadius: '50rpx', |
| 116 | padding: '30rpx 40rpx', |
| 117 | marginLeft: '10rpx', |
| 118 | } |
| 119 | } |
| 120 | }, |
| 121 | methods: { |
| 122 | moveHandle() { |
| 123 | return |
| 124 | }, |
| 125 | getSrcollViewHeight(){ |
| 126 | let winHeight |
| 127 | let that =this |
| 128 | uni.getSystemInfo({ |
| 129 | success: function(res) { |
| 130 | winHeight = res.windowHeight |
| 131 | } |
| 132 | }); |
| 133 | const query = uni.createSelectorQuery().in(that); |
| 134 | let top,height |
| 135 | query.select('.scrollView').boundingClientRect(data => { |
| 136 | console.log(data) |
| 137 | top = Number(data.top) |
| 138 | }).exec(); |
| 139 | query.select('.chatDetails-bottom').boundingClientRect(data => { |
| 140 | height = Number(data.height) |
| 141 | that.height = winHeight - top - height |
| 142 | }).exec(); |
| 143 | } |
| 144 | }, |
| 145 | onLoad() { |
| 146 | |
| 147 | }, |
| 148 | onReady() { |
| 149 | this.getSrcollViewHeight() |
| 150 | } |
| 151 | } |
| 152 | </script> |
| 153 | |
| 154 | <style lang="scss" scoped> |
| 155 | scroll-view ::-webkit-scrollbar { |
| 156 | width: 0; |
| 157 | height: 0; |
| 158 | display: none; |
| 159 | background-color: transparent; |
| 160 | } |
| 161 | |
| 162 | .scrollView { |
| 163 | // height: calc(100vh - 560rpx); |
| 164 | // padding-bottom: 150rpx; |
| 165 | } |
| 166 | |
| 167 | .chatDetails { |
| 168 | width: 100vw; |
| 169 | background-color: #FFFFFF; |
| 170 | font-family: "PingFang-SC-Medium"; |
| 171 | |
| 172 | &-header { |
| 173 | padding: 30rpx; |
| 174 | |
| 175 | &-title { |
| 176 | color: #343434; |
| 177 | font-size: 31rpx; |
| 178 | } |
| 179 | |
| 180 | &-avatar { |
| 181 | display: flex; |
| 182 | margin: 30rpx 0 20rpx; |
| 183 | |
| 184 | &-desc { |
| 185 | display: flex; |
| 186 | flex-direction: column; |
| 187 | justify-content: space-around; |
| 188 | margin-left: 20rpx; |
| 189 | |
| 190 | &-name { |
| 191 | color: #343434; |
| 192 | font-size: 28rpx; |
| 193 | } |
| 194 | |
| 195 | &-date { |
| 196 | color: #9A9A9A; |
| 197 | font-size: 24rpx; |
| 198 | } |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | &-con { |
| 203 | color: #666666; |
| 204 | font-size: 28rpx; |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | &-line { |
| 209 | width: 100%; |
| 210 | height: 2rpx; |
| 211 | background-color: rgba(204, 204, 204, 1); |
| 212 | margin: 10rpx 0 0; |
| 213 | } |
| 214 | |
| 215 | &-items { |
| 216 | padding: 30rpx; |
| 217 | |
| 218 | &-desc { |
| 219 | display: flex; |
| 220 | |
| 221 | &-right { |
| 222 | width: 80%; |
| 223 | margin-left: 20rpx; |
| 224 | margin-top: 15rpx; |
| 225 | |
| 226 | &-author { |
| 227 | display: flex; |
| 228 | align-items: center; |
| 229 | justify-content: space-between; |
| 230 | |
| 231 | &-name { |
| 232 | color: #343434; |
| 233 | font-size: 28rpx; |
| 234 | } |
| 235 | |
| 236 | &-sup { |
| 237 | color: #9A9A9A; |
| 238 | font-size: 24rpx; |
| 239 | display: flex; |
| 240 | align-items: center; |
| 241 | |
| 242 | text { |
| 243 | margin-right: 10rpx; |
| 244 | } |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | &-date { |
| 249 | color: #9A9A9A; |
| 250 | font-size: 24rpx; |
| 251 | margin: 10rpx 0; |
| 252 | } |
| 253 | |
| 254 | &-desc { |
| 255 | color: #666666; |
| 256 | font-size: 28rpx; |
| 257 | display: inline-block; |
| 258 | text-align: justify; |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | &-bottom { |
| 266 | position: fixed; |
| 267 | bottom: 0; |
| 268 | width: 100vw; |
| 269 | height: 120rpx; |
| 270 | padding: 30rpx; |
| 271 | display: flex; |
| 272 | background-color: #FFFFFF; |
| 273 | align-items: center; |
| 274 | border-top: 2rpx rgba(100, 100, 100, 0.09) solid; |
| 275 | |
| 276 | &-num { |
| 277 | color: #9A9A9A; |
| 278 | font-size: 24rpx; |
| 279 | font-family: "PingFang-SC-Regular"; |
| 280 | margin: 0 20rpx 0 5rpx; |
| 281 | } |
| 282 | |
| 283 | &-ipt { |
| 284 | width: 65%; |
| 285 | margin-right: 20rpx; |
| 286 | } |
| 287 | |
| 288 | &-btn { |
| 289 | color: #ffffff; |
| 290 | background-color: #30A8E1; |
| 291 | border-radius: 50rpx; |
| 292 | padding: 30rpx 40rpx; |
| 293 | margin-left: 10rpx; |
| 294 | } |
| 295 | } |
| 296 | } |
| 297 | </style> |