...
|
...
|
@@ -22,6 +22,7 @@ const isMobile = { |
|
|
const mycurrency = isMobile.any() ? '//m.yohobuy.com/home/mycurrency' : '//www.yohobuy.com/home/currency';
|
|
|
const $tipTmpl = $('<div class="featuretip tip-wrap"><div class="tip"><div class="title"></div><div class="content"></div><a class="button" href="">返回</a></div></div>'); // eslint-disable-line
|
|
|
const $cointipTmpl = $('<div class="feature-coin tip-wrap"><div class="tip"><div class="tip-close">×</div><div class="title"></div><div class="content"></div><div class="bottom-button"><a class="button" href="">去逛逛</a><a class="coin" href=\'' + mycurrency + '?openby:yohobuy={"action":"go.mine"}\'>查看有货币</a></div></div></div>'); // eslint-disable-line
|
|
|
const $tostaTmpl = $('<div class="feature-tosta feature-tosta-wrap"><div class="feature-tosta-content"></div></div>');
|
|
|
|
|
|
let _queryString = function() {
|
|
|
if (!window._jssdkQS) {
|
...
|
...
|
@@ -179,5 +180,34 @@ export default { |
|
|
|
|
|
$('body').append($cointipTmpl);
|
|
|
$cointipTmpl.show();
|
|
|
},
|
|
|
tosta(content, options = {}) {
|
|
|
if (typeof content === 'undefined') {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
let {bottom, paddingX, paddingY, radius, duration} = $.extend({
|
|
|
bottom: '10%',
|
|
|
paddingX: 6,
|
|
|
paddingY: 10,
|
|
|
radius: 3
|
|
|
}, options);
|
|
|
|
|
|
$tostaTmpl.css('bottom', bottom);
|
|
|
$tostaTmpl.find('.feature-tosta-content').html(content).css({
|
|
|
padding: `${paddingY || 6}px ${paddingX || 10}px`,
|
|
|
'border-radius': `${radius}px`
|
|
|
});
|
|
|
|
|
|
if (!this.tostaAppended) {
|
|
|
this.tostaAppended = true;
|
|
|
$('body').append($tostaTmpl);
|
|
|
}
|
|
|
|
|
|
$tostaTmpl.show();
|
|
|
this.tostaTimer && clearTimeout(this.tostaTimer);
|
|
|
this.tostaTimer = setTimeout(function() {
|
|
|
$tostaTmpl.hide();
|
|
|
}, (duration && duration > 0) ? duration : 2000);
|
|
|
}
|
|
|
}; |
...
|
...
|
|