Authored by 2586703@qq.com

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohood into develop

... ... @@ -206,6 +206,7 @@ define('admin/news',function(require, exports)
box.alert('给张缩略图吧!');
return false ;
}
content = '<div id="temp">'+content+'</div>';
if((tag == "视频" || tag == "手机视频") && $(content).find("embed").size()<=0)
{
box.alert('天啊,视频呢!');
... ...
... ... @@ -19,6 +19,22 @@ class Controller_Brand extends Controller_Abstract
{
$id = intval($this->_request->id);
$info = Facade_Brand::getBrandbyID($id);
$client = $this->_request->query('client', 0);
if($client || $this->_platform != 'web')
{
$signBrands = Facade_Brand::getSignBrand();
$yohobuyBrandId = '0';
foreach($signBrands as $signBrand)
{
$signBrand['brand_name'] = trim(strtolower($signBrand['brand_name']));
if(strtolower($info['name']) == $signBrand['brand_name'])
{
$yohobuyBrandId = $signBrand['brand_id'];
break;
}
}
$info['link'] = 'openby:'.urlencode('yohobuy={"action":"go.brand","params":{"brand_id":"'.$yohobuyBrandId.'"}}');
}
$relas = Facade_Brand::getBrandNewsRelaByBrandID($id);
$news = array();
foreach ($relas as $rela)
... ...
... ... @@ -25,8 +25,16 @@ class Service_News extends Lib_Service
$column = Util_Utils_SqlString::mergeInsertFields($data);
$value = Util_Utils_SqlString::mergeInsertString($data);
$up = Util_Utils_SqlString::mergeSqlUpstring($data);
if(isset($data['id']))
{
$func = 'status';
}
else
{
$func = 'lastInsertId';
}
$replaces = array('column' => $column, 'value' => $value , 'up' => $up) ;
$status = self::service(self::ROUTER)->cache(false)->insert('setInfo', $data, $replaces)->status();
$status = self::service(self::ROUTER)->cache(false)->insert('setInfo', $data, $replaces)->$func();
if($status)
{
self::service(self::ROUTER)->delTags(self::$_tag);
... ...
... ... @@ -43,7 +43,7 @@
'8.购买的二维码遗失了怎么办?'=>'二维码会保存在您的有货账户下,可在活动现场通过服务台咨询找回。',
'9.我不想用手机注册你们的账号,我还可不可以入场?'=>'如果您不想使用手机注册的话,您也可以选择邮箱注册,或者也可以使用支付宝、QQ、新浪微博等联合登录方式绑定入场手环。',
'10.现场手机注册账户,但一直收不到验证短信怎么办?'=>'如果您一直无法接受验证信息的话,建议您可以尝试通过邮箱注册,或使用支付宝、QQ、新浪微博等联合登录方式绑定入场手环。',
'11.如何进行支付?'=>'可以通过网上银行、支付宝、微信等方式支付,请参见有货支付规则:<a href="http://www.yohobuy.com/help/?category_id=43" target="_blank" style="color:red;">http://www.yohobuy.com/help/?category_id=43</a>。',
'11.如何进行支付?'=>'可以通过网上银行、支付宝、微信、以及现场刷卡等方式支付,请参见有货网上支付规则:<a href="http://www.yohobuy.com/help/?category_id=43" target="_blank" style="color:red;">http://www.yohobuy.com/help/?category_id=43</a>。',
'12.下单后需要多久完成支付?'=>'订单生成后需要在二小时内付款,逾时订单会被取消。',
'13.现场是否可以通过手机支付?'=>'可通过下载YOHO!有货手机客户端,在现场进行货品查看、购买及支付。',
'14.我可以在现场用现金购物吗?'=>'现场商品均为线上销售,需通过有货APP进行购物,不接受现金支付,请提前下载有货APP。',
... ...
... ... @@ -41,7 +41,7 @@
'8.购买的二维码遗失了怎么办?'=>'二维码会保存在您的有货账户下,可在活动现场通过服务台咨询找回。',
'9.我不想用手机注册你们的账号,我还可不可以入场?'=>'如果您不想使用手机注册的话,您也可以选择邮箱注册,或者也可以使用支付宝、QQ、新浪微博等联合登录方式绑定入场手环。',
'10.现场手机注册账户,但一直收不到验证短信怎么办?'=>'如果您一直无法接受验证信息的话,建议您可以尝试通过邮箱注册,或使用支付宝、QQ、新浪微博等联合登录方式绑定入场手环。',
'11.如何进行支付?'=>'可以通过网上银行、支付宝、微信等方式支付,请参见有货支付规则:<a href="http://www.yohobuy.com/help/?category_id=43" target="_blank" style="color:red;">http://www.yohobuy.com/help/?category_id=43</a>。',
'11.如何进行支付?'=>'可以通过网上银行、支付宝、微信、以及现场刷卡等方式支付,请参见有货网上支付规则:<a href="http://www.yohobuy.com/help/?category_id=43" target="_blank" style="color:red;">http://www.yohobuy.com/help/?category_id=43</a>。',
'12.下单后需要多久完成支付?'=>'订单生成后需要在二小时内付款,逾时订单会被取消。',
'13.现场是否可以通过手机支付?'=>'可通过下载YOHO!有货手机客户端,在现场进行货品查看、购买及支付。',
'14.我可以在现场用现金购物吗?'=>'现场商品均为线上销售,需通过有货APP进行购物,不接受现金支付,请提前下载有货APP。',
... ...
<?php $this->_extends('layout/default_layout_mobile');?>
<?php $this->_block('main');?>
<?php if(strtotime('2015-09-18 23:59:00') > $this->view->currentday && time() < strtotime('2015-09-18 23:59:00')):?>
<?php if(false)://strtotime('2015-09-18 23:59:00') > $this->view->currentday && time() < strtotime('2015-09-18 23:59:00')):?>
<img src="<?php echo SITE_RES.'/images/yohood/comingsoon.jpg';?>" style="width:100%;"/>
<?php else:?>
<div class="scene-tab">
<ul class="clearfix">
<?php $navs = current($this->view->navs);ksort($navs);
foreach($navs as $nav):
if(strtotime('2015-09-18 00:00:00') > $nav['timestamp']) continue;
//if(strtotime('2015-09-18 00:00:00') > $nav['timestamp']) continue;
?>
<li
<?php if($nav['timestamp'] == $this->view->currentday && $nav['enable']) echo 'class="current"';
... ... @@ -19,7 +19,7 @@
</ul>
</div>
<div class="scene-content">
<?php if(strtotime('2015-09-18 23:59:00') > $this->view->currentday && time() < strtotime('2015-09-18 23:59:00')):?>
<?php if(false): //(strtotime('2015-09-18 23:59:00') > $this->view->currentday && time() < strtotime('2015-09-18 23:59:00')):?>
<img src="<?php echo SITE_RES.'/images/yohood/comingsoon.jpg';?>" style="width:100%;"/>
<?php else:?>
<div class="main-layout current clearfix">
... ... @@ -57,8 +57,13 @@
<?php $this->_endblock();?>
<?php $this->_block('js');?>
<script type="text/javascript">
seajs.use(['zepto', 'mobile'],function($, mobile){
seajs.use(['mobile', 'lib/util/json'],function(mobile, json){
mobile.scene();
window.json = json;
})
function getClientShare()
{
//return window.json.stringify({title: shareTitle,desc: shareDesc,imgUrl: shareImg, link: shareLink});
}
</script>
<?php $this->_endblock();?>
... ...
... ... @@ -86,7 +86,7 @@ a.btn
<input type="hidden" id="thumb" name="thumb" value="<?php echo $this->view->info['thumb']?>" />
<div id='picdiv'>
<?php if ($this->view->info['thumb']):?>
<img src="<?php echo $this->view->info['image']?>">
<img src="<?php echo $this->view->info['image']?>" width="150">
<?php endif;?>
</div>
</td>
... ... @@ -99,7 +99,7 @@ a.btn
<input type="hidden" id="client_thumb" name="client_thumb" value="<?php echo $this->view->info['client_thumb']?>" />
<div id='clientpicdiv'>
<?php if ($this->view->info['client_thumb']):?>
<img src="<?php echo $this->view->info['client_image']?>">
<img src="<?php echo $this->view->info['client_image']?>" width="150">
<?php endif;?>
</div>
</td>
... ...
... ... @@ -25,4 +25,14 @@
</ul>
</div>
<?php endif;?>
<?php $this->_endblock();?>
\ No newline at end of file
<?php $this->_endblock();?>
<?php $this->_block('js');?>
<script type="text/javascript">
function getClientShare() {
return "<?php echo str_replace("\\\\","\\", addslashes(@preg_replace("#\\\u([0-9a-f]{4})#ie", "iconv('UCS-2BE', 'UTF-8', pack('H4', '\\1'))", json_encode(array('title'=> $this->view->info['name'],'desc'=> $this->view->info['description'],
'imgUrl'=> Lib_Images::getImageUrl($this->view->info['logo'], 'source','fragmentimg'),
'link'=> SITE_MAIN.'/brand/detail/id/'.$this->view->info['id'])))));?>";
}
</script>
<?php $this->_endblock();?>
... ...
... ... @@ -32,7 +32,7 @@
<span class="border"></span>
<span class="arrow"></span>
<img class="lazy" data-original="<?php echo Lib_Images::getImageUrl($pic, 'source','fragmentimg');?>" alt=""
src="<?php echo Lib_Images::getImageUrl($pic, '0100x0065','fragmentimg');?>" style="display: block;">
src="<?php echo Lib_Images::getImageUrl($pic, 'source','fragmentimg');?>?imageMogr2/thumbnail/!0100x0065r/crop/0100x0065/strip/quality/100" style="display: block;">
</a>
</li>
<?php endforeach;?>
... ... @@ -46,26 +46,58 @@
<?php
if(preg_match('/ipad/i', $_SERVER['HTTP_USER_AGENT']))
{
$temps = $videoMatches = array();
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yoho\.cn\/res\/yohood\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $this->view->info['content'], $videoMatches1);
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohood\.test\.yoho\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $this->view->info['content'], $videoMatches2);
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohood\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $this->view->info['content'], $videoMatches3);
$temps[] = $videoMatches1;
$temps[] = $videoMatches2;
$temps[] = $videoMatches3;
foreach($temps as $temp)
preg_match_all('@<(object.*?)>(.*?)<(\/object.*?)>@si', $this->view->info['content'], $videosHtml);
if(!empty($videosHtml[0]))
{
if(!empty($temp[2]))
{
$videoMatches = $temp;
}
}
if(!empty($videoMatches[2]))
{
$video = current($videoMatches[2]);
$videoHtml = '<video controls="controls" preload="auto" poster="'.Lib_Images::getImageUrl($this->view->info['thumb'],'0640x0390','fragmentimg','autoCrop').'" width="640" height="390"><source src="'.$video.'" type="video/mp4" /></video>';
$this->view->info['content'] = preg_replace('@<(object.*?)>(.*?)<(\/object.*?)>@si',$videoHtml, $this->view->info['content']);
$this->view->info['content'] = preg_replace('@<(embed.*?)>@si', $videoHtml, $this->view->info['content']);
foreach($videosHtml[0] as $videoHtml)
{
$temps = array();
$cover = Lib_Images::getImageUrl($this->view->info['thumb'],'0300x0300','fragmentimg','autoCrop');
$video = '';
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yoho\.cn\/res\/yohood\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $videoHtml, $videoMatches1);
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohood\.test\.yoho\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $videoHtml, $videoMatches2);
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohood\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $videoHtml, $videoMatches3);
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohoboys\.com\/res\/www\/swf\/util\/VideoPlayerNew\.swf\?url=(.+\.mp4|.+)&title1=*&shareurl=*&coverpic=(.+)\"@i", $videoHtml, $boysVideoMatches);
$videoMatches1 = array_filter($videoMatches1);
$videoMatches2 = array_filter($videoMatches2);
$videoMatches3 = array_filter($videoMatches3);
if(!empty($videoMatches1))
{
$temps = $videoMatches1;
}
else if(!empty($videoMatches2))
{
$temps = $videoMatches2;
}
else if(!empty($videoMatches3))
{
$temps = $videoMatches3;
}
if(!empty($temps))
{
if(!empty($temps[2][0]))
{
$video = $temps[2][0];
}
}
else if(!empty($boysVideoMatches))
{
$temps = $boysVideoMatches;
if(!empty($temps[2][0]))
{
$video = $temps[2][0];
}
if(!empty($temps[3][0]))
{
$cover = $temps[3][0];
}
}
if(!empty($video))
{
$html = '<video controls="controls" preload="auto" poster="'.$cover.'" width="300" height="300" style="width:300px;height:300px;display:block;margin:auto;"><source src="'.$video.'" type="video/mp4" /></video>';
$this->view->info['content'] = str_replace($videoHtml, $html, $this->view->info['content']);
}
}
}
}
echo $this->view->info['content'];
... ...
... ... @@ -26,26 +26,58 @@
<?php endif;?>
<div class="detail-article">
<?php
$temps = $videoMatches = array();
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yoho\.cn\/res\/yohood\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $this->view->info['content'], $videoMatches1);
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohood\.test\.yoho\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $this->view->info['content'], $videoMatches2);
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohood\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $this->view->info['content'], $videoMatches3);
$temps[] = $videoMatches1;
$temps[] = $videoMatches2;
$temps[] = $videoMatches3;
foreach($temps as $temp)
preg_match_all('@<(object.*?)>(.*?)<(\/object.*?)>@si', $this->view->info['content'], $videosHtml);
if(!empty($videosHtml[0]))
{
if(!empty($temp[2]))
{
$videoMatches = $temp;
}
}
if(!empty($videoMatches[2]))
{
$video = current($videoMatches[2]);
$videoHtml = '<video controls="controls" preload="auto" poster="'.Lib_Images::getImageUrl($this->view->info['thumb'],'0300x0300','fragmentimg','autoCrop').'" width="300" height="300" style="width:300px;height:300px;display:block;margin:auto;"><source src="'.$video.'" type="video/mp4" /></video>';
$this->view->info['content'] = preg_replace('@<(object.*?)>(.*?)<(\/object.*?)>@si',$videoHtml, $this->view->info['content']);
$this->view->info['content'] = preg_replace('@<(embed.*?)>@si', $videoHtml, $this->view->info['content']);
foreach($videosHtml[0] as $videoHtml)
{
$temps = array();
$cover = Lib_Images::getImageUrl($this->view->info['thumb'],'0300x0300','fragmentimg','autoCrop');
$video = '';
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yoho\.cn\/res\/yohood\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $videoHtml, $videoMatches1);
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohood\.test\.yoho\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $videoHtml, $videoMatches2);
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohood\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $videoHtml, $videoMatches3);
@preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohoboys\.com\/res\/www\/swf\/util\/VideoPlayerNew\.swf\?url=(.+\.mp4|.+)&title1=*&shareurl=*&coverpic=(.+)\"@i", $videoHtml, $boysVideoMatches);
$videoMatches1 = array_filter($videoMatches1);
$videoMatches2 = array_filter($videoMatches2);
$videoMatches3 = array_filter($videoMatches3);
if(!empty($videoMatches1))
{
$temps = $videoMatches1;
}
else if(!empty($videoMatches2))
{
$temps = $videoMatches2;
}
else if(!empty($videoMatches3))
{
$temps = $videoMatches3;
}
if(!empty($temps))
{
if(!empty($temps[2][0]))
{
$video = $temps[2][0];
}
}
else if(!empty($boysVideoMatches))
{
$temps = $boysVideoMatches;
if(!empty($temps[2][0]))
{
$video = $temps[2][0];
}
if(!empty($temps[3][0]))
{
$cover = $temps[3][0];
}
}
if(!empty($video))
{
$html = '<video controls="controls" preload="auto" poster="'.$cover.'" width="300" height="300" style="width:300px;height:300px;display:block;margin:auto;"><source src="'.$video.'" type="video/mp4" /></video>';
$this->view->info['content'] = str_replace($videoHtml, $html, $this->view->info['content']);
}
}
}
echo $this->view->info['content'];
?>
... ... @@ -71,7 +103,8 @@
$thumb = empty($this->view->info['client_thumb']) ? $this->view->info['thumb'] : $this->view->info['client_thumb'];
echo Lib_Images::getImageUrl($thumb, 'source','fragmentimg');?>"
desc="<?php echo Lib_Utils_StringHelper::substr_full_en(Lib_Utils_StringHelper::stripTags($this->view->info['content']), 200);?>"
data-link="<?php echo SITE_MAIN.'/news/detail/id/'.$this->view->info['id'];?>">
data-link="<?php echo SITE_MAIN.'/news/detail/id/'.$this->view->info['id'];?>"
style="<?php echo $this->view->client ? 'display:none':'';?>">
<ul class="clearfix">
<li class="yohoo-share-button-sina"><a href="javascript:;"></a></li>
<li class="yohoo-share-button-qq"><a href="javascript:;"></a></li>
... ... @@ -137,6 +170,7 @@
}
});
//构造分享信息
var shareTitle = $('.title').text();
var shareImg = $(".share").attr("cover-url");
... ... @@ -165,8 +199,13 @@
// wx.error(function (res) {
// alert(res.errMsg);
// });
seajs.use('mobile',function(mobile) {
seajs.use(['mobile','lib/util/json'],function(mobile, json) {
mobile.detail();
window.json = json;
});
function getClientShare() {
return window.json.stringify({title: shareTitle,desc: shareDesc,imgUrl: shareImg, link: shareLink});
}
</script>
<?php $this->_endblock();?>
... ...