You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
163
hyhproject/home2/view/default/shops/shopconfigs/shop_cfg.html
Executable file
163
hyhproject/home2/view/default/shops/shopconfigs/shop_cfg.html
Executable file
@ -0,0 +1,163 @@
|
||||
{extend name="default/shops/base" /}
|
||||
{block name="title"}店铺设置-卖家中心{__block__}{/block}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" type="text/css" href="__STATIC__/plugins/webuploader/webuploader.css?v={$v}" />
|
||||
<link rel="stylesheet" type="text/css" href="__STATIC__/plugins/webuploader/batchupload.css?v={$v}" />
|
||||
<link href="__STATIC__/plugins/validator/jquery.validator.css?v={$v}" rel="stylesheet">
|
||||
{/block}
|
||||
{block name="content"}
|
||||
<script>
|
||||
$(function(){
|
||||
$('.state-complete').css('border-color','#ddd');
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
.filelist .btn-del,.webuploader-pick,.wst-batchupload .placeholder .webuploader-pick,.wst-batchupload .statusBar .btns .uploadBtn{background: #e45050;}
|
||||
.wst-batchupload .statusBar .btns .uploadBtn:hover {background: #e45525 none repeat scroll 0 0;}
|
||||
.shopbanner{position: relative;}
|
||||
.del-banner{position: absolute;top:0px;right:0px;background: #e45050 none repeat scroll 0 0 z-index: 55;color: #ffffff;cursor: pointer;height: 18px;line-height: 18px;padding: 0 5px;}
|
||||
.wst-batchupload .filelist li{background:#ffffff;}
|
||||
</style>
|
||||
<div class="wst-body">
|
||||
<div class="wst-shop-head"><span>店铺设置</span></div>
|
||||
<div class="wst-clear"></div>
|
||||
<div class="wst-shop-content">
|
||||
|
||||
<form name="shopCfg" id="shopCfg" autocomplete="off">
|
||||
|
||||
|
||||
<table class="wst-form">
|
||||
<tr>
|
||||
<th width='120' align='right'>店铺SEO关键字<font color='red'>*</font>:</th>
|
||||
<td><input type='text' id='shopKeywords' name='shopKeywords' class="ipt" value='{$object.shopKeywords}' data-rule='关键字:required;' style='width:350px;' maxLength='25' /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th width='120'>店铺SEO描述:</th>
|
||||
<td colspan='3'>
|
||||
<textarea rows="2" style='width:350px;' class="ipt" id='shopDesc' name='shopDesc' >{$object.shopDesc}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th width='120'>店铺热搜关键词:</th>
|
||||
<td><input type='text' id='shopHotWords' name='shopHotWords' class="ipt" value='{$object.shopHotWords}' style='width:350px;' placeholder="店铺主页搜索栏下的引导搜索词" maxLength='100'/></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr style="height:80px">
|
||||
<th width='120' align='right' valign='top'>店铺街背景:</th>
|
||||
<td>
|
||||
<div id="shopStreetImgPicker" style='margin-left:0px;margin-top:5px;height:30px;overflow:hidden'>上传(首页)店铺街背景图片</div>
|
||||
<div>图片大小:228 x 138 (px)(格式为 gif, jpg, jpeg, png)</div>
|
||||
<div style="margin-top:5px;">
|
||||
<div class="wst-lfloat shopbanner" {if empty($object.shopStreetImg)}style='display:none'{/if}>
|
||||
<img id="shopStreetImgPreview" class="lazyImg" height="100" style="max-width:500px;" src="__IMGURL__/{$object.shopStreetImg}">
|
||||
<span class="del-banner" onclick="delShopStreetBg(this)">删除</span>
|
||||
</div>
|
||||
<input type="hidden" id="shopStreetImg" class="ipt" value="{$object.shopStreetImg}" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr style="height:80px">
|
||||
<th width='120' align='right' valign='top'>顶部广告:</th>
|
||||
<td>
|
||||
<div id="shopBannerPicker" style='margin-left:0px;margin-top:5px;height:30px;overflow:hidden'>上传顶部广告图片</div>
|
||||
<div>图片大小:1920 x 110 (px)(格式为 gif, jpg, jpeg, png)</div>
|
||||
<div style="margin-top:5px;">
|
||||
<div class="wst-lfloat shopbanner" {if empty($object.shopBanner)}style='display:none'{/if}>
|
||||
<img id="shopBannerPreview" class="lazyImg" height="100" style="max-width:500px;" src="__IMGURL__/{$object.shopBanner}">
|
||||
<span class="del-banner" onclick="delbanner(this)">删除</span>
|
||||
</div>
|
||||
<input type="hidden" id="shopBanner" class="ipt" value="{$object.shopBanner}" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<th width='120' align='right'>滚动广告<font color='red'>*</font>:</th>
|
||||
<td>
|
||||
|
||||
<div id="batchUpload" class="wst-batchupload" style="border:1px solid #ccc">
|
||||
<div style="border-bottom:1px solid #dadada;padding-left:10px; "> 图片大小:1200 x 400 (px)(格式为 gif, jpg, jpeg, png) </div>
|
||||
<div class="queueList filled">
|
||||
<div id="dndArea" class="placeholder {if !empty($object['shopAds'])}element-invisible{/if}">
|
||||
<div id="filePicker"></div>
|
||||
<p>或将照片拖到这里,单次最多可选5张,每张最大不超过5M</p>
|
||||
</div>
|
||||
<ul class="filelist" >
|
||||
{volist name="$object['shopAds']" id="vo"}
|
||||
<li class="state-complete" style="border: 1px solid #ddd;height:213px;">
|
||||
<p class="title"></p>
|
||||
<p class="imgWrap">
|
||||
<img src="__IMGURL__/{$vo}">
|
||||
</p>
|
||||
<input type="hidden" v="{$vo}" iv="{$vo}" class="j-gallery-img">
|
||||
<span class="btn-del">删除</span>
|
||||
<input class="cfg-img-url" type="text" value="{$object['shopAdsUrl'][$key]}" style="width:170px;" placeholder="广告路径">
|
||||
</li>
|
||||
{/volist}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="statusBar" >
|
||||
<div class="progress" style="display: none;">
|
||||
<span class="text">0%</span>
|
||||
<span class="percentage" style="width: 0%;"></span>
|
||||
</div>
|
||||
<div class="info"></div>
|
||||
<div class="btns">
|
||||
<div id="filePicker2"></div><div class="uploadBtn">开始上传</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style='clear:both;'></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan='2' style='text-align:center;padding:20px;'>
|
||||
<a class='s-btn' href="javascript:save()">保 存</a>
|
||||
<a class='s-btn2' href='javascript:location.reload();'>重 置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="footer"}
|
||||
{include file="default/footer" /}
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__STYLE__/shops/shopconfigs/shop_cfg.js?v={$v}'></script>
|
||||
<script type='text/javascript' src='__STATIC__/plugins/webuploader/webuploader.js?v={$v}'></script>
|
||||
<script type='text/javascript' src='__STATIC__/plugins/webuploader/batchupload.js?v={$v}'></script>
|
||||
<script type="text/javascript" src="__STATIC__/plugins/validator/jquery.validator.min.js?v={$v}"></script>
|
||||
<script>
|
||||
$(function(){
|
||||
})
|
||||
function delbanner(obj){
|
||||
var c = WST.confirm({content:'您确定要删除顶部广告图片吗?',yes:function(){
|
||||
$('#shopBannerPreview').attr('src','');
|
||||
$('#shopBanner').val('');
|
||||
$(obj).hide();
|
||||
layer.close(c);
|
||||
}})
|
||||
}
|
||||
function delShopStreetBg(obj){
|
||||
var c = WST.confirm({content:'您确定要删除店铺街背景图片吗?',yes:function(){
|
||||
$('#shopStreetImgPreview').attr('src','');
|
||||
$('#shopStreetImg').val('');
|
||||
$(obj).hide();
|
||||
layer.close(c);
|
||||
}})
|
||||
}
|
||||
</script>
|
||||
|
||||
{/block}
|
124
hyhproject/home2/view/default/shops/shopconfigs/shop_cfg.js
Executable file
124
hyhproject/home2/view/default/shops/shopconfigs/shop_cfg.js
Executable file
@ -0,0 +1,124 @@
|
||||
function save(){
|
||||
/* 表单验证 */
|
||||
$('#shopCfg').isValid(function(v){
|
||||
if(v){
|
||||
var params = WST.getParams('.ipt');
|
||||
// 图片路径
|
||||
var shopAds = [];
|
||||
$('.j-gallery-img').each(function(){
|
||||
shopAds.push($(this).attr('v'));
|
||||
});
|
||||
params.shopAds = shopAds.join(',');
|
||||
// 图片轮播广告路径
|
||||
var shopAdsUrl = [];
|
||||
$('.cfg-img-url').each(function(){
|
||||
shopAdsUrl.push($(this).val());
|
||||
});
|
||||
params.shopAdsUrl = shopAdsUrl.join(',');
|
||||
|
||||
var loading = WST.load({msg:'正在提交数据,请稍后...'});
|
||||
|
||||
$.post(WST.U('home/shopconfigs/editShopCfg'),params,function(data,textStatus){
|
||||
layer.close(loading);
|
||||
var json = WST.toJson(data);
|
||||
if(json.status=='1'){
|
||||
WST.msg("操作成功",{icon:1});
|
||||
}else{
|
||||
WST.msg(json.msg,{icon:2});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$(function(){
|
||||
//店铺顶部广告图上传
|
||||
WST.upload({
|
||||
pick:'#shopBannerPicker',
|
||||
formData: {dir:'shopconfigs'},
|
||||
accept: {extensions: 'gif,jpg,jpeg,png',mimeTypes: 'image/jpg,image/jpeg,image/png,image/gif'},
|
||||
callback:function(f){
|
||||
var json = WST.toJson(f);
|
||||
if(json.status==1){
|
||||
$('#uploadMsg').empty().hide();
|
||||
var shopbanner = json.savePath+json.thumb; //保存到数据库的路径
|
||||
$('#shopBanner').val(shopbanner);
|
||||
$('#shopBannerPreview').parent().show();
|
||||
$('.del-banner').show();
|
||||
$('#shopBannerPreview').attr('src',WST.conf.IMGURL+'/'+json.savePath+json.thumb);
|
||||
}else{
|
||||
WST.msg(json.msg,{icon:2});
|
||||
}
|
||||
},
|
||||
progress:function(rate){
|
||||
$('#uploadMsg').show().html('已上传'+rate+"%");
|
||||
}
|
||||
});
|
||||
|
||||
// 店铺街背景图上传
|
||||
WST.upload({
|
||||
pick:'#shopStreetImgPicker',
|
||||
formData: {dir:'shopconfigs'},
|
||||
accept: {extensions: 'gif,jpg,jpeg,png',mimeTypes: 'image/jpg,image/jpeg,image/png,image/gif'},
|
||||
callback:function(f){
|
||||
var json = WST.toJson(f);
|
||||
if(json.status==1){
|
||||
$('#uploadMsg').empty().hide();
|
||||
var shopbanner = json.savePath+json.thumb; //保存到数据库的路径
|
||||
$('#shopStreetImg').val(shopbanner);
|
||||
$('#shopStreetImgPreview').parent().show();
|
||||
$('.del-banner').show();
|
||||
$('#shopStreetImgPreview').attr('src',WST.conf.IMGURL+'/'+json.savePath+json.thumb);
|
||||
}else{
|
||||
WST.msg(json.msg,{icon:2});
|
||||
}
|
||||
},
|
||||
progress:function(rate){
|
||||
$('#uploadMsg').show().html('已上传'+rate+"%");
|
||||
}
|
||||
});
|
||||
|
||||
/********** 轮播广告图片上传 **********/
|
||||
var uploader = batchUpload({uploadPicker:'#batchUpload',uploadServer:WST.U('home/index/uploadPic'),formData:{dir:'shopconfigs'},uploadSuccess:function(file,response){
|
||||
var json = WST.toJson(response);
|
||||
if(json.status==1){
|
||||
$li = $('#'+file.id);
|
||||
$li.append('<input type="hidden" class="j-gallery-img" iv="'+json.savePath + json.thumb+'" v="' +json.savePath + json.name+'"/>');
|
||||
var delBtn = $('<span class="btn-del">删除</span>');
|
||||
$li.append(delBtn);
|
||||
$li.append('<input class="cfg-img-url" type="text" value="" style="width:170px;" placeholder="广告路径">' );
|
||||
$li.css('height','212px');
|
||||
$li.find('.success').remove();
|
||||
delBtn.on('click',function(){
|
||||
delBatchUploadImg($(this),function(){
|
||||
uploader.removeFile(file);
|
||||
uploader.refresh();
|
||||
});
|
||||
});
|
||||
$('.filelist li').css('border','1px solid #f7375c');
|
||||
}else{
|
||||
WST.msg(json.msg,{icon:2});
|
||||
}
|
||||
}});
|
||||
// 删除广告图片
|
||||
$('.btn-del').click(function(){
|
||||
delBatchUploadImg($(this),function(){
|
||||
$(this).parent().remove();
|
||||
});
|
||||
})
|
||||
|
||||
function delBatchUploadImg(obj){
|
||||
var c = WST.confirm({content:'您确定要删除广告图片吗?',yes:function(){
|
||||
$(obj).parent().remove("li");
|
||||
layer.close(c);
|
||||
}});
|
||||
}
|
||||
|
||||
|
||||
});
|
Reference in New Issue
Block a user