网友真实露脸自拍10p,成人国产精品秘?久久久按摩,国产精品久久久久久无码不卡,成人免费区一区二区三区

小程序模板網(wǎng)

小程序實現(xiàn)經(jīng)典的列表頁

發(fā)布時間:2018-04-20 10:22 所屬欄目:小程序開發(fā)教程

結果示例圖

conversation.png 
思路

善用flex

對row左右對開 
東邊上面對開 
東北角左右分散對齊

 

  1.  
  2. class="row" wx:for="{{list}}" wx:key="" bindtap="rowTapped" data-id="{{item.id}}">
  3.  
  4. src="{{item.head_img_url}}" />
  5.  
  6. class="content">
  7. class="top">
  8. class="nickname">{{item.nickname}}
  9. class="datetime">{{item.datetime}}
  10.  
  11. class="bottom">
  12. class="sentence">{{item.last_content}}
  13.  
  14.  
  15.  
 

wxss

 

  1. /*首頁樣式*/
  2.  
  3. /*單元行*/
  4. .row {
  5. display: flex;
  6. flex-direction: row;
  7. align-items: center;
  8. margin: 0 30rpx;
  9. border-bottom: 1px solid #e8e8e8;
  10. }
  11.  
  12. /*頭像*/
  13. .row image {
  14. width: 100rpx;
  15. height: 100rpx;
  16. border-radius: 50rpx;
  17. margin: 20rpx;
  18. }
  19.  
  20. /*主體*/
  21. .content {
  22. display: flex;
  23. flex-direction: column;
  24. width: 76%;
  25. padding-left: 20rpx;
  26. }
  27.  
  28. /*昵稱與日期*/
  29. .top, .bottom {
  30. display: flex;
  31. flex-direction: row;
  32. justify-content: space-between;
  33. align-items: center;
  34. width: 100%;
  35. }
  36.  
  37. /*昵稱*/
  38. .nickname {
  39. color: #4d4d4d;
  40. font-size: 36rpx;
  41. }
  42.  
  43. /*日期*/
  44. .datetime {
  45. padding: 10rpx;
  46. font-size: 26rpx;
  47. color: #b2b2b2;
  48. }
  49.  
  50. /*話語*/
  51. .sentence {
  52. color: #ccc;
  53. font-size: 28rpx;
  54. margin-top: 6rpx;
  55. overflow: hidden;
  56. text-overflow: ellipsis;
  57. white-space: nowrap;
  58. }
 

技術點

1.flex

電梯直達:http://www.ruanyifeng.com/blog/2015/07/flex-grammar.html

2.字符串截取

在上述css代碼中

 

  1. overflow: hidden;
  2. text-overflow: ellipsis;
  3. white-space: nowrap;

用處是將過多的文本變成...,并且只有一占據(jù)一行

3.圓角圖標

 

  1. border-radius = width / 2


易優(yōu)小程序(企業(yè)版)+靈活api+前后代碼開源 碼云倉庫:starfork
本文地址:http://www.xiuhaier.com/wxmini/doc/course/23732.html 復制鏈接 如需定制請聯(lián)系易優(yōu)客服咨詢:800182392 點擊咨詢
QQ在線咨詢
AI智能客服 ×