Authored by 陈峰

Merge branch 'feature/union-apply' into 'release/6.7.9'

Feature/union apply

有赚优化

See merge request !1556
... ... @@ -37,34 +37,6 @@ class HaveGain {
account: '',
required: true,
fans: 0
},
{
name: '微信订阅号',
icon: '//cdn.yoho.cn/m-yohobuy-node/assets/img/weixin@2x.png',
type: 2,
account: '',
fans: 0
},
{
name: '抖音',
icon: '//cdn.yoho.cn/m-yohobuy-node/assets/img/douyin@2x.png',
type: 3,
account: '',
fans: 0
},
{
name: '微博',
icon: '//cdn.yoho.cn/m-yohobuy-node/assets/img/weibo@2x.png',
type: 4,
account: '',
fans: 0
},
{
name: 'Instagram',
icon: '//cdn.yoho.cn/m-yohobuy-node/assets/img/ins@2x.png',
type: 5,
account: '',
fans: 0
}
];
... ...
... ... @@ -4,33 +4,10 @@
<div class="apply-title">基本信息</div>
<ul class="section-ul">
<li><span>姓名</span><input type="text" class="name" placeholder="请输入姓名" /></li>
<li class="border-node"><span>手机号码</span><input type="number" class="mobile" placeholder="请输入手机号码" /></li>
<li><span>手机号码</span><input type="number" class="mobile" placeholder="请输入手机号码" /></li>
<li><span>微信号</span><input type="text" class="wechat" placeholder="请输入微信号(选填)" /></li>
</ul>
</div>
<div class="section">
<div class="apply-title">完善信息</div>
{{#socialMediaList}}
<div class="party-icon-item">
<div class="public-info-section">
<img class="public-icon" src="{{icon}}" />
<div class="personal">
<div class="public-name">{{name}}</div>
<div class="account-name {{#if required}}required{{/if}}" data-type="{{type}}">
{{#if account}}
账号:<em>{{account}}</em>&nbsp;&nbsp;
粉丝:<em data-fans="{{fans}}">{{fans}}</em>
{{/if}}
</div>
</div>
</div>
{{#if account}}
<div class="fill-in disable">已填写</div>
{{else}}
<div class="fill-in">填写</div>
{{/if}}
</div>
{{/socialMediaList}}
<p class="other">如果您有其他渠道,可以添加我们的服务号“有货有赚”反馈,也可以了解您的申请状态<em class="added">点击添加</em></p>
<p class="other">提供微信号,方便邀您加入达人微信群,赚钱秘籍、特殊福利享不停!添加关注公众号“有货有赚”,申请状态、高佣活动早知道。<em class="added">点击添加</em></p>
</div>
<div class="agreement-section">
<div class="agreement">
... ...
... ... @@ -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;
... ...
@import "have-gain-dialog";
body {
background-color: #fff;
}
.have-gain-apply {
background-color: #f0f0f0;
... ... @@ -35,10 +39,6 @@
}
}
li.border-node {
border: none;
}
.party-icon-item {
display: flex;
flex-direction: row;
... ... @@ -114,6 +114,10 @@
}
.agreement-section {
position: fixed;
bottom: 0;
left: 0;
right: 0;
margin: 30px 30px 0;
padding-bottom: 30px;
... ... @@ -149,7 +153,7 @@
height: 100px;
line-height: 100px;
background-color: #d0021b;
border-radius: 10px;
border-radius: 4px;
color: #fff;
text-align: center;
}
... ...