Authored by whb

修改bug

... ... @@ -147,61 +147,6 @@ define('mobile', function(require, exports) {
tweetText: '【YOHOOD 2015】' + detailTitle.text() + '\r\n' + detailSubtitle.text(),
qqText: '【YOHOOD 2015】' + detailTitle.text() + ' ' + detailSubtitle.text() + '#YOHOOD 2015'
});
var imgUrl = shareCover; //注意必须是绝对路径
var lineLink = shareUrl; //同样,必须是绝对路径
var descContent = detailTitle.text(); //分享给朋友或朋友圈时的文字简介
var shareTitle = 'aaa'; //分享title
var appid = ''; //apiID,可留空
function shareFriend() {
WeixinJSBridge.invoke('sendAppMessage',{
"appid": appid,
"img_url": imgUrl,
"img_width": "200",
"img_height": "200",
"link": lineLink,
"desc": descContent,
"title": shareTitle
}, function(res) {
})
}
function shareTimeline() {
WeixinJSBridge.invoke('shareTimeline',{
"img_url": imgUrl,
"img_width": "200",
"img_height": "200",
"link": lineLink,
"desc": descContent,
"title": shareTitle
}, function(res) {
//_report('timeline', res.err_msg);
});
}
function shareWeibo() {
WeixinJSBridge.invoke('shareWeibo',{
"content": descContent,
"url": lineLink,
}, function(res) {
});
}
// 当微信内置浏览器完成内部初始化后会触发WeixinJSBridgeReady事件。
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
// 发送给好友
WeixinJSBridge.on('menu:share:appmessage', function(argv){
alert('aaa');
shareFriend();
});
// 分享到朋友圈
WeixinJSBridge.on('menu:share:timeline', function(argv){
alert('bbb');
shareTimeline();
});
// 分享到微博
WeixinJSBridge.on('menu:share:weibo', function(argv){
alert('ccc');
shareWeibo();
});
}, false);
};
exports.show = function() {
... ...
... ... @@ -4,6 +4,7 @@ define('yohood', function(require, exports) {
var common = require("common");
var share = require('plugins/share');
var freetile = require("lib/ui/jquery.freetile");
var tools = require("lib/util/tools");
var goodsSwiper = null;
require("plugins/slider");
require("plugins/imgZoom");
... ... @@ -104,19 +105,28 @@ define('yohood', function(require, exports) {
var product = data.data,
pic = '',
pos = offset,
part, topClass = '';
part, topClass = '', price = '', market_price = '';
if (data.code == 200 && product != "") {
$.each(product, function(i, v) {
//http://img05.static.yohobuy.com/thumb/2014/08/01/02/015008fea15e6a7c44afc0a6293e87b594-0150x0200-2-goodsimg.jpg
pic = v.pic.split('|')[0].replace(/-(\w+)-/g, '-0150x0200-');
//http://img12.static.yhbimg.com/goodsimg/2015/05/27/09/0235d475f72b11a24128a02c7fc24d4cfc.jpg?imageView/2/w/100/h/100
pic = pic.replace('imageView/2/w/100/h/100','imageView/2/w/200/h/200');
parts = v.price.split('.');
topClass = pos > 2 ? '' : 'red';
parts = v.price.split('.');
market_price = '';
//价格样式
price = parts[0] + '.' + (parts[1] ? parts[1] : '00');
if(parseInt(v.market_price) > 0) //原价
{
parts = v.market_price.split('.');
market_price = parts[0] + '.' + (parts[1] ? parts[1] : '00');
market_price = '<span class="original-price">¥ '+market_price+'</span>';
}
html += '<li><a href="' + v.url + '" target="_blank" title="' + v.name + '">' +
'<div class="img-box"><img src="' + pic + '" alt=""><span class="' + topClass + '">TOP ' + (++pos) + '</span></div>' +
'<p class="goods-name">' + v.name + '</p>' +
'<p class="price"><span class="original-price">¥ 309</span>¥' + (parts[0] + '.' + (parts[1] ? parts[1] : '00')) + '</p></a></li>';
'<p class="goods-name">' + tools.limitWords(v.name, 62) + '</p>' +
'<p class="price">'+market_price+'¥' + price + '</p></a></li>';
if (pos % 5 == 0) {
temp += template.replace('{li}', html);
html = '';
... ... @@ -134,6 +144,10 @@ define('yohood', function(require, exports) {
goodsSwiper.setup();
$('.limited-slide-next').removeClass('disable');
}
if(pos<=5) //去掉左右按钮
{
$(".limited-slide-control").remove();
}
}
}
});
... ...
... ... @@ -29,6 +29,6 @@ class Controller_Product extends Controller_Abstract
$limit = intval($this->_request->query('limit', 5));
$recomStatus = 1;
$products = Facade_Prod::getProd($recomStatus, $offset, $limit);
return $this->returnJson(true, 200, $products, '');
return $this->returnJson(true, 200, array_values($products), '');
}
}
... ...
... ... @@ -15,7 +15,7 @@ class Controller_Admin_Index extends Controller_Admin_Base
$this->_view['data'] = $info;
$this->_view['type'] = $type;
$this->_view['typeDescription'] = array( 1 =>'banner', 2 =>'广告', 3 =>'广告', 4=> '广告');
$this->_view['sizeDescription'] = array( 1 =>'980x474 [移动端:320x155]', 2 =>'308x392', 3=>'980*474px[移动端:320x155]', 4 =>'');
$this->_view['sizeDescription'] = array( 1 =>'980x474 [移动端:320x155]', 2 =>'308x392', 3=>'980x474px[移动端:320x155]', 4 =>'280x357px');
$this->_view['key'] = Lib_Images::genKey('fragmentimg');
}
... ...
<?php $this->_extends('layout/admin_layout');?>
<?php $this->_block('main');?>
<h4>品牌列表</h4>
<ul class="nav nav-tabs">
<li class="active">
<a href="/admin/brand">品牌列表</a>
</li>
<li>
<a href="/admin/prod">商品列表</a>
</li>
</ul>
<table class="table">
<caption style="text-align:left; padding-bottom:5px;">
<button class="btn" style="float:left;" id="add_brand" href="javascript:void(0)">添加品牌</button>
... ...
... ... @@ -32,9 +32,10 @@
<td width="9%">品牌ID</td>
<td width="9%">品牌LOGO</td>
<td>链接</td>
<td width="12%">图片</td>
<td width="9%">价格 ( 单位:元 ) </td>
<td width="15%">介绍</td>
<td width="6%">图片</td>
<td width="9%">促销价格 ( 单位:元 ) </td>
<td width="9%">市场价格 ( 单位:元 ) </td>
<td width="12%">介绍</td>
<td>排序(值越大,排序越靠前)</td>
<td>创建时间</td>
<td width="12%">操作</td>
... ... @@ -62,6 +63,7 @@
?>
</td>
<td><?php echo $prod['price'];?></td>
<td><?php echo $prod['market_price'];?></td>
<td><?php echo $prod['text']?></td>
<td><?php echo $prod['sort']?></td>
<td>
... ... @@ -120,7 +122,7 @@
</tr>
<tr>
<td>
价格 <span class="text-error"> * </span>
促销价格 <span class="text-error"> * </span>
<br/>(单位:元)
<input type="hidden" name="market_price" id="market_price" value="0"/>
<input type="hidden" name="product_skn" id="product_skn" value="0" />
... ...
... ... @@ -138,8 +138,17 @@ EOL;
<div id="right_banner" style="display:none;" num="<?php echo count($this->view->rightBanners);?>">
<div class="fluid-item layout-item tiled">
<?php
foreach($this->view->rightBanners as $banner):
<?php
$banners = $this->view->rightBanners;
$temp = array();
$len = count($banners);
if($len >=3)
{
$temp = array_slice($banners, 0, 1);
$pos = rand(1, $len - 1);
$banners = array_merge($temp, array_slice($banners, $pos, 1));
}
foreach($banners as $banner):
$res_size = json_decode($banner['res_size'], true);
$height = ceil($res_size['height'] * (308 / $res_size['width']));
$width = 308;
... ...