Authored by Rock Zhang

Merge branch 'feature/wap4.3' of git.dev.yoho.cn:web/yohobuy into feature/wap4.3

... ... @@ -1702,6 +1702,15 @@ lazyLoad($('img.lazy'));
$('body').addClass('star-class-body');
function loadIntimacyAvatar(myImage, src) {
var newSrc = '';
myImage.onload = function() {
newSrc = 'background-image:url(' + src + ')';
};
return newSrc;
}
// 日历弹出框显示及粉丝排行榜数据组装
function intimacyData(data) {
var $ul = $('.fan-charts-cont'),
... ... @@ -1712,6 +1721,7 @@ function intimacyData(data) {
style = '',
bgStyle = '',
nowDate = new Date(),
myImage = new Image(),
nowYear = nowDate.getFullYear(),
nowMonth = nowDate.getMonth(),
nowDaysNub = calendar.calculateMonthDays(nowMonth, nowYear);
... ... @@ -1735,8 +1745,9 @@ function intimacyData(data) {
style = '';
}
if (data.fanCharts[i].img !== '') {
bgStyle = 'background-image:url(' + data.fanCharts[i].img + ')';
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 = '';
}
... ... @@ -1853,10 +1864,12 @@ if ($('.home-floor-sign').length > 0) {
}
// 星鲜事点赞事件
$(document).on('click', '.like-ico', function() {
$(document).on('touchstart', '.like-ico', function() {
var $that = $(this),
addString = '';
event.stopPropagation();
$.ajax({
type: 'POST',
url: '/guang/starclass/setPraise',
... ... @@ -2138,12 +2151,14 @@ if ($('.collocation-list').find('li').length === 0) {
}
// 星搭配收藏请求
$(document).on('click', '.collection', function() {
$(document).on('touchstart', '.collection', function() {
var $that = $(this),
$icon = $that.find('.collected-ico');
var type;
event.stopPropagation();
if ($icon.hasClass('collected')) {
type = 'del';
} else {
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -76,12 +76,14 @@ if ($('.collocation-list').find('li').length === 0) {
}
// 星搭配收藏请求
$(document).on('click', '.collection', function() {
$(document).on('touchstart', '.collection', function() {
var $that = $(this),
$icon = $that.find('.collected-ico');
var type;
event.stopPropagation();
if ($icon.hasClass('collected')) {
type = 'del';
} else {
... ...
... ... @@ -16,6 +16,15 @@ lazyLoad($('img.lazy'));
$('body').addClass('star-class-body');
function loadIntimacyAvatar(myImage, src) {
var newSrc = '';
myImage.onload = function() {
newSrc = 'background-image:url(' + src + ')';
};
return newSrc;
}
// 日历弹出框显示及粉丝排行榜数据组装
function intimacyData(data) {
var $ul = $('.fan-charts-cont'),
... ... @@ -26,6 +35,7 @@ function intimacyData(data) {
style = '',
bgStyle = '',
nowDate = new Date(),
myImage = new Image(),
nowYear = nowDate.getFullYear(),
nowMonth = nowDate.getMonth(),
nowDaysNub = calendar.calculateMonthDays(nowMonth, nowYear);
... ... @@ -49,8 +59,9 @@ function intimacyData(data) {
style = '';
}
if (data.fanCharts[i].img !== '') {
bgStyle = 'background-image:url(' + data.fanCharts[i].img + ')';
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 = '';
}
... ... @@ -167,10 +178,12 @@ if ($('.home-floor-sign').length > 0) {
}
// 星鲜事点赞事件
$(document).on('click', '.like-ico', function() {
$(document).on('touchstart', '.like-ico', function() {
var $that = $(this),
addString = '';
event.stopPropagation();
$.ajax({
type: 'POST',
url: '/guang/starclass/setPraise',
... ...
... ... @@ -31,11 +31,11 @@ class StarClassModel
* @param $uid
* @return array
*/
public static function getStarClass($uid)
public static function getStarClass($uid, $appVersion)
{
$result = array();
//头部导航
$result['headTab'] = self::getHeadTab('index');
$result['headTab'] = self::getHeadTab('index', $appVersion);
//组装调资源位URL(获取星潮教室首页数据)
$res['starClassIndex'] = StarClassData::getResourceDataUrl(self::CODE_FLOOR_STARCLASS_INDEX);
... ... @@ -100,11 +100,11 @@ class StarClassModel
* 星专题
* @return array
*/
public static function getspecial()
public static function getspecial($appVersion)
{
$result = array();
//头部导航
$result['headTab'] = self::getHeadTab('special');
$result['headTab'] = self::getHeadTab('special', $appVersion);
//组装资源位获取星潮教室首页数据URL
$data = StarClassData::getResourceData(self::CODE_FLOOR_STARCLASS_SPECIAL);
... ... @@ -139,11 +139,11 @@ class StarClassModel
/**
* 星搭配页面
*/
public static function getCollocation()
public static function getCollocation($appVersion)
{
$result = array();
//头部导航
$result['headTab'] = self::getHeadTab('collocation');
$result['headTab'] = self::getHeadTab('collocation', $appVersion);
return $result;
}
... ... @@ -257,20 +257,20 @@ class StarClassModel
/**
* 获取headTab
*/
public static function getHeadTab($tab)
public static function getHeadTab($tab, $appVersion)
{
$result = array(
array(
'name' => '全部',
'url' => Helpers::url('/guang/starclass/index'),
'url' => Helpers::url('/guang/starclass/index', $appVersion),
),
array(
'name' => '星专题',
'url' => Helpers::url('/guang/starclass/special')
'url' => Helpers::url('/guang/starclass/special', $appVersion)
),
array(
'name' => '星搭配',
'url' => Helpers::url('/guang/starclass/collocation')
'url' => Helpers::url('/guang/starclass/collocation', $appVersion)
),
// array(
// 'name' => '星鲜事',
... ... @@ -403,6 +403,6 @@ class StarClassModel
return $result;
}
}
\ No newline at end of file
... ...
... ... @@ -21,13 +21,16 @@ class StarClassController extends AbstractAction
{
//获取uid
$uid = self::getLoggedUid();
$appVersion = array();
if (!$this->_isApp) {
//设置头部公共导航
$this->setNavHeader('星潮教室', true, false);
}else{
$appVersion = array('app_version'=>1);
}
$this->setTitle('星潮教室');
//调用模型获得星潮教室首页数据
$data = StarClassModel::getStarClass($uid);
$data = StarClassModel::getStarClass($uid, $appVersion);
//渲染模板
$this->_view->display('index', array(
'trendClassHome' => $data,
... ... @@ -44,14 +47,17 @@ class StarClassController extends AbstractAction
{
//获取uid
$uid = self::getLoggedUid();
$appVersion = array();
if (!$this->_isApp) {
//设置头部公共导航
$this->setNavHeader('星潮教室', true, false);
}else{
$appVersion = array('app_version'=>1);
}
$this->setTitle('星潮教室');
//调用模型获得星专题数据
$data = StarClassModel::getspecial();
$data = StarClassModel::getspecial($appVersion);
//渲染模板
$this->_view->display('subject', array(
... ... @@ -68,14 +74,17 @@ class StarClassController extends AbstractAction
{
//获取uid
$uid = self::getLoggedUid();
$appVersion = array();
if (!$this->_isApp) {
//设置头部公共导航
$this->setNavHeader('星潮教室', true, false);
}else{
$appVersion = array('app_version'=>1);
}
$this->setTitle('星潮教室');
//调用模板获得星搭配数据
$data = StarClassModel::getCollocation();
$data = StarClassModel::getCollocation($appVersion);
//渲染模板
$this->_view->display('collocation', array(
... ... @@ -115,16 +124,21 @@ class StarClassController extends AbstractAction
*/
public function topAction()
{
//获取uid
$uid = self::getLoggedUid();
$appVersion = array();
//设置头部公共导航(此处返回键调转星潮教室首页)
$url = Helpers::url('/guang/starclass/index');
if (!$this->_isApp) {
$url = Helpers::url('/guang/starclass/index');
//设置头部公共导航
$this->setNavHeader('星潮粉丝榜', $url, false);
}else{
$appVersion = array('app_version'=>1);
$url = Helpers::url('/guang/starclass/index', $appVersion);
}
$this->setTitle('星潮粉丝榜');
//根据客户端类型,进行未登录跳转
$uid = $this->getLoggedUid();
if (!$uid) {
$refer = Helpers::url('/guang/starclass/top');
if (!$this->_isApp) {
... ...