@fle-ui/plus-choose-mall-goods 1.0.1
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.
- package/LICENSE +1 -0
- package/README.md +19 -0
- package/es/components/changePrice/index.d.ts +16 -0
- package/es/components/changePrice/index.js +510 -0
- package/es/components/changePrice/index.less +97 -0
- package/es/components/changePrice/utils/api.d.ts +5 -0
- package/es/components/changePrice/utils/api.js +4 -0
- package/es/components/changePrice/utils/common.d.ts +24 -0
- package/es/components/changePrice/utils/common.js +26 -0
- package/es/components/changePrice/utils/request.d.ts +26 -0
- package/es/components/changePrice/utils/request.js +177 -0
- package/es/components/changePrice/utils/serviceEnv.d.ts +8 -0
- package/es/components/changePrice/utils/serviceEnv.js +12 -0
- package/es/components/changePriceConfirm/index.d.ts +7 -0
- package/es/components/changePriceConfirm/index.js +124 -0
- package/es/components/changePriceConfirm/index.less +78 -0
- package/es/components/icon/index.d.ts +3 -0
- package/es/components/icon/index.js +7 -0
- package/es/index.d.ts +21 -0
- package/es/index.js +1330 -0
- package/es/index.less +103 -0
- package/es/utils/api.d.ts +11 -0
- package/es/utils/api.js +10 -0
- package/es/utils/common.d.ts +24 -0
- package/es/utils/common.js +26 -0
- package/es/utils/options.d.ts +30 -0
- package/es/utils/options.js +84 -0
- package/es/utils/request.d.ts +26 -0
- package/es/utils/request.js +177 -0
- package/es/utils/serviceEnv.d.ts +8 -0
- package/es/utils/serviceEnv.js +12 -0
- package/lib/components/changePrice/index.d.ts +16 -0
- package/lib/components/changePrice/index.js +511 -0
- package/lib/components/changePrice/index.less +97 -0
- package/lib/components/changePrice/utils/api.d.ts +5 -0
- package/lib/components/changePrice/utils/api.js +11 -0
- package/lib/components/changePrice/utils/common.d.ts +24 -0
- package/lib/components/changePrice/utils/common.js +36 -0
- package/lib/components/changePrice/utils/request.d.ts +26 -0
- package/lib/components/changePrice/utils/request.js +183 -0
- package/lib/components/changePrice/utils/serviceEnv.d.ts +8 -0
- package/lib/components/changePrice/utils/serviceEnv.js +21 -0
- package/lib/components/changePriceConfirm/index.d.ts +7 -0
- package/lib/components/changePriceConfirm/index.js +128 -0
- package/lib/components/changePriceConfirm/index.less +78 -0
- package/lib/components/icon/index.d.ts +3 -0
- package/lib/components/icon/index.js +14 -0
- package/lib/index.d.ts +21 -0
- package/lib/index.js +1313 -0
- package/lib/index.less +103 -0
- package/lib/utils/api.d.ts +11 -0
- package/lib/utils/api.js +17 -0
- package/lib/utils/common.d.ts +24 -0
- package/lib/utils/common.js +36 -0
- package/lib/utils/options.d.ts +30 -0
- package/lib/utils/options.js +97 -0
- package/lib/utils/request.d.ts +26 -0
- package/lib/utils/request.js +183 -0
- package/lib/utils/serviceEnv.d.ts +8 -0
- package/lib/utils/serviceEnv.js +21 -0
- package/package.json +46 -0
package/LICENSE
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
MIT
|
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# @fle-ui/plus-choose-mall-goods
|
|
2
|
+
|
|
3
|
+
> @fle-ui/plus-choose-mall-goods
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Using npm:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
$ npm install --save @fle-ui/plus-choose-mall-goods
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
or using yarn:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
$ yarn add @fle-ui/plus-choose-mall-goods
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export interface ChangePrice {
|
|
4
|
+
env?: string;
|
|
5
|
+
token?: string;
|
|
6
|
+
loginErrFn?: any;
|
|
7
|
+
siteId?: string | number;
|
|
8
|
+
app: number;
|
|
9
|
+
onExit?: any;
|
|
10
|
+
onSuccess?: any;
|
|
11
|
+
changePriceGoodsIds?: any;
|
|
12
|
+
resetPriceInfo?: any;
|
|
13
|
+
isAllSelf?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const ChangePrice: FC<ChangePrice>;
|
|
16
|
+
export default ChangePrice;
|
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
import "antd/es/space/style";
|
|
3
|
+
import _Space from "antd/es/space";
|
|
4
|
+
import "antd/es/radio/style";
|
|
5
|
+
import _Radio from "antd/es/radio";
|
|
6
|
+
import "antd/es/input-number/style";
|
|
7
|
+
import _InputNumber from "antd/es/input-number";
|
|
8
|
+
import "antd/es/modal/style";
|
|
9
|
+
import _Modal from "antd/es/modal";
|
|
10
|
+
import "antd/es/message/style";
|
|
11
|
+
import _message from "antd/es/message";
|
|
12
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
17
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
18
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
19
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
20
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
21
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
22
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
23
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
24
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
25
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
|
+
import React, { useState } from 'react';
|
|
27
|
+
import { ExclamationCircleOutlined } from '@ant-design/icons';
|
|
28
|
+
import './index.less';
|
|
29
|
+
import api from './utils/api';
|
|
30
|
+
import request from './utils/request';
|
|
31
|
+
import { getApiHost } from './utils/serviceEnv';
|
|
32
|
+
import ChangePriceConfirm from '../changePriceConfirm';
|
|
33
|
+
// 非营销云配置
|
|
34
|
+
var priceRuleConfig1 = {
|
|
35
|
+
modeType: 2,
|
|
36
|
+
rules: [{
|
|
37
|
+
label: '按照会员价上调',
|
|
38
|
+
changeType: 1,
|
|
39
|
+
operateType: 1,
|
|
40
|
+
rate: '',
|
|
41
|
+
tip: '* 销售价=会员价*(1+a%) ; a为输入值,a越大,您的利润越高;',
|
|
42
|
+
key: 11
|
|
43
|
+
}, {
|
|
44
|
+
label: '按照市场价下调',
|
|
45
|
+
changeType: 2,
|
|
46
|
+
operateType: 2,
|
|
47
|
+
rate: '',
|
|
48
|
+
tip: '* 销售价=市场价*(1-a%) ; a为输入值,a越大,您的利润越低;',
|
|
49
|
+
key: 22
|
|
50
|
+
}, {
|
|
51
|
+
label: '按照商品利润率上调',
|
|
52
|
+
changeType: 3,
|
|
53
|
+
operateType: 1,
|
|
54
|
+
rate: '',
|
|
55
|
+
tip: '* 销售价=会员价/[1-(利润率+a%)] ; a为输入值,a越大,您的利润越高',
|
|
56
|
+
key: 31
|
|
57
|
+
}, {
|
|
58
|
+
label: '按照商品利润率下调',
|
|
59
|
+
changeType: 3,
|
|
60
|
+
operateType: 2,
|
|
61
|
+
rate: '',
|
|
62
|
+
tip: '* 销售价=会员价/[1-(利润率-a%)] ; a为输入值,a越大,您的利润越低',
|
|
63
|
+
key: 32
|
|
64
|
+
}, {
|
|
65
|
+
label: '等于市场价',
|
|
66
|
+
changeType: 2,
|
|
67
|
+
operateType: 3,
|
|
68
|
+
rate: '',
|
|
69
|
+
tip: '',
|
|
70
|
+
key: 23
|
|
71
|
+
}, {
|
|
72
|
+
label: '等于会员价',
|
|
73
|
+
changeType: 1,
|
|
74
|
+
operateType: 3,
|
|
75
|
+
rate: '',
|
|
76
|
+
tip: '* 代表商品销售利润率为0;',
|
|
77
|
+
key: 13
|
|
78
|
+
}, {
|
|
79
|
+
label: '等于采购价',
|
|
80
|
+
changeType: 4,
|
|
81
|
+
operateType: 3,
|
|
82
|
+
rate: '',
|
|
83
|
+
tip: '* 代表商品销售利润率为0;',
|
|
84
|
+
key: 43
|
|
85
|
+
}]
|
|
86
|
+
};
|
|
87
|
+
// 营销云配置 - 代发
|
|
88
|
+
var priceRuleConfig2 = {
|
|
89
|
+
modeType: 2,
|
|
90
|
+
rules: [{
|
|
91
|
+
label: '按照代发价上调',
|
|
92
|
+
changeType: 1,
|
|
93
|
+
operateType: 1,
|
|
94
|
+
rate: '',
|
|
95
|
+
tip: '* 销售价=代发价*(1+a%) ; a为输入值,a越大,您的利润越高;',
|
|
96
|
+
key: 11
|
|
97
|
+
}, {
|
|
98
|
+
label: '按照代发市场价下调',
|
|
99
|
+
changeType: 2,
|
|
100
|
+
operateType: 2,
|
|
101
|
+
rate: '',
|
|
102
|
+
tip: '* 销售价=代发市场价*(1-a%) ; a为输入值,a越大,您的利润越低;',
|
|
103
|
+
key: 22
|
|
104
|
+
}, {
|
|
105
|
+
label: '等于代发市场价',
|
|
106
|
+
changeType: 2,
|
|
107
|
+
operateType: 3,
|
|
108
|
+
rate: '',
|
|
109
|
+
tip: '',
|
|
110
|
+
key: 23
|
|
111
|
+
}, {
|
|
112
|
+
label: '等于代发价',
|
|
113
|
+
changeType: 1,
|
|
114
|
+
operateType: 3,
|
|
115
|
+
rate: '',
|
|
116
|
+
tip: '',
|
|
117
|
+
key: 13
|
|
118
|
+
}]
|
|
119
|
+
};
|
|
120
|
+
// 营销云配置 - 集采
|
|
121
|
+
var priceRuleConfig3 = {
|
|
122
|
+
modeType: 1,
|
|
123
|
+
rules: [{
|
|
124
|
+
label: '按照集采价上调',
|
|
125
|
+
changeType: 1,
|
|
126
|
+
operateType: 1,
|
|
127
|
+
rate: '',
|
|
128
|
+
tip: '* 销售价=集采价*(1+a%) ; a为输入值,a越大,您的利润越高;',
|
|
129
|
+
key: 11
|
|
130
|
+
}, {
|
|
131
|
+
label: '按照集采市场价下调',
|
|
132
|
+
changeType: 2,
|
|
133
|
+
operateType: 2,
|
|
134
|
+
rate: '',
|
|
135
|
+
tip: '* 销售价=集采市场价*(1-a%) ; a为输入值,a越大,您的利润越低;',
|
|
136
|
+
key: 22
|
|
137
|
+
}, {
|
|
138
|
+
label: '等于集采市场价',
|
|
139
|
+
changeType: 2,
|
|
140
|
+
operateType: 3,
|
|
141
|
+
rate: '',
|
|
142
|
+
tip: '',
|
|
143
|
+
key: 23
|
|
144
|
+
}, {
|
|
145
|
+
label: '等于集采价',
|
|
146
|
+
changeType: 1,
|
|
147
|
+
operateType: 3,
|
|
148
|
+
rate: '',
|
|
149
|
+
tip: '',
|
|
150
|
+
key: 13
|
|
151
|
+
}]
|
|
152
|
+
};
|
|
153
|
+
// 改价逻辑
|
|
154
|
+
var ChangePrice = function ChangePrice(props) {
|
|
155
|
+
var _priceRuleConfig1$rul, _priceRuleConfig1$rul2;
|
|
156
|
+
var _props$env = props.env,
|
|
157
|
+
env = _props$env === void 0 ? 'prod' : _props$env,
|
|
158
|
+
token = props.token,
|
|
159
|
+
_props$loginErrFn = props.loginErrFn,
|
|
160
|
+
loginErrFn = _props$loginErrFn === void 0 ? function () {} : _props$loginErrFn,
|
|
161
|
+
siteId = props.siteId,
|
|
162
|
+
_props$app = props.app,
|
|
163
|
+
app = _props$app === void 0 ? 1 : _props$app,
|
|
164
|
+
_props$onExit = props.onExit,
|
|
165
|
+
onExit = _props$onExit === void 0 ? function () {} : _props$onExit,
|
|
166
|
+
_props$onSuccess = props.onSuccess,
|
|
167
|
+
onSuccess = _props$onSuccess === void 0 ? function () {} : _props$onSuccess,
|
|
168
|
+
_props$changePriceGoo = props.changePriceGoodsIds,
|
|
169
|
+
changePriceGoodsIds = _props$changePriceGoo === void 0 ? [] : _props$changePriceGoo,
|
|
170
|
+
_props$resetPriceInfo = props.resetPriceInfo,
|
|
171
|
+
resetPriceInfo = _props$resetPriceInfo === void 0 ? {} : _props$resetPriceInfo,
|
|
172
|
+
_props$isAllSelf = props.isAllSelf,
|
|
173
|
+
isAllSelf = _props$isAllSelf === void 0 ? false : _props$isAllSelf;
|
|
174
|
+
// http ------------ begin
|
|
175
|
+
var $http = request({
|
|
176
|
+
baseUrl: getApiHost(env),
|
|
177
|
+
token: token,
|
|
178
|
+
loginErrFn: loginErrFn
|
|
179
|
+
});
|
|
180
|
+
// http ------------ end
|
|
181
|
+
var _useState = useState((resetPriceInfo === null || resetPriceInfo === void 0 ? void 0 : resetPriceInfo.show) || false),
|
|
182
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
183
|
+
changePriceConfirmShow = _useState2[0],
|
|
184
|
+
setChangePriceConfirmShow = _useState2[1]; // 重复改价弹窗确认
|
|
185
|
+
var handleCloseConfirm = function handleCloseConfirm() {
|
|
186
|
+
setChangePriceConfirmShow(false);
|
|
187
|
+
onExit();
|
|
188
|
+
};
|
|
189
|
+
// 重新改价确认ok
|
|
190
|
+
var handleConfirmOk = function handleConfirmOk(obj) {
|
|
191
|
+
setKeepRule(obj);
|
|
192
|
+
setChangePriceConfirmShow(false);
|
|
193
|
+
setChangePriceShow(true);
|
|
194
|
+
};
|
|
195
|
+
// ----------------------------------------------------------------
|
|
196
|
+
// 保留原有定价规则
|
|
197
|
+
var _useState3 = useState({
|
|
198
|
+
isKeepPrice: 0,
|
|
199
|
+
isKeepStatus: 0
|
|
200
|
+
}),
|
|
201
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
202
|
+
keepRule = _useState4[0],
|
|
203
|
+
setKeepRule = _useState4[1];
|
|
204
|
+
var _useState5 = useState(!(resetPriceInfo === null || resetPriceInfo === void 0 ? void 0 : resetPriceInfo.show)),
|
|
205
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
206
|
+
changePriceShow = _useState6[0],
|
|
207
|
+
setChangePriceShow = _useState6[1]; // 改价弹窗显示
|
|
208
|
+
// 一件代发 begin ---
|
|
209
|
+
var _useState7 = useState(23),
|
|
210
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
211
|
+
radioKey = _useState8[0],
|
|
212
|
+
setRadioKey = _useState8[1]; // 默认 等于市场价
|
|
213
|
+
var handleRadioChange = function handleRadioChange(e) {
|
|
214
|
+
setRadioKey(e.target.value);
|
|
215
|
+
};
|
|
216
|
+
var _useState9 = useState({}),
|
|
217
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
218
|
+
rateObj = _useState10[0],
|
|
219
|
+
setRateObj = _useState10[1];
|
|
220
|
+
var handleRateChange = function handleRateChange(key, value) {
|
|
221
|
+
var rateObjCopy = JSON.parse(JSON.stringify(rateObj));
|
|
222
|
+
rateObjCopy[key] = value;
|
|
223
|
+
setRateObj(rateObjCopy);
|
|
224
|
+
};
|
|
225
|
+
// 一件代发 end ---
|
|
226
|
+
// 集采 begin ---
|
|
227
|
+
var _useState11 = useState(23),
|
|
228
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
229
|
+
radioKeyJc = _useState12[0],
|
|
230
|
+
setRadioKeyJc = _useState12[1]; // 默认 等于集采市场价
|
|
231
|
+
var handleRadioChangeJc = function handleRadioChangeJc(e) {
|
|
232
|
+
setRadioKeyJc(e.target.value);
|
|
233
|
+
};
|
|
234
|
+
var _useState13 = useState({}),
|
|
235
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
236
|
+
rateObjJc = _useState14[0],
|
|
237
|
+
setRateObjJc = _useState14[1];
|
|
238
|
+
var handleRateChangeJc = function handleRateChangeJc(key, value) {
|
|
239
|
+
var rateObjJcCopy = JSON.parse(JSON.stringify(rateObjJc));
|
|
240
|
+
rateObjJcCopy[key] = value;
|
|
241
|
+
setRateObjJc(rateObjJcCopy);
|
|
242
|
+
};
|
|
243
|
+
// 集采 end ---
|
|
244
|
+
var _useState15 = useState(false),
|
|
245
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
246
|
+
loading = _useState16[0],
|
|
247
|
+
setLoading = _useState16[1];
|
|
248
|
+
var handleOk = /*#__PURE__*/function () {
|
|
249
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
250
|
+
var params, arr, rate, obj, arr2, rate2, obj2, res, num, _res;
|
|
251
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
252
|
+
while (1) switch (_context.prev = _context.next) {
|
|
253
|
+
case 0:
|
|
254
|
+
params = _objectSpread(_objectSpread({
|
|
255
|
+
goodsIdList: changePriceGoodsIds,
|
|
256
|
+
siteId: siteId
|
|
257
|
+
}, keepRule), {}, {
|
|
258
|
+
priceRuleParams: []
|
|
259
|
+
}); // 一件代发 begin
|
|
260
|
+
arr = String(radioKey).split('').map(function (item) {
|
|
261
|
+
return Number(item);
|
|
262
|
+
});
|
|
263
|
+
rate = rateObj[radioKey];
|
|
264
|
+
obj = {
|
|
265
|
+
modeType: 2,
|
|
266
|
+
changeType: arr[0],
|
|
267
|
+
operateType: arr[1],
|
|
268
|
+
rate: rate
|
|
269
|
+
};
|
|
270
|
+
if (radioKey === 22 && rate >= 100) {
|
|
271
|
+
// 按照市场价下调超过100% 前端先做个校验
|
|
272
|
+
// return message.warning('销售价必须大于0')
|
|
273
|
+
}
|
|
274
|
+
// 一件代发 end
|
|
275
|
+
// 集采 begin
|
|
276
|
+
arr2 = String(radioKeyJc).split('').map(function (item) {
|
|
277
|
+
return Number(item);
|
|
278
|
+
});
|
|
279
|
+
rate2 = rateObjJc[radioKeyJc];
|
|
280
|
+
obj2 = {
|
|
281
|
+
modeType: 1,
|
|
282
|
+
changeType: arr2[0],
|
|
283
|
+
operateType: arr2[1],
|
|
284
|
+
rate: rate2
|
|
285
|
+
};
|
|
286
|
+
if (!(obj.operateType !== 3 && !obj.rate)) {
|
|
287
|
+
_context.next = 10;
|
|
288
|
+
break;
|
|
289
|
+
}
|
|
290
|
+
return _context.abrupt("return", _message.warning('请输入改价百分比'));
|
|
291
|
+
case 10:
|
|
292
|
+
if (!(obj2.operateType !== 3 && !obj2.rate)) {
|
|
293
|
+
_context.next = 12;
|
|
294
|
+
break;
|
|
295
|
+
}
|
|
296
|
+
return _context.abrupt("return", _message.warning('请输入改价百分比'));
|
|
297
|
+
case 12:
|
|
298
|
+
if (radioKeyJc === 22 && rate2 >= 100) {
|
|
299
|
+
// 按照市场价下调超过100% 前端先做个校验
|
|
300
|
+
// return message.warning('销售价必须大于0')
|
|
301
|
+
}
|
|
302
|
+
// 集采 end
|
|
303
|
+
if (app !== 1) {
|
|
304
|
+
params.priceRuleParams.push(obj);
|
|
305
|
+
} else {
|
|
306
|
+
params.priceRuleParams.push(obj);
|
|
307
|
+
params.priceRuleParams.push(obj2);
|
|
308
|
+
}
|
|
309
|
+
setLoading(true);
|
|
310
|
+
_context.prev = 15;
|
|
311
|
+
_context.next = 18;
|
|
312
|
+
return $http.post(api['checkBeforeAddGoods'], params);
|
|
313
|
+
case 18:
|
|
314
|
+
res = _context.sent;
|
|
315
|
+
if (!(res === null || res === void 0 ? void 0 : res.success)) {
|
|
316
|
+
_context.next = 29;
|
|
317
|
+
break;
|
|
318
|
+
}
|
|
319
|
+
num = res === null || res === void 0 ? void 0 : res.data; // 亏本数量
|
|
320
|
+
if (!(num > 0)) {
|
|
321
|
+
_context.next = 25;
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
_Modal.confirm({
|
|
325
|
+
title: '温馨提示',
|
|
326
|
+
icon: /*#__PURE__*/React.createElement(ExclamationCircleOutlined, null),
|
|
327
|
+
cancelButtonProps: {
|
|
328
|
+
style: {
|
|
329
|
+
display: 'none'
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
content: "\u5F53\u524D\u6709 ".concat(num, " \u4EF6\u5546\u54C1\u5B58\u5728\u4E8F\u672C\uFF0C\u8BF7\u91CD\u65B0\u8BBE\u7F6E"),
|
|
333
|
+
okText: '确认',
|
|
334
|
+
cancelText: '我再想想'
|
|
335
|
+
});
|
|
336
|
+
_context.next = 29;
|
|
337
|
+
break;
|
|
338
|
+
case 25:
|
|
339
|
+
_context.next = 27;
|
|
340
|
+
return $http.post(api['addGoods'], params);
|
|
341
|
+
case 27:
|
|
342
|
+
_res = _context.sent;
|
|
343
|
+
if (_res === null || _res === void 0 ? void 0 : _res.success) {
|
|
344
|
+
onExit();
|
|
345
|
+
onSuccess();
|
|
346
|
+
}
|
|
347
|
+
case 29:
|
|
348
|
+
_context.prev = 29;
|
|
349
|
+
setLoading(false);
|
|
350
|
+
return _context.finish(29);
|
|
351
|
+
case 32:
|
|
352
|
+
case "end":
|
|
353
|
+
return _context.stop();
|
|
354
|
+
}
|
|
355
|
+
}, _callee, null, [[15,, 29, 32]]);
|
|
356
|
+
}));
|
|
357
|
+
return function handleOk() {
|
|
358
|
+
return _ref.apply(this, arguments);
|
|
359
|
+
};
|
|
360
|
+
}();
|
|
361
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, changePriceConfirmShow && /*#__PURE__*/React.createElement(ChangePriceConfirm, {
|
|
362
|
+
onClose: handleCloseConfirm,
|
|
363
|
+
content: resetPriceInfo === null || resetPriceInfo === void 0 ? void 0 : resetPriceInfo.content,
|
|
364
|
+
onOk: handleConfirmOk
|
|
365
|
+
}), /*#__PURE__*/React.createElement(_Modal, {
|
|
366
|
+
visible: changePriceShow,
|
|
367
|
+
className: "change-price",
|
|
368
|
+
width: 800,
|
|
369
|
+
onCancel: onExit,
|
|
370
|
+
title: "\u6539\u4EF7",
|
|
371
|
+
cancelText: "\u53D6\u6D88",
|
|
372
|
+
okText: "\u786E\u8BA4\u4FDD\u5B58",
|
|
373
|
+
okButtonProps: {
|
|
374
|
+
loading: loading
|
|
375
|
+
},
|
|
376
|
+
onOk: handleOk
|
|
377
|
+
}, app !== 1 && /*#__PURE__*/React.createElement("div", {
|
|
378
|
+
className: "change-price-body"
|
|
379
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
380
|
+
className: "cpb-header"
|
|
381
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
382
|
+
className: "cpb-header-title"
|
|
383
|
+
}, "\u9500\u552E\u4EF7"), /*#__PURE__*/React.createElement("div", {
|
|
384
|
+
className: "cpb-header-desc"
|
|
385
|
+
}, "\u5546\u57CE\u9500\u552E\u4EF7\u662F\u5546\u57CE\u5BF9\u7528\u6237\u7684\u9500\u552E\u4EF7\uFF1B\u8BE5\u7AD9\u70B9\u6BCF\u9500\u552E\u4E00\u4EF6\u5546\u54C1\uFF0C\u5C06\u4ECE\u7AD9\u70B9\u4F59\u989D\u6263\u9664\u4E00\u4EF6\u4F1A\u5458\u4EF7\u91D1\u989D\u3002")), /*#__PURE__*/React.createElement("div", {
|
|
386
|
+
className: "cpb-rules"
|
|
387
|
+
}, /*#__PURE__*/React.createElement(_Radio.Group, {
|
|
388
|
+
onChange: handleRadioChange,
|
|
389
|
+
value: radioKey
|
|
390
|
+
}, /*#__PURE__*/React.createElement(_Space, {
|
|
391
|
+
direction: "vertical",
|
|
392
|
+
size: "middle"
|
|
393
|
+
}, priceRuleConfig1.rules.slice(0, isAllSelf ? (_priceRuleConfig1$rul = priceRuleConfig1.rules) === null || _priceRuleConfig1$rul === void 0 ? void 0 : _priceRuleConfig1$rul.length : ((_priceRuleConfig1$rul2 = priceRuleConfig1.rules) === null || _priceRuleConfig1$rul2 === void 0 ? void 0 : _priceRuleConfig1$rul2.length) - 1).map(function (item) {
|
|
394
|
+
var inputShow = radioKey === item.key && item.operateType !== 3;
|
|
395
|
+
var tipShow = radioKey === item.key && !!item.tip;
|
|
396
|
+
return /*#__PURE__*/React.createElement(_Radio, {
|
|
397
|
+
value: item.key,
|
|
398
|
+
key: item.key
|
|
399
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
400
|
+
className: "rule-flex"
|
|
401
|
+
}, /*#__PURE__*/React.createElement("span", null, item.label), inputShow && /*#__PURE__*/React.createElement(_InputNumber, {
|
|
402
|
+
style: {
|
|
403
|
+
width: 100,
|
|
404
|
+
marginLeft: 10
|
|
405
|
+
},
|
|
406
|
+
min: 0,
|
|
407
|
+
max: 100,
|
|
408
|
+
step: 1,
|
|
409
|
+
precision: 0,
|
|
410
|
+
value: rateObj[item.key],
|
|
411
|
+
onChange: function onChange(v) {
|
|
412
|
+
handleRateChange(item.key, v);
|
|
413
|
+
},
|
|
414
|
+
addonAfter: "%"
|
|
415
|
+
})), tipShow && /*#__PURE__*/React.createElement("div", {
|
|
416
|
+
className: "rule-tip"
|
|
417
|
+
}, item.tip));
|
|
418
|
+
})))), /*#__PURE__*/React.createElement("div", {
|
|
419
|
+
className: "cpb-bot-tip"
|
|
420
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
421
|
+
className: "cpb-bot-tip-left"
|
|
422
|
+
}, "\u6CE8:"), /*#__PURE__*/React.createElement("div", {
|
|
423
|
+
className: "cpb-bot-tip-right"
|
|
424
|
+
}, /*#__PURE__*/React.createElement("div", null, "\u5546\u54C1\u5229\u6DA6\u7387 =\uFF08\u5E02\u573A\u4EF7-\u4F1A\u5458\u4EF7\uFF09/\u5E02\u573A\u4EF7*100%"), /*#__PURE__*/React.createElement("div", null, "\u9500\u552E\u5229\u6DA6\u7387 =\uFF08\u9500\u552E\u4EF7-\u4F1A\u5458\u4EF7\uFF09/\u9500\u552E\u4EF7*100%")))), app === 1 && /*#__PURE__*/React.createElement("div", {
|
|
425
|
+
className: "change-price-body"
|
|
426
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
427
|
+
className: "cpb-header"
|
|
428
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
429
|
+
className: "cpb-header-title"
|
|
430
|
+
}, "\u9500\u552E\u4EF7"), /*#__PURE__*/React.createElement("div", {
|
|
431
|
+
className: "cpb-header-desc"
|
|
432
|
+
}, "\u9500\u552E\u4EF7\u4EC5\u505A\u5C55\u793A\u4F5C\u7528\uFF0C\u4E3A\u907F\u514D\u5546\u54C1\u9500\u552E\u652F\u6301\u7C7B\u578B\u8C03\u6574\u5BFC\u81F4\u4EF7\u683C\u7F3A\u5931\uFF0C\u8BF7\u5BF9\u96C6\u91C7\u4EF7\u548C\u4EE3\u53D1\u4EF7\u90FD\u8FDB\u884C\u8BBE\u7F6E")), /*#__PURE__*/React.createElement("div", {
|
|
433
|
+
className: "alter_price_content_wrapper"
|
|
434
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
435
|
+
className: "alter_price_content_wrapper_item"
|
|
436
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
437
|
+
className: "alter_price_content_wrapper_item_title"
|
|
438
|
+
}, "\u96C6\u91C7\u9500\u552E\u4EF7"), /*#__PURE__*/React.createElement("div", {
|
|
439
|
+
className: "alter_price_content_wrapper_item_content"
|
|
440
|
+
}, /*#__PURE__*/React.createElement(_Radio.Group, {
|
|
441
|
+
onChange: handleRadioChangeJc,
|
|
442
|
+
value: radioKeyJc
|
|
443
|
+
}, /*#__PURE__*/React.createElement(_Space, {
|
|
444
|
+
direction: "vertical",
|
|
445
|
+
size: "middle"
|
|
446
|
+
}, priceRuleConfig3.rules.map(function (item) {
|
|
447
|
+
var inputShow = radioKeyJc === item.key && item.operateType !== 3;
|
|
448
|
+
var tipShow = radioKeyJc === item.key && !!item.tip;
|
|
449
|
+
return /*#__PURE__*/React.createElement(_Radio, {
|
|
450
|
+
value: item.key,
|
|
451
|
+
key: item.key
|
|
452
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
453
|
+
className: "rule-flex"
|
|
454
|
+
}, /*#__PURE__*/React.createElement("span", null, item.label), inputShow && /*#__PURE__*/React.createElement(_InputNumber, {
|
|
455
|
+
style: {
|
|
456
|
+
width: 100,
|
|
457
|
+
marginLeft: 10
|
|
458
|
+
},
|
|
459
|
+
min: 0,
|
|
460
|
+
max: 100,
|
|
461
|
+
step: 1,
|
|
462
|
+
precision: 0,
|
|
463
|
+
value: rateObjJc[item.key],
|
|
464
|
+
onChange: function onChange(v) {
|
|
465
|
+
handleRateChangeJc(item.key, v);
|
|
466
|
+
},
|
|
467
|
+
addonAfter: "%"
|
|
468
|
+
})), tipShow && /*#__PURE__*/React.createElement("div", {
|
|
469
|
+
className: "rule-tip"
|
|
470
|
+
}, item.tip));
|
|
471
|
+
}))))), /*#__PURE__*/React.createElement("div", {
|
|
472
|
+
className: "alter_price_content_wrapper_item"
|
|
473
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
474
|
+
className: "alter_price_content_wrapper_item_title"
|
|
475
|
+
}, "\u4EE3\u53D1\u9500\u552E\u4EF7"), /*#__PURE__*/React.createElement("div", {
|
|
476
|
+
className: "alter_price_content_wrapper_item_content"
|
|
477
|
+
}, /*#__PURE__*/React.createElement(_Radio.Group, {
|
|
478
|
+
onChange: handleRadioChange,
|
|
479
|
+
value: radioKey
|
|
480
|
+
}, /*#__PURE__*/React.createElement(_Space, {
|
|
481
|
+
direction: "vertical",
|
|
482
|
+
size: "middle"
|
|
483
|
+
}, priceRuleConfig2.rules.map(function (item) {
|
|
484
|
+
var inputShow = radioKey === item.key && item.operateType !== 3;
|
|
485
|
+
var tipShow = radioKey === item.key && !!item.tip;
|
|
486
|
+
return /*#__PURE__*/React.createElement(_Radio, {
|
|
487
|
+
value: item.key,
|
|
488
|
+
key: item.key
|
|
489
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
490
|
+
className: "rule-flex"
|
|
491
|
+
}, /*#__PURE__*/React.createElement("span", null, item.label), inputShow && /*#__PURE__*/React.createElement(_InputNumber, {
|
|
492
|
+
style: {
|
|
493
|
+
width: 100,
|
|
494
|
+
marginLeft: 10
|
|
495
|
+
},
|
|
496
|
+
min: 0,
|
|
497
|
+
max: 100,
|
|
498
|
+
step: 1,
|
|
499
|
+
precision: 0,
|
|
500
|
+
value: rateObj[item.key],
|
|
501
|
+
onChange: function onChange(v) {
|
|
502
|
+
handleRateChange(item.key, v);
|
|
503
|
+
},
|
|
504
|
+
addonAfter: "%"
|
|
505
|
+
})), tipShow && /*#__PURE__*/React.createElement("div", {
|
|
506
|
+
className: "rule-tip"
|
|
507
|
+
}, item.tip));
|
|
508
|
+
})))))))));
|
|
509
|
+
};
|
|
510
|
+
export default ChangePrice;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
.change-price {
|
|
2
|
+
.change-price-body {
|
|
3
|
+
margin: 0 20px;
|
|
4
|
+
.cpb-header {
|
|
5
|
+
.cpb-header-title {
|
|
6
|
+
color: #000;
|
|
7
|
+
font-size: 16px;
|
|
8
|
+
font-weight: 500;
|
|
9
|
+
height: 22px;
|
|
10
|
+
line-height: 22px;
|
|
11
|
+
}
|
|
12
|
+
.cpb-header-desc {
|
|
13
|
+
color: #999;
|
|
14
|
+
font-size: 12px;
|
|
15
|
+
font-weight: 400;
|
|
16
|
+
line-height: 17px;
|
|
17
|
+
margin-top: 11px;
|
|
18
|
+
width: 100%;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
.cpb-rules {
|
|
22
|
+
margin-top: 20px;
|
|
23
|
+
.rule-flex {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
}
|
|
27
|
+
.rule-tip {
|
|
28
|
+
color: #2c68ff;
|
|
29
|
+
font-size: 12px;
|
|
30
|
+
font-weight: 400;
|
|
31
|
+
height: 17px;
|
|
32
|
+
line-height: 17px;
|
|
33
|
+
margin-bottom: 10px;
|
|
34
|
+
margin-top: 10px;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
.cpb-bot-tip {
|
|
38
|
+
display: flex;
|
|
39
|
+
margin-top: 20px;
|
|
40
|
+
.cpb-bot-tip-left {
|
|
41
|
+
color: #999;
|
|
42
|
+
line-height: 20px;
|
|
43
|
+
font-size: 12px;
|
|
44
|
+
}
|
|
45
|
+
.cpb-bot-tip-right {
|
|
46
|
+
color: #999;
|
|
47
|
+
line-height: 20px;
|
|
48
|
+
font-size: 12px;
|
|
49
|
+
margin-left: 8px;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
.cpb-save {
|
|
53
|
+
margin: 0 auto;
|
|
54
|
+
margin-top: 30px;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
.alter_price_content_wrapper {
|
|
58
|
+
border: 1px solid #e2e2e2;
|
|
59
|
+
display: flex;
|
|
60
|
+
margin-bottom: 19px;
|
|
61
|
+
margin-top: 12px;
|
|
62
|
+
width: 100%;
|
|
63
|
+
.alter_price_content_wrapper_item {
|
|
64
|
+
display: inline-block;
|
|
65
|
+
width: 50%;
|
|
66
|
+
&:first-child {
|
|
67
|
+
border-right: 1px solid #e2e2e2;
|
|
68
|
+
}
|
|
69
|
+
.alter_price_content_wrapper_item_title {
|
|
70
|
+
background: #f0f0f0;
|
|
71
|
+
border-bottom: 1px solid #e2e2e2;
|
|
72
|
+
color: #4c4c4c;
|
|
73
|
+
font-size: 14px;
|
|
74
|
+
font-weight: 500;
|
|
75
|
+
height: 44px;
|
|
76
|
+
line-height: 44px;
|
|
77
|
+
text-align: center;
|
|
78
|
+
}
|
|
79
|
+
.alter_price_content_wrapper_item_content {
|
|
80
|
+
padding: 20px 15px;
|
|
81
|
+
.rule-flex {
|
|
82
|
+
display: flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
}
|
|
85
|
+
.rule-tip {
|
|
86
|
+
color: #2c68ff;
|
|
87
|
+
font-size: 12px;
|
|
88
|
+
font-weight: 400;
|
|
89
|
+
height: 17px;
|
|
90
|
+
line-height: 17px;
|
|
91
|
+
margin-bottom: 10px;
|
|
92
|
+
margin-top: 10px;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|