...
|
...
|
@@ -17,6 +17,7 @@ class HaveGainApplyPage extends Page { |
|
|
$apply: $('.have-gain-apply'),
|
|
|
$nameInput: $('.section .name'),
|
|
|
$mobileInput: $('.section .mobile'),
|
|
|
$wxInput: $('.section .wechat'),
|
|
|
$fillIn: $('.party-icon-item .fill-in'),
|
|
|
$added: $('.other .added'),
|
|
|
$agreement: $('.agreement-section .agreement'),
|
...
|
...
|
@@ -127,7 +128,6 @@ class HaveGainApplyPage extends Page { |
|
|
let errStatus = 0;
|
|
|
let name = $.trim(this.selector.$nameInput.val());
|
|
|
let mobile = $.trim(this.selector.$mobileInput.val());
|
|
|
let wxInput = $('.account-name.required').find('em').length > 0;
|
|
|
|
|
|
if (name === '') {
|
|
|
errStatus = 1;
|
...
|
...
|
@@ -135,8 +135,6 @@ class HaveGainApplyPage extends Page { |
|
|
errStatus = 2;
|
|
|
} else if (!/^1[0-9]{10}$/.test(mobile)) {
|
|
|
errStatus = 21;
|
|
|
} else if (!wxInput) {
|
|
|
errStatus = 3;
|
|
|
}
|
|
|
|
|
|
if (errStatus) {
|
...
|
...
|
@@ -213,8 +211,6 @@ class HaveGainApplyPage extends Page { |
|
|
tip.show('请输入手机号');
|
|
|
} else if (errStatus === 21) {
|
|
|
tip.show('请输入正确的手机号');
|
|
|
} else if (errStatus === 3) {
|
|
|
tip.show('请填写微信账号');
|
|
|
}
|
|
|
|
|
|
if (errStatus) {
|
...
|
...
|
@@ -226,15 +222,14 @@ class HaveGainApplyPage extends Page { |
|
|
return tip.show('请勾选《我已阅读并同意》');
|
|
|
}
|
|
|
|
|
|
this.selector.$fillIn.each((index, event) => {
|
|
|
let $accountName = $(event).closest('.party-icon-item').find('.account-name');
|
|
|
let wxAccount = $.trim(this.selector.$wxInput.val());
|
|
|
|
|
|
if (wxAccount) {
|
|
|
socialMediaList.push({
|
|
|
type: $accountName.data('type'),
|
|
|
account: $accountName.find('em').eq(0).text() || '',
|
|
|
fans: parseInt(`0${$accountName.find('em').eq(1).data('fans')}`, 10)
|
|
|
});
|
|
|
type: 1,
|
|
|
account: wxAccount
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (this.selector.isFlag) {
|
|
|
return false;
|
...
|
...
|
@@ -246,13 +241,16 @@ class HaveGainApplyPage extends Page { |
|
|
union.union_type = this.query.union_type;
|
|
|
}
|
|
|
|
|
|
if (socialMediaList.length) {
|
|
|
union.socialMediaList = JSON.stringify(socialMediaList);
|
|
|
}
|
|
|
|
|
|
return this.ajax({
|
|
|
type: 'post',
|
|
|
url: `/activity/have-gain/submitApply${window.location.search}`,
|
|
|
data: Object.assign({
|
|
|
name: $.trim(this.selector.$nameInput.val()),
|
|
|
mobile: $.trim(this.selector.$mobileInput.val()),
|
|
|
socialMediaList: JSON.stringify(socialMediaList)
|
|
|
mobile: $.trim(this.selector.$mobileInput.val())
|
|
|
}, union)
|
|
|
}).then(res => {
|
|
|
this.selector.isFlag = false;
|
...
|
...
|
|