easy3wmui 0.0.42-beta2 → 0.0.42-beta21

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.
@@ -56,6 +56,12 @@ var Easy3wMLogin = function (_Component) {
56
56
 
57
57
  var _this = (0, _possibleConstructorReturn3['default'])(this, _Component.call(this, props));
58
58
 
59
+ _this.onChange = function (key) {
60
+ _this.setState({
61
+ activeKey: key // 标签页的key
62
+ });
63
+ };
64
+
59
65
  _this.checkCaptcha = function (rule, value, callback) {
60
66
  var captcharesult = _this.state.captcharesult;
61
67
 
@@ -75,6 +81,52 @@ var Easy3wMLogin = function (_Component) {
75
81
  });
76
82
  };
77
83
 
84
+ _this.touchSetPassword = function () {
85
+ var visible = _this.state.visible;
86
+
87
+ _this.setState({
88
+ visible: !visible // 密码显示隐藏
89
+ });
90
+ };
91
+
92
+ _this.toPage = function (operationType) {
93
+ var toPage = _this.props.toPage;
94
+
95
+ if (toPage && typeof toPage === 'function') {
96
+ toPage(operationType);
97
+ }
98
+ };
99
+
100
+ _this.showModal = function (operationType) {
101
+ var showModal = _this.props.showModal;
102
+
103
+ if (showModal && typeof showModal === 'function') {
104
+ showModal(operationType);
105
+ }
106
+ };
107
+
108
+ _this.touchSendCode = function () {
109
+ var touchSendCode = _this.props.touchSendCode;
110
+
111
+ if (touchSendCode && typeof touchSendCode === 'function') {
112
+ touchSendCode(function (countProps) {
113
+ var count = countProps || 59;
114
+ _this.setState({
115
+ count: count // 验证码时间
116
+ });
117
+ _this.interval = setInterval(function () {
118
+ count -= 1;
119
+ _this.setState({
120
+ count: count // 验证码时间
121
+ });
122
+ if (count === 0) {
123
+ clearInterval(_this.interval);
124
+ }
125
+ }, 1000);
126
+ });
127
+ }
128
+ };
129
+
78
130
  _this.submitAccountLogin = function (values) {
79
131
  var handleOk = _this.props.handleOk;
80
132
  // this.props.form.validateFields().then((values) => {
@@ -85,17 +137,15 @@ var Easy3wMLogin = function (_Component) {
85
137
  // });
86
138
  };
87
139
 
88
- _this.touchSetPassword = function () {
89
- var visible = _this.state.visible;
90
-
91
- _this.setState({
92
- visible: !visible // 密码显示隐藏
93
- });
94
- };
140
+ var activeKey = _this.props.activeKey;
95
141
 
96
142
  _this.state = {
143
+ activeKey: activeKey || 'account', // 标签页的key
144
+ // 账号密码登录
97
145
  captcharesult: '', // 验证码--state
98
- visible: false // 密码显示隐藏
146
+ visible: false, // 密码显示隐藏
147
+ // 账号密码登录
148
+ count: 0 // 手机验证码登录
99
149
  };
100
150
  return _this;
101
151
  }
@@ -103,22 +153,44 @@ var Easy3wMLogin = function (_Component) {
103
153
  Easy3wMLogin.prototype.componentWillUnmount = function componentWillUnmount() {};
104
154
  // 生成form实例
105
155
  // formRef = React.createRef()
156
+ // 切换标签页
157
+
158
+ // --------------------------------------- 账号密码登录 start ---------------------------------------
106
159
  // 校验验证码
107
160
 
108
161
  // 生成校验码
109
162
 
110
- // 提交
111
-
112
163
  // 密码显示隐藏
113
164
 
165
+ // 跳转忘记密码
166
+
167
+ // 显示联系客服弹窗
168
+
169
+ // --------------------------------------- 账号密码登录 end -----------------------------------------
170
+ // --------------------------------------- 手机验证码登录 start ---------------------------------------
171
+ // 发送验证码
172
+
173
+ // --------------------------------------- 手机验证码登录 end -----------------------------------------
174
+ // 提交
175
+
114
176
 
115
177
  Easy3wMLogin.prototype.render = function render() {
178
+ var _this2 = this;
179
+
180
+ var _state = this.state,
181
+ visible = _state.visible,
182
+ activeKey = _state.activeKey,
183
+ count = _state.count;
116
184
  var _props = this.props,
117
185
  form = _props.form,
118
186
  status = _props.status,
119
187
  submitting = _props.submitting,
120
- errorMsg = _props.errorMsg;
121
- var visible = this.state.visible;
188
+ errorMsg = _props.errorMsg,
189
+ objLoginMethod = _props.objLoginMethod;
190
+
191
+ var _ref = objLoginMethod || {},
192
+ account = _ref.account,
193
+ phone = _ref.phone;
122
194
 
123
195
  var errorMsgReal = errorMsg || '账户或密码错误';
124
196
  return _react2['default'].createElement(
@@ -126,22 +198,39 @@ var Easy3wMLogin = function (_Component) {
126
198
  { id: 'Easy3wMLogin' },
127
199
  _react2['default'].createElement(
128
200
  _tabs2['default'],
129
- { activeKey: 'account', onChange: this.onChange },
130
- _react2['default'].createElement(
201
+ { activeKey: activeKey, onChange: this.onChange },
202
+ account ? _react2['default'].createElement(
131
203
  Tab,
132
- { title: '\u7528\u6237\u767B\u5F55', key: 'account' },
204
+ { title: '\u8D26\u53F7\u5BC6\u7801\u767B\u5F55', key: 'account', destroyOnClose: true },
133
205
  _react2['default'].createElement(
134
206
  _form2['default'],
135
207
  {
136
- // ref={this.formRef}
137
208
  onFinish: this.submitAccountLogin,
138
209
  form: form,
139
- layout: 'horizontal' // 字段与
140
- , name: 'login',
210
+ layout: 'horizontal' // 字段与字段值排列方式
211
+ , name: 'account',
141
212
  footer: // 表单尾部的内容,常常用来放置提交按钮
142
213
  _react2['default'].createElement(
143
214
  'div',
144
215
  null,
216
+ _react2['default'].createElement(
217
+ 'div',
218
+ { className: 'funArea' },
219
+ _react2['default'].createElement(
220
+ 'a',
221
+ { onClick: function onClick() {
222
+ return _this2.toPage('forgotPassword');
223
+ } },
224
+ '\u5FD8\u8BB0\u5BC6\u7801'
225
+ ),
226
+ _react2['default'].createElement(
227
+ 'a',
228
+ { onClick: function onClick() {
229
+ return _this2.showModal('customerService');
230
+ } },
231
+ '\u8054\u7CFB\u5BA2\u670D'
232
+ )
233
+ ),
145
234
  _react2['default'].createElement(
146
235
  _button2['default'],
147
236
  { color: 'primary', fill: 'solid', block: true, type: 'primary', htmlType: 'submit' },
@@ -190,7 +279,61 @@ var Easy3wMLogin = function (_Component) {
190
279
  _react2['default'].createElement(_input2['default'], { placeholder: '\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801 \u4E0D\u533A\u5206\u5927\u5C0F\u5199' })
191
280
  )
192
281
  )
193
- )
282
+ ) : '',
283
+ phone ? _react2['default'].createElement(
284
+ Tab,
285
+ { title: '\u624B\u673A\u9A8C\u8BC1\u7801\u767B\u5F55', key: 'phone', destroyOnClose: true },
286
+ _react2['default'].createElement(
287
+ _form2['default'],
288
+ {
289
+ form: form,
290
+ layout: 'horizontal' // 字段与字段值排列方式
291
+ , name: 'phone',
292
+ onFinish: this.submitAccountLogin,
293
+ footer: // 表单尾部的内容,常常用来放置提交按钮
294
+ _react2['default'].createElement(
295
+ 'div',
296
+ null,
297
+ _react2['default'].createElement(
298
+ _button2['default'],
299
+ { type: 'submit', color: 'primary', fill: 'solid', block: true },
300
+ '\u767B\u5F55'
301
+ )
302
+ )
303
+ },
304
+ status === 'error' && submitting === false ? _react2['default'].createElement(
305
+ FormItem,
306
+ null,
307
+ _react2['default'].createElement(
308
+ 'div',
309
+ { className: 'errorMsgReal' },
310
+ errorMsgReal
311
+ )
312
+ ) : '',
313
+ _react2['default'].createElement(
314
+ FormItem,
315
+ { name: 'phone', rules: [{ pattern: /^1\d{10}$/, required: true, message: '手机格式错误' }] },
316
+ _react2['default'].createElement(_input2['default'], { placeholder: '\u8BF7\u8F93\u5165\u624B\u673A\u53F7' })
317
+ ),
318
+ _react2['default'].createElement(
319
+ FormItem,
320
+ {
321
+ name: 'piccaptcha',
322
+ extra: count ? _react2['default'].createElement(
323
+ _button2['default'],
324
+ { size: 'small', type: 'button' },
325
+ count,
326
+ 's'
327
+ ) : _react2['default'].createElement(
328
+ _button2['default'],
329
+ { size: 'small', type: 'button', onClick: this.touchSendCode },
330
+ '\u53D1\u9001\u9A8C\u8BC1\u7801'
331
+ )
332
+ },
333
+ _react2['default'].createElement(_input2['default'], { placeholder: '\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801 \u4E0D\u533A\u5206\u5927\u5C0F\u5199' })
334
+ )
335
+ )
336
+ ) : ''
194
337
  )
195
338
  );
196
339
  };
@@ -2,14 +2,6 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
 
5
- var _spinLoading = require('antd-mobile/es/components/spin-loading');
6
-
7
- var _spinLoading2 = _interopRequireDefault(_spinLoading);
8
-
9
- var _extends2 = require('babel-runtime/helpers/extends');
10
-
11
- var _extends3 = _interopRequireDefault(_extends2);
12
-
13
5
  var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
14
6
 
15
7
  var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
@@ -51,7 +43,12 @@ var Easy3wMSpin = function (_Component) {
51
43
  return _react2['default'].createElement(
52
44
  'div',
53
45
  { id: 'Easy3wMSpin' },
54
- _react2['default'].createElement(_spinLoading2['default'], (0, _extends3['default'])({ color: 'primary', className: 'spinLoading' }, this.props))
46
+ _react2['default'].createElement('img', { src: 'common/easy3wloading.gif', alt: 'logo', style: { height: '14px', width: '14px' } }),
47
+ _react2['default'].createElement(
48
+ 'div',
49
+ null,
50
+ '\u540E\u53F0\u5904\u7406\u4E2D......'
51
+ )
55
52
  );
56
53
  } else {
57
54
  return '';
@@ -1,15 +1,15 @@
1
1
  #Easy3wMSpin { // 锁屏加载
2
- position: fixed;
3
- background: rgba(255, 255, 255, 0);
4
- top: 0;
5
- bottom: 0;
6
- left: 0;
7
- right: 0;
8
- z-index: 9999;
9
- .spinLoading { // 内容
10
- position: relative;
11
- left: 50%;
12
- top: 50%;
13
- --size: 48px;
14
- }
2
+ position: fixed;
3
+ background: rgba(255, 255, 255, 0);
4
+ top: 0;
5
+ bottom: 0;
6
+ left: 0;
7
+ right: 0;
8
+ z-index: 9999;
9
+ .spinLoading { // 内容
10
+ position: relative;
11
+ left: 50%;
12
+ top: 50%;
13
+ --size: 48px;
14
+ }
15
15
  }
@@ -78,6 +78,7 @@ var Easy3wMUserLayout = function (_PureComponent) {
78
78
  copyrightContent = _props.copyrightContent,
79
79
  headerElem = _props.headerElem,
80
80
  links = _props.links,
81
+ bottomFixed = _props.bottomFixed,
81
82
  rootRedirectPath = _props.rootRedirectPath,
82
83
  routeDataLayout = _props.routeDataLayout,
83
84
  backImg = _props.backImg,
@@ -123,6 +124,7 @@ var Easy3wMUserLayout = function (_PureComponent) {
123
124
  )
124
125
  ),
125
126
  copyRightFlag ? _react2['default'].createElement(_Easy3wMGlobalFooter2['default'], {
127
+ bottomFixed: bottomFixed,
126
128
  links: links,
127
129
  copyright: copyright
128
130
  }) : ''
@@ -1,11 +1,13 @@
1
1
  #Easy3wMUserLayout {
2
- .Easy3wMUserLayoutContent { // 内容
3
- background-color: #f0f2f5;
4
- width: 100%;
5
- min-height: 100%;
6
- background-repeat: no-repeat;
7
- background-position: center;
8
- background-size: 100%;
9
- padding: 40px 0 0 0;
10
- }
2
+ height: 100%;
3
+ .Easy3wMUserLayoutContent { // 内容
4
+ background-color: #f0f2f5;
5
+ width: 100%;
6
+ // min-height: 100%;
7
+ background-repeat: no-repeat;
8
+ background-position: center;
9
+ background-size: 100%;
10
+ padding: 40px 0 0 0;
11
+ flex-grow: 1;
12
+ }
11
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy3wmui",
3
- "version": "0.0.42-beta2",
3
+ "version": "0.0.42-beta21",
4
4
  "description": "easy3wmui components for react",
5
5
  "keywords": [
6
6
  "react",