_newsName.js 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. exports.ids = [68];
  2. exports.modules = {
  3. /***/ 270:
  4. /***/ (function(module, exports) {
  5. // Exports
  6. module.exports = {
  7. };
  8. /***/ }),
  9. /***/ 330:
  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_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_newsName_vue_vue_type_style_index_0_id_1d926fac_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(270);
  14. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_newsName_vue_vue_type_style_index_0_id_1d926fac_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_newsName_vue_vue_type_style_index_0_id_1d926fac_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
  15. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_newsName_vue_vue_type_style_index_0_id_1d926fac_prod_lang_scss_scoped_true__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_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_newsName_vue_vue_type_style_index_0_id_1d926fac_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  16. /***/ }),
  17. /***/ 367:
  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!./pages/news/_newsName.vue?vue&type=template&id=1d926fac&scoped=true
  23. var render = function render() {
  24. var _vm = this,
  25. _c = _vm._self._c;
  26. return _c('div', {
  27. staticClass: "com-main com-width-1400 com-margin-auto"
  28. }, [_vm._ssrNode("<div class=\"content\" data-v-1d926fac>" + _vm._s(_vm.articleDetails) + "</div> <div id=\"formTag\"" + _vm._ssrStyle(null, null, {
  29. display: _vm.showMargin ? '' : 'none'
  30. }) + " data-v-1d926fac></div> <iframe frameborder=\"0\" id=\"formFrame\" src" + _vm._ssrStyle({
  31. "height": "1100px",
  32. "width": "100%",
  33. "border": "none"
  34. }, null, {
  35. display: _vm.$route.params.newsName === 'indent-ideas' ? '' : 'none'
  36. }) + " data-v-1d926fac></iframe>")]);
  37. };
  38. var staticRenderFns = [];
  39. // CONCATENATED MODULE: ./pages/news/_newsName.vue?vue&type=template&id=1d926fac&scoped=true
  40. // 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!./pages/news/_newsName.vue?vue&type=script&lang=js
  41. /* harmony default export */ var _newsNamevue_type_script_lang_js = ({
  42. data() {
  43. return {
  44. showMargin: true,
  45. articleDetails: '',
  46. routerParams: {},
  47. profileform: {},
  48. defaultURL: 'https://forms.zohopublic.com/promocollectionau/form/PCIndentSourcingForm/formperma/I8RpkeF104QfGCw2oK_PUZtj5lCwdwZEY5QJJpvllVI'
  49. };
  50. },
  51. computed: {
  52. userInfo() {
  53. return this.$store.state.userInfo || {};
  54. },
  55. computedURL() {
  56. if (this.userInfo.email) {
  57. const config = {
  58. name: this.userInfo.contacts,
  59. phone: this.userInfo.phone,
  60. email: this.userInfo.email,
  61. company: this.userInfo.company
  62. };
  63. let query = '';
  64. for (const key in config) {
  65. if (config[key]) {
  66. query += `&${key}=${encodeURIComponent(config[key])}`;
  67. }
  68. }
  69. query = query.slice(1);
  70. return this.defaultURL + '?' + query;
  71. } else {
  72. return this.defaultURL;
  73. }
  74. }
  75. },
  76. watch: {
  77. userInfo() {
  78. if (this.$route.params.newsName === 'indent-ideas') {
  79. setTimeout(() => {
  80. const target = document.getElementById('formFrame');
  81. target.src = this.computedURL;
  82. }, 1000);
  83. }
  84. }
  85. },
  86. async created() {
  87. const paramsData = this.$cookies.get('can-use-cookie') ? this.$cookies.get('paramsData') : '';
  88. if (paramsData) {
  89. this.routerParams = paramsData;
  90. } else {
  91. this.routerParams = this.$route.params;
  92. if (this.$cookies.get('can-use-cookie')) this.$cookies.set('paramsData', this.$route.params);
  93. }
  94. await this.getArticleDetails();
  95. this.showMargin = true;
  96. },
  97. mounted() {
  98. if (this.$route.params.newsName === 'indent-ideas') {
  99. setTimeout(() => {
  100. const target = document.getElementById('formFrame');
  101. target.src = this.computedURL;
  102. }, 1000);
  103. }
  104. setTimeout(() => {
  105. this.showMargin = false;
  106. }, 2000);
  107. },
  108. // 这个路由在设计的时候就不对劲, 结构层级只有1层, 但是跳转和传参传了两个params, 导致只有一个参数体现在了url上, 改动页面刷新的时候就会丢失参数id.
  109. beforeDestroy() {
  110. this.$cookies.remove('paramsData');
  111. },
  112. methods: {
  113. getArticleDetails() {
  114. let title = this.$route.params.newsName || '';
  115. title = decodeURIComponent(title);
  116. this.$axios.post('/uk-api/home/articleDetail', {
  117. title: title.replaceAll('-', ' ')
  118. // state: 'au',
  119. }).then(res => {
  120. if (res.code === 1) {
  121. this.articleDetails = res.result.content.replace(/&nbsp;/gi, '');
  122. }
  123. }).catch(() => {});
  124. }
  125. }
  126. });
  127. // CONCATENATED MODULE: ./pages/news/_newsName.vue?vue&type=script&lang=js
  128. /* harmony default export */ var news_newsNamevue_type_script_lang_js = (_newsNamevue_type_script_lang_js);
  129. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  130. var componentNormalizer = __webpack_require__(2);
  131. // CONCATENATED MODULE: ./pages/news/_newsName.vue
  132. function injectStyles (context) {
  133. var style0 = __webpack_require__(330)
  134. if (style0.__inject__) style0.__inject__(context)
  135. }
  136. /* normalize component */
  137. var component = Object(componentNormalizer["a" /* default */])(
  138. news_newsNamevue_type_script_lang_js,
  139. render,
  140. staticRenderFns,
  141. false,
  142. injectStyles,
  143. "1d926fac",
  144. "52de20e7"
  145. )
  146. /* harmony default export */ var _newsName = __webpack_exports__["default"] = (component.exports);
  147. /***/ })
  148. };;
  149. //# sourceMappingURL=_newsName.js.map