Merge branch 'develop' of http://git.dev.yoho.cn/web/yohood into develop
Showing
10 changed files
with
162 additions
and
51 deletions
@@ -206,6 +206,7 @@ define('admin/news',function(require, exports) | @@ -206,6 +206,7 @@ define('admin/news',function(require, exports) | ||
206 | box.alert('给张缩略图吧!'); | 206 | box.alert('给张缩略图吧!'); |
207 | return false ; | 207 | return false ; |
208 | } | 208 | } |
209 | + content = '<div id="temp">'+content+'</div>'; | ||
209 | if((tag == "视频" || tag == "手机视频") && $(content).find("embed").size()<=0) | 210 | if((tag == "视频" || tag == "手机视频") && $(content).find("embed").size()<=0) |
210 | { | 211 | { |
211 | box.alert('天啊,视频呢!'); | 212 | box.alert('天啊,视频呢!'); |
@@ -19,6 +19,22 @@ class Controller_Brand extends Controller_Abstract | @@ -19,6 +19,22 @@ class Controller_Brand extends Controller_Abstract | ||
19 | { | 19 | { |
20 | $id = intval($this->_request->id); | 20 | $id = intval($this->_request->id); |
21 | $info = Facade_Brand::getBrandbyID($id); | 21 | $info = Facade_Brand::getBrandbyID($id); |
22 | + $client = $this->_request->query('client', 0); | ||
23 | + if($client || $this->_platform != 'web') | ||
24 | + { | ||
25 | + $signBrands = Facade_Brand::getSignBrand(); | ||
26 | + $yohobuyBrandId = '0'; | ||
27 | + foreach($signBrands as $signBrand) | ||
28 | + { | ||
29 | + $signBrand['brand_name'] = trim(strtolower($signBrand['brand_name'])); | ||
30 | + if(strtolower($info['name']) == $signBrand['brand_name']) | ||
31 | + { | ||
32 | + $yohobuyBrandId = $signBrand['brand_id']; | ||
33 | + break; | ||
34 | + } | ||
35 | + } | ||
36 | + $info['link'] = 'openby:'.urlencode('yohobuy={"action":"go.brand","params":{"brand_id":"'.$yohobuyBrandId.'"}}'); | ||
37 | + } | ||
22 | $relas = Facade_Brand::getBrandNewsRelaByBrandID($id); | 38 | $relas = Facade_Brand::getBrandNewsRelaByBrandID($id); |
23 | $news = array(); | 39 | $news = array(); |
24 | foreach ($relas as $rela) | 40 | foreach ($relas as $rela) |
@@ -25,8 +25,16 @@ class Service_News extends Lib_Service | @@ -25,8 +25,16 @@ class Service_News extends Lib_Service | ||
25 | $column = Util_Utils_SqlString::mergeInsertFields($data); | 25 | $column = Util_Utils_SqlString::mergeInsertFields($data); |
26 | $value = Util_Utils_SqlString::mergeInsertString($data); | 26 | $value = Util_Utils_SqlString::mergeInsertString($data); |
27 | $up = Util_Utils_SqlString::mergeSqlUpstring($data); | 27 | $up = Util_Utils_SqlString::mergeSqlUpstring($data); |
28 | + if(isset($data['id'])) | ||
29 | + { | ||
30 | + $func = 'status'; | ||
31 | + } | ||
32 | + else | ||
33 | + { | ||
34 | + $func = 'lastInsertId'; | ||
35 | + } | ||
28 | $replaces = array('column' => $column, 'value' => $value , 'up' => $up) ; | 36 | $replaces = array('column' => $column, 'value' => $value , 'up' => $up) ; |
29 | - $status = self::service(self::ROUTER)->cache(false)->insert('setInfo', $data, $replaces)->status(); | 37 | + $status = self::service(self::ROUTER)->cache(false)->insert('setInfo', $data, $replaces)->$func(); |
30 | if($status) | 38 | if($status) |
31 | { | 39 | { |
32 | self::service(self::ROUTER)->delTags(self::$_tag); | 40 | self::service(self::ROUTER)->delTags(self::$_tag); |
@@ -43,7 +43,7 @@ | @@ -43,7 +43,7 @@ | ||
43 | '8.购买的二维码遗失了怎么办?'=>'二维码会保存在您的有货账户下,可在活动现场通过服务台咨询找回。', | 43 | '8.购买的二维码遗失了怎么办?'=>'二维码会保存在您的有货账户下,可在活动现场通过服务台咨询找回。', |
44 | '9.我不想用手机注册你们的账号,我还可不可以入场?'=>'如果您不想使用手机注册的话,您也可以选择邮箱注册,或者也可以使用支付宝、QQ、新浪微博等联合登录方式绑定入场手环。', | 44 | '9.我不想用手机注册你们的账号,我还可不可以入场?'=>'如果您不想使用手机注册的话,您也可以选择邮箱注册,或者也可以使用支付宝、QQ、新浪微博等联合登录方式绑定入场手环。', |
45 | '10.现场手机注册账户,但一直收不到验证短信怎么办?'=>'如果您一直无法接受验证信息的话,建议您可以尝试通过邮箱注册,或使用支付宝、QQ、新浪微博等联合登录方式绑定入场手环。', | 45 | '10.现场手机注册账户,但一直收不到验证短信怎么办?'=>'如果您一直无法接受验证信息的话,建议您可以尝试通过邮箱注册,或使用支付宝、QQ、新浪微博等联合登录方式绑定入场手环。', |
46 | - '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>。', | 46 | + '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>。', |
47 | '12.下单后需要多久完成支付?'=>'订单生成后需要在二小时内付款,逾时订单会被取消。', | 47 | '12.下单后需要多久完成支付?'=>'订单生成后需要在二小时内付款,逾时订单会被取消。', |
48 | '13.现场是否可以通过手机支付?'=>'可通过下载YOHO!有货手机客户端,在现场进行货品查看、购买及支付。', | 48 | '13.现场是否可以通过手机支付?'=>'可通过下载YOHO!有货手机客户端,在现场进行货品查看、购买及支付。', |
49 | '14.我可以在现场用现金购物吗?'=>'现场商品均为线上销售,需通过有货APP进行购物,不接受现金支付,请提前下载有货APP。', | 49 | '14.我可以在现场用现金购物吗?'=>'现场商品均为线上销售,需通过有货APP进行购物,不接受现金支付,请提前下载有货APP。', |
@@ -41,7 +41,7 @@ | @@ -41,7 +41,7 @@ | ||
41 | '8.购买的二维码遗失了怎么办?'=>'二维码会保存在您的有货账户下,可在活动现场通过服务台咨询找回。', | 41 | '8.购买的二维码遗失了怎么办?'=>'二维码会保存在您的有货账户下,可在活动现场通过服务台咨询找回。', |
42 | '9.我不想用手机注册你们的账号,我还可不可以入场?'=>'如果您不想使用手机注册的话,您也可以选择邮箱注册,或者也可以使用支付宝、QQ、新浪微博等联合登录方式绑定入场手环。', | 42 | '9.我不想用手机注册你们的账号,我还可不可以入场?'=>'如果您不想使用手机注册的话,您也可以选择邮箱注册,或者也可以使用支付宝、QQ、新浪微博等联合登录方式绑定入场手环。', |
43 | '10.现场手机注册账户,但一直收不到验证短信怎么办?'=>'如果您一直无法接受验证信息的话,建议您可以尝试通过邮箱注册,或使用支付宝、QQ、新浪微博等联合登录方式绑定入场手环。', | 43 | '10.现场手机注册账户,但一直收不到验证短信怎么办?'=>'如果您一直无法接受验证信息的话,建议您可以尝试通过邮箱注册,或使用支付宝、QQ、新浪微博等联合登录方式绑定入场手环。', |
44 | - '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>。', | 44 | + '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>。', |
45 | '12.下单后需要多久完成支付?'=>'订单生成后需要在二小时内付款,逾时订单会被取消。', | 45 | '12.下单后需要多久完成支付?'=>'订单生成后需要在二小时内付款,逾时订单会被取消。', |
46 | '13.现场是否可以通过手机支付?'=>'可通过下载YOHO!有货手机客户端,在现场进行货品查看、购买及支付。', | 46 | '13.现场是否可以通过手机支付?'=>'可通过下载YOHO!有货手机客户端,在现场进行货品查看、购买及支付。', |
47 | '14.我可以在现场用现金购物吗?'=>'现场商品均为线上销售,需通过有货APP进行购物,不接受现金支付,请提前下载有货APP。', | 47 | '14.我可以在现场用现金购物吗?'=>'现场商品均为线上销售,需通过有货APP进行购物,不接受现金支付,请提前下载有货APP。', |
1 | <?php $this->_extends('layout/default_layout_mobile');?> | 1 | <?php $this->_extends('layout/default_layout_mobile');?> |
2 | <?php $this->_block('main');?> | 2 | <?php $this->_block('main');?> |
3 | -<?php if(strtotime('2015-09-18 23:59:00') > $this->view->currentday && time() < strtotime('2015-09-18 23:59:00')):?> | 3 | +<?php if(false)://strtotime('2015-09-18 23:59:00') > $this->view->currentday && time() < strtotime('2015-09-18 23:59:00')):?> |
4 | <img src="<?php echo SITE_RES.'/images/yohood/comingsoon.jpg';?>" style="width:100%;"/> | 4 | <img src="<?php echo SITE_RES.'/images/yohood/comingsoon.jpg';?>" style="width:100%;"/> |
5 | <?php else:?> | 5 | <?php else:?> |
6 | <div class="scene-tab"> | 6 | <div class="scene-tab"> |
7 | <ul class="clearfix"> | 7 | <ul class="clearfix"> |
8 | <?php $navs = current($this->view->navs);ksort($navs); | 8 | <?php $navs = current($this->view->navs);ksort($navs); |
9 | foreach($navs as $nav): | 9 | foreach($navs as $nav): |
10 | - if(strtotime('2015-09-18 00:00:00') > $nav['timestamp']) continue; | 10 | + //if(strtotime('2015-09-18 00:00:00') > $nav['timestamp']) continue; |
11 | ?> | 11 | ?> |
12 | <li | 12 | <li |
13 | <?php if($nav['timestamp'] == $this->view->currentday && $nav['enable']) echo 'class="current"'; | 13 | <?php if($nav['timestamp'] == $this->view->currentday && $nav['enable']) echo 'class="current"'; |
@@ -19,7 +19,7 @@ | @@ -19,7 +19,7 @@ | ||
19 | </ul> | 19 | </ul> |
20 | </div> | 20 | </div> |
21 | <div class="scene-content"> | 21 | <div class="scene-content"> |
22 | - <?php if(strtotime('2015-09-18 23:59:00') > $this->view->currentday && time() < strtotime('2015-09-18 23:59:00')):?> | 22 | + <?php if(false): //(strtotime('2015-09-18 23:59:00') > $this->view->currentday && time() < strtotime('2015-09-18 23:59:00')):?> |
23 | <img src="<?php echo SITE_RES.'/images/yohood/comingsoon.jpg';?>" style="width:100%;"/> | 23 | <img src="<?php echo SITE_RES.'/images/yohood/comingsoon.jpg';?>" style="width:100%;"/> |
24 | <?php else:?> | 24 | <?php else:?> |
25 | <div class="main-layout current clearfix"> | 25 | <div class="main-layout current clearfix"> |
@@ -57,8 +57,13 @@ | @@ -57,8 +57,13 @@ | ||
57 | <?php $this->_endblock();?> | 57 | <?php $this->_endblock();?> |
58 | <?php $this->_block('js');?> | 58 | <?php $this->_block('js');?> |
59 | <script type="text/javascript"> | 59 | <script type="text/javascript"> |
60 | - seajs.use(['zepto', 'mobile'],function($, mobile){ | 60 | + seajs.use(['mobile', 'lib/util/json'],function(mobile, json){ |
61 | mobile.scene(); | 61 | mobile.scene(); |
62 | + window.json = json; | ||
62 | }) | 63 | }) |
64 | + function getClientShare() | ||
65 | + { | ||
66 | + //return window.json.stringify({title: shareTitle,desc: shareDesc,imgUrl: shareImg, link: shareLink}); | ||
67 | + } | ||
63 | </script> | 68 | </script> |
64 | <?php $this->_endblock();?> | 69 | <?php $this->_endblock();?> |
@@ -86,7 +86,7 @@ a.btn | @@ -86,7 +86,7 @@ a.btn | ||
86 | <input type="hidden" id="thumb" name="thumb" value="<?php echo $this->view->info['thumb']?>" /> | 86 | <input type="hidden" id="thumb" name="thumb" value="<?php echo $this->view->info['thumb']?>" /> |
87 | <div id='picdiv'> | 87 | <div id='picdiv'> |
88 | <?php if ($this->view->info['thumb']):?> | 88 | <?php if ($this->view->info['thumb']):?> |
89 | - <img src="<?php echo $this->view->info['image']?>"> | 89 | + <img src="<?php echo $this->view->info['image']?>" width="150"> |
90 | <?php endif;?> | 90 | <?php endif;?> |
91 | </div> | 91 | </div> |
92 | </td> | 92 | </td> |
@@ -99,7 +99,7 @@ a.btn | @@ -99,7 +99,7 @@ a.btn | ||
99 | <input type="hidden" id="client_thumb" name="client_thumb" value="<?php echo $this->view->info['client_thumb']?>" /> | 99 | <input type="hidden" id="client_thumb" name="client_thumb" value="<?php echo $this->view->info['client_thumb']?>" /> |
100 | <div id='clientpicdiv'> | 100 | <div id='clientpicdiv'> |
101 | <?php if ($this->view->info['client_thumb']):?> | 101 | <?php if ($this->view->info['client_thumb']):?> |
102 | - <img src="<?php echo $this->view->info['client_image']?>"> | 102 | + <img src="<?php echo $this->view->info['client_image']?>" width="150"> |
103 | <?php endif;?> | 103 | <?php endif;?> |
104 | </div> | 104 | </div> |
105 | </td> | 105 | </td> |
@@ -25,4 +25,14 @@ | @@ -25,4 +25,14 @@ | ||
25 | </ul> | 25 | </ul> |
26 | </div> | 26 | </div> |
27 | <?php endif;?> | 27 | <?php endif;?> |
28 | -<?php $this->_endblock();?> | ||
28 | +<?php $this->_endblock();?> | ||
29 | +<?php $this->_block('js');?> | ||
30 | +<script type="text/javascript"> | ||
31 | +function getClientShare() { | ||
32 | + 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'], | ||
33 | + 'imgUrl'=> Lib_Images::getImageUrl($this->view->info['logo'], 'source','fragmentimg'), | ||
34 | + 'link'=> SITE_MAIN.'/brand/detail/id/'.$this->view->info['id'])))));?>"; | ||
35 | +} | ||
36 | +</script> | ||
37 | +<?php $this->_endblock();?> | ||
38 | + |
@@ -32,7 +32,7 @@ | @@ -32,7 +32,7 @@ | ||
32 | <span class="border"></span> | 32 | <span class="border"></span> |
33 | <span class="arrow"></span> | 33 | <span class="arrow"></span> |
34 | <img class="lazy" data-original="<?php echo Lib_Images::getImageUrl($pic, 'source','fragmentimg');?>" alt="" | 34 | <img class="lazy" data-original="<?php echo Lib_Images::getImageUrl($pic, 'source','fragmentimg');?>" alt="" |
35 | - src="<?php echo Lib_Images::getImageUrl($pic, '0100x0065','fragmentimg');?>" style="display: block;"> | 35 | + src="<?php echo Lib_Images::getImageUrl($pic, 'source','fragmentimg');?>?imageMogr2/thumbnail/!0100x0065r/crop/0100x0065/strip/quality/100" style="display: block;"> |
36 | </a> | 36 | </a> |
37 | </li> | 37 | </li> |
38 | <?php endforeach;?> | 38 | <?php endforeach;?> |
@@ -46,26 +46,58 @@ | @@ -46,26 +46,58 @@ | ||
46 | <?php | 46 | <?php |
47 | if(preg_match('/ipad/i', $_SERVER['HTTP_USER_AGENT'])) | 47 | if(preg_match('/ipad/i', $_SERVER['HTTP_USER_AGENT'])) |
48 | { | 48 | { |
49 | - $temps = $videoMatches = array(); | ||
50 | - @preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yoho\.cn\/res\/yohood\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $this->view->info['content'], $videoMatches1); | ||
51 | - @preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohood\.test\.yoho\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $this->view->info['content'], $videoMatches2); | ||
52 | - @preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohood\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $this->view->info['content'], $videoMatches3); | ||
53 | - $temps[] = $videoMatches1; | ||
54 | - $temps[] = $videoMatches2; | ||
55 | - $temps[] = $videoMatches3; | ||
56 | - foreach($temps as $temp) | 49 | + preg_match_all('@<(object.*?)>(.*?)<(\/object.*?)>@si', $this->view->info['content'], $videosHtml); |
50 | + if(!empty($videosHtml[0])) | ||
57 | { | 51 | { |
58 | - if(!empty($temp[2])) | ||
59 | - { | ||
60 | - $videoMatches = $temp; | ||
61 | - } | ||
62 | - } | ||
63 | - if(!empty($videoMatches[2])) | ||
64 | - { | ||
65 | - $video = current($videoMatches[2]); | ||
66 | - $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>'; | ||
67 | - $this->view->info['content'] = preg_replace('@<(object.*?)>(.*?)<(\/object.*?)>@si',$videoHtml, $this->view->info['content']); | ||
68 | - $this->view->info['content'] = preg_replace('@<(embed.*?)>@si', $videoHtml, $this->view->info['content']); | 52 | + foreach($videosHtml[0] as $videoHtml) |
53 | + { | ||
54 | + $temps = array(); | ||
55 | + $cover = Lib_Images::getImageUrl($this->view->info['thumb'],'0300x0300','fragmentimg','autoCrop'); | ||
56 | + $video = ''; | ||
57 | + @preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yoho\.cn\/res\/yohood\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $videoHtml, $videoMatches1); | ||
58 | + @preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohood\.test\.yoho\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $videoHtml, $videoMatches2); | ||
59 | + @preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohood\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $videoHtml, $videoMatches3); | ||
60 | + @preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohoboys\.com\/res\/www\/swf\/util\/VideoPlayerNew\.swf\?url=(.+\.mp4|.+)&title1=*&shareurl=*&coverpic=(.+)\"@i", $videoHtml, $boysVideoMatches); | ||
61 | + $videoMatches1 = array_filter($videoMatches1); | ||
62 | + $videoMatches2 = array_filter($videoMatches2); | ||
63 | + $videoMatches3 = array_filter($videoMatches3); | ||
64 | + if(!empty($videoMatches1)) | ||
65 | + { | ||
66 | + $temps = $videoMatches1; | ||
67 | + } | ||
68 | + else if(!empty($videoMatches2)) | ||
69 | + { | ||
70 | + $temps = $videoMatches2; | ||
71 | + } | ||
72 | + else if(!empty($videoMatches3)) | ||
73 | + { | ||
74 | + $temps = $videoMatches3; | ||
75 | + } | ||
76 | + if(!empty($temps)) | ||
77 | + { | ||
78 | + if(!empty($temps[2][0])) | ||
79 | + { | ||
80 | + $video = $temps[2][0]; | ||
81 | + } | ||
82 | + } | ||
83 | + else if(!empty($boysVideoMatches)) | ||
84 | + { | ||
85 | + $temps = $boysVideoMatches; | ||
86 | + if(!empty($temps[2][0])) | ||
87 | + { | ||
88 | + $video = $temps[2][0]; | ||
89 | + } | ||
90 | + if(!empty($temps[3][0])) | ||
91 | + { | ||
92 | + $cover = $temps[3][0]; | ||
93 | + } | ||
94 | + } | ||
95 | + if(!empty($video)) | ||
96 | + { | ||
97 | + $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>'; | ||
98 | + $this->view->info['content'] = str_replace($videoHtml, $html, $this->view->info['content']); | ||
99 | + } | ||
100 | + } | ||
69 | } | 101 | } |
70 | } | 102 | } |
71 | echo $this->view->info['content']; | 103 | echo $this->view->info['content']; |
@@ -26,26 +26,58 @@ | @@ -26,26 +26,58 @@ | ||
26 | <?php endif;?> | 26 | <?php endif;?> |
27 | <div class="detail-article"> | 27 | <div class="detail-article"> |
28 | <?php | 28 | <?php |
29 | - $temps = $videoMatches = array(); | ||
30 | - @preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yoho\.cn\/res\/yohood\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $this->view->info['content'], $videoMatches1); | ||
31 | - @preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohood\.test\.yoho\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $this->view->info['content'], $videoMatches2); | ||
32 | - @preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohood\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $this->view->info['content'], $videoMatches3); | ||
33 | - $temps[] = $videoMatches1; | ||
34 | - $temps[] = $videoMatches2; | ||
35 | - $temps[] = $videoMatches3; | ||
36 | - foreach($temps as $temp) | 29 | + preg_match_all('@<(object.*?)>(.*?)<(\/object.*?)>@si', $this->view->info['content'], $videosHtml); |
30 | + if(!empty($videosHtml[0])) | ||
37 | { | 31 | { |
38 | - if(!empty($temp[2])) | ||
39 | - { | ||
40 | - $videoMatches = $temp; | ||
41 | - } | ||
42 | - } | ||
43 | - if(!empty($videoMatches[2])) | ||
44 | - { | ||
45 | - $video = current($videoMatches[2]); | ||
46 | - $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>'; | ||
47 | - $this->view->info['content'] = preg_replace('@<(object.*?)>(.*?)<(\/object.*?)>@si',$videoHtml, $this->view->info['content']); | ||
48 | - $this->view->info['content'] = preg_replace('@<(embed.*?)>@si', $videoHtml, $this->view->info['content']); | 32 | + foreach($videosHtml[0] as $videoHtml) |
33 | + { | ||
34 | + $temps = array(); | ||
35 | + $cover = Lib_Images::getImageUrl($this->view->info['thumb'],'0300x0300','fragmentimg','autoCrop'); | ||
36 | + $video = ''; | ||
37 | + @preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yoho\.cn\/res\/yohood\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $videoHtml, $videoMatches1); | ||
38 | + @preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohood\.test\.yoho\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $videoHtml, $videoMatches2); | ||
39 | + @preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohood\.cn\/swf\/YohoodPlayer\.swf\?url=(.+\.mp4|.+)\"@iU", $videoHtml, $videoMatches3); | ||
40 | + @preg_match_all("@<embed([^>]*)\s*src=\"http:\/\/res\.yohoboys\.com\/res\/www\/swf\/util\/VideoPlayerNew\.swf\?url=(.+\.mp4|.+)&title1=*&shareurl=*&coverpic=(.+)\"@i", $videoHtml, $boysVideoMatches); | ||
41 | + $videoMatches1 = array_filter($videoMatches1); | ||
42 | + $videoMatches2 = array_filter($videoMatches2); | ||
43 | + $videoMatches3 = array_filter($videoMatches3); | ||
44 | + if(!empty($videoMatches1)) | ||
45 | + { | ||
46 | + $temps = $videoMatches1; | ||
47 | + } | ||
48 | + else if(!empty($videoMatches2)) | ||
49 | + { | ||
50 | + $temps = $videoMatches2; | ||
51 | + } | ||
52 | + else if(!empty($videoMatches3)) | ||
53 | + { | ||
54 | + $temps = $videoMatches3; | ||
55 | + } | ||
56 | + if(!empty($temps)) | ||
57 | + { | ||
58 | + if(!empty($temps[2][0])) | ||
59 | + { | ||
60 | + $video = $temps[2][0]; | ||
61 | + } | ||
62 | + } | ||
63 | + else if(!empty($boysVideoMatches)) | ||
64 | + { | ||
65 | + $temps = $boysVideoMatches; | ||
66 | + if(!empty($temps[2][0])) | ||
67 | + { | ||
68 | + $video = $temps[2][0]; | ||
69 | + } | ||
70 | + if(!empty($temps[3][0])) | ||
71 | + { | ||
72 | + $cover = $temps[3][0]; | ||
73 | + } | ||
74 | + } | ||
75 | + if(!empty($video)) | ||
76 | + { | ||
77 | + $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>'; | ||
78 | + $this->view->info['content'] = str_replace($videoHtml, $html, $this->view->info['content']); | ||
79 | + } | ||
80 | + } | ||
49 | } | 81 | } |
50 | echo $this->view->info['content']; | 82 | echo $this->view->info['content']; |
51 | ?> | 83 | ?> |
@@ -71,7 +103,8 @@ | @@ -71,7 +103,8 @@ | ||
71 | $thumb = empty($this->view->info['client_thumb']) ? $this->view->info['thumb'] : $this->view->info['client_thumb']; | 103 | $thumb = empty($this->view->info['client_thumb']) ? $this->view->info['thumb'] : $this->view->info['client_thumb']; |
72 | echo Lib_Images::getImageUrl($thumb, 'source','fragmentimg');?>" | 104 | echo Lib_Images::getImageUrl($thumb, 'source','fragmentimg');?>" |
73 | desc="<?php echo Lib_Utils_StringHelper::substr_full_en(Lib_Utils_StringHelper::stripTags($this->view->info['content']), 200);?>" | 105 | desc="<?php echo Lib_Utils_StringHelper::substr_full_en(Lib_Utils_StringHelper::stripTags($this->view->info['content']), 200);?>" |
74 | - data-link="<?php echo SITE_MAIN.'/news/detail/id/'.$this->view->info['id'];?>"> | 106 | + data-link="<?php echo SITE_MAIN.'/news/detail/id/'.$this->view->info['id'];?>" |
107 | + style="<?php echo $this->view->client ? 'display:none':'';?>"> | ||
75 | <ul class="clearfix"> | 108 | <ul class="clearfix"> |
76 | <li class="yohoo-share-button-sina"><a href="javascript:;"></a></li> | 109 | <li class="yohoo-share-button-sina"><a href="javascript:;"></a></li> |
77 | <li class="yohoo-share-button-qq"><a href="javascript:;"></a></li> | 110 | <li class="yohoo-share-button-qq"><a href="javascript:;"></a></li> |
@@ -137,6 +170,7 @@ | @@ -137,6 +170,7 @@ | ||
137 | 170 | ||
138 | } | 171 | } |
139 | }); | 172 | }); |
173 | + | ||
140 | //构造分享信息 | 174 | //构造分享信息 |
141 | var shareTitle = $('.title').text(); | 175 | var shareTitle = $('.title').text(); |
142 | var shareImg = $(".share").attr("cover-url"); | 176 | var shareImg = $(".share").attr("cover-url"); |
@@ -165,8 +199,13 @@ | @@ -165,8 +199,13 @@ | ||
165 | // wx.error(function (res) { | 199 | // wx.error(function (res) { |
166 | // alert(res.errMsg); | 200 | // alert(res.errMsg); |
167 | // }); | 201 | // }); |
168 | - seajs.use('mobile',function(mobile) { | 202 | + |
203 | + seajs.use(['mobile','lib/util/json'],function(mobile, json) { | ||
169 | mobile.detail(); | 204 | mobile.detail(); |
205 | + window.json = json; | ||
170 | }); | 206 | }); |
207 | + function getClientShare() { | ||
208 | + return window.json.stringify({title: shareTitle,desc: shareDesc,imgUrl: shareImg, link: shareLink}); | ||
209 | + } | ||
171 | </script> | 210 | </script> |
172 | <?php $this->_endblock();?> | 211 | <?php $this->_endblock();?> |
-
Please register or login to post a comment