p-i-f-section-2.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view>
  3. <view class="section">
  4. <view class="box">
  5. <view class="title">
  6. 风机参数
  7. </view>
  8. <view class="content">
  9. <view class="inner">
  10. <view class="inner_title">
  11. <view class="title_item" :class="active == 1?'title_item_active':''" @click="click_title(1)">
  12. 1#风机
  13. </view>
  14. <view class="title_item" :class="active == 2?'title_item_active':''" @click="click_title(2)">
  15. 2#风机
  16. </view>
  17. </view>
  18. <view v-if="active == 1">
  19. <view class="inner_box">
  20. <view class="box_title">
  21. <view class="text name">参数名称</view>
  22. <view class="text num">数值</view>
  23. <view class="text company">单位</view>
  24. </view>
  25. <view class="box_list">
  26. <view class="item" v-for="(item,index) in param1" :key="index">
  27. <view class="text name">{{item.name}}</view>
  28. <view class="text num">
  29. <view class="num_box">{{item.value}}</view>
  30. </view>
  31. <view class="text company">{{item.unit}}</view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <view v-if="active == 2">
  37. <view class="inner_box">
  38. <view class="box_title">
  39. <view class="text name">参数名称</view>
  40. <view class="text num">数值</view>
  41. <view class="text company">单位</view>
  42. </view>
  43. <view class="box_list">
  44. <view class="item" v-for="(item,index) in param2" :key="index">
  45. <view class="text name">{{item.name}}</view>
  46. <view class="text num">
  47. <view class="num_box">{{item.value}}</view>
  48. </view>
  49. <view class="text company">{{item.unit}}</view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. export default {
  62. props:[
  63. "param1",
  64. "param2"
  65. ],
  66. data() {
  67. return {
  68. active:1,
  69. };
  70. },
  71. methods:{
  72. click_title(active){
  73. this.active = active
  74. }
  75. }
  76. }
  77. </script>
  78. <style lang="scss">
  79. .section{
  80. margin-top: 10rpx;
  81. box-sizing: border-box;
  82. padding: 0 15rpx;
  83. .box{
  84. background: #FFFFFF;
  85. box-shadow: 0px 3rpx 30rpx 0px rgba(59, 74, 116, 0.14);
  86. border-radius: 21rpx;
  87. .title{
  88. width: 750rpx;
  89. font-size: 32rpx;
  90. font-family: PingFangSC-Medium, PingFang SC;
  91. font-weight: 500;
  92. color: #232627;
  93. line-height: 100rpx;
  94. text-align: center;
  95. border-bottom: 2rpx solid #f3f3f3;
  96. }
  97. .content{
  98. .inner{
  99. box-sizing: border-box;
  100. padding: 0 15rpx;
  101. .inner_title{
  102. height: 74rpx;
  103. display: flex;
  104. .title_item{
  105. width: 188rpx;
  106. text-align: center;
  107. font-size: 31rpx;
  108. font-family: PingFangSC-Medium, PingFang SC;
  109. font-weight: 500;
  110. color: #6C6F74;
  111. line-height: 74rpx;
  112. }
  113. .title_item_active{
  114. color: #3498DB;
  115. border-bottom: 3rpx solid #3498d8;
  116. }
  117. }
  118. .inner_box{
  119. margin-top: 17rpx;
  120. margin-bottom: 20rpx;
  121. padding-bottom: 20rpx;
  122. width: 690rpx;
  123. .box_title{
  124. display: flex;
  125. background: #F3F6FA;
  126. .text{
  127. font-size: 27rpx;
  128. font-family: PingFangSC-Regular, PingFang SC;
  129. font-weight: 400;
  130. color: #232627;
  131. line-height: 83rpx;
  132. text-align: center;
  133. }
  134. .name{
  135. width: 324rpx;
  136. }
  137. .num{
  138. margin-left: 26rpx;
  139. width: 162rpx;
  140. }
  141. .company{
  142. margin-left: 16rpx;
  143. width: 162rpx;
  144. }
  145. }
  146. .box_list{
  147. .item{
  148. display: flex;
  149. border-bottom: 1rpx solid #f3f3f3;
  150. .text{
  151. font-size: 27rpx;
  152. font-family: PingFangSC-Regular, PingFang SC;
  153. font-weight: 400;
  154. color: #232627;
  155. line-height: 83rpx;
  156. text-align: center;
  157. }
  158. .name{
  159. width: 324rpx;
  160. }
  161. .num{
  162. margin-left: 26rpx;
  163. width: 162rpx;
  164. .num_box{
  165. margin-top: 22rpx;
  166. background: #8ADAFF;
  167. line-height: 40rpx;
  168. }
  169. }
  170. .company{
  171. margin-left: 16rpx;
  172. width: 162rpx;
  173. }
  174. }
  175. }
  176. }
  177. }
  178. }
  179. }
  180. }
  181. </style>