Authored by 陈峰

Merge branch 'feature/cps-optimize' into 'gray'

Feature/cps optimize



See merge request !1488
... ... @@ -67,7 +67,13 @@ class HaveGain {
}
];
return req.ctx(haveGainModel).checkApply({uid}).then(result => {
if (req.yoho.isMiniApp) {
uid.appVersion = _.get(global, 'yoho.config.appVersion');
}
const apply = true;
return req.ctx(haveGainModel).checkApply({uid}, apply).then(result => {
let checkUrl = result.data && result.data.checkUrl || '';
if (checkUrl.indexOf('activity/have-gain/apply') === -1) {
... ... @@ -112,6 +118,7 @@ class HaveGain {
width750: true,
localCss: true,
title: '有货有赚',
isApp: req.yoho.isApp,
pageHeader: !req.yoho.isApp && headerModel.setNav({
navTitle: '有货有赚',
navBtn: false
... ...
... ... @@ -16,15 +16,16 @@ module.exports = class extends global.yoho.BaseModel {
let share = (_.get(res[0], 'data.context', '')).match(/\>(\d+)</g);
let gainList = [
{
url: _.get(res[1], 'data.checkUrl', ''),
img: '//img11.static.yhbimg.com/yhb-img01/2018/07/09/10/018092224dc2f48195e3ad15269f981d1f.jpg?imageView2/{mode}/w/{width}/h/{height}', // eslint-disable-line
isShow: false
},
{
url: _.get(res[0], 'data.url', ''),
img: '//img11.static.yhbimg.com/yhb-img01/2018/07/09/10/010d4f185b1a155449966ef12d3ed41490.jpg?imageView2/{mode}/w/{width}/h/{height}', // eslint-disable-line
totalUser: parseInt(_.get(share, '[0]', 0).replace('>', '').replace('<', ''), 10),
totalCouponNum: parseInt(_.get(share, '[1]', 0).replace('>', '').replace('<', ''), 10),
isShow: true
}, {
url: _.get(res[1], 'data.checkUrl', ''),
img: '//img11.static.yhbimg.com/yhb-img01/2018/07/09/10/018092224dc2f48195e3ad15269f981d1f.jpg?imageView2/{mode}/w/{width}/h/{height}', // eslint-disable-line
isShow: false
}
];
... ... @@ -52,14 +53,19 @@ module.exports = class extends global.yoho.BaseModel {
* @param {[type]} params [{uid: 0}]
* @return {[type]} [{}]
*/
checkApply(params) {
checkApply(params, apply) {
return this.get({
data: Object.assign({
method: 'app.union.shareOrder.checkApply'
}, params)
}).then(res => {
let checkStatus = _.get(res, 'data.status', 0);
let checkUrl = helpers.urlFormat('/activity/have-gain/apply', {}); // 未申请
let checkUrl = 'https://activity.yoho.cn/feature/2601.html?&title=有货有赚&openby:yohobuy={"action":"go.h5","params":{"title":"有货有赚","url":"https://activity.yoho.cn/feature/2601.html"}}'; // 中间页
if (apply) {
checkUrl = helpers.urlFormat('/activity/have-gain/apply', {}); // 未申请
}
if (checkStatus === 1) { // 审核中
checkUrl = helpers.urlFormat('/activity/have-gain/verify', {});
... ...
... ... @@ -30,7 +30,7 @@
{{/if}}
</div>
{{/socialMediaList}}
<p class="other">如果您有其他渠道,可以添加我们的服务号“有货有赚”反馈,也可以了解申请状态,<em class="added">点击添加</em></p>
<p class="other">如果您有其他渠道,可以添加我们的服务号“有货有赚”反馈,也可以了解您的申请状态</p>
</div>
<div class="agreement-section">
<div class="agreement">
... ...
<div class="have-gain-verify">
<div class="esp-audit">审核中,请耐心等待</div>
<div class="esp-progress">审核期间您可以参加我们“邀请好友赚现金券”活动。邀请好友越多,不仅审核通过几率越大,且可以<em>无限赚取现金券</em></div>
<div class="esp-go">
<div class="add-btn">去添加</div>
<div class="esp-progress">
<p>审核期间您可以参加我们“邀请好友赚现金券”活动。邀请好</p>
<p>友越多,不仅审核通过几率越大,且可以<em>无限赚取现金券</em></p>
</div>
<div class="review-bg {{#if isApp}}app{{/if}}"></div>
<div class="esp-go">
<div class="add-btn">关注“有货有赚”公众号,了解申请进度</div>
</div>
</div>
... ...
... ... @@ -5,6 +5,7 @@ import tip from 'plugin/tip';
import dialog from 'plugin/dialog';
import fillInHbs from 'activity/have-gain/fill-in.hbs';
import yoho from 'yoho-app';
import parse from 'yoho-qs/parse';
class HaveGainApplyPage extends Page {
constructor() {
... ... @@ -20,6 +21,7 @@ class HaveGainApplyPage extends Page {
$agreement: $('.agreement-section .agreement'),
$applyBtn: $('.apply-btn'),
};
this.query = parse(window.location.search.substr(1));
this.init();
}
... ... @@ -35,7 +37,6 @@ class HaveGainApplyPage extends Page {
this.selector.$mobileInput.on('input', this.changeBtnStatus.bind(this));
this.selector.$fillIn.on('click', that.tapFillIn);
this.selector.$agreement.on('click', that.tapAgreement);
this.selector.$added.on('click', this.tapAdded.bind(this));
this.selector.$applyBtn.on('click', this.apply.bind(this));
}
... ... @@ -44,16 +45,34 @@ class HaveGainApplyPage extends Page {
let jumpUrl = this.selector.$apply.data('url');
if (jump) {
// app内审核通过跳转区分处理
if (yoho.isApp && jumpUrl.indexOf('go.minealliance') > -1) {
// 若指定跳转
if (this.query.passJump === 'Y') {
jumpUrl = `//m.yohobuy.com/?openby:yohobuy={"action":"go.h5","params":{"title":"${this.query.title}","url":"${this.query.jumpUrl}"}}`; // eslint-disable-line
}
$('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);
const jumpFn = () => {
setTimeout(() => {
$('#jump-url')[0].click();
// ios暂不支持go.back关闭前置webview
if (yoho.isAndroid) {
yoho.invokeMethod('go.back');
}
}, 500);
};
if (window.yohoInterface) {
jumpFn();
} else {
yoho.ready(jumpFn);
}
} else {
window.location.href = jumpUrl;
}
... ... @@ -157,7 +176,6 @@ class HaveGainApplyPage extends Page {
}
apply() {
let that = this;
let errStatus = this.changeBtnStatus();
let socialMediaList = [];
... ... @@ -219,10 +237,10 @@ class HaveGainApplyPage extends Page {
dialogText: '请等待工作人员审核,您可以关注“有货有赚”服务号,了解进度',
hasFooter: {
leftBtnText: '取消',
rightBtnText: '去添加'
rightBtnText: '确定'
}
}, function() {
that.awakeWeixin();
window.location.href = '//m.yohobuy.com/activity/have-gain/verify';
}, function() {
window.location.href = '//m.yohobuy.com/activity/have-gain/verify';
});
... ...
... ... @@ -18,9 +18,7 @@ class HaveGainVerifyPage extends Page {
this.bindEvents();
}
bindEvents() {
this.selector.$addBtn.on('click', this.tapAdded.bind(this));
}
bindEvents() {}
tapAdded() {
if (window.yohoInterface) {
... ...
... ... @@ -2,35 +2,57 @@
.have-gain-verify {
text-align: center;
padding-bottom: 140px;
.esp-audit {
font-family: PingFang-SC-Medium, sans-serif;
font-size: 40px;
color: #444;
margin-top: 200px;
margin-top: 40px;
}
.esp-progress {
font-family: PingFangSC-Regular, sans-serif;
font-size: 28px;
font-size: 24px;
color: #b0b0b0;
padding: 20px 60px;
padding: 20px 0;
em {
color: #000;
}
p {
margin: 0 auto;
}
}
.review-bg {
display: inline-block;
width: 750px;
height: 1090px;
background: resolve("activity/have-gain/reviewing.jpg") no-repeat;
background-size: 100% 100%;
}
.esp-go {
position: fixed;
left: 0;
right: 0;
bottom: 0;
height: 140px;
padding: 20px;
background-color: #fff;
}
.add-btn {
font-family: PingFang-SC-Regular, sans-serif;
height: 100px;
border-radius: 8px;
font-family: PingFangSC-Regular, sans-serif;
font-size: 32px;
color: #fff;
text-align: center;
width: 400px;
height: 100px;
letter-spacing: 0;
line-height: 100px;
background-color: #444;
border-radius: 8px;
margin: 30px auto 0;
text-align: center;
background: #d0021b;
}
}
... ...