media.js 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033
  1. exports.ids = [67,17,18];
  2. exports.modules = {
  3. /***/ 156:
  4. /***/ (function(module, exports) {
  5. // Exports
  6. module.exports = {
  7. };
  8. /***/ }),
  9. /***/ 174:
  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_Pagination_vue_vue_type_style_index_0_id_044ef958_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(156);
  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_Pagination_vue_vue_type_style_index_0_id_044ef958_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_Pagination_vue_vue_type_style_index_0_id_044ef958_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_Pagination_vue_vue_type_style_index_0_id_044ef958_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_Pagination_vue_vue_type_style_index_0_id_044ef958_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  16. /***/ }),
  17. /***/ 182:
  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/Pagination.vue?vue&type=template&id=044ef958&scoped=true
  23. var render = function render() {
  24. var _vm = this,
  25. _c = _vm._self._c;
  26. return _c('div', {
  27. staticClass: "pagination-container",
  28. class: {
  29. 'hidden': _vm.hidden
  30. }
  31. }, [_vm._t("slot"), _vm._ssrNode(" "), _c('el-pagination', _vm._b({
  32. attrs: {
  33. "background": _vm.background,
  34. "current-page": _vm.currentPage,
  35. "page-size": _vm.pageSize,
  36. "layout": _vm.layout,
  37. "total": _vm.total
  38. },
  39. on: {
  40. "update:currentPage": function ($event) {
  41. _vm.currentPage = $event;
  42. },
  43. "update:current-page": function ($event) {
  44. _vm.currentPage = $event;
  45. },
  46. "update:pageSize": function ($event) {
  47. _vm.pageSize = $event;
  48. },
  49. "update:page-size": function ($event) {
  50. _vm.pageSize = $event;
  51. },
  52. "size-change": _vm.handleSizeChange,
  53. "current-change": _vm.handleCurrentChange
  54. }
  55. }, 'el-pagination', _vm.$attrs, false))], 2);
  56. };
  57. var staticRenderFns = [];
  58. // CONCATENATED MODULE: ./components/Pagination.vue?vue&type=template&id=044ef958&scoped=true
  59. // 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/Pagination.vue?vue&type=script&lang=js
  60. /* harmony default export */ var Paginationvue_type_script_lang_js = ({
  61. name: 'Pagination',
  62. props: {
  63. total: {
  64. required: true,
  65. type: Number
  66. },
  67. page: {
  68. type: Number,
  69. default: 0
  70. },
  71. limit: {
  72. type: Number,
  73. default: 10
  74. },
  75. // pageSizes: {
  76. // type: Array,
  77. // default() {
  78. // return [10, 20, 50, 100]
  79. // }
  80. // },
  81. layout: {
  82. type: String,
  83. default: 'prev, pager, next'
  84. },
  85. background: {
  86. type: Boolean,
  87. default: true
  88. },
  89. autoScroll: {
  90. type: Boolean,
  91. default: true
  92. },
  93. hidden: {
  94. type: Boolean,
  95. default: false
  96. }
  97. },
  98. computed: {
  99. currentPage: {
  100. get() {
  101. return this.page;
  102. },
  103. set(val) {
  104. this.$emit('update:page', val);
  105. }
  106. },
  107. pageSize: {
  108. get() {
  109. return this.limit;
  110. },
  111. set(val) {
  112. this.$emit('update:limit', val);
  113. }
  114. }
  115. },
  116. methods: {
  117. handleSizeChange(val) {
  118. this.$emit('pagination', {
  119. page: this.currentPage,
  120. limit: val
  121. });
  122. if (this.autoScroll) {
  123. scrollTo(0, 800);
  124. }
  125. },
  126. handleCurrentChange(val) {
  127. this.$emit('pagination', {
  128. page: val,
  129. limit: this.pageSize
  130. });
  131. if (this.autoScroll) {
  132. scrollTo(0, 800);
  133. }
  134. }
  135. }
  136. });
  137. // CONCATENATED MODULE: ./components/Pagination.vue?vue&type=script&lang=js
  138. /* harmony default export */ var components_Paginationvue_type_script_lang_js = (Paginationvue_type_script_lang_js);
  139. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  140. var componentNormalizer = __webpack_require__(2);
  141. // CONCATENATED MODULE: ./components/Pagination.vue
  142. function injectStyles (context) {
  143. var style0 = __webpack_require__(174)
  144. if (style0.__inject__) style0.__inject__(context)
  145. }
  146. /* normalize component */
  147. var component = Object(componentNormalizer["a" /* default */])(
  148. components_Paginationvue_type_script_lang_js,
  149. render,
  150. staticRenderFns,
  151. false,
  152. injectStyles,
  153. "044ef958",
  154. "230c7770"
  155. )
  156. /* harmony default export */ var Pagination = __webpack_exports__["default"] = (component.exports);
  157. /***/ }),
  158. /***/ 205:
  159. /***/ (function(module, exports) {
  160. // Exports
  161. module.exports = {
  162. };
  163. /***/ }),
  164. /***/ 226:
  165. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  166. "use strict";
  167. __webpack_require__.r(__webpack_exports__);
  168. /* 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_MediaCard_vue_vue_type_style_index_0_id_69177590_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(205);
  169. /* 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_MediaCard_vue_vue_type_style_index_0_id_69177590_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_MediaCard_vue_vue_type_style_index_0_id_69177590_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
  170. /* 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_MediaCard_vue_vue_type_style_index_0_id_69177590_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_MediaCard_vue_vue_type_style_index_0_id_69177590_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  171. /***/ }),
  172. /***/ 247:
  173. /***/ (function(module, exports) {
  174. // Exports
  175. module.exports = {
  176. };
  177. /***/ }),
  178. /***/ 286:
  179. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  180. "use strict";
  181. // ESM COMPAT FLAG
  182. __webpack_require__.r(__webpack_exports__);
  183. // 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/MediaCard.vue?vue&type=template&id=69177590&scoped=true
  184. var render = function render() {
  185. var _vm = this,
  186. _c = _vm._self._c;
  187. return _c('figure', {
  188. class: ['card', {
  189. row: _vm.toggle
  190. }]
  191. }, [_vm._ssrNode("<div class=\"card-media\" data-v-69177590>", "</div>", [_vm.cardData.type === 5 && _vm.toggle ? _vm._ssrNode("<video controls=\"controls\" class=\"card-media-content\" data-v-69177590>", "</video>", [_vm._ssrNode("<source" + _vm._ssrAttr("src", _vm.cardData.media_url) + " data-v-69177590>\n Your browser does not support the video tag.\n ")], 2) : _c('el-image', {
  192. staticClass: "card-img-1",
  193. staticStyle: {
  194. "width": "100%",
  195. "height": "100%"
  196. },
  197. attrs: {
  198. "src": _vm.cardData.type === 1 || _vm.cardData.type === 8 ? _vm.cardData.media_url : _vm.cardData.image,
  199. "fit": "contain"
  200. }
  201. }), _vm._ssrNode(" " + (_vm.cardData.typeName && !_vm.toggle ? "<div class=\"type-icon\" data-v-69177590>" + _vm._ssrEscape("\n " + _vm._s(_vm.cardData.typeName.toUpperCase()) + "\n ") + "</div>" : "<!---->"))], 2), _vm._ssrNode(" "), _vm._ssrNode("<figcaption class=\"card-info\" data-v-69177590>", "</figcaption>", [_vm._ssrNode("<div class=\"card-info-1\" data-v-69177590>", "</div>", [_vm._ssrNode("<h1 data-v-69177590>" + _vm._ssrEscape(_vm._s(_vm.cardData.name)) + "</h1> <p class=\"card-info-point\" data-v-69177590>" + _vm._s(_vm.cardData.description) + "</p> "), _vm._ssrNode("<ul class=\"card-info-label\" data-v-69177590>", "</ul>", [_vm._ssrNode(_vm._ssrList(_vm.cardData.mapLabel, function (l, index) {
  202. return "<li data-v-69177590>" + _vm._ssrEscape("\n " + _vm._s(l) + "\n ") + "</li>";
  203. }) + " "), _vm._l(_vm.cardData.sku, function (item, i) {
  204. return _c('nuxt-link', {
  205. key: item + i,
  206. attrs: {
  207. "to": {
  208. name: 'product-code',
  209. params: {
  210. code: item
  211. }
  212. },
  213. "target": "_blank"
  214. }
  215. }, [_c('li', [_vm._v(_vm._s(item))])]);
  216. })], 2)], 2), _vm._ssrNode(" "), _vm._ssrNode("<div class=\"card-info-btn\" data-v-69177590>", "</div>", [!_vm.toggle ? _c('el-button', {
  217. on: {
  218. "click": _vm.handLeftBtn
  219. }
  220. }, [_vm._v("View")]) : _vm._e(), _vm._ssrNode(" "), _c('el-button', {
  221. on: {
  222. "click": _vm.handRightBtn
  223. }
  224. }, [_vm._v("Download")])], 2)], 2)], 2);
  225. };
  226. var staticRenderFns = [];
  227. // CONCATENATED MODULE: ./components/MediaCard.vue?vue&type=template&id=69177590&scoped=true
  228. // 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/MediaCard.vue?vue&type=script&lang=js
  229. /* harmony default export */ var MediaCardvue_type_script_lang_js = ({
  230. props: {
  231. cardData: {},
  232. toggle: {
  233. type: Boolean,
  234. default: false
  235. }
  236. },
  237. data() {
  238. return {};
  239. },
  240. watch: {
  241. 'cardData.media_url': function (newVal, oldVal) {
  242. if (newVal !== oldVal && this.$refs.video) {
  243. this.$refs.video.load(); // 重新加载视频
  244. }
  245. }
  246. },
  247. methods: {
  248. emitLabel(l) {
  249. this.$emit('labelEvent', l);
  250. },
  251. handLeftBtn() {
  252. this.$emit('leftBtnEvent');
  253. },
  254. handRightBtn() {
  255. this.$emit('rightBtnEvent');
  256. }
  257. }
  258. });
  259. // CONCATENATED MODULE: ./components/MediaCard.vue?vue&type=script&lang=js
  260. /* harmony default export */ var components_MediaCardvue_type_script_lang_js = (MediaCardvue_type_script_lang_js);
  261. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  262. var componentNormalizer = __webpack_require__(2);
  263. // CONCATENATED MODULE: ./components/MediaCard.vue
  264. function injectStyles (context) {
  265. var style0 = __webpack_require__(226)
  266. if (style0.__inject__) style0.__inject__(context)
  267. }
  268. /* normalize component */
  269. var component = Object(componentNormalizer["a" /* default */])(
  270. components_MediaCardvue_type_script_lang_js,
  271. render,
  272. staticRenderFns,
  273. false,
  274. injectStyles,
  275. "69177590",
  276. "91453854"
  277. )
  278. /* harmony default export */ var MediaCard = __webpack_exports__["default"] = (component.exports);
  279. /***/ }),
  280. /***/ 298:
  281. /***/ (function(module, exports) {
  282. /**
  283. * lodash (Custom Build) <https://lodash.com/>
  284. * Build: `lodash modularize exports="npm" -o ./`
  285. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  286. * Released under MIT license <https://lodash.com/license>
  287. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  288. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  289. */
  290. /** Used as the `TypeError` message for "Functions" methods. */
  291. var FUNC_ERROR_TEXT = 'Expected a function';
  292. /** Used as references for various `Number` constants. */
  293. var NAN = 0 / 0;
  294. /** `Object#toString` result references. */
  295. var symbolTag = '[object Symbol]';
  296. /** Used to match leading and trailing whitespace. */
  297. var reTrim = /^\s+|\s+$/g;
  298. /** Used to detect bad signed hexadecimal string values. */
  299. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  300. /** Used to detect binary string values. */
  301. var reIsBinary = /^0b[01]+$/i;
  302. /** Used to detect octal string values. */
  303. var reIsOctal = /^0o[0-7]+$/i;
  304. /** Built-in method references without a dependency on `root`. */
  305. var freeParseInt = parseInt;
  306. /** Detect free variable `global` from Node.js. */
  307. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  308. /** Detect free variable `self`. */
  309. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  310. /** Used as a reference to the global object. */
  311. var root = freeGlobal || freeSelf || Function('return this')();
  312. /** Used for built-in method references. */
  313. var objectProto = Object.prototype;
  314. /**
  315. * Used to resolve the
  316. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  317. * of values.
  318. */
  319. var objectToString = objectProto.toString;
  320. /* Built-in method references for those with the same name as other `lodash` methods. */
  321. var nativeMax = Math.max,
  322. nativeMin = Math.min;
  323. /**
  324. * Gets the timestamp of the number of milliseconds that have elapsed since
  325. * the Unix epoch (1 January 1970 00:00:00 UTC).
  326. *
  327. * @static
  328. * @memberOf _
  329. * @since 2.4.0
  330. * @category Date
  331. * @returns {number} Returns the timestamp.
  332. * @example
  333. *
  334. * _.defer(function(stamp) {
  335. * console.log(_.now() - stamp);
  336. * }, _.now());
  337. * // => Logs the number of milliseconds it took for the deferred invocation.
  338. */
  339. var now = function() {
  340. return root.Date.now();
  341. };
  342. /**
  343. * Creates a debounced function that delays invoking `func` until after `wait`
  344. * milliseconds have elapsed since the last time the debounced function was
  345. * invoked. The debounced function comes with a `cancel` method to cancel
  346. * delayed `func` invocations and a `flush` method to immediately invoke them.
  347. * Provide `options` to indicate whether `func` should be invoked on the
  348. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  349. * with the last arguments provided to the debounced function. Subsequent
  350. * calls to the debounced function return the result of the last `func`
  351. * invocation.
  352. *
  353. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  354. * invoked on the trailing edge of the timeout only if the debounced function
  355. * is invoked more than once during the `wait` timeout.
  356. *
  357. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  358. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  359. *
  360. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  361. * for details over the differences between `_.debounce` and `_.throttle`.
  362. *
  363. * @static
  364. * @memberOf _
  365. * @since 0.1.0
  366. * @category Function
  367. * @param {Function} func The function to debounce.
  368. * @param {number} [wait=0] The number of milliseconds to delay.
  369. * @param {Object} [options={}] The options object.
  370. * @param {boolean} [options.leading=false]
  371. * Specify invoking on the leading edge of the timeout.
  372. * @param {number} [options.maxWait]
  373. * The maximum time `func` is allowed to be delayed before it's invoked.
  374. * @param {boolean} [options.trailing=true]
  375. * Specify invoking on the trailing edge of the timeout.
  376. * @returns {Function} Returns the new debounced function.
  377. * @example
  378. *
  379. * // Avoid costly calculations while the window size is in flux.
  380. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  381. *
  382. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  383. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  384. * 'leading': true,
  385. * 'trailing': false
  386. * }));
  387. *
  388. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  389. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  390. * var source = new EventSource('/stream');
  391. * jQuery(source).on('message', debounced);
  392. *
  393. * // Cancel the trailing debounced invocation.
  394. * jQuery(window).on('popstate', debounced.cancel);
  395. */
  396. function debounce(func, wait, options) {
  397. var lastArgs,
  398. lastThis,
  399. maxWait,
  400. result,
  401. timerId,
  402. lastCallTime,
  403. lastInvokeTime = 0,
  404. leading = false,
  405. maxing = false,
  406. trailing = true;
  407. if (typeof func != 'function') {
  408. throw new TypeError(FUNC_ERROR_TEXT);
  409. }
  410. wait = toNumber(wait) || 0;
  411. if (isObject(options)) {
  412. leading = !!options.leading;
  413. maxing = 'maxWait' in options;
  414. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  415. trailing = 'trailing' in options ? !!options.trailing : trailing;
  416. }
  417. function invokeFunc(time) {
  418. var args = lastArgs,
  419. thisArg = lastThis;
  420. lastArgs = lastThis = undefined;
  421. lastInvokeTime = time;
  422. result = func.apply(thisArg, args);
  423. return result;
  424. }
  425. function leadingEdge(time) {
  426. // Reset any `maxWait` timer.
  427. lastInvokeTime = time;
  428. // Start the timer for the trailing edge.
  429. timerId = setTimeout(timerExpired, wait);
  430. // Invoke the leading edge.
  431. return leading ? invokeFunc(time) : result;
  432. }
  433. function remainingWait(time) {
  434. var timeSinceLastCall = time - lastCallTime,
  435. timeSinceLastInvoke = time - lastInvokeTime,
  436. result = wait - timeSinceLastCall;
  437. return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
  438. }
  439. function shouldInvoke(time) {
  440. var timeSinceLastCall = time - lastCallTime,
  441. timeSinceLastInvoke = time - lastInvokeTime;
  442. // Either this is the first call, activity has stopped and we're at the
  443. // trailing edge, the system time has gone backwards and we're treating
  444. // it as the trailing edge, or we've hit the `maxWait` limit.
  445. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  446. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  447. }
  448. function timerExpired() {
  449. var time = now();
  450. if (shouldInvoke(time)) {
  451. return trailingEdge(time);
  452. }
  453. // Restart the timer.
  454. timerId = setTimeout(timerExpired, remainingWait(time));
  455. }
  456. function trailingEdge(time) {
  457. timerId = undefined;
  458. // Only invoke if we have `lastArgs` which means `func` has been
  459. // debounced at least once.
  460. if (trailing && lastArgs) {
  461. return invokeFunc(time);
  462. }
  463. lastArgs = lastThis = undefined;
  464. return result;
  465. }
  466. function cancel() {
  467. if (timerId !== undefined) {
  468. clearTimeout(timerId);
  469. }
  470. lastInvokeTime = 0;
  471. lastArgs = lastCallTime = lastThis = timerId = undefined;
  472. }
  473. function flush() {
  474. return timerId === undefined ? result : trailingEdge(now());
  475. }
  476. function debounced() {
  477. var time = now(),
  478. isInvoking = shouldInvoke(time);
  479. lastArgs = arguments;
  480. lastThis = this;
  481. lastCallTime = time;
  482. if (isInvoking) {
  483. if (timerId === undefined) {
  484. return leadingEdge(lastCallTime);
  485. }
  486. if (maxing) {
  487. // Handle invocations in a tight loop.
  488. timerId = setTimeout(timerExpired, wait);
  489. return invokeFunc(lastCallTime);
  490. }
  491. }
  492. if (timerId === undefined) {
  493. timerId = setTimeout(timerExpired, wait);
  494. }
  495. return result;
  496. }
  497. debounced.cancel = cancel;
  498. debounced.flush = flush;
  499. return debounced;
  500. }
  501. /**
  502. * Checks if `value` is the
  503. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  504. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  505. *
  506. * @static
  507. * @memberOf _
  508. * @since 0.1.0
  509. * @category Lang
  510. * @param {*} value The value to check.
  511. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  512. * @example
  513. *
  514. * _.isObject({});
  515. * // => true
  516. *
  517. * _.isObject([1, 2, 3]);
  518. * // => true
  519. *
  520. * _.isObject(_.noop);
  521. * // => true
  522. *
  523. * _.isObject(null);
  524. * // => false
  525. */
  526. function isObject(value) {
  527. var type = typeof value;
  528. return !!value && (type == 'object' || type == 'function');
  529. }
  530. /**
  531. * Checks if `value` is object-like. A value is object-like if it's not `null`
  532. * and has a `typeof` result of "object".
  533. *
  534. * @static
  535. * @memberOf _
  536. * @since 4.0.0
  537. * @category Lang
  538. * @param {*} value The value to check.
  539. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  540. * @example
  541. *
  542. * _.isObjectLike({});
  543. * // => true
  544. *
  545. * _.isObjectLike([1, 2, 3]);
  546. * // => true
  547. *
  548. * _.isObjectLike(_.noop);
  549. * // => false
  550. *
  551. * _.isObjectLike(null);
  552. * // => false
  553. */
  554. function isObjectLike(value) {
  555. return !!value && typeof value == 'object';
  556. }
  557. /**
  558. * Checks if `value` is classified as a `Symbol` primitive or object.
  559. *
  560. * @static
  561. * @memberOf _
  562. * @since 4.0.0
  563. * @category Lang
  564. * @param {*} value The value to check.
  565. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  566. * @example
  567. *
  568. * _.isSymbol(Symbol.iterator);
  569. * // => true
  570. *
  571. * _.isSymbol('abc');
  572. * // => false
  573. */
  574. function isSymbol(value) {
  575. return typeof value == 'symbol' ||
  576. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  577. }
  578. /**
  579. * Converts `value` to a number.
  580. *
  581. * @static
  582. * @memberOf _
  583. * @since 4.0.0
  584. * @category Lang
  585. * @param {*} value The value to process.
  586. * @returns {number} Returns the number.
  587. * @example
  588. *
  589. * _.toNumber(3.2);
  590. * // => 3.2
  591. *
  592. * _.toNumber(Number.MIN_VALUE);
  593. * // => 5e-324
  594. *
  595. * _.toNumber(Infinity);
  596. * // => Infinity
  597. *
  598. * _.toNumber('3.2');
  599. * // => 3.2
  600. */
  601. function toNumber(value) {
  602. if (typeof value == 'number') {
  603. return value;
  604. }
  605. if (isSymbol(value)) {
  606. return NAN;
  607. }
  608. if (isObject(value)) {
  609. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  610. value = isObject(other) ? (other + '') : other;
  611. }
  612. if (typeof value != 'string') {
  613. return value === 0 ? value : +value;
  614. }
  615. value = value.replace(reTrim, '');
  616. var isBinary = reIsBinary.test(value);
  617. return (isBinary || reIsOctal.test(value))
  618. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  619. : (reIsBadHex.test(value) ? NAN : +value);
  620. }
  621. module.exports = debounce;
  622. /***/ }),
  623. /***/ 299:
  624. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  625. "use strict";
  626. __webpack_require__.r(__webpack_exports__);
  627. /* 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_media_vue_vue_type_style_index_0_id_09dd2dea_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(247);
  628. /* 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_media_vue_vue_type_style_index_0_id_09dd2dea_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_media_vue_vue_type_style_index_0_id_09dd2dea_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
  629. /* 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_media_vue_vue_type_style_index_0_id_09dd2dea_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_media_vue_vue_type_style_index_0_id_09dd2dea_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  630. /***/ }),
  631. /***/ 348:
  632. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  633. "use strict";
  634. // ESM COMPAT FLAG
  635. __webpack_require__.r(__webpack_exports__);
  636. // 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/media.vue?vue&type=template&id=09dd2dea&scoped=true
  637. var render = function render() {
  638. var _vm = this,
  639. _c = _vm._self._c;
  640. return _c('div', {
  641. staticClass: "com-main com-width-1400 com-margin-auto"
  642. }, [_c('el-breadcrumb', {
  643. attrs: {
  644. "separator-class": "el-icon-arrow-right"
  645. }
  646. }, [_c('el-breadcrumb-item', {
  647. attrs: {
  648. "to": {
  649. path: '/'
  650. }
  651. }
  652. }, [_vm._v("Home")]), _vm._v(" "), _c('el-breadcrumb-item', [_vm._v(" Media Centre")])], 1), _vm._ssrNode(" <ul class=\"flex around tab\" data-v-09dd2dea>" + _vm._ssrList(_vm.list, function (item, index) {
  653. return "<li" + _vm._ssrClass(null, {
  654. active: index === _vm.curTab
  655. }) + " data-v-09dd2dea>" + _vm._ssrEscape("\n " + _vm._s(item.typeName) + "\n ") + "</li>";
  656. }) + "</ul> "), _c('el-input', {
  657. attrs: {
  658. "placeholder": "Search",
  659. "clearable": ""
  660. },
  661. on: {
  662. "clear": _vm.getList
  663. },
  664. nativeOn: {
  665. "keyup": function ($event) {
  666. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) return null;
  667. return _vm.getList.apply(null, arguments);
  668. }
  669. },
  670. model: {
  671. value: _vm.keyword,
  672. callback: function ($$v) {
  673. _vm.keyword = $$v;
  674. },
  675. expression: "keyword"
  676. }
  677. }, [_c('i', {
  678. staticClass: "el-input__icon el-icon-search",
  679. attrs: {
  680. "slot": "suffix"
  681. },
  682. on: {
  683. "click": _vm.getList
  684. },
  685. slot: "suffix"
  686. })]), _vm._ssrNode(" "), _vm.listLoading ? _c('div', {
  687. directives: [{
  688. name: "loading",
  689. rawName: "v-loading",
  690. value: true,
  691. expression: "true"
  692. }],
  693. staticClass: "com-loading",
  694. attrs: {
  695. "slot": "spinner",
  696. "element-loading-text": "Loading",
  697. "element-loading-spinner": "el-icon-loading"
  698. },
  699. slot: "spinner"
  700. }) : _vm._ssrNode("<div class=\"item\" data-v-09dd2dea>", "</div>", [_vm.comCurObj.total ? _vm._ssrNode("<section data-v-09dd2dea>", "</section>", [_vm._ssrNode("<ul data-v-09dd2dea>", "</ul>", _vm._l(_vm.comCurObj.data, function (item) {
  701. return _c('media-card', {
  702. key: item.id,
  703. attrs: {
  704. "cardData": item
  705. },
  706. on: {
  707. "labelEvent": _vm.receveLabel,
  708. "leftBtnEvent": function ($event) {
  709. return _vm.openDialog(item);
  710. },
  711. "rightBtnEvent": function ($event) {
  712. return _vm.download(item);
  713. }
  714. }
  715. });
  716. }), 1), _vm._ssrNode(" "), _c('pagination', {
  717. directives: [{
  718. name: "show",
  719. rawName: "v-show",
  720. value: _vm.comCurObj.total > 0,
  721. expression: "comCurObj.total > 0"
  722. }],
  723. attrs: {
  724. "total": _vm.comCurObj.total,
  725. "page": _vm.comCurObj.page,
  726. "limit": _vm.limit
  727. },
  728. on: {
  729. "update:page": function ($event) {
  730. return _vm.$set(_vm.comCurObj, "page", $event);
  731. },
  732. "update:limit": function ($event) {
  733. _vm.limit = $event;
  734. },
  735. "pagination": _vm.getList
  736. }
  737. })], 2) : _c('el-empty', {
  738. attrs: {
  739. "description": "No Data"
  740. }
  741. })], 1), _vm._ssrNode(" "), _c('el-dialog', {
  742. attrs: {
  743. "lock-scroll": false,
  744. "visible": _vm.dialogVisible,
  745. "width": "1000px"
  746. },
  747. on: {
  748. "update:visible": function ($event) {
  749. _vm.dialogVisible = $event;
  750. }
  751. }
  752. }, [_c('media-card', {
  753. attrs: {
  754. "cardData": _vm.cardData,
  755. "toggle": true
  756. },
  757. on: {
  758. "labelEvent": _vm.receveLabel,
  759. "rightBtnEvent": function ($event) {
  760. return _vm.download(_vm.cardData);
  761. }
  762. }
  763. })], 1)], 2);
  764. };
  765. var staticRenderFns = [];
  766. // CONCATENATED MODULE: ./pages/media.vue?vue&type=template&id=09dd2dea&scoped=true
  767. // EXTERNAL MODULE: ./node_modules/lodash.debounce/index.js
  768. var lodash_debounce = __webpack_require__(298);
  769. var lodash_debounce_default = /*#__PURE__*/__webpack_require__.n(lodash_debounce);
  770. // 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/media.vue?vue&type=script&lang=js
  771. /* harmony default export */ var mediavue_type_script_lang_js = ({
  772. data() {
  773. return {
  774. list: [{
  775. id: 0,
  776. typeName: 'All Content'
  777. }, {
  778. id: 3,
  779. typeName: 'EDMs'
  780. }, {
  781. id: 1,
  782. typeName: 'Banners'
  783. }, {
  784. id: 4,
  785. typeName: 'Catalogues'
  786. }, {
  787. id: 2,
  788. typeName: 'Social Media'
  789. }, {
  790. id: 8,
  791. typeName: 'Email Signature'
  792. }, {
  793. id: 5,
  794. typeName: 'Videos'
  795. }, {
  796. id: 7,
  797. typeName: 'News'
  798. }],
  799. curTab: 0,
  800. keyword: '',
  801. limit: 20,
  802. listLoading: true,
  803. cardData: {},
  804. dialogVisible: false,
  805. getDebList: null
  806. };
  807. },
  808. async created() {
  809. await this.getList();
  810. this.getDebList = lodash_debounce_default()(this.getList, 500);
  811. },
  812. watch: {
  813. keyword(newValue, oldValue) {
  814. if (newValue != oldValue) {
  815. window.scrollTo({
  816. top: 0,
  817. behavior: 'smooth'
  818. });
  819. this.getDebList();
  820. this.dialogVisible = false;
  821. }
  822. }
  823. },
  824. computed: {
  825. comCurObj() {
  826. return this.list[this.curTab];
  827. }
  828. },
  829. methods: {
  830. getList() {
  831. var _this$comCurObj;
  832. this.listLoading = true;
  833. let params = {
  834. keyword: this.keyword,
  835. page: this.comCurObj.page || 1,
  836. limit: this.limit
  837. };
  838. this.curTab && (params.type = (_this$comCurObj = this.comCurObj) === null || _this$comCurObj === void 0 ? void 0 : _this$comCurObj.id);
  839. this.$axios.get('/uk-api/data/list', {
  840. params
  841. }).then(res => {
  842. if (res.code == 1) {
  843. const {
  844. data,
  845. total
  846. } = res.result;
  847. this.comCurObj.data = data.map(i => {
  848. var _this$comCurObj2;
  849. const mapLabel = i.datalabel.map(o => o.name);
  850. const obj = this.list.find(item => item.id === i.type);
  851. const typeName = this.curTab === 0 ? obj === null || obj === void 0 ? void 0 : obj.typeName : (_this$comCurObj2 = this.comCurObj) === null || _this$comCurObj2 === void 0 ? void 0 : _this$comCurObj2.typeName;
  852. return {
  853. ...i,
  854. mapLabel,
  855. typeName
  856. };
  857. });
  858. this.comCurObj.total = total;
  859. this.listLoading = false;
  860. }
  861. if (false) {}
  862. }).catch(() => {
  863. this.listLoading = false;
  864. });
  865. },
  866. selTab(i) {
  867. this.curTab = i;
  868. this.$set(this.comCurObj, 'page', 1);
  869. this.getList();
  870. },
  871. openDialog(data) {
  872. this.cardData = data;
  873. this.dialogVisible = true;
  874. },
  875. download(item) {
  876. if (!item.media_url) {
  877. this.$message.error('No File');
  878. return;
  879. }
  880. var urlStr = item.media_url.match('[^/]+(?!.*/)')[0];
  881. this.$utils.downloadXhr(item.media_url, urlStr);
  882. },
  883. receveLabel(l) {
  884. this.keyword = l;
  885. }
  886. }
  887. });
  888. // CONCATENATED MODULE: ./pages/media.vue?vue&type=script&lang=js
  889. /* harmony default export */ var pages_mediavue_type_script_lang_js = (mediavue_type_script_lang_js);
  890. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  891. var componentNormalizer = __webpack_require__(2);
  892. // CONCATENATED MODULE: ./pages/media.vue
  893. function injectStyles (context) {
  894. var style0 = __webpack_require__(299)
  895. if (style0.__inject__) style0.__inject__(context)
  896. }
  897. /* normalize component */
  898. var component = Object(componentNormalizer["a" /* default */])(
  899. pages_mediavue_type_script_lang_js,
  900. render,
  901. staticRenderFns,
  902. false,
  903. injectStyles,
  904. "09dd2dea",
  905. "366c9b0e"
  906. )
  907. /* harmony default export */ var media = __webpack_exports__["default"] = (component.exports);
  908. /* nuxt-component-imports */
  909. installComponents(component, {MediaCard: __webpack_require__(286).default,Pagination: __webpack_require__(182).default})
  910. /***/ })
  911. };;
  912. //# sourceMappingURL=media.js.map