App.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <div id="app" @mousewheel.stop @touchstart.stop>
  3. <chat-mini
  4. :show="show"
  5. :groupId="groupId"
  6. :width="outWidth"
  7. :height="outHeight"
  8. >
  9. </chat-mini>
  10. </div>
  11. </template>
  12. <script>
  13. import { mapActions, mapMutations } from 'vuex'
  14. import { getUrlParam } from '@/util/util'
  15. import chatMini from '@/components/chatMini/chatMini'
  16. export default {
  17. name: 'App',
  18. components: {
  19. chatMini
  20. },
  21. data () {
  22. var width = getUrlParam('width') || window.innerWidth
  23. var height = getUrlParam('height') || window.innerHeight - 16
  24. return {
  25. show: getUrlParam('show') === 'true',
  26. groupId: getUrlParam('groupId') || 10001,
  27. outWidth: parseInt(width),
  28. outHeight: parseInt(height)
  29. }
  30. },
  31. methods: {
  32. ...mapMutations([
  33. 'setPublicKey'
  34. ]),
  35. ...mapActions([
  36. 'setScatter',
  37. 'setAccount',
  38. 'doScatterLogin'
  39. ])
  40. },
  41. created () {
  42. // if (self !== top) {
  43. // let account = getUrlParam('account')
  44. // let publicKey = getUrlParam('pk')
  45. // if (account && publicKey) {
  46. // account = {
  47. // authority: account.split('@')[1],
  48. // blockchain: 'eos',
  49. // name: account.split('@')[0]
  50. // }
  51. //
  52. // this.setAccount(account)
  53. // this.setPublicKey(publicKey)
  54. // }
  55. // }
  56. }
  57. }
  58. </script>
  59. <style lang="scss">
  60. @import '@/style/mini.scss';
  61. </style>