webgl_rxdz_test_roam.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template src="./webgl_rxdz_test_roam.html"></template>
  2. <script>
  3. import {getStorage} from '@/utils/localStorage';
  4. var requestId = "";
  5. const util = require('@/utils/util.js').default;
  6. import viewMask from'@/components/newQCCom/viewMask/viewMask.vue';
  7. import commonPageMethod from '@/mixins/commonPageMethod.js';
  8. export default {
  9. components:{viewMask},
  10. mixins:[commonPageMethod],
  11. /**
  12. * 页面的初始数据
  13. */
  14. data() {
  15. return {
  16. pvCurPageName: "room_show",
  17. locusBehaviorName: "房间展示",
  18. pvCurPageParams: null,
  19. houseId: "",
  20. pvId: 'p_2cmina_23080402',
  21. canvas:null,
  22. navbar: {
  23. showCapsule: 1,
  24. title: '客厅',
  25. titleColor: '#000',
  26. navPadding: 0,
  27. navPaddingBg:'transparent',
  28. navBarColor: 'transparent',
  29. navBackColor: 'transparent',
  30. haveCallback: true, // 如果是 true 会接手 navbarBackClk
  31. fromShare: false,
  32. fromProject: 0,
  33. shareToken: "",
  34. pageName: this.pvCurPageName,
  35. },
  36. id:'',// 户型编号
  37. spaceId:'',
  38. isIOS:false,
  39. defaulIndex:null, //默认视角的序号
  40. repeatFlag:false, //重复点击
  41. canvasHeight:408, //canvas视图的高度-计算得出
  42. }
  43. },
  44. mounted(options) {
  45. var that = this;
  46. // alert("JavaScript 堆大小限制: "+performance.memory.jsHeapSizeLimit
  47. // +"\n已使用的 JavaScript 堆大小: "+performance.memory.usedJSHeapSize
  48. // +"\nJavaScript 堆的总大小: "+performance.memory.totalJSHeapSize);
  49. console.warn("***webgl_rxdz_roam-options***",this.$route.query)
  50. this.isIOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
  51. // if(this.isIOS){
  52. // this.curHouseObj = JSON.parse(getStorage('curHouseObj'));
  53. // this.wallList = JSON.parse(getStorage('wallList'));
  54. // }else{
  55. // this.curHouseObj = this.$store.state.curHouseObj;
  56. // this.wallList = this.$store.state.wallList;
  57. // }
  58. // alert("***mounted-webgl_rxdz_roam***"+this.isIOS + this.curHouseObj)
  59. let screenWidth = window.screen.width;
  60. let screenHeight = window.screen.height;
  61. if(window.innerWidth && window.screen.width){
  62. screenWidth = Math.min(window.innerWidth,window.screen.width)
  63. }
  64. if(window.innerHeight && window.screen.height){
  65. screenHeight = Math.min(window.innerHeight,window.screen.height)
  66. }
  67. let unit = screenWidth / 750;//单位rpm 对应 px 的值
  68. this.canvasHeight = screenHeight - (600 * unit) + (40 * unit);
  69. this.houseId = this.$route.query.houseId?this.$route.query.houseId:'';
  70. this.spaceId = this.$route.query.spaceId?this.$route.query.spaceId:'';
  71. },
  72. // computed: {
  73. // curHouseObj() {
  74. // return this.$store.state.curHouseObj;
  75. // },
  76. // wallList() {
  77. // return this.$store.state.wallList;
  78. // },
  79. // },
  80. methods: {
  81. navbarBackClk() {
  82. if(!this.$refs.viewMask){
  83. this.$router.go(-1);
  84. return false
  85. }
  86. if (this.$refs.viewMask.showAIImage) {
  87. this.$refs.viewMask.showOrHideWebGl();//隐藏显示的AI生图
  88. // if(this.currentActor.userIndex!=this.defaulIndex){//当前不是默认视角了
  89. this.switchActor(this.defaulIndex);//切换到默认视角
  90. // }
  91. } else {
  92. this.$router.go(-1);
  93. }
  94. },
  95. clearHandle(){
  96. // this.clearEvent();
  97. },
  98. save(){
  99. this.$refs.viewMask.save();//下载
  100. },
  101. }
  102. }
  103. </script>
  104. <style lang="scss" scoped>
  105. @import "./webgl_rxdz_test_roam.scss";
  106. /* @import "@/common/css/common.css"; */
  107. </style>