@fonixtree/magic-design 1.0.14 → 1.0.16

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.
@@ -204,8 +204,6 @@ var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
204
204
  return r;
205
205
  };
206
206
 
207
- var precision = (0, _currencyUtil.getPrecision)();
208
-
209
207
  var formatData = function formatData(list) {
210
208
  list.map(function (item) {
211
209
  item.preSalesPrice = (0, _currencyUtil.formatCurrencyWithSymbol)(item.salesPrice);
@@ -701,8 +699,8 @@ var ProductModal = function ProductModal(props) {
701
699
  productCode: productCode,
702
700
  storeId: storeId,
703
701
  cmpTypeId: promotions || '',
704
- minPrice: minPrice === '' ? '' : minPrice * Math.pow(10, precision),
705
- maxPrice: maxPrice === '' ? '' : maxPrice * Math.pow(10, precision),
702
+ minPrice: (0, _currencyUtil.formatBackendCurrency)(minPrice),
703
+ maxPrice: (0, _currencyUtil.formatBackendCurrency)(maxPrice),
706
704
  catgIds: selCatgsList.join(','),
707
705
  brandIds: selBrandsList.join(','),
708
706
  labelIds: selLabelData.value || '',
@@ -731,8 +729,8 @@ var ProductModal = function ProductModal(props) {
731
729
  productName: productName,
732
730
  productCode: productCode,
733
731
  cmpTypeId: promotions || '',
734
- minPrice: minPrice === '' ? '' : minPrice * Math.pow(10, precision),
735
- maxPrice: maxPrice === '' ? '' : maxPrice * Math.pow(10, precision),
732
+ minPrice: (0, _currencyUtil.formatBackendCurrency)(minPrice),
733
+ maxPrice: (0, _currencyUtil.formatBackendCurrency)(maxPrice),
736
734
  catgIds: selCatgsList.join(','),
737
735
  brandIds: selBrandsList.join(','),
738
736
  labelIds: selLabelData.value || '',
@@ -98,7 +98,7 @@ var recommendGroupSourceJSON = function recommendGroupSourceJSON(parentId, logo,
98
98
  },
99
99
  hover: null
100
100
  },
101
- sourceType: 'recommend',
101
+ sourceType: 'select',
102
102
  prodIds: '',
103
103
  intelligentType: 'Hot',
104
104
  intelligentValue: [],
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.numberToFixed = exports.getPricePrefix = exports.getPrecision = exports.formatCurrencyWithSymbol = exports.formatCurrency = exports.currencyToFont = exports.calcFloatCount = exports.addSeparators = void 0;
6
+ exports.numberToFixed = exports.getPricePrefix = exports.getPrecision = exports.formatCurrencyWithSymbol = exports.formatCurrency = exports.formatBackendCurrency = exports.currencyToFont = exports.calcFloatCount = exports.addSeparators = void 0;
7
7
 
8
8
  var _divide = _interopRequireDefault(require("lodash/divide"));
9
9
 
@@ -54,11 +54,30 @@ var getPrecision = function getPrecision() {
54
54
  return window.systemParams.precision;
55
55
  }, '0');
56
56
  return Number(ret);
57
- }; // 格式化金额
57
+ };
58
+ /**
59
+ * 前端数值转换为后端数值
60
+ * @param num
61
+ */
58
62
 
59
63
 
60
64
  exports.getPrecision = getPrecision;
61
65
 
66
+ var formatBackendCurrency = function formatBackendCurrency(num) {
67
+ var precision = (0, _commonUtil.ensure)(function () {
68
+ return window.systemParams.precision;
69
+ }, '0');
70
+
71
+ if (!num) {
72
+ return num;
73
+ }
74
+
75
+ return num * Math.pow(10, precision);
76
+ }; // 格式化金额
77
+
78
+
79
+ exports.formatBackendCurrency = formatBackendCurrency;
80
+
62
81
  var formatCurrency = function formatCurrency(num) {
63
82
  var displayPrecision = (0, _commonUtil.ensure)(function () {
64
83
  return window.systemParams.displayCurrencyPrecision;
@@ -204,8 +204,6 @@ var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
204
204
  return r;
205
205
  };
206
206
 
207
- var precision = (0, _currencyUtil.getPrecision)();
208
-
209
207
  var formatData = function formatData(list) {
210
208
  list.map(function (item) {
211
209
  item.preSalesPrice = (0, _currencyUtil.formatCurrencyWithSymbol)(item.salesPrice);
@@ -701,8 +699,8 @@ var ProductModal = function ProductModal(props) {
701
699
  productCode: productCode,
702
700
  storeId: storeId,
703
701
  cmpTypeId: promotions || '',
704
- minPrice: minPrice === '' ? '' : minPrice * Math.pow(10, precision),
705
- maxPrice: maxPrice === '' ? '' : maxPrice * Math.pow(10, precision),
702
+ minPrice: (0, _currencyUtil.formatBackendCurrency)(minPrice),
703
+ maxPrice: (0, _currencyUtil.formatBackendCurrency)(maxPrice),
706
704
  catgIds: selCatgsList.join(','),
707
705
  brandIds: selBrandsList.join(','),
708
706
  labelIds: selLabelData.value || '',
@@ -731,8 +729,8 @@ var ProductModal = function ProductModal(props) {
731
729
  productName: productName,
732
730
  productCode: productCode,
733
731
  cmpTypeId: promotions || '',
734
- minPrice: minPrice === '' ? '' : minPrice * Math.pow(10, precision),
735
- maxPrice: maxPrice === '' ? '' : maxPrice * Math.pow(10, precision),
732
+ minPrice: (0, _currencyUtil.formatBackendCurrency)(minPrice),
733
+ maxPrice: (0, _currencyUtil.formatBackendCurrency)(maxPrice),
736
734
  catgIds: selCatgsList.join(','),
737
735
  brandIds: selBrandsList.join(','),
738
736
  labelIds: selLabelData.value || '',
@@ -98,7 +98,7 @@ var recommendGroupSourceJSON = function recommendGroupSourceJSON(parentId, logo,
98
98
  },
99
99
  hover: null
100
100
  },
101
- sourceType: 'recommend',
101
+ sourceType: 'select',
102
102
  prodIds: '',
103
103
  intelligentType: 'Hot',
104
104
  intelligentValue: [],
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.numberToFixed = exports.getPricePrefix = exports.getPrecision = exports.formatCurrencyWithSymbol = exports.formatCurrency = exports.currencyToFont = exports.calcFloatCount = exports.addSeparators = void 0;
6
+ exports.numberToFixed = exports.getPricePrefix = exports.getPrecision = exports.formatCurrencyWithSymbol = exports.formatCurrency = exports.formatBackendCurrency = exports.currencyToFont = exports.calcFloatCount = exports.addSeparators = void 0;
7
7
 
8
8
  var _divide = _interopRequireDefault(require("lodash/divide"));
9
9
 
@@ -54,11 +54,30 @@ var getPrecision = function getPrecision() {
54
54
  return window.systemParams.precision;
55
55
  }, '0');
56
56
  return Number(ret);
57
- }; // 格式化金额
57
+ };
58
+ /**
59
+ * 前端数值转换为后端数值
60
+ * @param num
61
+ */
58
62
 
59
63
 
60
64
  exports.getPrecision = getPrecision;
61
65
 
66
+ var formatBackendCurrency = function formatBackendCurrency(num) {
67
+ var precision = (0, _commonUtil.ensure)(function () {
68
+ return window.systemParams.precision;
69
+ }, '0');
70
+
71
+ if (!num) {
72
+ return num;
73
+ }
74
+
75
+ return num * Math.pow(10, precision);
76
+ }; // 格式化金额
77
+
78
+
79
+ exports.formatBackendCurrency = formatBackendCurrency;
80
+
62
81
  var formatCurrency = function formatCurrency(num) {
63
82
  var displayPrecision = (0, _commonUtil.ensure)(function () {
64
83
  return window.systemParams.displayCurrencyPrecision;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "1.0.14",
4
+ "version": "1.0.16",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",
Binary file
Binary file