|
@@ -17,6 +17,7 @@ class HaveGainApplyPage extends Page { |
|
@@ -17,6 +17,7 @@ class HaveGainApplyPage extends Page { |
17
|
$apply: $('.have-gain-apply'),
|
17
|
$apply: $('.have-gain-apply'),
|
18
|
$nameInput: $('.section .name'),
|
18
|
$nameInput: $('.section .name'),
|
19
|
$mobileInput: $('.section .mobile'),
|
19
|
$mobileInput: $('.section .mobile'),
|
|
|
20
|
+ $wxInput: $('.section .wechat'),
|
20
|
$fillIn: $('.party-icon-item .fill-in'),
|
21
|
$fillIn: $('.party-icon-item .fill-in'),
|
21
|
$added: $('.other .added'),
|
22
|
$added: $('.other .added'),
|
22
|
$agreement: $('.agreement-section .agreement'),
|
23
|
$agreement: $('.agreement-section .agreement'),
|
|
@@ -127,7 +128,6 @@ class HaveGainApplyPage extends Page { |
|
@@ -127,7 +128,6 @@ class HaveGainApplyPage extends Page { |
127
|
let errStatus = 0;
|
128
|
let errStatus = 0;
|
128
|
let name = $.trim(this.selector.$nameInput.val());
|
129
|
let name = $.trim(this.selector.$nameInput.val());
|
129
|
let mobile = $.trim(this.selector.$mobileInput.val());
|
130
|
let mobile = $.trim(this.selector.$mobileInput.val());
|
130
|
- let wxInput = $('.account-name.required').find('em').length > 0;
|
|
|
131
|
|
131
|
|
132
|
if (name === '') {
|
132
|
if (name === '') {
|
133
|
errStatus = 1;
|
133
|
errStatus = 1;
|
|
@@ -135,8 +135,6 @@ class HaveGainApplyPage extends Page { |
|
@@ -135,8 +135,6 @@ class HaveGainApplyPage extends Page { |
135
|
errStatus = 2;
|
135
|
errStatus = 2;
|
136
|
} else if (!/^1[0-9]{10}$/.test(mobile)) {
|
136
|
} else if (!/^1[0-9]{10}$/.test(mobile)) {
|
137
|
errStatus = 21;
|
137
|
errStatus = 21;
|
138
|
- } else if (!wxInput) {
|
|
|
139
|
- errStatus = 3;
|
|
|
140
|
}
|
138
|
}
|
141
|
|
139
|
|
142
|
if (errStatus) {
|
140
|
if (errStatus) {
|
|
@@ -213,8 +211,6 @@ class HaveGainApplyPage extends Page { |
|
@@ -213,8 +211,6 @@ class HaveGainApplyPage extends Page { |
213
|
tip.show('请输入手机号');
|
211
|
tip.show('请输入手机号');
|
214
|
} else if (errStatus === 21) {
|
212
|
} else if (errStatus === 21) {
|
215
|
tip.show('请输入正确的手机号');
|
213
|
tip.show('请输入正确的手机号');
|
216
|
- } else if (errStatus === 3) {
|
|
|
217
|
- tip.show('请填写微信账号');
|
|
|
218
|
}
|
214
|
}
|
219
|
|
215
|
|
220
|
if (errStatus) {
|
216
|
if (errStatus) {
|
|
@@ -226,15 +222,14 @@ class HaveGainApplyPage extends Page { |
|
@@ -226,15 +222,14 @@ class HaveGainApplyPage extends Page { |
226
|
return tip.show('请勾选《我已阅读并同意》');
|
222
|
return tip.show('请勾选《我已阅读并同意》');
|
227
|
}
|
223
|
}
|
228
|
|
224
|
|
229
|
- this.selector.$fillIn.each((index, event) => {
|
|
|
230
|
- let $accountName = $(event).closest('.party-icon-item').find('.account-name');
|
225
|
+ let wxAccount = $.trim(this.selector.$wxInput.val());
|
231
|
|
226
|
|
|
|
227
|
+ if (wxAccount) {
|
232
|
socialMediaList.push({
|
228
|
socialMediaList.push({
|
233
|
- type: $accountName.data('type'),
|
|
|
234
|
- account: $accountName.find('em').eq(0).text() || '',
|
|
|
235
|
- fans: parseInt(`0${$accountName.find('em').eq(1).data('fans')}`, 10)
|
|
|
236
|
- });
|
229
|
+ type: 1,
|
|
|
230
|
+ account: wxAccount
|
237
|
});
|
231
|
});
|
|
|
232
|
+ }
|
238
|
|
233
|
|
239
|
if (this.selector.isFlag) {
|
234
|
if (this.selector.isFlag) {
|
240
|
return false;
|
235
|
return false;
|
|
@@ -246,13 +241,16 @@ class HaveGainApplyPage extends Page { |
|
@@ -246,13 +241,16 @@ class HaveGainApplyPage extends Page { |
246
|
union.union_type = this.query.union_type;
|
241
|
union.union_type = this.query.union_type;
|
247
|
}
|
242
|
}
|
248
|
|
243
|
|
|
|
244
|
+ if (socialMediaList.length) {
|
|
|
245
|
+ union.socialMediaList = JSON.stringify(socialMediaList);
|
|
|
246
|
+ }
|
|
|
247
|
+
|
249
|
return this.ajax({
|
248
|
return this.ajax({
|
250
|
type: 'post',
|
249
|
type: 'post',
|
251
|
url: `/activity/have-gain/submitApply${window.location.search}`,
|
250
|
url: `/activity/have-gain/submitApply${window.location.search}`,
|
252
|
data: Object.assign({
|
251
|
data: Object.assign({
|
253
|
name: $.trim(this.selector.$nameInput.val()),
|
252
|
name: $.trim(this.selector.$nameInput.val()),
|
254
|
- mobile: $.trim(this.selector.$mobileInput.val()),
|
|
|
255
|
- socialMediaList: JSON.stringify(socialMediaList)
|
253
|
+ mobile: $.trim(this.selector.$mobileInput.val())
|
256
|
}, union)
|
254
|
}, union)
|
257
|
}).then(res => {
|
255
|
}).then(res => {
|
258
|
this.selector.isFlag = false;
|
256
|
this.selector.isFlag = false;
|