viewShell.vue 8.0 KB

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