cms-chenhj-ui 2.0.18 → 2.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10090,8 +10090,8 @@ var map = {
10090
10090
  "./cms-servePlan-text/index.js": 6501,
10091
10091
  "./cms-stored-value-card": 2399,
10092
10092
  "./cms-stored-value-card/": 2399,
10093
- "./cms-stored-value-card/View": 9673,
10094
- "./cms-stored-value-card/View.vue": 9673,
10093
+ "./cms-stored-value-card/View": 3837,
10094
+ "./cms-stored-value-card/View.vue": 3837,
10095
10095
  "./cms-stored-value-card/index": 2399,
10096
10096
  "./cms-stored-value-card/index.js": 2399,
10097
10097
  "./cms-termsAndConditions": 9387,
@@ -13005,7 +13005,7 @@ const View = () => Promise.resolve(/* import() */).then(__webpack_require__.bind
13005
13005
  __webpack_require__.r(__webpack_exports__);
13006
13006
  /* harmony import */ var _baseConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(649);
13007
13007
 
13008
- const View = () => Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 9673));
13008
+ const View = () => Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 3837));
13009
13009
  const langData = {
13010
13010
  configList: [
13011
13011
  // {
@@ -13069,7 +13069,8 @@ const validateSchema = (0,_baseConfig__WEBPACK_IMPORTED_MODULE_0__.getValidateSc
13069
13069
  settings: cmsCompName => {
13070
13070
  return (0,_baseConfig__WEBPACK_IMPORTED_MODULE_0__.getInitCompData)({
13071
13071
  cmsCompName,
13072
- langData
13072
+ langData,
13073
+ isLangAll: true
13073
13074
  });
13074
13075
  }
13075
13076
  });
@@ -27278,6 +27279,395 @@ module.exports = function (obj) {
27278
27279
  };
27279
27280
 
27280
27281
 
27282
+ /***/ }),
27283
+
27284
+ /***/ 3837:
27285
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
27286
+
27287
+ "use strict";
27288
+ // ESM COMPAT FLAG
27289
+ __webpack_require__.r(__webpack_exports__);
27290
+
27291
+ // EXPORTS
27292
+ __webpack_require__.d(__webpack_exports__, {
27293
+ "default": function() { return /* binding */ View; }
27294
+ });
27295
+
27296
+ ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/babel-loader/lib/index.js??clonedRuleSet-41.use!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./package/cms-stored-value-card/View.vue?vue&type=template&id=ae178d02&scoped=true
27297
+ var render = function render() {
27298
+ var _vm = this,
27299
+ _c = _vm._self._c;
27300
+ return _c('BaseComp', _vm._b({
27301
+ attrs: {
27302
+ "data": _vm.data,
27303
+ "nowCompId": _vm.nowCompId,
27304
+ "isOpcacity": _vm.isOpcacity,
27305
+ "lang": _vm.lang
27306
+ },
27307
+ on: {
27308
+ "getConfigData": _vm.getConfigData
27309
+ }
27310
+ }, 'BaseComp', _vm.$attrs, false), [_c('section', {
27311
+ staticClass: "cmhk-home_main"
27312
+ }, [_c('div', {
27313
+ staticClass: "wrap"
27314
+ }, [_c('div', {
27315
+ ref: "cardList",
27316
+ staticClass: "cardList"
27317
+ }, [_vm.configList.length === 0 ? [_c('div', {
27318
+ staticClass: "card-box"
27319
+ }, [_c('div', {
27320
+ staticClass: "card"
27321
+ }, [_c('div', {
27322
+ staticClass: "img-box"
27323
+ }, [_c('div', {
27324
+ staticClass: "card-img",
27325
+ class: {
27326
+ 'is-cms': _vm.$EventBus
27327
+ }
27328
+ }, [_c('img', {
27329
+ staticStyle: {
27330
+ "height": "200px"
27331
+ },
27332
+ attrs: {
27333
+ "src": _vm.placeholderImg,
27334
+ "alt": ""
27335
+ }
27336
+ })])]), _c('div', {
27337
+ staticClass: "content-box"
27338
+ }, [_c('div', {
27339
+ staticClass: "card-name"
27340
+ }, [_vm._v(_vm._s(_vm.langText.productName))]), _c('div', {
27341
+ staticClass: "text-box"
27342
+ }, [_c('div', {
27343
+ staticClass: "card-refPrice"
27344
+ }, [_vm._v(" " + _vm._s(_vm.langText.Price) + " HK$XXXX ")]), _c('div', {
27345
+ staticClass: "card-pice-text"
27346
+ }, [_vm._v(_vm._s(_vm.langText.onlinePrice))])]), _c('div', {
27347
+ staticClass: "card-pice"
27348
+ }, [_c('span', [_vm._v("HK$")]), _vm._v("XXXX")]), _c('div', {
27349
+ staticClass: "card-btn"
27350
+ }, [_vm._v(_vm._s(_vm.langText.buyNow))])])])])] : _vm._e(), _vm._l(_vm.viewList, function (item, index) {
27351
+ return _c('div', {
27352
+ key: `${index}-${item.commodityId || index}`,
27353
+ staticClass: "card-box"
27354
+ }, [_c('div', {
27355
+ staticClass: "card"
27356
+ }, [_c('div', {
27357
+ staticClass: "tag-box-left"
27358
+ }, [_vm._l(item.malltCommodityLeft, function (ele, i) {
27359
+ return [_c('img', {
27360
+ key: i,
27361
+ attrs: {
27362
+ "src": _vm.compBaseUrl + ele.pictureUrl,
27363
+ "alt": ""
27364
+ }
27365
+ })];
27366
+ })], 2), _c('div', {
27367
+ staticClass: "tag-box-right"
27368
+ }, [_vm._l(item.malltCommodityRight, function (ele, i) {
27369
+ return [_c('img', {
27370
+ key: i,
27371
+ attrs: {
27372
+ "src": _vm.compBaseUrl + ele.pictureUrl,
27373
+ "alt": ""
27374
+ }
27375
+ })];
27376
+ })], 2), _c('div', {
27377
+ staticClass: "img-box"
27378
+ }, [_vm.isNotActive(item) ? _c('div', {
27379
+ staticClass: "mask"
27380
+ }, [_vm._v(" " + _vm._s(new Date(item.upTime).getTime() > _vm.nowTs ? _vm.langText.comingSoon : _vm.langText.expired) + " ")]) : _vm._e(), _c('div', {
27381
+ staticClass: "card-img",
27382
+ class: {
27383
+ 'is-cms': _vm.$EventBus
27384
+ }
27385
+ }, [_c('img', {
27386
+ attrs: {
27387
+ "src": _vm.compBaseUrl + item.maxPicId,
27388
+ "alt": ""
27389
+ }
27390
+ })])]), _c('div', {
27391
+ staticClass: "content-box"
27392
+ }, [_vm.isNotActive(item) ? _c('div', {
27393
+ staticClass: "content-mask"
27394
+ }) : _vm._e(), _c('div', {
27395
+ staticClass: "card-name"
27396
+ }, [_vm._v(_vm._s(item.commodityName))]), _c('div', {
27397
+ staticClass: "text-box"
27398
+ }, [item.price !== item.refPrice ? _c('div', {
27399
+ staticClass: "card-refPrice"
27400
+ }, [_vm._v(" " + _vm._s(_vm.langText.Price) + " HK$" + _vm._s(_vm.convertCentsToYuan(item.refPrice)) + " ")]) : _c('div', {
27401
+ staticClass: "card-refPrice"
27402
+ }), _c('div', {
27403
+ staticClass: "card-pice-text"
27404
+ }, [_vm._v(" " + _vm._s(item.price !== item.refPrice ? _vm.langText.onlinePrice : _vm.langText.Price) + " ")])]), _c('div', {
27405
+ staticClass: "card-pice spc-font"
27406
+ }, [_c('span', [_vm._v("HK$")]), _vm._v(_vm._s(_vm.convertCentsToYuan(item.price)) + " ")]), _vm.isActive(item) ? _c('div', {
27407
+ staticClass: "card-btn",
27408
+ on: {
27409
+ "click": function ($event) {
27410
+ return _vm.goDetail(item);
27411
+ }
27412
+ }
27413
+ }, [_vm._v(" " + _vm._s(_vm.langText.buyNow)), _c('img', {
27414
+ attrs: {
27415
+ "src": _vm.arrowRightImg
27416
+ }
27417
+ })]) : _c('div', {
27418
+ staticClass: "card-btn"
27419
+ }, [_vm._v(" " + _vm._s(new Date(item.upTime).getTime() > _vm.nowTs ? (_vm.langText.launch || "").replace("NNN", item.upTime) : _vm.langText.Offer) + " ")])])])]);
27420
+ })], 2), !_vm.seeMore && _vm.configList.length > 9 ? _c('div', {
27421
+ ref: "seeMoreRef",
27422
+ staticClass: "seeMore",
27423
+ on: {
27424
+ "click": function ($event) {
27425
+ _vm.seeMore = true;
27426
+ }
27427
+ }
27428
+ }, [_vm._v(" " + _vm._s(_vm.langText.more) + " "), _c('img', {
27429
+ staticClass: "btm",
27430
+ attrs: {
27431
+ "src": _vm.arrowDownImg
27432
+ }
27433
+ }), _c('img', {
27434
+ staticClass: "hover",
27435
+ attrs: {
27436
+ "src": _vm.arrowHoverImg
27437
+ }
27438
+ }), _c('img', {
27439
+ staticClass: "active",
27440
+ attrs: {
27441
+ "src": _vm.arrowActiveImg
27442
+ }
27443
+ })]) : _vm._e()])])]);
27444
+ };
27445
+ var staticRenderFns = [];
27446
+
27447
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.constructor.js
27448
+ var es_iterator_constructor = __webpack_require__(8111);
27449
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.filter.js
27450
+ var es_iterator_filter = __webpack_require__(2489);
27451
+ // EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.for-each.js
27452
+ var es_iterator_for_each = __webpack_require__(7588);
27453
+ // EXTERNAL MODULE: ./package/baseComp.vue + 5 modules
27454
+ var baseComp = __webpack_require__(1941);
27455
+ // EXTERNAL MODULE: ./src/api/index.js
27456
+ var api = __webpack_require__(929);
27457
+ // EXTERNAL MODULE: ./node_modules/qs/lib/index.js
27458
+ var lib = __webpack_require__(9122);
27459
+ var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
27460
+ ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/babel-loader/lib/index.js??clonedRuleSet-41.use!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./package/cms-stored-value-card/View.vue?vue&type=script&lang=js
27461
+
27462
+
27463
+
27464
+
27465
+
27466
+
27467
+
27468
+
27469
+
27470
+ /* harmony default export */ var Viewvue_type_script_lang_js = ({
27471
+ name: "cms-stored-value-card",
27472
+ components: {
27473
+ BaseComp: baseComp["default"]
27474
+ },
27475
+ props: {
27476
+ data: {
27477
+ type: Object,
27478
+ default: () => {
27479
+ return {};
27480
+ }
27481
+ },
27482
+ nowCompId: {
27483
+ type: [String, Number],
27484
+ default: ""
27485
+ },
27486
+ isOpcacity: {
27487
+ type: Boolean,
27488
+ default: true
27489
+ },
27490
+ lang: {
27491
+ type: String,
27492
+ default: "zh-HK"
27493
+ }
27494
+ },
27495
+ data() {
27496
+ return {
27497
+ langConfig: {
27498
+ "zh-HK": {
27499
+ productName: "產品名稱",
27500
+ Price: "建議零售價",
27501
+ onlinePrice: "網上優惠價",
27502
+ buyNow: "立即選購",
27503
+ comingSoon: "即將推出",
27504
+ expired: "優惠已過期",
27505
+ more: "查看更多",
27506
+ launch: "NNN 上線",
27507
+ Offer: "優惠即將推出"
27508
+ },
27509
+ "zh-CN": {
27510
+ productName: "产品名称",
27511
+ Price: "建议零售价",
27512
+ onlinePrice: "网上优惠价",
27513
+ buyNow: "立即选购",
27514
+ comingSoon: "即将推出",
27515
+ expired: "优惠已过期",
27516
+ more: "查看更多",
27517
+ launch: "NNN 上线",
27518
+ Offer: "优惠即将推出"
27519
+ },
27520
+ "en-US": {
27521
+ productName: "Product Name",
27522
+ Price: "RRP",
27523
+ onlinePrice: "Online Price",
27524
+ buyNow: "Buy Now",
27525
+ comingSoon: "Coming Soon",
27526
+ expired: "Expired",
27527
+ more: "See more",
27528
+ launch: "Launch at NNN",
27529
+ Offer: "Offer Coming"
27530
+ }
27531
+ },
27532
+ configList: [],
27533
+ seeMore: false,
27534
+ nowTs: Date.now(),
27535
+ compBaseUrl: this.$route.query.envId == 4 ? "https://omniapi.hk.chinamobile.com" : "https://omniapi-uat.hk.chinamobile.com",
27536
+ // images
27537
+ placeholderImg: __webpack_require__(5335),
27538
+ arrowRightImg: __webpack_require__(4860),
27539
+ arrowDownImg: __webpack_require__(1861),
27540
+ arrowHoverImg: __webpack_require__(4116),
27541
+ arrowActiveImg: __webpack_require__(9670),
27542
+ shopList: []
27543
+ };
27544
+ },
27545
+ computed: {
27546
+ langText() {
27547
+ return this.config && this.langConfig && this.langConfig[this.lang] || this.langConfig["zh-HK"];
27548
+ },
27549
+ viewList() {
27550
+ if (this.seeMore) return this.shopList;
27551
+ return this.shopList.slice(0, 9);
27552
+ }
27553
+ },
27554
+ mounted() {
27555
+ if (!this.$EventBus) {
27556
+ if (["https://omniapi.hk.chinamobile.com", "https://www.hk.chinamobile.com"].includes(window.location.origin)) {
27557
+ this.compBaseUrl = "https://omniapi.hk.chinamobile.com";
27558
+ } else {
27559
+ this.compBaseUrl = "https://omniapi-uat.hk.chinamobile.com";
27560
+ }
27561
+ }
27562
+ },
27563
+ beforeDestroy() {},
27564
+ methods: {
27565
+ getConfigData(configData) {
27566
+ this.configList = configData.configList;
27567
+ console.log("getConfigData", this.configList);
27568
+ this.getValue();
27569
+ },
27570
+ async getValue() {
27571
+ await this.getCommodityDetails();
27572
+ },
27573
+ // 拉取已选商品详情
27574
+ async getCommodityDetails() {
27575
+ // try {
27576
+ let req = {
27577
+ busInfo: JSON.stringify({
27578
+ commodityIds: [...this.configList],
27579
+ commodityTypes: ["604", "605"]
27580
+ })
27581
+ };
27582
+ req = lib_default().stringify(req);
27583
+ const json = await (0,api/* getCommodityDetails */.yX)(req, this.lang);
27584
+ let dataResult = json && json.busiResp && json.busiResp.busiDataResp;
27585
+ if (Array.isArray(dataResult)) {
27586
+ dataResult.forEach(item => {
27587
+ if (Array.isArray(item.malltCommodityTags)) {
27588
+ const left = item.malltCommodityTags.filter(ele => ele.tagType == 5001).sort((a, b) => a.sort - b.sort);
27589
+ const right = item.malltCommodityTags.filter(ele => ele.tagType == 5002).sort((a, b) => a.sort - b.sort);
27590
+ item.malltCommodityLeft = left.slice(0, 2);
27591
+ item.malltCommodityRight = right.slice(0, 4);
27592
+ } else {
27593
+ item.malltCommodityLeft = [];
27594
+ item.malltCommodityRight = [];
27595
+ }
27596
+ });
27597
+ // 按选择顺序排序
27598
+ this.shopList = dataResult.sort((a, b) => {
27599
+ return this.configList.indexOf(a.commodityId) - this.configList.indexOf(b.commodityId);
27600
+ });
27601
+ } else {
27602
+ this.shopList = [];
27603
+ }
27604
+ // } catch (e) {
27605
+ // this.shopList = [];
27606
+ // }
27607
+ },
27608
+ isActive(item) {
27609
+ const now = Date.now();
27610
+ return new Date(item.upTime).getTime() < now && new Date(item.downTime).getTime() > now;
27611
+ },
27612
+ isNotActive(item) {
27613
+ const now = Date.now();
27614
+ return new Date(item.upTime).getTime() > now || new Date(item.downTime).getTime() < now;
27615
+ },
27616
+ convertCentsToYuan(cents) {
27617
+ const yuan = (Number(cents || 0) / 100).toFixed(2);
27618
+ return parseFloat(yuan);
27619
+ },
27620
+ goDetail(item) {
27621
+ const base = this.$EventBus ? this.compBaseUrl : window.location.origin;
27622
+ const langMap = {
27623
+ "zh-CN": "sc",
27624
+ "zh-HK": "tc",
27625
+ "en-US": "en"
27626
+ };
27627
+ const routeLang = langMap[this.lang];
27628
+ if (item.commodityType === "604") {
27629
+ if ((item.commodityName || "").includes("MySIM")) {
27630
+ window.parent.location.href = `${base}/${routeLang}/home/prepaid-card/mysim/detail?commodityId=${item.commodityId}&mysim=${item.commodityName}`;
27631
+ } else {
27632
+ window.parent.location.href = `${base}/${routeLang}/home/prepaid-card/detail?commodityId=${item.commodityId}&commodityType=604&commodityName=${item.commodityName}`;
27633
+ }
27634
+ } else if (item.commodityType === "605") {
27635
+ window.parent.location.href = `${base}/${routeLang}/home/prepaid/refill-voucher/detail?commodityId=${item.commodityId}&commodityType=605&commodityName=${item.commodityName}`;
27636
+ }
27637
+ }
27638
+ }
27639
+ });
27640
+ ;// ./package/cms-stored-value-card/View.vue?vue&type=script&lang=js
27641
+ /* harmony default export */ var cms_stored_value_card_Viewvue_type_script_lang_js = (Viewvue_type_script_lang_js);
27642
+ ;// ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-42.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./package/cms-stored-value-card/View.vue?vue&type=style&index=0&id=ae178d02&prod&lang=scss&scoped=true
27643
+ // extracted by mini-css-extract-plugin
27644
+
27645
+ ;// ./package/cms-stored-value-card/View.vue?vue&type=style&index=0&id=ae178d02&prod&lang=scss&scoped=true
27646
+
27647
+ // EXTERNAL MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
27648
+ var componentNormalizer = __webpack_require__(1656);
27649
+ ;// ./package/cms-stored-value-card/View.vue
27650
+
27651
+
27652
+
27653
+ ;
27654
+
27655
+
27656
+ /* normalize component */
27657
+
27658
+ var component = (0,componentNormalizer/* default */.A)(
27659
+ cms_stored_value_card_Viewvue_type_script_lang_js,
27660
+ render,
27661
+ staticRenderFns,
27662
+ false,
27663
+ null,
27664
+ "ae178d02",
27665
+ null
27666
+
27667
+ )
27668
+
27669
+ /* harmony default export */ var View = (component.exports);
27670
+
27281
27671
  /***/ }),
27282
27672
 
27283
27673
  /***/ 3838:
@@ -39344,7 +39734,7 @@ var map = {
39344
39734
  "./cms-richText/View.vue": 3411,
39345
39735
  "./cms-servePlan-tab/View.vue": 4193,
39346
39736
  "./cms-servePlan-text/View.vue": 9487,
39347
- "./cms-stored-value-card/View.vue": 9673,
39737
+ "./cms-stored-value-card/View.vue": 3837,
39348
39738
  "./cms-termsAndConditions/View.vue": 8073,
39349
39739
  "./cms-text/View.vue": 1452,
39350
39740
  "./cms-threeScroll/View.vue": 8045,
@@ -55650,393 +56040,6 @@ module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABz
55650
56040
 
55651
56041
  /***/ }),
55652
56042
 
55653
- /***/ 9673:
55654
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
55655
-
55656
- "use strict";
55657
- // ESM COMPAT FLAG
55658
- __webpack_require__.r(__webpack_exports__);
55659
-
55660
- // EXPORTS
55661
- __webpack_require__.d(__webpack_exports__, {
55662
- "default": function() { return /* binding */ View; }
55663
- });
55664
-
55665
- ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/babel-loader/lib/index.js??clonedRuleSet-41.use!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./package/cms-stored-value-card/View.vue?vue&type=template&id=5dba4ef6&scoped=true
55666
- var render = function render() {
55667
- var _vm = this,
55668
- _c = _vm._self._c;
55669
- return _c('BaseComp', _vm._b({
55670
- attrs: {
55671
- "data": _vm.data,
55672
- "nowCompId": _vm.nowCompId,
55673
- "isOpcacity": _vm.isOpcacity,
55674
- "lang": _vm.lang
55675
- },
55676
- on: {
55677
- "getConfigData": _vm.getConfigData
55678
- }
55679
- }, 'BaseComp', _vm.$attrs, false), [_c('section', {
55680
- staticClass: "cmhk-home_main"
55681
- }, [_c('div', {
55682
- staticClass: "wrap"
55683
- }, [_c('div', {
55684
- ref: "cardList",
55685
- staticClass: "cardList"
55686
- }, [_vm.configList.length === 0 ? [_c('div', {
55687
- staticClass: "card-box"
55688
- }, [_c('div', {
55689
- staticClass: "card"
55690
- }, [_c('div', {
55691
- staticClass: "img-box"
55692
- }, [_c('div', {
55693
- staticClass: "card-img",
55694
- class: {
55695
- 'is-cms': _vm.$EventBus
55696
- }
55697
- }, [_c('img', {
55698
- staticStyle: {
55699
- "height": "200px"
55700
- },
55701
- attrs: {
55702
- "src": _vm.placeholderImg,
55703
- "alt": ""
55704
- }
55705
- })])]), _c('div', {
55706
- staticClass: "content-box"
55707
- }, [_c('div', {
55708
- staticClass: "card-name"
55709
- }, [_vm._v(_vm._s(_vm.langText.productName))]), _c('div', {
55710
- staticClass: "text-box"
55711
- }, [_c('div', {
55712
- staticClass: "card-refPrice"
55713
- }, [_vm._v(" " + _vm._s(_vm.langText.Price) + " HK$XXXX ")]), _c('div', {
55714
- staticClass: "card-pice-text"
55715
- }, [_vm._v(_vm._s(_vm.langText.onlinePrice))])]), _c('div', {
55716
- staticClass: "card-pice"
55717
- }, [_c('span', [_vm._v("HK$")]), _vm._v("XXXX")]), _c('div', {
55718
- staticClass: "card-btn"
55719
- }, [_vm._v(_vm._s(_vm.langText.buyNow))])])])])] : _vm._e(), _vm._l(_vm.viewList, function (item, index) {
55720
- return _c('div', {
55721
- key: `${index}-${item.commodityId || index}`,
55722
- staticClass: "card-box"
55723
- }, [_c('div', {
55724
- staticClass: "card"
55725
- }, [_c('div', {
55726
- staticClass: "tag-box-left"
55727
- }, [_vm._l(item.malltCommodityLeft, function (ele, i) {
55728
- return [_c('img', {
55729
- key: i,
55730
- attrs: {
55731
- "src": _vm.compBaseUrl + ele.pictureUrl,
55732
- "alt": ""
55733
- }
55734
- })];
55735
- })], 2), _c('div', {
55736
- staticClass: "tag-box-right"
55737
- }, [_vm._l(item.malltCommodityRight, function (ele, i) {
55738
- return [_c('img', {
55739
- key: i,
55740
- attrs: {
55741
- "src": _vm.compBaseUrl + ele.pictureUrl,
55742
- "alt": ""
55743
- }
55744
- })];
55745
- })], 2), _c('div', {
55746
- staticClass: "img-box"
55747
- }, [_vm.isNotActive(item) ? _c('div', {
55748
- staticClass: "mask"
55749
- }, [_vm._v(" " + _vm._s(new Date(item.upTime).getTime() > _vm.nowTs ? _vm.langText.comingSoon : _vm.langText.expired) + " ")]) : _vm._e(), _c('div', {
55750
- staticClass: "card-img",
55751
- class: {
55752
- 'is-cms': _vm.$EventBus
55753
- }
55754
- }, [_c('img', {
55755
- attrs: {
55756
- "src": _vm.compBaseUrl + item.maxPicId,
55757
- "alt": ""
55758
- }
55759
- })])]), _c('div', {
55760
- staticClass: "content-box"
55761
- }, [_vm.isNotActive(item) ? _c('div', {
55762
- staticClass: "content-mask"
55763
- }) : _vm._e(), _c('div', {
55764
- staticClass: "card-name"
55765
- }, [_vm._v(_vm._s(item.commodityName))]), _c('div', {
55766
- staticClass: "text-box"
55767
- }, [item.price !== item.refPrice ? _c('div', {
55768
- staticClass: "card-refPrice"
55769
- }, [_vm._v(" " + _vm._s(_vm.langText.Price) + " HK$" + _vm._s(_vm.convertCentsToYuan(item.refPrice)) + " ")]) : _c('div', {
55770
- staticClass: "card-refPrice"
55771
- }), _c('div', {
55772
- staticClass: "card-pice-text"
55773
- }, [_vm._v(" " + _vm._s(item.price !== item.refPrice ? _vm.langText.onlinePrice : _vm.langText.Price) + " ")])]), _c('div', {
55774
- staticClass: "card-pice spc-font"
55775
- }, [_c('span', [_vm._v("HK$")]), _vm._v(_vm._s(_vm.convertCentsToYuan(item.price)) + " ")]), _vm.isActive(item) ? _c('div', {
55776
- staticClass: "card-btn",
55777
- on: {
55778
- "click": function ($event) {
55779
- return _vm.goDetail(item);
55780
- }
55781
- }
55782
- }, [_vm._v(" " + _vm._s(_vm.langText.buyNow)), _c('img', {
55783
- attrs: {
55784
- "src": _vm.arrowRightImg
55785
- }
55786
- })]) : _c('div', {
55787
- staticClass: "card-btn"
55788
- }, [_vm._v(" " + _vm._s(new Date(item.upTime).getTime() > _vm.nowTs ? (_vm.langText.launch || "").replace("NNN", item.upTime) : _vm.langText.Offer) + " ")])])])]);
55789
- })], 2), !_vm.seeMore && _vm.configList.length > 9 ? _c('div', {
55790
- ref: "seeMoreRef",
55791
- staticClass: "seeMore",
55792
- on: {
55793
- "click": function ($event) {
55794
- _vm.seeMore = true;
55795
- }
55796
- }
55797
- }, [_vm._v(" " + _vm._s(_vm.langText.more) + " "), _c('img', {
55798
- staticClass: "btm",
55799
- attrs: {
55800
- "src": _vm.arrowDownImg
55801
- }
55802
- }), _c('img', {
55803
- staticClass: "hover",
55804
- attrs: {
55805
- "src": _vm.arrowHoverImg
55806
- }
55807
- }), _c('img', {
55808
- staticClass: "active",
55809
- attrs: {
55810
- "src": _vm.arrowActiveImg
55811
- }
55812
- })]) : _vm._e()])])]);
55813
- };
55814
- var staticRenderFns = [];
55815
-
55816
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.constructor.js
55817
- var es_iterator_constructor = __webpack_require__(8111);
55818
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.filter.js
55819
- var es_iterator_filter = __webpack_require__(2489);
55820
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.for-each.js
55821
- var es_iterator_for_each = __webpack_require__(7588);
55822
- // EXTERNAL MODULE: ./package/baseComp.vue + 5 modules
55823
- var baseComp = __webpack_require__(1941);
55824
- // EXTERNAL MODULE: ./src/api/index.js
55825
- var api = __webpack_require__(929);
55826
- // EXTERNAL MODULE: ./node_modules/qs/lib/index.js
55827
- var lib = __webpack_require__(9122);
55828
- var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
55829
- ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/babel-loader/lib/index.js??clonedRuleSet-41.use!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./package/cms-stored-value-card/View.vue?vue&type=script&lang=js
55830
-
55831
-
55832
-
55833
-
55834
-
55835
-
55836
-
55837
-
55838
-
55839
- /* harmony default export */ var Viewvue_type_script_lang_js = ({
55840
- name: "cms-stored-value-card",
55841
- components: {
55842
- BaseComp: baseComp["default"]
55843
- },
55844
- props: {
55845
- data: {
55846
- type: Object,
55847
- default: () => {
55848
- return {};
55849
- }
55850
- },
55851
- nowCompId: {
55852
- type: [String, Number],
55853
- default: ""
55854
- },
55855
- isOpcacity: {
55856
- type: Boolean,
55857
- default: true
55858
- },
55859
- lang: {
55860
- type: String,
55861
- default: "zh-HK"
55862
- }
55863
- },
55864
- data() {
55865
- return {
55866
- langConfig: {
55867
- "zh-HK": {
55868
- productName: "產品名稱",
55869
- Price: "建議零售價",
55870
- onlinePrice: "網上優惠價",
55871
- buyNow: "立即選購",
55872
- comingSoon: "即將推出",
55873
- expired: "優惠已過期",
55874
- more: "查看更多",
55875
- launch: "NNN 上線",
55876
- Offer: "優惠即將推出"
55877
- },
55878
- "zh-CN": {
55879
- productName: "产品名称",
55880
- Price: "建议零售价",
55881
- onlinePrice: "网上优惠价",
55882
- buyNow: "立即选购",
55883
- comingSoon: "即将推出",
55884
- expired: "优惠已过期",
55885
- more: "查看更多",
55886
- launch: "NNN 上线",
55887
- Offer: "优惠即将推出"
55888
- },
55889
- "en-US": {
55890
- productName: "Product Name",
55891
- Price: "RRP",
55892
- onlinePrice: "Online Price",
55893
- buyNow: "Buy Now",
55894
- comingSoon: "Coming Soon",
55895
- expired: "Expired",
55896
- more: "See more",
55897
- launch: "Launch at NNN",
55898
- Offer: "Offer Coming"
55899
- }
55900
- },
55901
- configList: [],
55902
- seeMore: false,
55903
- nowTs: Date.now(),
55904
- compBaseUrl: this.$route.query.envId == 4 ? "https://omniapi.hk.chinamobile.com" : "https://omniapi-uat.hk.chinamobile.com",
55905
- // images
55906
- placeholderImg: __webpack_require__(5335),
55907
- arrowRightImg: __webpack_require__(4860),
55908
- arrowDownImg: __webpack_require__(1861),
55909
- arrowHoverImg: __webpack_require__(4116),
55910
- arrowActiveImg: __webpack_require__(9670),
55911
- shopList: []
55912
- };
55913
- },
55914
- computed: {
55915
- langText() {
55916
- return this.config && this.langConfig && this.langConfig[this.lang] || this.langConfig["zh-HK"];
55917
- },
55918
- viewList() {
55919
- if (this.seeMore) return this.shopList;
55920
- return this.shopList.slice(0, 9);
55921
- }
55922
- },
55923
- mounted() {
55924
- if (!this.$EventBus) {
55925
- if (["https://omniapi.hk.chinamobile.com", "https://www.hk.chinamobile.com"].includes(window.location.origin)) {
55926
- this.compBaseUrl = "https://omniapi.hk.chinamobile.com";
55927
- } else {
55928
- this.compBaseUrl = "https://omniapi-uat.hk.chinamobile.com";
55929
- }
55930
- }
55931
- },
55932
- beforeDestroy() {},
55933
- methods: {
55934
- getConfigData(configData) {
55935
- this.configList = configData.configList;
55936
- console.log("getConfigData", this.configList);
55937
- this.getValue();
55938
- },
55939
- async getValue() {
55940
- await this.getCommodityDetails();
55941
- },
55942
- // 拉取已选商品详情
55943
- async getCommodityDetails() {
55944
- // try {
55945
- let req = {
55946
- busInfo: JSON.stringify({
55947
- commodityIds: [...this.configList],
55948
- commodityTypes: ["604", "605"]
55949
- })
55950
- };
55951
- req = lib_default().stringify(req);
55952
- const json = await (0,api/* getCommodityDetails */.yX)(req, {
55953
- lang_sc: "zh-CN",
55954
- lang_tc: "zh-HK",
55955
- lang_en: "en-US"
55956
- }[this.lang]);
55957
- let dataResult = json && json.busiResp && json.busiResp.busiDataResp;
55958
- if (Array.isArray(dataResult)) {
55959
- dataResult.forEach(item => {
55960
- if (Array.isArray(item.malltCommodityTags)) {
55961
- const left = item.malltCommodityTags.filter(ele => ele.tagType == 5001).sort((a, b) => a.sort - b.sort);
55962
- const right = item.malltCommodityTags.filter(ele => ele.tagType == 5002).sort((a, b) => a.sort - b.sort);
55963
- item.malltCommodityLeft = left.slice(0, 2);
55964
- item.malltCommodityRight = right.slice(0, 4);
55965
- } else {
55966
- item.malltCommodityLeft = [];
55967
- item.malltCommodityRight = [];
55968
- }
55969
- });
55970
- // 按选择顺序排序
55971
- this.shopList = dataResult.sort((a, b) => {
55972
- return this.configList.indexOf(a.commodityId) - this.configList.indexOf(b.commodityId);
55973
- });
55974
- } else {
55975
- this.shopList = [];
55976
- }
55977
- // } catch (e) {
55978
- // this.shopList = [];
55979
- // }
55980
- },
55981
- isActive(item) {
55982
- const now = Date.now();
55983
- return new Date(item.upTime).getTime() < now && new Date(item.downTime).getTime() > now;
55984
- },
55985
- isNotActive(item) {
55986
- const now = Date.now();
55987
- return new Date(item.upTime).getTime() > now || new Date(item.downTime).getTime() < now;
55988
- },
55989
- convertCentsToYuan(cents) {
55990
- const yuan = (Number(cents || 0) / 100).toFixed(2);
55991
- return parseFloat(yuan);
55992
- },
55993
- goDetail(item) {
55994
- const base = this.$EventBus ? this.compBaseUrl : window.location.origin;
55995
- if (item.commodityType === "604") {
55996
- if ((item.commodityName || "").includes("MySIM")) {
55997
- window.parent.location.href = `${base}/${this.lang}/home/prepaid-card/mysim/detail?commodityId=${item.commodityId}&mysim=${item.commodityName}`;
55998
- } else {
55999
- window.parent.location.href = `${base}/${this.lang}/home/prepaid-card/detail?commodityId=${item.commodityId}&commodityType=604&commodityName=${item.commodityName}`;
56000
- }
56001
- } else if (item.commodityType === "605") {
56002
- window.parent.location.href = `${base}/${this.lang}/home/prepaid/refill-voucher/detail?commodityId=${item.commodityId}&commodityType=605&commodityName=${item.commodityName}`;
56003
- }
56004
- }
56005
- }
56006
- });
56007
- ;// ./package/cms-stored-value-card/View.vue?vue&type=script&lang=js
56008
- /* harmony default export */ var cms_stored_value_card_Viewvue_type_script_lang_js = (Viewvue_type_script_lang_js);
56009
- ;// ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-42.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./package/cms-stored-value-card/View.vue?vue&type=style&index=0&id=5dba4ef6&prod&lang=scss&scoped=true
56010
- // extracted by mini-css-extract-plugin
56011
-
56012
- ;// ./package/cms-stored-value-card/View.vue?vue&type=style&index=0&id=5dba4ef6&prod&lang=scss&scoped=true
56013
-
56014
- // EXTERNAL MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
56015
- var componentNormalizer = __webpack_require__(1656);
56016
- ;// ./package/cms-stored-value-card/View.vue
56017
-
56018
-
56019
-
56020
- ;
56021
-
56022
-
56023
- /* normalize component */
56024
-
56025
- var component = (0,componentNormalizer/* default */.A)(
56026
- cms_stored_value_card_Viewvue_type_script_lang_js,
56027
- render,
56028
- staticRenderFns,
56029
- false,
56030
- null,
56031
- "5dba4ef6",
56032
- null
56033
-
56034
- )
56035
-
56036
- /* harmony default export */ var View = (component.exports);
56037
-
56038
- /***/ }),
56039
-
56040
56043
  /***/ 9699:
56041
56044
  /***/ (function(__unused_webpack_module, exports) {
56042
56045