Authored by 郝肖肖

'有赚申请'

... ... @@ -17,7 +17,7 @@
<div class="account-name" data-type="{{type}}">
{{#if account}}
账号:<em>{{account}}</em>&nbsp;&nbsp;
粉丝:<em>{{fans}}</em>
粉丝:<em data-fans="{{fans}}">{{fans}}</em>
{{/if}}
</div>
</div>
... ...
<div class="dialog-fill-content">
<div class="fill-item">账号:<input type="text" class="account" placeholder="请输入账号昵称" value="{{account}}" /></div>
<div class="fill-item">粉丝数:<input type="text" class="fans" placeholder="请输入粉丝数量" value="{{fans}}" /></div>
<div class="fill-item">粉丝数:<input type="text" class="fans" placeholder="请输入粉丝数量"
onkeyup="value=value.replace(/[^\d]/g,'')" value="{{fans}}" maxlength="9" /></div>
</div>
... ...
... ... @@ -75,14 +75,19 @@ class HaveGainApplyPage extends Page {
hasClass: 'dialog-fill-in',
dialogText: fillInHbs({
account: $accountName.find('em').eq(0).text() || '',
fans: $accountName.find('em').eq(1).text() || ''
fans: $accountName.find('em').eq(1).data('fans') || ''
}),
hasFooter: {
leftBtnText: '取消',
rightBtnText: '去添加'
}
}, function() {
$accountName.html(`账号:<em>${$('.dialog-fill-in .account').val()}</em>&nbsp;&nbsp;粉丝:<em>${$('.dialog-fill-in .fans').val()}</em>`); // eslint-disable-line
let fans = $('.dialog-fill-in .fans').val() || 0;
let fansFix = Math.round((fans / 10000) * 100) / 100; // 保留二个小数
fansFix = fansFix >= 10 ? fansFix + '万' : fans;
$accountName.html(`账号:<em>${$('.dialog-fill-in .account').val()}</em>&nbsp;&nbsp;粉丝:<em data-fans="${fans}">${fansFix}</em>`); // eslint-disable-line
dialog.hideDialog();
$event.text('已填写').addClass('disable');
});
... ... @@ -136,7 +141,7 @@ class HaveGainApplyPage extends Page {
socialMediaList.push({
type: $accountName.data('type'),
account: $accountName.find('em').eq(0).text() || '',
fans: $accountName.find('em').eq(1).text() || ''
fans: $accountName.find('em').eq(1).data('fans') || ''
});
});
... ... @@ -157,7 +162,7 @@ class HaveGainApplyPage extends Page {
}).then(res => {
this.selector.isFlag = false;
if (res.code !== 200) {
if ([200, 613].indexOf(res.code) === -1) {
return tip.show(res.message || '请稍后再试');
}
... ...
import 'activity/have-gain-verify.page.css';
import Page from 'yoho-page';
import $ from 'yoho-jquery';
import tip from 'plugin/tip';
import dialog from 'plugin/dialog';
import yoho from 'yoho-app';
class HaveGainVerifyPage extends Page {
constructor() {
super();
this.view = {
header: $('.user-defined-header')
this.selector = {
$addBtn: $('.esp-go .add-btn')
};
this.init();
}
apply() {
return this.ajax({
url: '/activity/grade/graph'
}).then(res => {
if (res.code !== 200) {
return tip.show(res.message);
init() {
this.bindEvents();
}
bindEvents() {
this.selector.$addBtn.on('click', this.tapAdded.bind(this));
}
tapAdded() {
yoho.invokeMethod('go.copy', {text: '有货有赚'});
dialog.showDialog({
dialogText: '“有货有赚”服务号已经复制,请去微信搜索添加',
hasClass: 'dialog-fill-in',
hasFooter: {
leftBtnText: '取消',
rightBtnText: '去添加'
}
}, function() {
window.location.href = 'weixin://';
});
}
}
... ...
.dialog-wrapper .dialog-fill-in {
background-color: #fff;
.dialog-fill-content {
padding: 0 10px;
margin-top: -20px;
.fill-item {
font-family: PingFang-SC-Regular, sans-serif;
font-size: 28px;
color: #444;
letter-spacing: -0.34px;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
input {
width: 340px;
height: 60px;
line-height: 60px;
border: 0.5px solid #eee;
padding: 0 10px;
}
}
}
... ...
@import "have-gain-dialog";
.have-gain-apply {
background-color: #f0f0f0;
... ... @@ -139,30 +141,3 @@
}
}
.dialog-wrapper .dialog-fill-in {
background-color: #fff;
.dialog-fill-content {
padding: 0 10px;
margin-top: -20px;
.fill-item {
font-family: PingFang-SC-Regular, sans-serif;
font-size: 28px;
color: #444;
letter-spacing: -0.34px;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
input {
width: 340px;
height: 60px;
line-height: 60px;
border: 0.5px solid #eee;
padding: 0 10px;
}
}
}
... ...
@import "have-gain-dialog";
.have-gain-verify {
text-align: center;
... ...