deviceDetail.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <view class="device-detail-box">
  3. <aircondition v-if="type === 'aircondition'" :title="title"></aircondition>
  4. <lighting v-else-if="type === 'lighting'" :title="title" :space="space"></lighting>
  5. <meter-show v-else-if="type === 'meter'" :title="title" :space="space"></meter-show>
  6. <water v-else-if="type === 'water'" :title="title" :space="space"></water>
  7. </view>
  8. </template>
  9. <script>
  10. import aircondition from '@/components/device/aircondition';
  11. import lighting from '@/components/device/lighting';
  12. import meterShow from '@/components/device/meter';
  13. import water from '@/components/device/water';
  14. export default {
  15. data() {
  16. return {
  17. type: '',
  18. title: '',
  19. space: ''
  20. }
  21. },
  22. onLoad(body) {
  23. this.title = body.name;
  24. this.space = body.space || '';
  25. uni.setNavigationBarTitle({
  26. title: body.name
  27. });
  28. this.type = body.type
  29. },
  30. methods: {
  31. },
  32. components: {
  33. aircondition,
  34. lighting,
  35. meterShow,
  36. water
  37. },
  38. }
  39. </script>
  40. <style>
  41. </style>