...
|
...
|
@@ -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) {
|
...
|
...
|
@@ -205,6 +203,7 @@ class HaveGainApplyPage extends Page { |
|
|
apply() {
|
|
|
let errStatus = this.changeBtnStatus();
|
|
|
let socialMediaList = [];
|
|
|
let union = {};
|
|
|
|
|
|
if (errStatus === 1) {
|
|
|
tip.show('请输入姓名');
|
...
|
...
|
@@ -212,8 +211,6 @@ class HaveGainApplyPage extends Page { |
|
|
tip.show('请输入手机号');
|
|
|
} else if (errStatus === 21) {
|
|
|
tip.show('请输入正确的手机号');
|
|
|
} else if (errStatus === 3) {
|
|
|
tip.show('请填写微信账号');
|
|
|
}
|
|
|
|
|
|
if (errStatus) {
|
...
|
...
|
@@ -225,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;
|
...
|
...
|
@@ -241,14 +237,21 @@ class HaveGainApplyPage extends Page { |
|
|
|
|
|
this.selector.isFlag = true;
|
|
|
|
|
|
if (this.query.union_type) {
|
|
|
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: {
|
|
|
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;
|
|
|
|
...
|
...
|
|