bxh.js 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. exports.ids = [4];
  2. exports.modules = {
  3. /***/ 169:
  4. /***/ (function(module, exports) {
  5. // Exports
  6. module.exports = {
  7. };
  8. /***/ }),
  9. /***/ 197:
  10. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11. "use strict";
  12. __webpack_require__.r(__webpack_exports__);
  13. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_3_oneOf_1_1_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Bxh_vue_vue_type_style_index_0_id_500dc45e_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(169);
  14. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_3_oneOf_1_1_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Bxh_vue_vue_type_style_index_0_id_500dc45e_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_3_oneOf_1_1_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Bxh_vue_vue_type_style_index_0_id_500dc45e_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__);
  15. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_3_oneOf_1_1_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Bxh_vue_vue_type_style_index_0_id_500dc45e_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_3_oneOf_1_1_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Bxh_vue_vue_type_style_index_0_id_500dc45e_prod_scoped_true_lang_css__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  16. /***/ }),
  17. /***/ 206:
  18. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19. "use strict";
  20. // ESM COMPAT FLAG
  21. __webpack_require__.r(__webpack_exports__);
  22. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/Bxh.vue?vue&type=template&id=500dc45e&scoped=true
  23. var render = function render() {
  24. var _vm = this,
  25. _c = _vm._self._c;
  26. return _c('div', {
  27. staticClass: "iframe-main"
  28. }, [_vm._ssrNode("<div class=\"iframe-dom\"" + _vm._ssrStyle(null, {
  29. height: _vm.height
  30. }, null) + " data-v-500dc45e></div>")]);
  31. };
  32. var staticRenderFns = [];
  33. // CONCATENATED MODULE: ./components/Bxh.vue?vue&type=template&id=500dc45e&scoped=true
  34. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/Bxh.vue?vue&type=script&lang=js
  35. /* harmony default export */ var Bxhvue_type_script_lang_js = ({
  36. head() {
  37. return {
  38. link: [{
  39. rel: 'stylesheet',
  40. href: '//yun.baoxiaohe.com/openflatform/css/v1.0/sdk.css'
  41. }]
  42. };
  43. },
  44. props: {
  45. bxhType: String,
  46. design: Number,
  47. height: {
  48. type: String,
  49. default: '99vh'
  50. },
  51. link: String,
  52. templateArr: {
  53. type: Array,
  54. default: () => {
  55. return [];
  56. }
  57. }
  58. },
  59. data() {
  60. return {
  61. iframe: null
  62. };
  63. },
  64. watch: {},
  65. mounted() {
  66. this.$nextTick(() => {
  67. this.createBxh();
  68. });
  69. window.addEventListener("message", this.receiveData);
  70. },
  71. beforeDestroy() {
  72. window.removeEventListener("message", this.receiveData);
  73. },
  74. methods: {
  75. async createBxh() {
  76. if (this.bxhType == '3D') {
  77. let companyToken = await this.$axios.get("/bxh/company/token");
  78. let design = this.design || this.link;
  79. this.init(design, companyToken.result, this.bxhType);
  80. } else if (this.bxhType == 'design') {
  81. let token = await this.$axios.get("/bxh/token");
  82. this.init(this.design, token.result, this.bxhType);
  83. } else if (this.bxhType == 'render') {
  84. let token = await this.$axios.get("/bxh/token");
  85. this.init(this.design, token.result, this.bxhType);
  86. }
  87. },
  88. init(id, token, bxhType) {
  89. this.iframe = new window.BXHIframe({
  90. // production: false,
  91. // env:true,
  92. elCls: 'iframe-dom',
  93. prefixCls: 'detail-iframe-sdk',
  94. locale: "en-US",
  95. params: {
  96. id,
  97. token3D: token,
  98. token,
  99. project_id: id,
  100. isShowRotate: false,
  101. //右下角的旋转按钮
  102. isShowFold: false,
  103. //右下角的折叠按钮
  104. locale: "en-US"
  105. },
  106. name: bxhType
  107. });
  108. },
  109. receiveData(event) {
  110. if (event) {
  111. try {
  112. if (typeof event.data === "string") {
  113. const {
  114. event: e,
  115. name,
  116. params,
  117. preDesignParams
  118. } = JSON.parse(event.data);
  119. if (e === "needLogin") {
  120. this.iframe.preDesign({
  121. ...preDesignParams,
  122. token: ''
  123. });
  124. } else if (e === "viewDetails") {
  125. this.iframe.render({
  126. name,
  127. params
  128. });
  129. } else if (e === "viewDetails") {
  130. this.iframe.render({
  131. name,
  132. params
  133. });
  134. } else if (e === "startDesign") {
  135. this.iframe.render({
  136. params: {
  137. id: params.id,
  138. token: ''
  139. },
  140. name: "design"
  141. });
  142. } else if (e === "logoutSuccess") {
  143. console.log("logoutSuccess");
  144. } else if (e === "reloadParams") {
  145. console.log("reloadParams");
  146. } else if (e === "saveSuccess") {
  147. console.log("saveSuccess");
  148. } else if (e === "saveFail") {
  149. console.log("saveFail");
  150. } else if (e === "loadSuccess") {
  151. console.log("loadSuccess");
  152. } else if (e === "toPreview3d") {
  153. console.log("手机端编辑器进入3d页面回调");
  154. } else if (e === "toEditor") {
  155. console.log("手机端从3d页面进入编辑器回调");
  156. }
  157. }
  158. } catch (error) {
  159. console.log(error);
  160. }
  161. }
  162. }
  163. }
  164. });
  165. // CONCATENATED MODULE: ./components/Bxh.vue?vue&type=script&lang=js
  166. /* harmony default export */ var components_Bxhvue_type_script_lang_js = (Bxhvue_type_script_lang_js);
  167. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  168. var componentNormalizer = __webpack_require__(2);
  169. // CONCATENATED MODULE: ./components/Bxh.vue
  170. function injectStyles (context) {
  171. var style0 = __webpack_require__(197)
  172. if (style0.__inject__) style0.__inject__(context)
  173. }
  174. /* normalize component */
  175. var component = Object(componentNormalizer["a" /* default */])(
  176. components_Bxhvue_type_script_lang_js,
  177. render,
  178. staticRenderFns,
  179. false,
  180. injectStyles,
  181. "500dc45e",
  182. "6ec49534"
  183. )
  184. /* harmony default export */ var Bxh = __webpack_exports__["default"] = (component.exports);
  185. /***/ })
  186. };;
  187. //# sourceMappingURL=bxh.js.map