Authored by 王水玲

新潮教室代码合并

21.3 KB | W: | H:

21.7 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

17.3 KB | W: | H:

17.1 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -76,7 +76,7 @@ if ($('.collocation-list').find('li').length === 0) {
}
// 星搭配收藏请求
$(document).on('touchstart', '.collection', function() {
$(document).on('touchstart', '.collection', function(event) {
var $that = $(this),
$icon = $that.find('.collected-ico');
... ...
... ... @@ -89,8 +89,12 @@ function intimacyData(data) {
$('.increased').hide();
}
$('.pop-intimacy').show();
$('.classroom-mask').show();
$('.pop-intimacy').css({
zIndex: '10'
}).show();
$('.classroom-mask').css({
zIndex: '9'
}).show();
$('body').css({
overflow: 'hidden'
});
... ... @@ -178,7 +182,7 @@ if ($('.home-floor-sign').length > 0) {
}
// 星鲜事点赞事件
$(document).on('touchstart', '.like-ico', function() {
$(document).on('touchstart', '.like-ico', function(event) {
var $that = $(this),
addString = '';
... ... @@ -216,8 +220,9 @@ $(document).on('touchstart', '.like-ico', function() {
});
// 增加亲密度请求
$('.add-intimacy').on('touchstart', function() {
$('.add-intimacy').on('touchstart', function(event) {
event.stopPropagation();
event.preventDefault();
$.ajax({
type: 'GET',
... ... @@ -231,7 +236,7 @@ $('.add-intimacy').on('touchstart', function() {
if (code === 201) {
if ($('#intimacy-link').length <= 0) {
$('body').append('<a href="' + data.data + '" style="display:none;" id="intimacy-link">' +
$('body').append('<a href=\'' + data.data + '\' style="display:none;" id="intimacy-link">' +
'<span class="intimacy-link"></span></a>');
}
... ... @@ -246,8 +251,12 @@ $('.add-intimacy').on('touchstart', function() {
// 关闭日历弹出窗事件
$('.pop-intimacy .pop-close, .classroom-mask').on('click', function() {
$('.pop-intimacy').hide();
$('.classroom-mask').hide();
$('.pop-intimacy').css({
zIndex: '-1'
}).hide();
$('.classroom-mask').css({
zIndex: '-1'
}).hide();
$('body').css({
overflow: 'visible'
... ...
.yoho-header .nav-title {
font-weight: normal;
}
... ... @@ -47,7 +49,7 @@
right: 0;
top: 0;
bottom: 0;
z-index: 9;
z-index: -1;
display: none;
}
... ... @@ -320,7 +322,7 @@
position: fixed;
top:20rem / $pxConvertRem;
left: 30rem / $pxConvertRem;
z-index: 10;
z-index: -1;
display: none;
.intimacy-head {
... ... @@ -731,7 +733,7 @@
}
.cont-txt {
font-size: 30rem / $pxConvertRem;
font-size: 28rem / $pxConvertRem;
line-height: 46rem / $pxConvertRem;
color: #b0b0b0;
margin-top: 10rem / $pxConvertRem;
... ... @@ -747,11 +749,17 @@
}
.title {
font-size: 42rem / $pxConvertRem;
font-size: 40rem / $pxConvertRem;
line-height: 48rem / $pxConvertRem;
a {
color: #fff;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
... ...
... ... @@ -47,7 +47,7 @@
right: 0;
top: 0;
bottom: 0;
z-index: 9;
z-index: -1;
display: none;
}
... ... @@ -320,7 +320,7 @@
position: fixed;
top:20px;
left: 30px;
z-index: 10;
z-index: -1;
display: none;
.intimacy-head {
... ...
... ... @@ -27,7 +27,7 @@
<span data-avatar="{{img}}" class="rank-avatar"></span>
<div class="ranking-mid">
<i class="rank-ico">{{num}}</i>
<p class="rank-name">{{userName}}</p>
<p class="rank-name">{{name}}</p>
</div>
<div class="ranking-rg">亲密度<span class="intimacy {{#if @first}}font-bold{{/if}}">{{intimacyNum}}</span></div>
</li>
... ...
... ... @@ -17,7 +17,7 @@
</div>
<div class="fan-charts">
<h2>新潮粉丝榜</h2>
<a href="/guang/starclass/top" class="arrow iconfont">&#xe614;</a>
<a href="{{topUrl}}" class="arrow iconfont">&#xe614;</a>
</div>
<ul class="fan-charts-cont">
<!-- {{#each fanCharts}}
... ...
... ... @@ -91,6 +91,8 @@ class StarClassModel
if (isset($data['starClassIndex']) && !empty($data['starClassIndex'])) {
array_splice($result['resources'], 1, 0 ,$rankInfo);
}
//top100链接
$result['topUrl'] = Helpers::url('/guang/starclass/top');
return $result;
}
... ... @@ -168,7 +170,6 @@ class StarClassModel
$collocationList[$key]['content'] = $value['intro'];
$collocationList[$key]['time'] = $value['publish_time'];
$collocationList[$key]['seeNum'] = $value['views_num'];
$collocationList[$key]['zanNum'] = $value['praise_num'];
$collocationList[$key]['articleId'] = $value['id'];
//string转bool值
$collocationList[$key]['isLiked'] = $value['isPraise'] == 'Y' ? true : false;
... ... @@ -228,14 +229,13 @@ class StarClassModel
$data = StarClassData::sign($uid);
$result = array();
$result['signDay'] = '';
//处理签到数据
if (isset($data['code']) && $data['code'] == 200) {
$result['signDay'] = '';
foreach ($data['data']['logs'] as $key => $value) {
$result['signDay'] .= !empty($value['createTime']) ? date('d', $value['createTime']) . ',' : '';
$result['todayIntimacy'] = $value['addNum'];
}
$result['topUrl'] = Helpers::url('/guang/starclass/top');
$result['intimacyNum'] = isset($data['data']['addNum']) ? $data['data']['addNum'] : '0';
foreach ($data['data']['rankList'] as $key => $value) {
//排名数据按数组顺序排列
... ... @@ -248,9 +248,10 @@ class StarClassModel
if (!empty($result)) {
return array('code'=>200, 'data'=>$result);
}else{
return array('code'=>201, 'message'=>'签到失败');
}
return;
}
... ...
... ... @@ -20,29 +20,26 @@ class StarClassController extends AbstractAction
public function indexAction()
{
//获取uid
$uid = $this->getLoggedUid();
$uid = $this->getLoggedUid() ? $this->getLoggedUid() : $this->getCookie('uid');
if (!$this->_isApp) {
if ($uid) {
$this->setCookie('uid', $uid);
}else{
$this->setCookie('uid', '', time() - 3600);
}
}else{
$this->setCookie('isApp',true);
if ($uid) {
$this->setCookie('uid', $uid);
}else{
$this->setCookie('uid', '', time() - 3600);
}
}
//设置头部公共导航
$isApp = $this->getCookie('isApp', false);
if (!$isApp) {
if (!($isApp || $this->_isApp)) {
$this->setNavHeader('星潮教室', true, false);
}
$this->setTitle('星潮教室');
$this->setTitle('星潮教室', false, '');
//调用模型获得星潮教室首页数据
$data = StarClassModel::getStarClass($uid);
//渲染模板
... ... @@ -66,7 +63,7 @@ class StarClassController extends AbstractAction
//设置头部公共导航
$this->setNavHeader('星潮教室', true, false);
}
$this->setTitle('星潮教室');
$this->setTitle('星潮教室', false, '');
//调用模型获得星专题数据
$data = StarClassModel::getspecial();
... ... @@ -91,7 +88,7 @@ class StarClassController extends AbstractAction
//设置头部公共导航
$this->setNavHeader('星潮教室', true, false);
}
$this->setTitle('星潮教室');
$this->setTitle('星潮教室', false, '');
//调用模板获得星搭配数据
$data = StarClassModel::getCollocation();
... ... @@ -143,7 +140,7 @@ class StarClassController extends AbstractAction
$url = Helpers::url('/guang/starclass/index');
$this->setNavHeader('星潮粉丝榜', $url, false);
}
$this->setTitle('星潮粉丝榜');
$this->setTitle('星潮粉丝榜', false, '');
//根据客户端类型,进行未登录跳转
if (!$uid) {
... ...