Authored by 王水玲

星潮 gulp ge

... ... @@ -1713,13 +1713,16 @@ lazyLoad($('img.lazy'));
$('body').addClass('star-class-body');
function loadIntimacyAvatar(myImage, src) {
var newSrc = '';
function setAvatar($userAvatar) {
var myImage = new Image(),
avatar;
// 部分老用户没有头像,显示默认头像
avatar = $userAvatar.data('avatar');
myImage.src = avatar;
myImage.onload = function() {
newSrc = 'background-image:url(' + src + ')';
$userAvatar.css('background-image', 'url(' + avatar + ')');
};
return newSrc;
}
// 日历弹出框显示及粉丝排行榜数据组装
... ... @@ -1730,7 +1733,6 @@ function intimacyData(data) {
signDay = data.signDay.split(','),
html = '',
style = '',
bgStyle = '',
nowDate = new Date(),
myImage = new Image(),
nowYear = nowDate.getFullYear(),
... ... @@ -1756,17 +1758,9 @@ function intimacyData(data) {
style = '';
}
if (data.fanCharts[i].img !== '' && data.fanCharts[i].img !== null) {
myImage.src = data.fanCharts[i].img;
bgStyle = loadIntimacyAvatar(myImage, data.fanCharts[i].img);
} else {
bgStyle = '';
}
html += '<li>' +
'<i class="rank-ico">' + data.fanCharts[i].num + '</i>' +
'<span data-avatar="' + data.fanCharts[i].img + '" style="' + bgStyle +
'" class="rank-avatar"></span>' +
'<span data-avatar="' + data.fanCharts[i].img + '" class="rank-avatar"></span>' +
'<span class="fans-name">' + data.fanCharts[i].name + '</span>' +
'<div class="fans-intimacy">亲密度<span class="' + style + '">' +
data.fanCharts[i].intimacyNum + '</span></div>' +
... ... @@ -1775,6 +1769,12 @@ function intimacyData(data) {
$ul.html(html);
$('.fan-charts-cont .rank-avatar').each(function(key, item) {
if ($(item).attr('data-avatar') !== '') {
setAvatar($(item));
}
});
$myIntimacy.find('span').html(data.todayIntimacy);
$increased.find('span').html(data.todayIntimacy);
... ... @@ -1948,37 +1948,12 @@ $('.add-intimacy').on('touchstart', function(event) {
// 关闭日历弹出窗事件
$('.pop-intimacy .pop-close, .classroom-mask').on('click', function() {
// $('.pop-intimacy').css({
// zIndex: '-1'
// }).hide();
// $('.classroom-mask').css({
// zIndex: '-1'
// }).hide();
// $('body').css({
// overflow: 'visible'
// });
// location.reload();
history.go(0);
});
function setAvatar() {
var $userAvatar = $('.user-head'),
myImage = new Image(),
avatar;
// 部分老用户没有头像,显示默认头像
avatar = $userAvatar.data('avatar');
myImage.src = avatar;
myImage.onload = function() {
$userAvatar.css('background-image', 'url(' + avatar + ')');
};
}
if ($('.user-head').attr('data-avatar') !== '') {
setAvatar();
setAvatar($('.user-head'));
}
});
define("js/guang/calendar", ["jquery"], function(require, exports, module){
... ... @@ -3943,10 +3918,17 @@ function getUrlParam(name) {
}
$receive.on('click', function() {
var $curDom = $(this);
var $curDom = $(this),
req;
if (getUrlParam('app_version')) {
req = '?app_version=' + getUrlParam('app_version');
} else {
req = '';
}
$.ajax({
url: '/coupon/receiveCoupon',
url: '/coupon/receiveCoupon' + req,
data: {
couponID: $curDom.parents('.coupon-floor').attr('coupon-id')
},
... ... @@ -3954,13 +3936,7 @@ $receive.on('click', function() {
success: function(data) {
var msg = data.msg,
status = data.status,
newUrl;
if (getUrlParam('app-version')) {
newUrl = data.url + '?code=' + getUrlParam('code') + '&app-version=' + getUrlParam('app-version');
} else {
newUrl = data.url + '?code=' + getUrlParam('code');
}
if (data.noLogin === true) {
if ($('#intimacy-link').length <= 0) {
... ... @@ -4015,14 +3991,12 @@ $('.coupon-message-op-rel').on('click', function() {
});
if ($('#noData').length > 0) {
if (location.href.indexOf('?openby:yohobuy=') <= 0){
if (location.href.indexOf('?openby:yohobuy=') <= 0) {
tip.show('网络异常!');
}else{
console.log(location.href.indexOf('?openby:yohobuy='))
}
}
$mask.on('click',function () {
$mask.on('click', function() {
$mask.hide();
$message.hide();
});
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.