index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <view style="padding: 30rpx;" >
  3. <view style="padding: 0 50rpx;">
  4. <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button" activeColor="#2F4379"></uni-segmented-control>
  5. </view>
  6. <view >
  7. <view v-show="current === 0">
  8. <view class="content" v-for="(item,index) in list" :key="index">
  9. <view class="c_t1">
  10. 2021年5月1日
  11. </view>
  12. <view>
  13. <u-row >
  14. <u-col span="5" >
  15. <view style="padding: 5rpx;">
  16. <image src="/static/banner.png" class="c_img"></image>
  17. </view>
  18. </u-col>
  19. <u-col span="7" >
  20. <view style="position: relative;height: 134rpx;padding-left: 10rpx;">
  21. <view class="c_title">
  22. 二级建造师市政公用工程
  23. </view>
  24. <view class="c_log">
  25. 上次看到 2.1 二级建造师章节标题
  26. </view>
  27. </view>
  28. </u-col>
  29. </u-row>
  30. </view>
  31. </view>
  32. </view>
  33. <view v-show="current === 1">
  34. 选项卡2的内容
  35. </view>
  36. <view v-show="current === 2">
  37. 选项卡3的内容
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. export default {
  44. data() {
  45. return {
  46. current:0,
  47. items: [
  48. '课程',
  49. '刷题',
  50. '重点考点'
  51. ],
  52. list:[1,1,1,1,1,1,1,1,1,1,1],
  53. }
  54. },
  55. onLoad(option) {
  56. },
  57. onShow(){
  58. },
  59. methods: {
  60. onClickItem(e){
  61. this.current = e.currentIndex
  62. }
  63. },
  64. }
  65. </script>
  66. <style scope>
  67. .c_log{
  68. font-size: 20rpx;
  69. font-family: PingFang SC;
  70. font-weight: 400;
  71. color: #2F4379;
  72. position: absolute;
  73. bottom: 10rpx;
  74. }
  75. .c_title{
  76. font-size: 30rpx;
  77. font-family: PingFang SC;
  78. font-weight: bold;
  79. color: #2F4379;
  80. padding-top: 10rpx;
  81. }
  82. .c_img{
  83. width: 278rpx;
  84. height: 134rpx;
  85. }
  86. .c_t1{
  87. font-size: 20rpx;
  88. color: #2F4379;
  89. padding: 15rpx;
  90. }
  91. .content{
  92. margin-top: 20rpx;
  93. width: 100%;
  94. height: 225rpx;
  95. background: #FFFFFF;
  96. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  97. border-radius: 32rpx;
  98. }
  99. .segmented-control__text{
  100. font-size: 24rpx !important;
  101. }
  102. .segmented-control{
  103. height: 56rpx !important;
  104. background-color: #F8F9FF;
  105. }
  106. page {
  107. background: #FFFFFF;
  108. }
  109. </style>