App.vue 1017 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <script>
  2. import {
  3. INIT_HOTEL_ID,
  4. INIT_HOTEL_NAME
  5. } from './config.js'
  6. import {
  7. initEid,
  8. startEid
  9. } from './mp_ecard_sdk/main'
  10. import {
  11. mapState,
  12. mapMutations
  13. } from 'vuex'
  14. export default {
  15. methods: {
  16. ...mapMutations('m_business', ['updateCurrentHotelId', 'updateCurrentHotelName']),
  17. },
  18. onLaunch: function() {
  19. initEid()
  20. console.warn('当前组件仅支持 uni_modules 目录结构 ,请升级 HBuilderX 到 3.1.0 版本以上!')
  21. console.log('App Launch')
  22. this.updateCurrentHotelId(INIT_HOTEL_ID)
  23. this.updateCurrentHotelName(INIT_HOTEL_NAME)
  24. },
  25. onShow: function() {
  26. console.log('App Show')
  27. },
  28. onHide: function() {
  29. console.log('App Hide')
  30. }
  31. }
  32. </script>
  33. <style lang="scss">
  34. @import "uview-ui/index.scss";
  35. /* #ifndef APP-NVUE */
  36. // 设置整个项目的背景色
  37. page {
  38. background-color: #F0EFF5;
  39. width: 100%;
  40. height: 100%;
  41. margin: 0;
  42. border: 0;
  43. }
  44. /* #endif */
  45. .example-info {
  46. font-size: 14px;
  47. color: #333;
  48. padding: 10px;
  49. }
  50. </style>