Authored by whb

修改产品提出的问题

... ... @@ -82,6 +82,35 @@ define('admin/news',function(require, exports)
box.alert(response.message);
}
}, {button_width:"100", button_height : "30"});
init_upload('upload_pic',function(response,swf)
{
if (response.code == 12)
{
var thumbPath = common.getImages(response.data.file.relaPath, "0140x0060", "blogimg", "primary");
var realPath = response.data.file.relaPath;
$("#thumb").val(realPath);
$("#picdiv").html("<img class='thumb_but' val='"+realPath+"' src='"+thumbPath+"'>");
}
else
{
box.alert(response.message);
}
} );
init_upload('client_upload_pic',function(response,swf)
{
if (response.code == 12)
{
var thumbPath = common.getImages(response.data.file.relaPath, "0140x0060", "blogimg", "primary");
var realPath = response.data.file.relaPath;
$("#client_thumb").val(realPath);
$("#clientpicdiv").html("<img class='thumb_but' val='"+realPath+"' src='"+thumbPath+"'>");
}
else
{
box.alert(response.message);
}
} );
}
//创建/更新初始化
exports.create = function ()
... ... @@ -151,6 +180,7 @@ define('admin/news',function(require, exports)
var content = $('#content').val() ;
var pic_list_thumb = $('.pic_list_thumb');
var main_title = $('#main_title').val();
var thumb = $("#thumb").val();
if(title == '')
{
box.alert('填写标题哎!');
... ... @@ -165,9 +195,9 @@ define('admin/news',function(require, exports)
box.alert('填写内容哦!');
return false ;
}
if(pic_list_thumb.size() == 0)
if(thumb == '')
{
box.alert('给张图吧!');
box.alert('给张缩略图吧!');
return false ;
}
},
... ...
... ... @@ -146,7 +146,59 @@ 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 = detailTitle; //分享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){
shareFriend();
});
// 分享到朋友圈
WeixinJSBridge.on('menu:share:timeline', function(argv){
shareTimeline();
});
// 分享到微博
WeixinJSBridge.on('menu:share:weibo', function(argv){
shareWeibo();
});
}, false);
};
exports.show = function() {
... ...
... ... @@ -11,6 +11,10 @@ define('yohood', function(require, exports) {
//图片转换
var imgTransform = function(obj) {
$(obj).bind("mousemove", function(){
if($(this).attr("disopen") == 1) { //禁止
return false;
}
//图片变大
if($(this).attr("isopen") != 1) {
$(this).css({
'-webkit-transition': '-webkit-transform .5s ease-in',
... ... @@ -29,6 +33,7 @@ define('yohood', function(require, exports) {
});
$(obj).bind("mouseout", function(){
if($(this).attr("isopen") == 1) {
//图片还原
$(this).css({
'-webkit-transition': '-webkit-transform .5s ease-in',
'-moz-transition': '-moz-transform .5s ease-in',
... ... @@ -102,7 +107,10 @@ define('yohood', function(require, exports) {
part, topClass = '';
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';
html += '<li><a href="' + v.url + '" target="_blank" title="' + v.name + '">' +
... ... @@ -460,6 +468,10 @@ define('yohood', function(require, exports) {
$(this).css({width:"650px"});
}
});
//图片一张时,没有左右按钮
if($(".box").size() == 1) {
$(".slide-shadow").remove();
}
}
//详情页资讯
... ... @@ -474,7 +486,7 @@ define('yohood', function(require, exports) {
var titleStyle = '';
var html = '<div class="layout-item clearfix">'+
'<div class="image-box">'+
'<a href="'+url+'">' +
'<a href="'+url+'" target="_blank">' +
'<img src="'+img+'" alt="" style="height:230px;width:230px;">'+
'{playIcon}'+
'</a>'+
... ...
... ... @@ -124,7 +124,6 @@ class Controller_Admin_News extends Controller_Admin_Base
$brands = array_filter(explode('|', $data['brands']));
unset($data['brands']);
$data['tag'] = str_replace(',',',',$data['tag']);
$data['thumb'] = current($pics);
$width = $height = 0;
$times = 0;
while($width <= 0 && $height <= 0 && $times++<=5)
... ...
... ... @@ -58,7 +58,7 @@ a.btn
<div>
<span id="upload_pic_list" key="<?php echo $this->view->key?>"></span>
<button class="btn btn-info" type="button">上传多图</button>
<span class="text-error"> 标准尺寸:644x415 第一张为封面 [ 图片可以拖放顺序 ]</span>
<span class="text-error"> 标准尺寸:644x415[ 图片可以拖放顺序 ]</span>
</div>
<div id="pic_list" style="padding-top:10px;">
<?php foreach($this->view->info['pics'] as $key => $pic):?>
... ... @@ -79,6 +79,32 @@ a.btn
</td>
</tr>
<tr>
<td>网页版缩图</td>
<td colspan="2">
<span id="upload_pic" key="<?php echo $this->view->key?>"></span>
<button class="btn btn-info" type="button">上传</button> (图片尺寸:308 x N)
<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']?>">
<?php endif;?>
</div>
</td>
</tr>
<tr>
<td>客户端缩图</td>
<td colspan="2">
<span id="client_upload_pic" key="<?php echo $this->view->key?>"></span>
<button class="btn btn-info" type="button">上传</button> (图片尺寸:640 x 400)
<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']?>">
<?php endif;?>
</div>
</td>
</tr>
<tr>
<td>排序(值越大,排序越靠前):</td>
<td colspan="2"><input type="text" name="sort" id="sort" value="<?php echo $this->view->info['sort'];?>"/></td>
</tr>
... ...
... ... @@ -146,7 +146,7 @@ EOL;
?>
<div class="image-box" style="padding-bottom: 30px;">
<a href="<?php echo $banner['url']?>" target="_blank" style="<?php echo sprintf("height:%spx;width:%spx;overflow:hidden;", $height, $width);?>">
<img src="<?php echo Lib_Images::getImageUrl($banner['res'], 'source','fragmentimg');?>" style="<?php echo sprintf("height:%spx;width:%spx;", $height, $width);?>"/>
<img disopen="1" src="<?php echo Lib_Images::getImageUrl($banner['res'], 'source','fragmentimg');?>" style="<?php echo sprintf("height:%spx;width:%spx;", $height, $width);?>"/>
</a>
</div>
<?php endforeach;?>
... ...
... ... @@ -4,7 +4,7 @@
<div class="detail-title">
<h2><?php echo $this->view->info['title']?></h2>
<h3>潮流嘉年华</h3>
<p class="time">2014.07.07</p>
<p class="time"><?php echo date('Y.m.d', $this->view->info['create_time']);?></p>
</div>
<div class="detail-body">
<div class="detail-slide">
... ...
... ... @@ -24,7 +24,7 @@ else
?>
<div class="<?php !isset($video) ?'fluid-item':'';?>layout-item tiled">
<div class="image-box">
<a href="<?php echo url('news/detail' ,array('id' => $news['id']))?>" title="<?php echo $news['title'];?>" style="<?php echo sprintf("height:%spx;width:%spx;overflow: hidden;", $height, $width);?>">
<a href="<?php echo url('news/detail' ,array('id' => $news['id']))?>" target="_blank" title="<?php echo $news['title'];?>" style="<?php echo sprintf("height:%spx;width:%spx;overflow: hidden;", $height, $width);?>">
<img src="<?php echo $thumb;?>" alt="" style="<?php echo sprintf("height:%spx;width:%spx;", $height, $width);?>">
<?php if(trim($news['tag']) == '视频'):?>
<i class="play-icon"></i>
... ... @@ -37,7 +37,7 @@ else
<a href="<?php echo url('news/detail' ,array('id' => $news['id']))?>"><?php echo $news['title'];?></a>
</h2>
<p class="text-content"><?php echo $description;?></p>
<p class="time"><?php echo date('Y.m.d', $news['create_time'])?></p>
<p class="time"><?php echo date('Y.m.d', $news['create_time']);?></p>
</div>
</div>
<?php endforeach;?>
\ No newline at end of file
... ...