@titaui/pc 1.9.113 → 1.9.117

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.
@@ -1,5 +1,7 @@
1
1
  .titaui-book-demo-pc-content {
2
2
  display: flex;
3
+ background-color: #ffffff;
4
+ border-radius: 24px;
3
5
  }
4
6
 
5
7
  .titaui-book-demo-pc-content__left {
@@ -72,14 +72,17 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
72
72
  var preCls = "titaui-book-demo-pc-content";
73
73
  var uname = window.BSGlobal && window.BSGlobal.loginUserInfo.Name || "";
74
74
  var uid = window.BSGlobal && window.BSGlobal.tenantInfo.Id || "";
75
- var source = window.BSGlobal && window.BSGlobal.tenantInfo.Source || (0, _utils.getSource)("source");
75
+ var Source = window.BSGlobal && window.BSGlobal.tenantInfo.Source || (0, _utils.getSource)();
76
76
  var lname = window.BSGlobal && window.BSGlobal.loginUserInfo.Name || "";
77
77
  var lmobile = window.BSGlobal && window.BSGlobal.loginUserInfo.Mobile || "";
78
78
  var lcompany = window.BSGlobal && window.BSGlobal.tenantInfo.Name || "";
79
79
 
80
80
  var BookDemoPCContent = function BookDemoPCContent(_ref) {
81
81
  var type = _ref.type,
82
- onSubmitSuccess = _ref.onSubmitSuccess;
82
+ onSubmitSuccess = _ref.onSubmitSuccess,
83
+ _ref$source = _ref.source,
84
+ source = _ref$source === void 0 ? 0 : _ref$source,
85
+ onChange = _ref.onChange;
83
86
 
84
87
  var _useState = (0, _react.useState)((0, _utils.getTypeData)(type)),
85
88
  _useState2 = _slicedToArray(_useState, 2),
@@ -125,6 +128,10 @@ var BookDemoPCContent = function BookDemoPCContent(_ref) {
125
128
  }
126
129
 
127
130
  setResult(_toConsumableArray(result));
131
+
132
+ if (onChange) {
133
+ onChange(result);
134
+ }
128
135
  };
129
136
 
130
137
  var emptyFun = function emptyFun() {};
@@ -150,13 +157,13 @@ var BookDemoPCContent = function BookDemoPCContent(_ref) {
150
157
  content: content,
151
158
  code: verificationData.value,
152
159
  keyRandomV2: yzmGuidVal.indexOf("?") !== -1 ? yzmGuidVal.slice(0, yzmGuidVal.indexOf("?")) : yzmGuidVal,
153
- source: source
160
+ source: source > 0 ? source : Source
154
161
  }
155
162
  }).then(function (res) {
156
163
  if (res.data.Code) {
157
164
  _toast["default"].Success("提交成功");
158
165
 
159
- onSubmitSuccess(false);
166
+ onSubmitSuccess();
160
167
  localStorage.setItem("isSubmitted", "1");
161
168
  } else {
162
169
  handelChangeImage();
@@ -302,5 +309,9 @@ var BookDemoPCContent = function BookDemoPCContent(_ref) {
302
309
  }, "\u63D0\u4EA4"))));
303
310
  };
304
311
 
312
+ BookDemoPCContent.defaultProps = {
313
+ source: 0,
314
+ onChange: function onChange() {}
315
+ };
305
316
  var _default = BookDemoPCContent;
306
317
  exports["default"] = _default;
@@ -17,6 +17,8 @@ var _content = _interopRequireDefault(require("./components/content"));
17
17
 
18
18
  var _demoClose = _interopRequireDefault(require("../../img/demo-close.svg"));
19
19
 
20
+ var _utils = require("../../utils");
21
+
20
22
  require("./index.css");
21
23
 
22
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -43,24 +45,49 @@ var role = window.BSGlobal && window.BSGlobal.loginUserInfo.Role;
43
45
  var isSubmitted = localStorage.getItem("isSubmitted");
44
46
  var time = Number(localStorage.getItem("pointDemoTime"));
45
47
  var newDate = new Date().getTime();
48
+ var uname = window.BSGlobal && window.BSGlobal.loginUserInfo.Name || "";
49
+ var uid = window.BSGlobal && window.BSGlobal.tenantInfo.Id || "";
50
+ var Source = window.BSGlobal && window.BSGlobal.tenantInfo.Source || (0, _utils.getSource)();
46
51
  var BookDemoPC = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
47
52
  var type = _ref.type,
48
53
  visible = _ref.visible,
49
54
  visibleChange = _ref.visibleChange,
50
55
  _ref$autoShow = _ref.autoShow,
51
- autoShow = _ref$autoShow === void 0 ? false : _ref$autoShow;
56
+ autoShow = _ref$autoShow === void 0 ? false : _ref$autoShow,
57
+ source = _ref.source;
52
58
 
53
59
  var _useState = (0, _react.useState)(false),
54
60
  _useState2 = _slicedToArray(_useState, 2),
55
61
  dialogVisible = _useState2[0],
56
62
  setDialogVisible = _useState2[1];
57
63
 
64
+ var _useState3 = (0, _react.useState)([]),
65
+ _useState4 = _slicedToArray(_useState3, 2),
66
+ data = _useState4[0],
67
+ setData = _useState4[1];
68
+
58
69
  var handleCloseBookDemo = function handleCloseBookDemo() {
70
+ var content = uid ? "\u79DF\u6237ID\uFF1A".concat(uid, "\uFF0C\u79DF\u6237\u8D26\u53F7\u540D\u79F0\uFF1A").concat(uname, ",") : "";
71
+ data.forEach(function (item) {
72
+ content += "".concat(item.name, ": ").concat(Array.isArray(item.value) ? item.value.join(",") : item.value, ",");
73
+ });
74
+ content += "source: ".concat(source || Source);
59
75
  setDialogVisible(false);
60
76
 
61
77
  if (visibleChange) {
62
78
  visibleChange(false);
63
79
  }
80
+
81
+ if (window.titaTracker) {
82
+ window.titaTracker("action").record({
83
+ actionName: "申请演示__取消提交",
84
+ productName: "\u586B\u5199\u60C5\u51B5\uFF1A".concat(content)
85
+ });
86
+ }
87
+ };
88
+
89
+ var handleChangeData = function handleChangeData(result) {
90
+ setData(result);
64
91
  };
65
92
 
66
93
  var handleShowBookDemo = function handleShowBookDemo() {
@@ -122,13 +149,16 @@ var BookDemoPC = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
122
149
  src: _demoClose["default"],
123
150
  className: (0, _classnames["default"])("".concat(preCls, "__close-icon"))
124
151
  })), /*#__PURE__*/_react["default"].createElement(_content["default"], {
152
+ onChange: handleChangeData,
153
+ source: source,
125
154
  type: type,
126
155
  onSubmitSuccess: handleCloseBookDemo
127
156
  }));
128
157
  });
129
158
  BookDemoPC.defaultProps = {
130
159
  autoShow: false,
131
- visibleChange: function visibleChange() {}
160
+ visibleChange: function visibleChange() {},
161
+ source: 0
132
162
  };
133
163
  var _default = BookDemoPC;
134
164
  exports["default"] = _default;
@@ -13,12 +13,13 @@ var getTypeData = function getTypeData(type) {
13
13
 
14
14
  exports.getTypeData = getTypeData;
15
15
 
16
- var getSource = function getSource(param) {
17
- var reg = new RegExp("(^|&)".concat(param, "=([^&]*)(&|$)"));
18
- var r = window.location.search.substr(1).match(reg) || window.location.hash.substring(window.location.hash.search(/\?/) + 1).match(reg);
16
+ var getSource = function getSource() {
17
+ var reg = /source=[0-9]*/g;
18
+ var sourceQuery = window.location.href.match(reg);
19
19
 
20
- if (r != null) {
21
- return decodeURIComponent(r[2]);
20
+ if (sourceQuery) {
21
+ var source = decodeURIComponent(sourceQuery[0].split("=")[1]);
22
+ return source;
22
23
  }
23
24
 
24
25
  return 0;
@@ -2,6 +2,10 @@
2
2
  z-index: 100;
3
3
  }
4
4
 
5
+ .rc-dialog-header {
6
+ border-radius: 24px 24px 0 0;
7
+ }
8
+
5
9
  .rc-dialog-wrap {
6
10
  display: flex;
7
11
  justify-content: center;
@@ -45,9 +45,9 @@
45
45
 
46
46
  .tita-ui-change-person-photo__upload-right-input {
47
47
  position: absolute;
48
- top: 76px;
48
+ top: 0;
49
49
  width: 240px;
50
- height: 60px;
50
+ height: 240px;
51
51
  opacity: 0;
52
52
  cursor: pointer;
53
53
  }
@@ -112,16 +112,16 @@
112
112
  .tita-ui-change-person-photo__upload-left-box {
113
113
  width: 160px;
114
114
  height: 32px;
115
- background: #F0F2F5;
115
+ background: #f0f2f5;
116
116
  border-radius: 2px;
117
- border: 1px solid #E9ECF0;
117
+ border: 1px solid #e9ecf0;
118
118
  }
119
119
 
120
120
  .tita-ui-change-person-photo__upload-left-preview {
121
121
  margin-top: 8px;
122
122
  font-size: 14px;
123
123
  font-weight: 400;
124
- color: #3F4755;
124
+ color: #3f4755;
125
125
  line-height: 22px;
126
126
  }
127
127
 
@@ -142,18 +142,18 @@
142
142
  .tita-ui-change-person-photo__preview-box-bgc {
143
143
  width: 160px;
144
144
  height: 32px;
145
- background: #2879FF;
145
+ background: #2879ff;
146
146
  border-radius: 2px;
147
- border: 1px solid #E9ECF0;
147
+ border: 1px solid #e9ecf0;
148
148
  }
149
149
 
150
150
  .tita-ui-change-person-photo__preview-box-browser {
151
151
  margin-left: 16px;
152
152
  width: 176px;
153
153
  height: 48px;
154
- background: #F0F2F5;
154
+ background: #f0f2f5;
155
155
  border-radius: 2px;
156
- border: 1px solid #E9ECF0;
156
+ border: 1px solid #e9ecf0;
157
157
  background-image: url("./img/browser-preview-bgc.png");
158
158
  background-size: 170px 28px;
159
159
  background-position: center center;
@@ -191,7 +191,7 @@
191
191
  margin-top: 36px;
192
192
  font-size: 14px;
193
193
  font-weight: 400;
194
- color: #3F4755;
194
+ color: #3f4755;
195
195
  line-height: 22px;
196
196
  }
197
197
 
@@ -209,7 +209,7 @@
209
209
  right: 10px;
210
210
  font-size: 12px;
211
211
  font-weight: 400;
212
- color: #3F4755;
212
+ color: #3f4755;
213
213
  line-height: 18px;
214
214
  }
215
215
 
@@ -217,7 +217,7 @@
217
217
  margin-top: 58px;
218
218
  font-size: 14px;
219
219
  font-weight: 400;
220
- color: #3F4755;
220
+ color: #3f4755;
221
221
  line-height: 22px;
222
222
  }
223
223
 
@@ -255,6 +255,7 @@
255
255
  }
256
256
 
257
257
  .tita-ui-change-person-photo__title-again {
258
+ opacity: 0;
258
259
  margin-left: 92px;
259
260
  margin-top: 8px;
260
261
  font-size: 14px;
@@ -264,15 +265,16 @@
264
265
  }
265
266
 
266
267
  .tita-ui-change-person-photo__title-again--show {
268
+ opacity: 1;
267
269
  color: #2879ff;
268
270
  }
269
271
 
270
272
  .tita-ui-change-person-photo__title-again--show:hover {
271
- color: #5C8EFF;
273
+ color: #5c8eff;
272
274
  }
273
275
 
274
276
  .tita-ui-change-person-photo__title-again--hover {
275
- color: #5C8EFF;
277
+ color: #5c8eff;
276
278
  }
277
279
 
278
280
  .tita-ui-change-person-photo__title-preview {
@@ -56,7 +56,8 @@ function ChangePhoto(props) {
56
56
  onCancel = props.onCancel,
57
57
  _props$type = props.type,
58
58
  type = _props$type === void 0 ? "person" : _props$type,
59
- handleSuccessUploadPhoto = props.handleSuccessUploadPhoto;
59
+ handleSuccessUploadPhoto = props.handleSuccessUploadPhoto,
60
+ title = props.title;
60
61
  var modalRef = (0, _react.useRef)();
61
62
  var cropperRef = (0, _react.useRef)(null);
62
63
 
@@ -115,8 +116,8 @@ function ChangePhoto(props) {
115
116
  var n = bstr.length;
116
117
  var u8arr = new Uint8Array(n);
117
118
 
118
- while (n--) {
119
- u8arr[n] = bstr.charCodeAt(n);
119
+ for (var i = n; i > 0; i -= 1) {
120
+ u8arr[i] = bstr.charCodeAt(i);
120
121
  }
121
122
 
122
123
  return new File([u8arr], filename, {
@@ -162,18 +163,20 @@ function ChangePhoto(props) {
162
163
  };
163
164
 
164
165
  var handleSaveInfo = function handleSaveInfo() {
165
- if (!image) {} else if (type === "person") {
166
- (0, _requestApi.saveUserPhoto)(cropper).then(function (resp) {
167
- handleSuccessSave(resp);
168
- });
169
- } else if (type === "enterprise") {
170
- (0, _requestApi.saveTenantLogo)(cropper).then(function (resp) {
171
- handleSuccessSave(resp);
172
- });
173
- } else {
174
- (0, _requestApi.saveBrowserIcon)(cropper).then(function (resp) {
175
- handleSuccessSave(resp);
176
- });
166
+ if (image) {
167
+ if (type === "person") {
168
+ (0, _requestApi.saveUserPhoto)(cropper).then(function (resp) {
169
+ handleSuccessSave(resp);
170
+ });
171
+ } else if (type === "enterprise") {
172
+ (0, _requestApi.saveTenantLogo)(cropper).then(function (resp) {
173
+ handleSuccessSave(resp);
174
+ });
175
+ } else {
176
+ (0, _requestApi.saveBrowserIcon)(cropper).then(function (resp) {
177
+ handleSuccessSave(resp);
178
+ });
179
+ }
177
180
  }
178
181
  };
179
182
 
@@ -196,7 +199,7 @@ function ChangePhoto(props) {
196
199
  width: 480,
197
200
  mask: true,
198
201
  centered: true,
199
- title: (0, _getLocale.getLocale)("Set_PI_Uploadavatar"),
202
+ title: title,
200
203
  noHeadLine: true,
201
204
  maskClosable: false,
202
205
  onClose: handleCancel,
@@ -264,25 +267,30 @@ function ChangePhoto(props) {
264
267
  condition: type === "person"
265
268
  }, /*#__PURE__*/_react["default"].createElement("img", {
266
269
  src: cropData,
267
- className: "".concat(preCls, "__preview-box1")
270
+ className: "".concat(preCls, "__preview-box1"),
271
+ alt: "bigImage"
268
272
  }), /*#__PURE__*/_react["default"].createElement("img", {
269
273
  src: cropData,
270
- className: "".concat(preCls, "__preview-box2")
274
+ className: "".concat(preCls, "__preview-box2"),
275
+ alt: "middleImage"
271
276
  }), /*#__PURE__*/_react["default"].createElement("img", {
272
277
  src: cropData,
273
- className: "".concat(preCls, "__preview-box3")
278
+ className: "".concat(preCls, "__preview-box3"),
279
+ alt: "smallImage"
274
280
  })), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
275
281
  condition: type === "enterprise"
276
282
  }, /*#__PURE__*/_react["default"].createElement("img", {
277
283
  src: cropData,
278
- className: "".concat(preCls, "__preview-enterprise-img")
284
+ className: "".concat(preCls, "__preview-enterprise-img"),
285
+ alt: "previewImage"
279
286
  }), /*#__PURE__*/_react["default"].createElement("span", {
280
287
  className: "".concat(preCls, "__preview-enterprise-title")
281
288
  }, item === null || item === void 0 ? void 0 : item.previewTitle)), /*#__PURE__*/_react["default"].createElement(_conditionRender["default"], {
282
289
  condition: type === "browser"
283
290
  }, /*#__PURE__*/_react["default"].createElement("img", {
284
291
  src: cropData,
285
- className: "".concat(preCls, "__preview-browser-img")
292
+ className: "".concat(preCls, "__preview-browser-img"),
293
+ alt: "previewImage"
286
294
  }), /*#__PURE__*/_react["default"].createElement("span", {
287
295
  className: "".concat(preCls, "__preview-browser-name")
288
296
  }, "Tita"), /*#__PURE__*/_react["default"].createElement("span", {
@@ -94,11 +94,12 @@ function PersonPhoto() {
94
94
  onClick: handleChangePhoto
95
95
  }, (0, _getLocale.getLocale)("Set_PI_Clicktomodify")), /*#__PURE__*/_react["default"].createElement("span", {
96
96
  className: "".concat(prefix, "__main-tip")
97
- }, (0, _getLocale.getLocale)("Set_PI_Suggestedsize"), " ", "150*150px")), /*#__PURE__*/_react["default"].createElement(_uploadPhotoModal["default"], {
97
+ }, (0, _getLocale.getLocale)("Set_PI_Suggestedsize"), "150*150px")), /*#__PURE__*/_react["default"].createElement(_uploadPhotoModal["default"], {
98
98
  visible: visible,
99
99
  onCancel: handleCancel,
100
100
  type: "person",
101
- handleSuccessUploadPhoto: handleSuccessUploadPhoto
101
+ handleSuccessUploadPhoto: handleSuccessUploadPhoto,
102
+ title: (0, _getLocale.getLocale)("Set_PI_Uploadavatar")
102
103
  }));
103
104
  }
104
105
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.9.113",
3
+ "version": "1.9.117",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",