@titaui/pc 1.9.82 → 1.9.83

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.
@@ -22,6 +22,10 @@ var _form = _interopRequireDefault(require("../../form"));
22
22
 
23
23
  var _getLocale = require("../../../utils/getLocale");
24
24
 
25
+ var _payBackgroundImg = _interopRequireDefault(require("../image/payBackgroundImg.png"));
26
+
27
+ var _submitLogo = _interopRequireDefault(require("../image/submitLogo.svg"));
28
+
25
29
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
26
30
 
27
31
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -48,8 +52,7 @@ var Fields = _form["default"].Fields;
48
52
 
49
53
  function SubmitDialog(props) {
50
54
  var handleShowSubmitOkrWindow = props.handleShowSubmitOkrWindow,
51
- isShowSubmitOkrWindow = props.isShowSubmitOkrWindow,
52
- allViewAreaRef = props.allViewAreaRef;
55
+ isShowSubmitOkrWindow = props.isShowSubmitOkrWindow;
53
56
 
54
57
  var _useState = (0, _react.useState)(""),
55
58
  _useState2 = _slicedToArray(_useState, 2),
@@ -79,10 +82,8 @@ function SubmitDialog(props) {
79
82
  truonlyFirstErrore: false
80
83
  });
81
84
 
82
- if (err.length) {
83
- console.log(err);
84
- } else {
85
- (0, _network.postSurvey)(body).then(function (res) {
85
+ if (!err.length) {
86
+ (0, _network.postSurvey)(body).then(function () {
86
87
  _toast["default"].Success("发送成功");
87
88
 
88
89
  handleShowSubmitOkrWindow(false);
@@ -105,7 +106,8 @@ function SubmitDialog(props) {
105
106
  }, /*#__PURE__*/_react["default"].createElement("div", {
106
107
  className: "okr-cases-library__submitWindow"
107
108
  }, /*#__PURE__*/_react["default"].createElement("img", {
108
- src: require("../image/submit\u5C0F\u9A74.svg")
109
+ src: _submitLogo["default"],
110
+ alt: "submit\u5C0F\u9A74"
109
111
  }), /*#__PURE__*/_react["default"].createElement("div", {
110
112
  className: "tu-icon-canceled",
111
113
  onClick: function onClick() {
@@ -166,7 +168,7 @@ function PayDialog(props) {
166
168
  var tenantType = window.BSGlobal.tenantInfo.tenantType; // 外部注冊賬號使用的產品ID不同
167
169
 
168
170
  // 外部注冊賬號使用的產品ID不同
169
- if (Version == 1 && tenantType == 3) return "D9E059E4-4303-4EE2-9275-AE2FA74BBAA6";
171
+ if (Version === 1 && tenantType === 3) return "D9E059E4-4303-4EE2-9275-AE2FA74BBAA6";
170
172
  return "60AFAD35-5273-4A06-B2F4-9A3193096BE7";
171
173
  }),
172
174
  _useState10 = _slicedToArray(_useState9, 1),
@@ -205,18 +207,18 @@ function PayDialog(props) {
205
207
  Total: 1
206
208
  }]
207
209
  }).then(function (orderInfo) {
208
- var orderId = orderInfo.Id,
210
+ var Id = orderInfo.Id,
209
211
  AliModel = orderInfo.AliModel;
210
212
  var PayCode = AliModel.PayCode,
211
213
  PayName = AliModel.PayName;
212
214
  setPayCode(PayCode);
213
- setOrderId(orderId);
215
+ setOrderId(Id);
214
216
  setPayName(PayName);
215
217
  });
216
218
  });
217
219
  }, []); // 点击立即支付后,2分钟内,每个10s,循环获取订单信息
218
220
 
219
- var loopOrderInfo = function loopOrderInfo(orderId) {
221
+ var loopOrderInfo = function loopOrderInfo(id) {
220
222
  if (getOrderInfoTimers.current === 12) {
221
223
  getOrderInfoTimers.current = 1;
222
224
  }
@@ -224,13 +226,13 @@ function PayDialog(props) {
224
226
  setTimeout(function () {
225
227
  // 循环获取订单信息 2 分钟
226
228
  if (getOrderInfoTimers.current < 12) {
227
- (0, _network.getOkrOrderInfo)(orderId).then(function (res) {
229
+ (0, _network.getOkrOrderInfo)(id).then(function (res) {
228
230
  getOrderInfoTimers.current += 1; // @ts-ignore
229
231
 
230
232
  var OrderStatus = res.OrderStatus; // 未支付成功重新获取订单
231
233
 
232
- if (OrderStatus != 2) {
233
- loopOrderInfo(orderId);
234
+ if (OrderStatus !== 2) {
235
+ loopOrderInfo(id);
234
236
  } else {
235
237
  // 订单已支付
236
238
  _titaUi.Modal.success({
@@ -279,7 +281,8 @@ function PayDialog(props) {
279
281
  }, /*#__PURE__*/_react["default"].createElement("div", {
280
282
  className: "okr-cases-library__payWindow"
281
283
  }, /*#__PURE__*/_react["default"].createElement("img", {
282
- src: require("../image/\u652F\u4ED8\u80CC\u666F\u6D6E\u51FA.png")
284
+ src: _payBackgroundImg["default"],
285
+ alt: "\u652F\u4ED8\u80CC\u666F\u6D6E\u51FA"
283
286
  }), /*#__PURE__*/_react["default"].createElement("div", {
284
287
  className: "tu-icon-canceled",
285
288
  onClick: function onClick() {
@@ -303,7 +306,7 @@ function PayDialog(props) {
303
306
  style: {
304
307
  fontSize: "32px"
305
308
  }
306
- }, "19.8"), "\u5143/\u5E74")), /*#__PURE__*/_react["default"].createElement("a", {
309
+ }, "29.8"), "\u5143/\u5E74")), /*#__PURE__*/_react["default"].createElement("a", {
307
310
  className: "okr-cases-library__payWindow__payButton",
308
311
  onClick: function onClick() {
309
312
  return loopOrderInfo(orderId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.9.82",
3
+ "version": "1.9.83",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "src/index.js",
@@ -7,16 +7,18 @@ import Toast from "../../toast";
7
7
  import Dialog from "../../dialog";
8
8
  import Form from "../../form";
9
9
  import { getLocale } from "../../../utils/getLocale";
10
+ import img from "../image/payBackgroundImg.png";
11
+ import submitImg from "../image/submitLogo.svg";
10
12
 
11
13
  const { Fields } = Form;
12
14
 
13
15
  interface Props1 {
14
16
  handleShowSubmitOkrWindow: Function;
15
17
  isShowSubmitOkrWindow: boolean;
16
- allViewAreaRef: any;
18
+ // allViewAreaRef: any;
17
19
  }
18
20
  export function SubmitDialog(props: Props1) {
19
- const { handleShowSubmitOkrWindow, isShowSubmitOkrWindow, allViewAreaRef } = props;
21
+ const { handleShowSubmitOkrWindow, isShowSubmitOkrWindow } = props;
20
22
  const [type, setType] = useState("");
21
23
  const [job, setJob] = useState("");
22
24
  const [scene, setScene] = useState("");
@@ -31,10 +33,8 @@ export function SubmitDialog(props: Props1) {
31
33
  };
32
34
  // 校验
33
35
  const err = formRef.current.verifing({ truonlyFirstErrore: false });
34
- if (err.length) {
35
- console.log(err);
36
- } else {
37
- postSurvey(body).then((res) => {
36
+ if (!err.length) {
37
+ postSurvey(body).then(() => {
38
38
  Toast.Success("发送成功");
39
39
  handleShowSubmitOkrWindow(false);
40
40
  }).catch(() => {
@@ -46,7 +46,7 @@ export function SubmitDialog(props: Props1) {
46
46
  return (
47
47
  <Dialog visible={isShowSubmitOkrWindow} noFooter width="480px" destroyOnClose noCloseIcon getContainer={() => document.body} zIndex={1200}>
48
48
  <div className="okr-cases-library__submitWindow">
49
- <img src={require("../image/submit小驴.svg")} />
49
+ <img src={submitImg} alt="submit小驴" />
50
50
  <div className="tu-icon-canceled" onClick={() => handleShowSubmitOkrWindow(false)} />
51
51
  <Form ref={formRef}>
52
52
  <Fields.Input
@@ -110,7 +110,7 @@ export function PayDialog(props: Props2) {
110
110
  // @ts-ignore
111
111
  const { tenantType } = window.BSGlobal.tenantInfo;
112
112
  // 外部注冊賬號使用的產品ID不同
113
- if (Version == 1 && tenantType == 3) return "D9E059E4-4303-4EE2-9275-AE2FA74BBAA6";
113
+ if (Version === 1 && tenantType === 3) return "D9E059E4-4303-4EE2-9275-AE2FA74BBAA6";
114
114
  return "60AFAD35-5273-4A06-B2F4-9A3193096BE7";
115
115
  });
116
116
  const [orderId, setOrderId] = useState("");
@@ -134,30 +134,30 @@ export function PayDialog(props: Props2) {
134
134
  Total: 1,
135
135
  }],
136
136
  }).then((orderInfo) => {
137
- const { Id: orderId, AliModel } = orderInfo;
137
+ const { Id, AliModel } = orderInfo;
138
138
  const { PayCode, PayName } = AliModel;
139
139
  setPayCode(PayCode);
140
- setOrderId(orderId);
140
+ setOrderId(Id);
141
141
  setPayName(PayName);
142
142
  });
143
143
  });
144
144
  }, []);
145
145
 
146
146
  // 点击立即支付后,2分钟内,每个10s,循环获取订单信息
147
- const loopOrderInfo = (orderId) => {
147
+ const loopOrderInfo = (id) => {
148
148
  if (getOrderInfoTimers.current === 12) {
149
149
  getOrderInfoTimers.current = 1;
150
150
  }
151
151
  setTimeout(() => {
152
152
  // 循环获取订单信息 2 分钟
153
153
  if (getOrderInfoTimers.current < 12) {
154
- getOkrOrderInfo(orderId).then((res) => {
154
+ getOkrOrderInfo(id).then((res) => {
155
155
  getOrderInfoTimers.current += 1;
156
156
  // @ts-ignore
157
157
  const { OrderStatus } = res;
158
158
  // 未支付成功重新获取订单
159
- if (OrderStatus != 2) {
160
- loopOrderInfo(orderId);
159
+ if (OrderStatus !== 2) {
160
+ loopOrderInfo(id);
161
161
  } else {
162
162
  // 订单已支付
163
163
  Modal.success({
@@ -178,7 +178,7 @@ export function PayDialog(props: Props2) {
178
178
  return (
179
179
  <Dialog visible={isShowPayWindow} noFooter width="480px" destroyOnClose noCloseIcon getContainer={() => allViewAreaRef.current}>
180
180
  <div className="okr-cases-library__payWindow">
181
- <img src={require("../image/支付背景浮出.png")} />
181
+ <img src={img} alt="支付背景浮出" />
182
182
  <div className="tu-icon-canceled" onClick={() => handleShowPayWindow(false)} style={{ width: "18px", height: "18px" }} />
183
183
  <p className="okr-cases-library__payWindow__head">
184
184
  {price}
@@ -192,7 +192,7 @@ export function PayDialog(props: Props2) {
192
192
  <div className="okr-cases-library__payWindow__amount">
193
193
  应付金额:
194
194
  <b>
195
- <span style={{ fontSize: "32px" }}>19.8</span>
195
+ <span style={{ fontSize: "32px" }}>29.8</span>
196
196
  元/年
197
197
  </b>
198
198
  </div>