viewShell.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. <template src="./viewShell.html">
  2. </template>
  3. <script>
  4. const util = require('@/utils/util.js').default;
  5. // import commonMethod from '@/common/commonMethod.js';
  6. import touchHandle from '@/mixins/touchHandle.js';
  7. // import requestConfig from '@/static/lib/requestConfig';
  8. import viewlayout from'@/components/newQCCom/viewlayout/viewlayout.vue';
  9. import viewCareful from'@/components/newQCCom/viewCareful/viewCareful.vue';
  10. import viewPlot from'@/components/newQCCom/viewPlot/viewPlot.vue';
  11. import {
  12. getStorage,
  13. } from '@/utils/localStorage';
  14. // import viewToolNav from'@/components/newQCCom/viewToolNav/viewToolNav.vue';
  15. // import viewStyle from'@/webgl/components/newQCCom/viewStyle/viewStyle.vue';
  16. // const app = getApp(); //获取应用实例
  17. // let positions = new Set();
  18. export default {
  19. data: function() {
  20. return {
  21. floorList:[
  22. {
  23. text:'1F',
  24. },
  25. {
  26. text:'2F',
  27. }
  28. ],
  29. floorId:0,//楼层选中的id
  30. shellHeight:'200px',
  31. isShare: false,
  32. shareVideoItem:null,
  33. styleType:2, //当前底部组件的状态
  34. seedItem:null, //当前选中的种子户型
  35. showSignscoll:true, //是否显示手势操作区域
  36. selectSpace:null,//用户选择的空间
  37. lastStyleType:null,
  38. connectUsImg:'',
  39. }
  40. },
  41. props:{
  42. overChange: {//当前选中的户型类型
  43. type: Boolean,
  44. default: false,
  45. },
  46. pageType: {//当前组件所在的页面类型-决定了使用哪些子组件和样式
  47. type: [String, Number],
  48. default: 1,
  49. },
  50. // curHouseType: {//当前选中的户型类型
  51. // type: [String, Number],
  52. // default: '',
  53. // },
  54. houseObj: {//当前户型的具体详情
  55. type: Object,
  56. default: () => {
  57. return null
  58. }
  59. },
  60. spaceObj: {//当前户型的空间详情
  61. type: Object,
  62. default: () => {
  63. return null
  64. }
  65. },
  66. },
  67. watch: {
  68. // curHouseType: {
  69. // handler(newVal) {
  70. // if (newVal) {
  71. // //户型大类发生了变更,此时需要更新楼层信息,并且重新选择具体的户型
  72. // console.warn("***curHouseType-change***",newVal)
  73. // this.initData()
  74. // }
  75. // },
  76. // },
  77. styleType: {//组件展开状态切换
  78. handler(newVal,oldVal) {
  79. if (newVal) {
  80. console.warn("***styleType***",newVal,oldVal)
  81. let _starHeight = parseInt(this.shellHeight);
  82. let _endHeight = 380;
  83. if(this.inter){//存在,说明当前还在弹窗过程中
  84. return false;
  85. }
  86. if(newVal==1){//变更为初始状态
  87. this.shellHeight = '200px';
  88. _endHeight = 200;
  89. }else if(newVal==2){//变更为展开状态
  90. this.shellHeight = '600px';
  91. _endHeight = 600;
  92. }else if(newVal==3){//变更为最小状态
  93. this.shellHeight = '600px';
  94. _endHeight = 600;
  95. }
  96. // let currPage = getCurrentPages()[getCurrentPages().length - 1] ? getCurrentPages()[getCurrentPages().length - 1].$vm : null;
  97. if(this.$parent && this.$parent.hasOwnProperty('canvasHeight')){
  98. this.$parent.gradientResize(1,_starHeight,_endHeight)
  99. }
  100. this.$parent.styleType = newVal;//变更为展开状态
  101. }
  102. },
  103. },
  104. // houseObj: {
  105. // handler(newVal) {
  106. // if (newVal) {
  107. // //户型大类发生了变更,此时需要更新楼层信息,并且重新选择具体的户型
  108. // console.warn("***curHouseType-change***",newVal)
  109. // }
  110. // },
  111. // },
  112. },
  113. components:{
  114. viewlayout,
  115. viewCareful,
  116. viewPlot,
  117. // viewStyle,
  118. },
  119. mixins: [touchHandle],
  120. async mounted() {
  121. // await this.getCityHouseList();
  122. console.warn("***viewShell***")
  123. let firstData = JSON.parse(getStorage('firstData'));
  124. if(firstData && firstData[0] && firstData[0].selectOptionImageUrl){
  125. this.connectUsImg = firstData[0].selectOptionImageUrl;
  126. }
  127. },
  128. methods:{
  129. changeStyleType(type,selectSpace){
  130. // console.warn("***changeStyleType***",this.lastStyleType)
  131. // if(this.styleType != type){
  132. // this.lastStyleType = this.styleType;//记录下当前的状态,因为会返回到这个状态
  133. // }
  134. // this.styleType = type;
  135. // this.selectSpace = selectSpace;
  136. },
  137. changeStyle(style){
  138. this.styleType = style;//打开功能空间
  139. if(this.styleType == 3){//功能变更
  140. this.$refs.viewPlot.initData()
  141. }
  142. },
  143. rebackLast(){
  144. this.styleType = 2;//返回记录下的状态
  145. },
  146. catchTouchMove: function() {
  147. return false;
  148. },
  149. // hideOrShowActor(type){
  150. // this.$emit('hideOrShowActor',type);//隐藏所有视角
  151. // },
  152. //子组件开始录音
  153. streamRecord(){
  154. this.showSignscoll = false;
  155. },
  156. //子组件录音结束
  157. streamRecordEnd(){
  158. this.showSignscoll = true;
  159. },
  160. //楼层切换
  161. // floorChange(item){
  162. // if(this.floorId==item.id){
  163. // return false;
  164. // }
  165. // if(this.$parent.loadLayFlag){//加载家具模型中
  166. // this.$message("加载模型中,请稍后再试");
  167. // return false
  168. // }
  169. // this.floorId = item.id;
  170. // let param = {
  171. // type: 'CLK', //埋点类型
  172. // clkId: 'clk_2cmina_23080410', //点击ID
  173. // clkName: 'floorswitching_clk', //点击前往的页面名称
  174. // clkParams: {
  175. // locusName: "楼层切换",
  176. // }
  177. // };
  178. // util.trackRequest(param);
  179. // this.$emit("curHouseFloorChange", item);//通知页面,户型楼层发生了变更
  180. // },
  181. //种子户型变更-户型大类变更
  182. // seedChange(item){
  183. // console.warn("***seedChange***",item)
  184. // this.seedItem = item;
  185. // this.$emit("curHouseTypeChange", item);//通知页面,户型大类发生了变更
  186. // },
  187. //放大缩小
  188. zoomInOut(){
  189. if(this.styleType == 2){
  190. this.styleType = 1;//变更为最小状态
  191. }else if(this.styleType == 1){
  192. this.styleType = 2;//变更为最大状态
  193. }
  194. },
  195. //子组件通知上划到状态2
  196. upCom(){
  197. if(this.styleType==1 || this.styleType==3){//初始状态 或者 收缩状态
  198. this.styleType = 2;//变更为展开状态
  199. }
  200. },
  201. curSpaceChange(data){
  202. this.$emit("curSpaceChange", data);
  203. },
  204. //点击-不是手势动作
  205. upScrollOrDown(){
  206. if(this.pageType!=1){//只有1才起作用
  207. return false
  208. }
  209. if(this.styleType==1 || this.styleType==3){//初始状态 或者 收缩状态
  210. this.styleType = 2;//变更为展开状态
  211. }
  212. else if(this.styleType==2){//当前是展开状态,可以下滑
  213. this.styleType = 1;//下滑到初始收缩状态
  214. }
  215. },
  216. //上划-手势动作
  217. upScroll(){
  218. if(this.pageType!=1){//只有1才起作用
  219. return false
  220. }
  221. if(this.styleType==1 || this.styleType==3){//初始状态 或者 收缩状态
  222. this.styleType = 2;//变更为展开状态
  223. }
  224. },
  225. //下划-手势动作
  226. downScroll(){
  227. if(this.pageType!=1){//只有1才起作用
  228. return false
  229. }
  230. let carefulList = this.$refs.viewCareful && this.$refs.viewCareful.carefulList ? JSON.parse(JSON.stringify(this.$refs.viewCareful.carefulList)) : {};
  231. if(this.styleType==2 || this.styleType==3){//当前是展开状态,可以下滑
  232. this.styleType = 1;//下滑到初始收缩状态
  233. let trackparam = {
  234. type: 'CLK', //埋点类型
  235. clkId: 'clk_2cmina_23080404', //点击ID
  236. clkName: 'adjust_back_clk', //点击前往的页面名称
  237. clkParams: {
  238. locusName: "精细调整返回 /下划线",
  239. userparamter:carefulList,
  240. }
  241. };
  242. util.trackRequest(trackparam);
  243. }
  244. },
  245. mynavigateFuc(e) {
  246. if (e) {
  247. let param = {
  248. type: 'CLK', //埋点类型
  249. clkId: 'clk_2cmina_23080408', //点击ID
  250. clkName: 'WeCom_clk', //点击前往的页面名称
  251. clkParams: {
  252. locusName: "联系定制",
  253. }
  254. };
  255. util.trackRequest(param);
  256. if(window.__wxjs_environment === 'miniprogram'){
  257. wx.miniProgram.navigateTo({url: '/pages/transfer/transfer?event=openCustomerServiceChat&houseId='+this.$store.state.houseId})
  258. }else{
  259. // this.$message.warning("敬请期待");
  260. }
  261. }
  262. },
  263. }
  264. }
  265. </script>
  266. <style lang="scss" scoped>
  267. @import "./viewShell.scss";
  268. /* @import "@/common/css/common.css"; */
  269. </style>