agency.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <view class="content">
  3. <view class="nav-top" style="position: fixed;top: 0;width: 100%;z-index: 99999;margin-top: -40rpx;">
  4. <scroll-view scroll-x class="base-bg-color nav padding-top-30" scroll-with-animation >
  5. <view class="cu-item text-white" :class="index==current?'checked':''" v-for="(item,index) in tabList" :key="index" @tap="tabSelect(index)" >
  6. {{item}}
  7. </view>
  8. </scroll-view>
  9. </view>
  10. <view class="" :style="{marginTop:navHeight}">
  11. <agency-info v-show="current==0"></agency-info>
  12. <data-service v-show="current==1"></data-service>
  13. <fire-service style="z-index: 99;" v-show="current==2"></fire-service>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. import agencyInfo from "./comps/agency-info.vue"
  19. import dataService from "./comps/data-service.vue"
  20. import fireService from "./comps/fire-service.vue"
  21. export default {
  22. components:{
  23. agencyInfo,
  24. dataService,
  25. fireService
  26. },
  27. data() {
  28. return {
  29. navHeight:'',
  30. current:0,
  31. tabList:['园区概况','数据统计','消防统计'],
  32. };
  33. },
  34. onLoad(options) {
  35. if (options.current) {
  36. this.current=options.current
  37. }
  38. },
  39. onReady() {
  40. this.$u.getRect('.nav-top').then(res => {
  41. this.navHeight=res.height-uni.upx2px(40)+'px'
  42. })
  43. },
  44. methods: {
  45. tabSelect(index){
  46. this.current=index
  47. }
  48. }
  49. };
  50. </script>
  51. <style lang="scss" >
  52. page{
  53. background-color: #FFFFFF;
  54. }
  55. .line-groove {
  56. height: 8rpx;
  57. // border-top: 10rpx groove $base-color;
  58. background: repeating-radial-gradient(#e9685e, #ffaa00, #0055ff 10%);
  59. }
  60. .cu-item1{
  61. height: 80rpx;
  62. line-height: 80rpx;
  63. display: inline-block;
  64. margin: 0 10rpx;
  65. padding: 0 20rpx;
  66. }
  67. .checked{
  68. font-weight: 800;
  69. font-size: 42rpx;
  70. }
  71. .top{
  72. height: 100rpx;
  73. background-color: $base-color;
  74. }
  75. </style>