IntServ.vue 1014 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <view>
  3. <modeBaseIntServ v-if="modeType == 'base'" ref="modeBaseIntServ"></modeBaseIntServ>
  4. <modeCareIntServ v-if="modeType == 'care'" ref="modeCareIntServ"></modeCareIntServ>
  5. </view>
  6. </template>
  7. <script>
  8. import modeBaseIntServ from '@/pages/BaseTabBar/IntServ.vue'
  9. import modeCareIntServ from '@/pages/CareTabBar/IntServ.vue'
  10. var that;
  11. export default {
  12. data() {
  13. return {
  14. modeType: ''
  15. }
  16. },
  17. components:{
  18. modeBaseIntServ,
  19. modeCareIntServ
  20. },
  21. onLoad(option) {
  22. that = this;
  23. that.modeType = uni.getStorageSync('modeType') || 'base';
  24. that.$nextTick(function() {
  25. if (that.modeType == 'base'){
  26. that.$refs.modeBaseIntServ.getData();
  27. }else if (that.modeType == 'care'){
  28. that.$refs.modeCareIntServ.getData();
  29. }
  30. })
  31. },
  32. onShow(){
  33. that.$nextTick(function() {
  34. if (that.modeType == 'base'){
  35. that.$refs.modeBaseIntServ.init();
  36. }else if (that.modeType == 'care'){
  37. that.$refs.modeCareIntServ.init();
  38. }
  39. })
  40. }
  41. }
  42. </script>