Authored by 王水玲

分期埋点

... ... @@ -65,23 +65,22 @@ const _reviewStatus = (res, req, uid, status) => {
};
// 还款列表公共处理块
const _repaymentList = (req, res, title, params) => {
const _repaymentList = (req, res, opt, params) => {
params = _.assign({
uid: req.cookies.installmentUid || 1
}, params);
installmentModel.getQueryAmtList(params).then((result) => {
res.render('installment/repayment-list', {
res.render('installment/repayment-list', _.assign({
module: 'home',
page: 'repayment-list',
isInstallmentPage: true,
title: title,
data: result
});
}, opt));
}).catch(() => {
_serverCrash(res, {
url: req.originalUrl,
title: title
title: opt.title
});
});
};
... ... @@ -193,28 +192,40 @@ const review = (req, res) => {
// 逾期未还款列表
const overdueList = (req, res) => {
_repaymentList(req, res, '逾期未还金额', {
_repaymentList(req, res, {
title: '逾期未还金额',
posId: 1
}, {
queryDays: -1
});
};
// 7日待还款列表
const sevenDayList = (req, res) => {
_repaymentList(req, res, '近7日待还款', {
_repaymentList(req, res, {
title: '近7日待还款',
posId: 2
}, {
queryDays: 7
});
};
// 本月待还款列表
const monthRepayList = (req, res) => {
_repaymentList(req, res, '本月待还金额', {
_repaymentList(req, res, {
title: '本月待还金额',
posId: 3
}, {
queryDays: 30
});
};
// 待还总金额列表
const totalRepayList = (req, res) => {
_repaymentList(req, res, '待还总金额', {
_repaymentList(req, res, {
title: '待还总金额',
posId: 4
}, {
queryDays: 0
});
};
... ... @@ -225,7 +236,8 @@ const repayRecordPage = (req, res) => {
module: 'home',
page: 'repay-record',
isInstallmentPage: true,
title: '还款记录'
title: '还款记录',
posId: 5
});
};
... ... @@ -256,8 +268,11 @@ const getRepayRecord = (req, res) => {
// 账号管理
const account = (req, res) => {
res.render('installment/account', {
module: 'home',
page: 'account',
title: '账号管理',
isInstallmentPage: true
isInstallmentPage: true,
posId: 7
});
};
... ... @@ -366,7 +381,8 @@ const orderIndex = (req, res) => {
page: 'installment.order',
title: '我的分期订单',
navBtn: false,
isInstallmentPage: true
isInstallmentPage: true,
posId: 6
});
};
... ...
<div class="account-page">
<div class="account-page" data-pos-id="{{posId}}">
<ul class="account-list">
<li><a href="/home/installment/bank-card">我的银行卡:<div class="list-right"><span class="iconfont">&#xe604;</span></div></a></li>
</ul>
... ...
<div class="installment-page installment-bg" is-open={{notOpen}}>
<div class="installment-page installment-bg">
{{#if notOpen}}
<input type="hidden" value="false" class="is-open">
{{# bannerTop}}
{{> resources/banner-top}}
{{/ bannerTop}}
... ... @@ -26,6 +27,7 @@
{{> installment/installment-only}}
{{/ installmentOnly}}
{{else}}
<input type="hidden" value="true" class="is-open">
<div class="detail-tab">
<span class="on is-repay">待还款金额</span>
<span class="is-usable">可用额度</span>
... ... @@ -35,19 +37,19 @@
<p class="detail-txt1">近7日待还款</p>
<p class="detail-txt1">¥<span class="detail-txt2">{{dayAmt}}</span></p>
{{#if isOverdue}}
<p class="detail-txt3">您有¥{{overAmt}}已逾期,点击<a href="/home/installment/repay/overdue">查看详情</a></p>
<p class="detail-txt3">您有¥{{overAmt}}已逾期,点击<a href="/home/installment/repay/overdue" class="nav-bit" data-id="1">查看详情</a></p>
{{/if}}
<a href="/home/installment/repay/7daylist" class="see-btn">明细</a>
<a href="/home/installment/repay/7daylist" class="see-btn nav-bit" data-id="2">明细</a>
</div>
<ul class="group-list">
<li><a href="/home/installment/repay/month">本月待还金额:<div class="list-right"><span class="list-r-txt">¥{{monthAmt}}</span><span class="iconfont"> &#xe604;</span></div></a></li>
<li><a href="/home/installment/repay/total">待还总金额:<div class="list-right"><span class="list-r-txt">¥{{totalAmt}}</span><span class="iconfont"> &#xe604;</span></div></a></li>
<li><a href="/home/installment/repay/record">还款记录:<div class="list-right iconfont">&#xe604;</div></a></li>
<li><a href="/home/installment/order">分期订单:<div class="list-right iconfont">&#xe604;</div></a></li>
<li><a href="/home/installment/repay/month" class="nav-bit" data-id="3">本月待还金额:<div class="list-right"><span class="list-r-txt">¥{{monthAmt}}</span><span class="iconfont"> &#xe604;</span></div></a></li>
<li><a href="/home/installment/repay/total" class="nav-bit" data-id="4">待还总金额:<div class="list-right"><span class="list-r-txt">¥{{totalAmt}}</span><span class="iconfont"> &#xe604;</span></div></a></li>
<li><a href="/home/installment/repay/record" class="nav-bit" data-id="5">还款记录:<div class="list-right iconfont">&#xe604;</div></a></li>
<li><a href="/home/installment/order" class="nav-bit" data-id="6">分期订单:<div class="list-right iconfont">&#xe604;</div></a></li>
</ul>
<ul class="group-list">
<li><a href="/home/installment/account">账户管理:<span class="list-right iconfont">&#xe604;</span></a></li>
<li><a href="/home/installment/account" class="nav-bit" data-id="7">账户管理:<span class="list-right iconfont">&#xe604;</span></a></li>
</ul>
</div>
<div class="usable installment-cont">
... ...
<div class="repayment-list-page installment-order-page yoho-page">
<div class="repayment-list-page installment-order-page yoho-page" data-pos-id="{{posId}}">
{{> resources/banner-top}}
<ul class="header-tab">
<li class="active">
... ...
<div class="repayment-list-page">
<div class="repayment-list-page" data-pos-id="{{posId}}">
<ul class="record-list"></ul>
<div class="no-result" style="display: none;">
<i class="result-icon"></i>
... ...
<div class="repayment-list-page yoho-page">
<div class="repayment-list-page yoho-page" data-pos-id="{{posId}}">
{{#data}}
{{#if isNoResult}}
<div class="no-result">
... ...
var $ = require('yoho-jquery');
var bp = require('./burying-point');
setTimeout(function() {
// 统计:各模块的落地页进入时
bp.setContYas({
POS_ID: $('.account-page').data('posId')
}, true);
}, 3000);
... ...
require('../common');
function setContYas(params, flag) {
params = $.extend({
C_ID: window.queryString.yh_channel || window.cookie('yhChannel')
}, params);
if (window._yas && window._yas.sendCustomInfo) {
window._yas.sendCustomInfo(params, flag);
}
}
function countGoodsId() {
var idStr = '';
$('.installment-only .good-info').each(function(key, item) {
if (key !== 0) {
idStr += ',';
}
idStr += $(item).data('id');
});
return idStr;
}
exports.setContYas = setContYas;
exports.countGoodsId = countGoodsId;
... ...
... ... @@ -7,6 +7,7 @@
var $ = require('yoho-jquery'),
tip = require('../plugin/tip'),
bp = require('./burying-point'),
loading = require('../plugin/loading');
var ListData = function(opt) {
... ... @@ -73,6 +74,16 @@ ListData.prototype.getListData = function(page) {
if (self.opt.noResult) {
$('.no-result').hide();
}
if (!self.opt.noResult) { // 有商品列表
// 统计:商品翻页时
bp.setContYas({
PRD_NUM: $('.installment-only .good-info').length,
PRD_ID: bp.countGoodsId(),
ACTION_ID: 0,
REC_ID: self.opt.uuid
}, true);
}
}
if ($('.good-detail-text').length > 0) {
... ...
var $ = require('yoho-jquery');
var debounce = require('lodash/debounce');
var loading = require('../plugin/loading');
var bp = require('./burying-point');
var hasEnd = false;
var search = {
pageIndex: 1,
... ... @@ -78,7 +79,6 @@ var scrollFn = debounce(function() {
lastScrollTop = scrollTop;
}, 100);
/**
* 顶部TAB
*/
... ... @@ -118,3 +118,10 @@ $(window).scroll(function() {
loading.hideLoadingMask();
});
})());
setTimeout(function() {
// 统计:各模块的落地页进入时
bp.setContYas({
POS_ID: $('.installment-order-page').data('posId')
}, true);
}, 3000);
... ...
var $ = require('yoho-jquery'),
ellipsis = require('yoho-mlellipsis'),
ListData = require('./installment-goods'),
bp = require('./burying-point'),
uuid = require('uuid'),
lazyLoad = require('yoho-jquery-lazyload');
var uuidVal = uuid.v4();
require('../common');
lazyLoad($('img.lazy'));
ellipsis.init();
new ListData({
url: '/home/installment/get-goods',
page: 1,
boxArea: $('#goods-list')
});
// 标题限制行数
function setDetailText() {
var $this, $title;
... ... @@ -25,23 +25,82 @@ function setDetailText() {
});
}
// 商品列表翻页加载数据
new ListData({
url: '/home/installment/get-goods',
page: 1,
boxArea: $('#goods-list'),
uuid: uuidVal
});
setDetailText();
// 已开通tab 切换
$('.detail-tab span').on('click', function() {
var labId = 1;
$(this).addClass('on').siblings().removeClass('on');
$('.installment-cont').hide().eq($(this).index()).show();
if ($(this).index() === 1) {
setDetailText();
labId = 2;
}
});
if (window._yas && window._yas.sendCustomInfo) {
window._yas.sendCustomInfo({
C_ID: window.queryString.yh_channel,
IS_OPEN: $('.installment-page').data('isOpen')
// 统计:开通成功后首页头部tab切换
bp.setContYas({
LAB_ID: labId
}, true);
}
});
// 统计:开通按钮点击时
$('.open-btn').on('click', function() {
bp.setContYas({}, false);
});
$(document).on('click', '.good-info', function() {
// 统计:商品点击时
bp.setContYas({
PRD_NUM: parseInt($(this).index()) + 1,
PRD_ID: $(this).data('id'),
ACTION_ID: 1,
REC_ID: uuidVal
}, false);
});
// 统计:开通后模块位点击时
$('.nav-bit').on('click', function() {
bp.setContYas({
POS_ID: $(this).data('id')
}, false);
});
setTimeout(function() {
if ($('.installment-only').length > 0) {
// 统计:进入页面时
bp.setContYas({
IS_OPEN: $('.is-open').val()
}, true);
// 统计:商品第一页加载时
bp.setContYas({
PRD_NUM: $('.installment-only .good-info').length,
PRD_ID: bp.countGoodsId(),
ACTION_ID: 0,
REC_ID: uuidVal
}, true);
if ($('.is-open').val() === 'true') {
// 统计:待还款金额默认页面加载时
bp.setContYas({
LAB_ID: 1
}, true);
}
}
}, 3000);
window.setCookie('installmentUid', window.queryString.uid);
window.setCookie('yhChannel', window.queryString.yh_channel);
... ...
var $ = require('yoho-jquery');
var tip = require('../plugin/tip');
var bp = require('./burying-point');
var Timer = function() {
this.counter = 0;
... ... @@ -59,7 +60,6 @@ const clearVerifyCode = function() {
$('#sns-check-code').val('');
};
checkCard(formModel);
/**
... ... @@ -203,6 +203,9 @@ $('#apply-button').click(function() {
return false;
}
// 统计:点击下一步按钮时
bp.setContYas({}, true);
$.ajax({
method: 'get',
async: false,
... ... @@ -242,6 +245,12 @@ $('#apply-button').click(function() {
};
if (result.code === 200 && result.data) {
if (parseInt(result.data.status) === 2) {
// 统计:开通成功时
bp.setContYas({}, true);
}
that.attr('href', location.pathname + '?openby:yohobuy=' + encodeURIComponent(JSON.stringify(params)));
ret = true;
} else if (result.code === 500) {
... ... @@ -279,3 +288,8 @@ $('#agreements').click(function() {
});
require('./overdue-notice');
setTimeout(function() {
// 统计:进入开通分期表单页面时
bp.setContYas({}, true);
}, 3000);
... ...
var bp = require('./burying-point');
var $notice = $('.installment-overdue-notice');
$('.repay-list .notice').on('click', function() {
$notice.show();
// 统计:点击逾期说明时
bp.setContYas({}, true);
return false;
});
... ...
... ... @@ -5,7 +5,8 @@
*/
var $ = require('yoho-jquery'),
ListData = require('./installment-goods');
ListData = require('./installment-goods'),
bp = require('./burying-point');
var listData = new ListData({
url: '/home/installment/repay/get-record',
... ... @@ -15,3 +16,10 @@ var listData = new ListData({
});
listData.getListData(0);
setTimeout(function() {
// 统计:各模块的落地页进入时
bp.setContYas({
POS_ID: $('.repayment-list-page').data('posId')
}, true);
}, 3000);
... ...
... ... @@ -6,7 +6,8 @@
var $ = require('yoho-jquery'),
Repayment = require('./repayment'),
tip = require('../plugin/tip');
tip = require('../plugin/tip'),
bp = require('./burying-point');
var CHECKBOX_SELECTOR = '.repay-list input';
var repayment = new Repayment({
... ... @@ -72,3 +73,10 @@ $(CHECKBOX_SELECTOR + ':checkbox').click(function() {
});
repayment.update();
setTimeout(function() {
// 统计:各模块的落地页进入时
bp.setContYas({
POS_ID: $('.repayment-list-page').data('posId')
}, true);
}, 3000);
... ...