12 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([[44,67],{523:function(e,t,r){"use strict";var n=r(2),o=r(525);n({target:"String",proto:!0,forced:r(526)("link")},{link:function(e){return o(this,"a","href",e)}})},525:function(e,t,r){"use strict";var n=r(4),o=r(28),c=r(14),l=/"/g,f=n("".replace);e.exports=function(e,t,r,n){var h=c(o(e)),m="<"+t;return""!==r&&(m+=" "+r+'="'+f(c(n),l,""")+'"'),m+">"+h+"</"+t+">"}},526:function(e,t,r){"use strict";var n=r(3);e.exports=function(e){return n((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}},531:function(e,t,r){e.exports={}},545:function(e,t,r){"use strict";r(531)},548:function(e,t,r){"use strict";r.r(t);var n=r(24),o=r(12);r(61),r(41),r(40),r(39),r(521),r(62),r(63),r(46),r(11),r(523),r(32);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f={head:function(){return{link:[{rel:"stylesheet",href:"//yun.baoxiaohe.com/openflatform/css/v1.0/sdk.css"}]}},props:{bxhType:String,design:Number,height:{type:String,default:"99vh"},link:String,templateArr:{type:Array,default:function(){return[]}}},data:function(){return{iframe:null}},watch:{},mounted:function(){var e=this;this.$nextTick((function(){e.createBxh()})),window.addEventListener("message",this.receiveData)},beforeDestroy:function(){window.removeEventListener("message",this.receiveData)},methods:{createBxh:function(){var e=this;return Object(o.a)(regeneratorRuntime.mark((function t(){var r,n,o,c;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("3D"!=e.bxhType){t.next=8;break}return t.next=3,e.$axios.get("/bxh/company/token");case 3:r=t.sent,n=e.design||e.link,e.init(n,r.result,e.bxhType),t.next=20;break;case 8:if("design"!=e.bxhType){t.next=15;break}return t.next=11,e.$axios.get("/bxh/token");case 11:o=t.sent,e.init(e.design,o.result,e.bxhType),t.next=20;break;case 15:if("render"!=e.bxhType){t.next=20;break}return t.next=18,e.$axios.get("/bxh/token");case 18:c=t.sent,e.init(e.design,c.result,e.bxhType);case 20:case"end":return t.stop()}}),t)})))()},init:function(e,t,r){this.iframe=new window.BXHIframe({elCls:"iframe-dom",prefixCls:"detail-iframe-sdk",locale:"en-US",params:{id:e,token3D:t,token:t,project_id:e,isShowRotate:!1,isShowFold:!1,locale:"en-US"},name:r})},receiveData:function(e){if(e)try{if("string"==typeof e.data){var t=JSON.parse(e.data),r=t.event,n=t.name,o=t.params,c=t.preDesignParams;"needLogin"===r?this.iframe.preDesign(l(l({},c),{},{token:""})):"viewDetails"===r||"viewDetails"===r?this.iframe.render({name:n,params:o}):"startDesign"===r?this.iframe.render({params:{id:o.id,token:""},name:"design"}):"logoutSuccess"===r?console.log("logoutSuccess"):"reloadParams"===r?console.log("reloadParams"):"saveSuccess"===r?console.log("saveSuccess"):"saveFail"===r?console.log("saveFail"):"loadSuccess"===r?console.log("loadSuccess"):"toPreview3d"===r?console.log("手机端编辑器进入3d页面回调"):"toEditor"===r&&console.log("手机端从3d页面进入编辑器回调")}}catch(e){console.log(e)}}}},h=(r(545),r(22)),component=Object(h.a)(f,(function(){var e=this._self._c;return e("div",{staticClass:"iframe-main"},[e("div",{staticClass:"iframe-dom",style:{height:this.height}})])}),[],!1,null,"500dc45e",null);t.default=component.exports},554:function(e,t,r){e.exports={}},573:function(e,t,r){"use strict";r.r(t);var n={name:"Zoom",props:{imgUrl:String},data:function(){return{}},methods:{handler:function(e){var mask=this.$refs.mask,t=e.offsetX-mask.offsetWidth/2,r=e.offsetY-mask.offsetHeight/2;t<=0&&(t=0),t>=mask.offsetWidth&&(t=mask.offsetWidth),r<=0&&(r=0),r>=mask.offsetHeight&&(r=mask.offsetHeight),mask.style.left=t+"px",mask.style.top=r+"px";var n={};n.left=t,n.top=r,n.bigShow=!0,this.$emit("sendStyle",n)},leave:function(){var e={left:0,top:0,bigShow:!1};this.$emit("sendStyle",e)}}},o=(r(599),r(22)),component=Object(o.a)(n,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"spec-preview"},[t("el-image",{staticStyle:{width:"100%",height:"100%"},attrs:{src:e.imgUrl,alt:"",fit:"cover"}}),e._v(" "),t("div",{staticClass:"event",on:{mousemove:e.handler,mouseleave:e.leave,click:function(t){return e.$emit("handleViwer")}}}),e._v(" "),t("div",{ref:"mask",staticClass:"mask"})],1)}),[],!1,null,"5b247e95",null);t.default=component.exports},599:function(e,t,r){"use strict";r(554)},600:function(e,t,r){e.exports={}},612:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(207);var o=r(229),c=r(143);function l(e){return function(e){if(Array.isArray(e))return Object(n.a)(e)}(e)||Object(o.a)(e)||Object(c.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},639:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAYCAYAAAAPtVbGAAAAAXNSR0IArs4c6QAAAepJREFUSEu9lk2IT2EUxn9Pk2SaBWWhbAYlalKk5GMhZKNYMWYnC6TMzhZjMRs7OxbKQr5WpmYjHwthMyspUj5SJDOYhZSFHp1/5+rOnTtzh9z/u7of7z2/8/Gc817RsGyvA4aAXcAAsDQ/mQaeAw+A65JezmVKc72wvRa4AOzPPb+AMPQp71cA4UBP3o8BpyW9qtqshdg+BlwEFgNP8npc0veyAdt9wD5gGNgG/IxrSZfL+2ZBbJ8DzgLfgOOSbjelNN7bPghcApYBI5LCTmfNgGQEsfE1sFfSm4UAij22VwN3gTXpYCeiP5CswTPgB7D5bwEV0ATQC2yIGpUhd7LIh+pSZHsj8F7Sl6boMnW3gDFJBzqQlOmLKLKk7VUjtpcDn4EAnJJ0YwGgxymG9QVkBDgDHJZ0swbSD7wtPY+oT0gq5DyLaXsQCGfOF5BHwNZotKpMM9IC8hBYBOwAvqZcr9VFlfKOhn1aQEKuHyRFR9d5VUCuAkezL0aBJUBEdVLSx5oMxERYWUAM3Je0pwki6UhGtwq4AuwEwuMt1W63fQ/Y3VVIV9LVlcJ3RcIxspuacRKY+udmTLU0jZVNwDtJ0R/zrtqxkpA4pNodkAmKw6q9UV8a1e0eWiVQu8dvCdTuj0RZOv/jl+g3/RhEvhTk7TEAAAAASUVORK5CYII="},640:function(e,t,r){"use strict";var n=r(2),o=r(525);n({target:"String",proto:!0,forced:r(526)("big")},{big:function(){return o(this,"big","","")}})},641:function(e,t,r){"use strict";r(600)},721:function(e,t,r){"use strict";r.r(t);r(523);var n=[function(){var e=this._self._c;return e("div",{staticClass:"playMask"},[e("img",{attrs:{src:r(639),alt:""}})])}],o=r(24),c=r(612),l=(r(41),r(98),r(40),r(64),r(62),r(63),r(46),r(11),r(32),r(521),r(640),r(43)),f=r(558);function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){Object(o.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d={components:{Zoom:r(573).default,ElImageViewer:f.a},props:{pageData:{type:Object,default:function(){return{}}},id:{type:Number,default:0}},data:function(){return{indexBanner:[],btnObj:["View larger","3D Preview"],btnCurrent:0,current3D:0,btnShow:!0,bigShow:!1,showViewer:!1}},computed:{currentPre:function(){return this.$store.state.product.smImgUlIdx},comInfo:function(){var e=this.pageData.main,a=e.image_color.map((function(i){return i.image}));return e.mergeImages=[].concat(Object(c.a)(e.images),Object(c.a)(a)),e},comS3Img:function(){var e=this;return this.comInfo.mergeImages.map((function(t){return e.$utils.repaceDomain(t)}))}},watch:{currentPre:function(e){this.$refs.carousel.setActiveItem(e)}},mounted:function(){this.comInfo.video&&(this.$refs.video.volume=.5)},methods:m(m({},Object(l.c)({setSmImgUlIdx:"product/setSmImgUlIdx"})),{},{handleSwitch:function(e){this.btnCurrent=e},changeCarousel:function(e){var t;this.setSmImgUlIdx(e),e===(null===(t=this.comInfo.mergeImages)||void 0===t?void 0:t.length)?(this.btnShow=!1,this.comInfo.video&&this.$refs.video.play()):(this.btnShow=!0,this.comInfo.video&&this.$refs.video.pause())},selectCurrent3D:function(e){this.current3D=e},goDesign:function(e,t){var r=this;this.$axios.get("/bxh/design",{params:{template_id:e,goods_id:t}}).then((function(e){var t=r.$router.resolve({name:"design-id",params:{id:e.result}}).href;window.open(t,"_black")}))},getStyle:function(e){var t=this.$refs.big;t.style.left=-2*e.left+"px",t.style.top=-2*e.top+"px",this.bigShow=e.bigShow},closeViewer:function(){this.showViewer=!1},handleViwer:function(){this.showViewer=!0}})},v=(r(641),r(22)),component=Object(v.a)(d,(function(){var e,t=this,r=t._self._c;return r("div",{staticClass:"product-left"},[r("div",{staticClass:"media"},[r("div",{directives:[{name:"show",rawName:"v-show",value:t.bigShow,expression:"bigShow"}],staticClass:"big"},[r("img",{ref:"big",attrs:{src:t.$utils.generateResizedImageUrl(t.comInfo.mergeImages[t.currentPre],1800),alt:""}})]),t._v(" "),r("el-carousel",{directives:[{name:"show",rawName:"v-show",value:!t.btnCurrent,expression:"!btnCurrent"}],ref:"carousel",attrs:{interval:5e3,arrow:"always",height:"578px","indicator-position":"none",autoplay:!1},on:{change:t.changeCarousel}},[t._l(t.comInfo.mergeImages,(function(e){return r("el-carousel-item",{key:e},[r("zoom",{attrs:{imgUrl:t.$utils.generateResizedImageUrl(t.comInfo.mergeImages[t.currentPre],1800)},on:{sendStyle:t.getStyle,handleViwer:t.handleViwer}})],1)})),t._v(" "),t.comInfo.video?r("el-carousel-item",[r("video",{ref:"video",attrs:{controls:"",width:"100%",height:"100%"}},[r("source",{attrs:{src:t.comInfo.video}}),t._v("\n Your browser does not support the video tag.\n ")])]):t._e()],2),t._v(" "),t.pageData.template.length?[r("bxh",{directives:[{name:"show",rawName:"v-show",value:t.btnCurrent,expression:"btnCurrent"}],key:t.current3D,attrs:{link:t.pageData.template[t.current3D].link,bxhType:"3D",height:"578px"}}),t._v(" "),r("section",{directives:[{name:"show",rawName:"v-show",value:t.btnShow,expression:"btnShow"}],staticClass:"switch-wrap"},[r("div",{directives:[{name:"show",rawName:"v-show",value:t.btnCurrent,expression:"btnCurrent"}],staticClass:"switch-btn"},[r("span",{staticClass:"primary_button",on:{click:function(e){return t.goDesign(t.pageData.template[t.current3D].template_id,t.pageData.template[t.current3D].link)}}},[t._v("Custom Design")])]),t._v(" "),r("div",{staticClass:"switch-btn"},t._l(t.btnObj,(function(e,n){return r("span",{key:n,staticClass:"primary_button",class:t.btnCurrent==n?"primary_checked":"",on:{click:function(e){return t.handleSwitch(n)}}},[t._v(t._s(e))])})),0)])]:t._e()],2),t._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.btnCurrent,expression:"!btnCurrent"}],staticClass:"smImgUl"},[r("ul",[t._l(t.comInfo.mergeImages,(function(e,n){return r("li",{key:n,staticClass:"banner",class:t.currentPre==n?"slip":"",on:{click:function(e){t.changeCarousel(n)}}},[r("el-image",{staticClass:"card-img-1",staticStyle:{width:"100%",height:"100%"},attrs:{src:t.$utils.generateResizedImageUrl(e,100),fit:"cover"}})],1)})),t._v(" "),t.comInfo.video&&!t.btnCurrent?r("li",{class:t.currentPre==(null===(e=t.comInfo.mergeImages)||void 0===e?void 0:e.length)?"slip":"",on:{click:function(e){var r;t.changeCarousel(null===(r=t.comInfo.mergeImages)||void 0===r?void 0:r.length)}}},[r("video",{attrs:{width:"100%",height:"100%",src:t.comInfo.video}}),t._v(" "),t._m(0)]):t._e()],2)]),t._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:t.btnCurrent,expression:"btnCurrent"}],staticClass:"smImgUl"},[r("ul",t._l(t.pageData.template,(function(e,n){return r("li",{key:n,staticClass:"banner",class:t.current3D==n?"slip":"",style:{backgroundImage:"url("+e.image+")"},on:{click:function(e){return t.selectCurrent3D(n)}}})})),0)]),t._v(" "),t.showViewer?r("ElImageViewer",{attrs:{"initial-index":t.currentPre,"on-close":t.closeViewer,"url-list":t.comS3Img}}):t._e()],1)}),n,!1,null,"7d12b996",null);t.default=component.exports;installComponents(component,{Zoom:r(573).default,Bxh:r(548).default})}}]);
- //# sourceMappingURL=60c1e14.js.map
|