...
|
...
|
@@ -12,6 +12,7 @@ class HaveGainApplyPage extends Page { |
|
|
|
|
|
this.selector = {
|
|
|
isFlag: false,
|
|
|
$apply: $('.have-gain-apply'),
|
|
|
$nameInput: $('.section .name'),
|
|
|
$mobileInput: $('.section .mobile'),
|
|
|
$fillIn: $('.party-icon-item .fill-in'),
|
...
|
...
|
@@ -29,6 +30,7 @@ class HaveGainApplyPage extends Page { |
|
|
bindEvents() {
|
|
|
let that = this;
|
|
|
|
|
|
this.jumpVerify();
|
|
|
this.selector.$nameInput.on('input', this.changeBtnStatus.bind(this));
|
|
|
this.selector.$mobileInput.on('input', this.changeBtnStatus.bind(this));
|
|
|
this.selector.$fillIn.on('click', that.tapFillIn);
|
...
|
...
|
@@ -37,6 +39,27 @@ class HaveGainApplyPage extends Page { |
|
|
this.selector.$applyBtn.on('click', this.apply.bind(this));
|
|
|
}
|
|
|
|
|
|
jumpVerify() {
|
|
|
let jump = this.selector.$apply.data('jump');
|
|
|
let jumpUrl = this.selector.$apply.data('url');
|
|
|
|
|
|
if (jump) {
|
|
|
if (yoho.isApp && jumpUrl.indexOf('go.minealliance') > -1) {
|
|
|
$('body').append('<a id="jump-url" href="javascript:;" style="display: none;"></a>');
|
|
|
$('#jump-url').attr('href', jumpUrl);
|
|
|
|
|
|
setTimeout(() => {
|
|
|
if (window.yohoInterface) {
|
|
|
yoho.invokeMethod('go.back');
|
|
|
}
|
|
|
$('#jump-url')[0].click();
|
|
|
}, 500);
|
|
|
} else {
|
|
|
window.location.href = jumpUrl;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
changeBtnStatus() {
|
|
|
let errStatus = 0;
|
|
|
let name = $.trim(this.selector.$nameInput.val());
|
...
|
...
|
@@ -104,7 +127,9 @@ class HaveGainApplyPage extends Page { |
|
|
tapAdded() {
|
|
|
let that = this;
|
|
|
|
|
|
yoho.invokeMethod('go.copy', {text: '有货有赚'});
|
|
|
if (window.yohoInterface) {
|
|
|
yoho.invokeMethod('go.copy', {text: '有货有赚'});
|
|
|
}
|
|
|
dialog.showDialog({
|
|
|
dialogText: '“有货有赚”服务号已经复制,请去微信搜索添加',
|
|
|
hasClass: 'dialog-text-apply',
|
...
|
...
|
@@ -171,7 +196,7 @@ class HaveGainApplyPage extends Page { |
|
|
|
|
|
return this.ajax({
|
|
|
type: 'post',
|
|
|
url: '/activity/have-gain/submitApply',
|
|
|
url: `/activity/have-gain/submitApply${window.location.search}`,
|
|
|
data: {
|
|
|
name: $.trim(this.selector.$nameInput.val()),
|
|
|
mobile: $.trim(this.selector.$mobileInput.val()),
|
...
|
...
|
@@ -184,7 +209,10 @@ class HaveGainApplyPage extends Page { |
|
|
return tip.show(res.message || '请稍后再试');
|
|
|
}
|
|
|
|
|
|
yoho.invokeMethod('go.copy', {text: '有货有赚'});
|
|
|
if (window.yohoInterface) {
|
|
|
yoho.invokeMethod('go.copy', {text: '有货有赚'});
|
|
|
}
|
|
|
|
|
|
dialog.showDialog({
|
|
|
hasHeader: '申请成功',
|
|
|
hasClass: 'dialog-text-apply',
|
...
|
...
|
|