Authored by 李奇

yas上报添加

... ... @@ -62,6 +62,13 @@ export default class Resource extends React.Component {
query = queryString.parse(url.split('?')[1]);
delete query['openby:yohobuy'];
// fix 中文编码
Object.keys(query).map(qk => {
if (/[\u4e00-\u9fa5]/.test(query[qk])) {
query[qk] = encodeURIComponent(query[qk]);
}
});
return `${domain}?${queryString.stringify(query)}`;
};
... ...
... ... @@ -176,6 +176,12 @@ export default class wheelSurf extends PureComponent {
delete query['openby:yohobuy'];
// fix 中文编码
Object.keys(query).map(qk => {
if (/[\u4e00-\u9fa5]/.test(query[qk])) {
query[qk] = encodeURIComponent(query[qk]);
}
});
conf[key] = `${url}?${queryString.stringify(query)}`;
});
};
... ... @@ -403,7 +409,7 @@ export default class wheelSurf extends PureComponent {
return (
<div className="home-wrap">
<img className="main-bg" src={conf.main_bg}/>
<img className="main-bg" src={`${conf.main_bg}?imageMogr2/format/jpg`}/>
{conf.rule_btn_bg ? (<a data-type="other" data-url={conf.rule_url} onClick={this.jump}>
<img className="rule-btn" src={conf.rule_btn_bg}/>
</a>) : ''}
... ...
... ... @@ -69,7 +69,6 @@ export default class Prize extends PureComponent {
let {showModal, modalTip, modalBtnText, pending} = this.state;
let backUrl = `${document.location.protocol}//${document.location.host}${config.routerPath[config.currentApp]}/home.html?actId=${yaSDK.getQueryObj().actId}`;
console.log(backUrl)
let couponLink = 'https://m.yohobuy.com/home/coupons?openby:yohobuy={"action":"go.coupon"}';
let redEnvelopeLink = 'https://activity.yoho.cn/feature/3221.html?title=我的红包&openby:yohobuy={"action":"go.mineredpackage"}';
... ...
... ... @@ -78,8 +78,43 @@
}
</style>
<div id="root"></div>
<script async="" src="//cdn.yoho.cn/yas-jssdk/2.4.18/yas.js"></script>
<script>
var _hmt = _hmt || [];
(function(w, d, s, j, f) {
var a = d.createElement(s);
var m = d.getElementsByTagName(s)[0];
w.YohoAcquisitionObject = f;
w[f] = function() {
w[f].p = arguments;
};
a.async = 1;
a.src = j;
m.parentNode.insertBefore(a, m);
}(window, document, 'script', (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//cdn.yoho.cn/yas-jssdk/2.4.18/yas.js', '_yas'));
function queryString() {
var vars = {},
hash,
i;
var hashes = window.location.search.slice(1).split('&');
for (i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
vars[hash[0]] = hash[1];
}
return vars;
}
var uid = queryString().uid || 0;
window._ozuid = uid; // 暴露ozuid
if (window._yas) {
window._yas(1 * new Date(), '2.4.18', 'yohobuy_m', uid, '', '');
}
(function() {
var hm = document.createElement('script');
... ...