index.vue 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <view class="">
  3. <!-- <view class="renal_top">
  4. <img class="renal_friends" src="../../static/images/4.png" alt="" />
  5. <view>肾友知识</view>
  6. </view> -->
  7. <!-- <text class="renal_friends">肾友知识</text> -->
  8. <van-tabs :active="active" sticky color="#69d9bf" offset-top="80px" @click="vantabs">
  9. <van-tab v-for="index in 8" :title="'标签 ' + (index+1)" :name="index+1">
  10. <view class="knowledge" v-for="(item,i) in 6" :key="i">
  11. <view class="knowledge_box" style="">
  12. <view class="box_left" style="">
  13. <view style="" class="knowledge_title">领透圣卫士肾友知识小科普</view>
  14. <view class="author" style="">
  15. <text class='author_1'>圣妞儿</text>
  16. <text class='author_1'>阅读量:xxxxx</text>
  17. </view>
  18. </view>
  19. <view class="box_right" style="width: 30%;">
  20. <img style="width: 100%;height: 160rpx;" src="@/static/images/11.png" alt="" />
  21. </view>
  22. </view>
  23. </view>
  24. </van-tab>
  25. </van-tabs>
  26. </view>
  27. </template>
  28. <script>
  29. export default{
  30. data(){
  31. return{
  32. active:1,
  33. }
  34. },
  35. methods:{
  36. vantabs(e){
  37. this.active = e.target.name
  38. console.log('ccccc',this.active);
  39. console.log('bbbbbbb',e);
  40. },
  41. }
  42. }
  43. </script>
  44. <style>
  45. .renal_top{
  46. height: 4rem;
  47. vertical-align:bottom;
  48. padding: 20rpx;
  49. background: gainsboro;
  50. }
  51. .renal_friends{
  52. width: 10px;
  53. height: 10px;
  54. /* text-align: center; */
  55. position:relative;
  56. top: 0;
  57. left: 10px;
  58. }
  59. .knowledge{
  60. /* margin-top: 20rpx; */
  61. }
  62. .knowledge_box{
  63. /* margin-bottom: 20rpx; */
  64. display: flex;
  65. padding: 40rpx;
  66. border-bottom: 1px solid #f2f0f0b3;
  67. height: 160rpx;
  68. background: white;
  69. box-shadow: 0 0 5 f2f0f0b3;
  70. /* border-radius: 20rpx; */
  71. }
  72. .box_left{
  73. width: 70%;
  74. }
  75. .box_right{
  76. width: 30%;
  77. }
  78. .knowledge_title{
  79. height: 120rpx;
  80. font-size: 36rpx;
  81. }
  82. .author{
  83. height: 40rpx;
  84. font-size: 28rpx;
  85. display: flex;
  86. text-align: left;
  87. }
  88. .author_1{
  89. flex: 1;
  90. }
  91. .right_img{
  92. width: 100%;
  93. height: 160rpx;
  94. }
  95. </style>