chunk-08b3356c.5379c75d.js 11 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-08b3356c"],{"873c":function(t,e,i){"use strict";i.r(e);var o=function(){var t=this,e=t._self._c;return e("div",{staticClass:"viewvr"},[e("div",{staticClass:"headerBack"},[e("img",{attrs:{src:i("ec85"),alt:""},on:{click:t.backFunc}})]),e("iframe",{ref:"iframeEle",attrs:{src:t.viewvr,width:"100%",height:"100%",scrolling:"no",frameborder:"0"}})])},a=[],n=i("b39c"),r=i("2d8e"),s=i("5880"),d={data(){return{viewvr:"",vrType:"",itemCid:"",ipStr:"",authCode:"",footId:"",viewId:"",viewObj:{},timeNum:0,timer:null,updateTimer:null}},computed:{...Object(s["mapState"])({personObj:t=>t.personObj,shareToken:t=>t.shareToken,weburl:t=>t.weburl}),isWechatBrower(){let t=window.navigator.userAgent.toLowerCase();return"micromessenger"==t.match(/MicroMessenger/i)},footerType(){return"housetype"==this.vrType?"buildingHousetype":this.vrType}},mounted(){let t=this.getQueryStringArgs();t.ip&&(this.ipStr=t.ip,this.vrType=t.type,this.viewvr=decodeURIComponent(t.vrlink),this.isWechatBrower||(this.getUserInfo(),this.getModuleDetail()),this.isWechatBrower&&this.shareToken&&(this.getUserInfo(),this.getModuleDetail())),this.$toast.loading({duration:4e3,message:"加载中...",forbidClick:!0}),setTimeout(()=>{if(t.state&&t.state.indexOf("#/shareViewvr")>-1&&(t.state=t.state.split("#/shareViewvr")[0]),t.code&&t.state&&!this.shareToken){if(t.state&&t.state.indexOf("@")>1){let e=t.state.split("@");this.ipStr=e[0],this.vrType=e[1],this.viewvr=decodeURIComponent(e[2])}this.authCode=t.code,this.getUserInfo()}else this.isWechatBrower&&!this.shareToken&&(window.location.href=`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa2523b5228d7e490&redirect_uri=${encodeURIComponent(this.weburl+"building.html#/shareViewvr")}&response_type=code&scope=snsapi_userinfo&state=${this.ipStr}@${this.vrType}@${encodeURIComponent(this.viewvr)}#wechat_redirect`)},600),this.shareToken&&this.totalTimeSumFun()},destroyed(){clearInterval(this.timer),clearInterval(this.updateTimer)},methods:{...Object(s["mapMutations"])(["setpersonObj","setShareToken","setclientype"]),backFunc(){this.$router.go(-1)},getQueryStringArgs:function(t){t=null==t?window.location.href:t;var e=t.substring(t.lastIndexOf("?")+1),i={},o=/([^?&=]+)=([^?&=]*)/g;return e.replace(o,(function(t,e,o){var a=decodeURIComponent(e),n=decodeURIComponent(o);return n=String(n),i[a]=n,t})),i},code2sessionFunc(){this.shareToken&&void 0!=this.shareToken||Object(n["k"])({code:this.authCode,share:this.personObj.str}).then(t=>{0==t.data.code&&(this.setShareToken(t.data.data),setTimeout(()=>{this.totalTimeSumFun(),this.getModuleDetail()},100))})},getUserInfo(){Object(n["t"])({token:this.ipStr}).then(t=>{0==t.data.code&&(this.setpersonObj(t.data.data),t.data.data.notify&&this.setclientype(t.data.data.notify),this.authCode&&this.code2sessionFunc())})},totalTimeSumFun(){this.shareToken&&(this.timeNum=0,this.timer=setInterval(()=>{this.timeNum++,console.log(this.timeNum)},1e3))},setFootRecordFun(){if(this.shareToken&&this.viewId){let t={token:this.shareToken,type:this.footerType,share:this.personObj.str,prompt:this.viewObj.title+"-VR",id:this.viewId};Object(n["x"])({...t}).then(t=>{0==t.data.code&&(this.footId=t.data.fid,this.updateTimer=setInterval(()=>{this.updateFootTime()},5e3))})}},updateFootTime(){if(this.shareToken&&this.footId&&this.timeNum>0){let t={fid:this.footId,time:this.timeNum};Object(n["D"])(t).then(t=>{t.data.code})}},getJSSDKConfig(){const t=this;Object(r["b"])({url:location.href}).then(e=>{0==e.data.code&&(wx.config({debug:!1,appId:e.data.appid,timestamp:e.data.data.timestamp,nonceStr:e.data.data.noncestr,signature:e.data.data.sign,jsApiList:["updateAppMessageShareData","updateTimelineShareData"],openTagList:[]}),wx.ready((function(){wx.updateAppMessageShareData({title:t.viewObj.title,desc:t.viewObj.shareDesc,link:`${t.weburl}building.html#/shareViewvr?ip=${t.ipStr}&type=${t.vrType}&vrlink=${encodeURIComponent(t.viewvr)}`,imgUrl:t.viewObj.shareCover,success:function(){console.log("配置成功")}}),wx.updateTimelineShareData({title:t.viewObj.title,desc:t.viewObj.shareDesc,link:`${t.weburl}building.html#/shareViewvr?ip=${t.ipStr}&type=${t.vrType}&vrlink=${encodeURIComponent(t.viewvr)}`,imgUrl:t.viewObj.shareCover,success:function(){console.log("配置成功")}})})))})},getModuleDetail(){if("building"==this.vrType){let t={token:this.ipStr};Object(n["j"])(t).then(t=>{0==t.data.code&&(this.viewId=t.data.data.id,this.viewObj.title=t.data.data.name,this.viewObj.shareDesc=t.data.data.content,t.data.data.cover&&t.data.data.cover.length&&(this.viewObj.shareCover=t.data.data.cover[0]),this.getJSSDKConfig(),this.footId||this.setFootRecordFun())})}else if("housetype"==this.vrType){let t={token:this.ipStr};Object(n["s"])(t).then(t=>{if(0==t.data.code){this.viewId=t.data.data.id;let e=t.data.data,i=t.data.bulid;this.viewObj.title=this.getHouseTypeVal(e),this.viewObj.shareDesc=i.community,e.house_img&&e.house_img.length?this.viewObj.shareCover=e.house_img[0]:e.vr_link_img&&(this.viewObj.shareCover=e.vr_link_img),this.getJSSDKConfig(),this.footId||this.setFootRecordFun()}})}else if("materialCase"==this.vrType){let t={token:this.ipStr};Object(n["y"])(t).then(t=>{0==t.data.code&&(this.viewId=t.data.data.id,this.viewObj.title=t.data.data.title,this.viewObj.shareDesc=t.data.data.decostyle?t.data.data.decostyle.name:"",t.data.data.cover_img&&(this.viewObj.shareCover=t.data.data.cover_img),this.getJSSDKConfig(),this.footId||this.setFootRecordFun())})}else if("construction"==this.vrType){let t={token:this.ipStr};Object(n["A"])(t).then(t=>{0==t.data.code&&(this.viewId=t.data.data.id,this.viewObj.title=t.data.data.name,this.viewObj.shareDesc=this.getProgress(t.data.data),t.data.data.cover&&(this.viewObj.shareCover=t.data.data.cover),this.getJSSDKConfig(),this.footId||this.setFootRecordFun())})}},getProgress(t){let e=t.step_list.filter(t=>1==t.upload);return e.length?e[e.length-1]["name"]:t.step_list[0]["name"]},getHouseTypeVal(t){return 9==t.room?"别墅":`${t.room||"1"}室${t.hall||"1"}厅${t.bathroom||"1"}卫`}}},u=d,c=(i("dd68"),i("2877")),l=Object(c["a"])(u,o,a,!1,null,"48455de4",null);e["default"]=l.exports},b39c:function(t,e,i){"use strict";i.d(e,"f",(function(){return a})),i.d(e,"e",(function(){return n})),i.d(e,"c",(function(){return r})),i.d(e,"a",(function(){return s})),i.d(e,"b",(function(){return d})),i.d(e,"v",(function(){return u})),i.d(e,"w",(function(){return c})),i.d(e,"m",(function(){return l})),i.d(e,"p",(function(){return h})),i.d(e,"n",(function(){return m})),i.d(e,"o",(function(){return b})),i.d(e,"h",(function(){return p})),i.d(e,"u",(function(){return f})),i.d(e,"l",(function(){return g})),i.d(e,"g",(function(){return v})),i.d(e,"j",(function(){return w})),i.d(e,"i",(function(){return j})),i.d(e,"t",(function(){return O})),i.d(e,"s",(function(){return A})),i.d(e,"C",(function(){return C})),i.d(e,"z",(function(){return T})),i.d(e,"B",(function(){return y})),i.d(e,"y",(function(){return I})),i.d(e,"A",(function(){return k})),i.d(e,"k",(function(){return S})),i.d(e,"x",(function(){return F})),i.d(e,"q",(function(){return R})),i.d(e,"r",(function(){return Q})),i.d(e,"d",(function(){return U})),i.d(e,"D",(function(){return D}));var o=i("b775");function a(t){return Object(o["a"])({url:"/mobile/building/index",method:"post",data:t})}function n(t){return Object(o["a"])({url:"/mobile/building/view",method:"post",data:t})}function r(t){return Object(o["a"])({url:"/mobile/building/progress",method:"post",data:t})}function s(t){return Object(o["a"])({url:"/mobile/building/collect",method:"post",data:t})}function d(t){return Object(o["a"])({url:"/mobile/building/collectCancel",method:"post",data:t})}function u(t){return Object(o["a"])({url:"/mobile/building/housetype_detail",method:"post",data:t})}function c(t){return Object(o["a"])({url:"/mobile/building/material_case",method:"post",data:t})}function l(t){return Object(o["a"])({url:"/mobile/building/construction",method:"post",data:t})}function h(t){return Object(o["a"])({url:"/mobile/building/casedetail",method:"get",params:t})}function m(t){return Object(o["a"])({url:"/mobile/building/constructionList",method:"get",params:t})}function b(t){return Object(o["a"])({url:"/mobile/building/constrationView",method:"get",params:t})}function p(t){return Object(o["a"])({url:"/mobile/building/collects",method:"post",data:t})}function f(t){return Object(o["a"])({url:"/mobile/building/getUserInfo",method:"post",data:t})}function g(t){return Object(o["a"])({url:"/mobile/building/collectHousetype",method:"post",data:t})}function v(t){return Object(o["a"])({url:"/mobile/building/cancelCollectHousetype",method:"post",data:t})}function w(t){return Object(o["a"])({url:"/mobile/detail/view",method:"post",data:t})}function j(t){return Object(o["a"])({url:"/mobile/detail/progress",method:"post",data:t})}function O(t){return Object(o["a"])({url:"/mobile/detail/getUserInfo",method:"post",data:t})}function A(t){return Object(o["a"])({url:"/mobile/detail/housetype_detail",method:"post",data:t})}function C(t){return Object(o["a"])({url:"/mobile/detail/materialCase",method:"post",data:t})}function T(t){return Object(o["a"])({url:"/mobile/detail/construction",method:"post",data:t})}function y(t){return Object(o["a"])({url:"/mobile/detail/constructionList",method:"get",params:t})}function I(t){return Object(o["a"])({url:"/mobile/detail/casedetail",method:"get",params:t})}function k(t){return Object(o["a"])({url:"/mobile/detail/constrationView",method:"get",params:t})}function S(t){return Object(o["a"])({url:"/mobile/share/getOfficeInfo",method:"post",data:t})}function F(t){return Object(o["a"])({url:"/mobile/share/saveFoots",method:"post",data:t})}function R(t){return Object(o["a"])({url:"/mobile/building/getBuildingLabel",method:"post",data:t})}function Q(t){return Object(o["a"])({url:"/mobile/share/getBuildingLabel",method:"post",data:t})}function U(t){return Object(o["a"])({url:"/mobile/share/urge",method:"post",data:t})}function D(t){return Object(o["a"])({url:"/mobile/share/updateSaveFoot",method:"post",data:t})}},be56:function(t,e,i){},dd68:function(t,e,i){"use strict";i("be56")},ec85:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAnxJREFUaEPVmT2vDVEUhp83QiI0aPArdCoFIhrCbVS+b4NEq/AHfFQoKRRCg0LlSjQiIVHdKIUECRLRKXwkLFnJvsnOyTB75uyPMdUp5px5nzXPXrP2GdH4MLNVwA7gBPAVuCbpVWospZ5Y4jwzWwMcBy4CG8I1XgALkj6mXLMZQKj8InAB2BiF/QwckvRksgAh/AJwPar8St6XwH5J7ycJELQ5BlzqCP8aOC3pcUp4P6eqQqHyJ4PzsTaexcMflfQ8NXxVgB5t3obKLw0JXw0gQZuzwCNJNjmAEtrEkEXXQAh/ELjRsWDfAackDdamCkCPNm8A12ZpjDbFAXq08fBHhnabv62N7AolaON9/uHQxVoFIGhzFLjc4Xw2bYooFGnjs82mmYpl1SY7QKSNzzazT1jvNlm1yQoQaeOzzWz4ItpkA0jQxmebZ7kWbNfvjO5CIfyB8JCqqs3cd8DMVgMrI3F1beYCCJX3/atvA7u6TXFtRgNMRZtRAFPSZizAWuC2/2PQ0Q2eAnsk/SjZcebuQma2HrgP7AR8IcfHXeCMpC81IQa3UTPbClwBfM6PIX6GO3SuJsRgAK+umW0BbgJ7Z6rtEA+Aw5L8c/FjFECAWBd02tVSp9EA0Z242lKnuQCmoNPcAK11ygLQUqdsAK10ygrQQqfsANGd8Iedjx1FH3ZFAGrqVAyglk5FAWroVBygtE5VAErqVA0gQGwGfHbK1p2qApTQqTpApNM9YHfHKH4HWJT0PWUz0QSgR6dPPp5L8jf2vUczgH/o9AHYJ2m5N33t98RdgczMd3auzXbgF3ALOC/p938BEK2JbcA3YDk1vH+3qUIpFe475w+z8S1A0olT9gAAAABJRU5ErkJggg=="}}]);