Authored by xuhongyun

build project

... ... @@ -97,7 +97,7 @@ webpackJsonp([9],[
}},
{display: '吊牌价', name: 'retail_price'},
{display: '销售价', name: 'sales_price'},
{display: '学生价', name: 'student_price'},
/*{display: '学生价', name: 'student_price'},*/
{display: 'VIP折扣类型', render: function(item) {
return ENUM.vipType[item.vip_discount_type];
}},
... ... @@ -170,7 +170,6 @@ webpackJsonp([9],[
var $wrap = parentTr.next('.product-detail'),
$price = $wrap.find('.sale-price'),
$student_price = $wrap.find('.student-price'),
$select = $wrap.find('.discount-select'),
$vipPrice = $wrap.find('.vip-price'),
$vip3Price = $wrap.find('.vip3-price'),
... ... @@ -199,7 +198,6 @@ webpackJsonp([9],[
data: {
product_skn: skn,
sales_price: $price.val(),
student_price: $student_price.val(),
vip_discount_type: $select.val(),
vip_price: $vipPrice.val(),
vip1_price: $vip1Price.val(),
... ... @@ -326,7 +324,7 @@ webpackJsonp([9],[
}},
{display: '学生价', render: function(item) {
/*{display: '学生价', render: function(item) {
var newPrice = item.newProductPriceBo,
newPriceHtml = '';
if (newPrice.student_price) {
... ... @@ -344,7 +342,7 @@ webpackJsonp([9],[
newPriceHtml += '<div>-</div>';
}
return newPriceHtml;
}},
}},*/
{display: 'VIP折扣类型', render: function(item) {
return '<p>'+ENUM.vipType[item.newProductPriceBo.vip_discount_type] + '</p>'+
... ...
... ... @@ -14,6 +14,7 @@ webpackJsonp([13],[
var curTemplateType = "2"; //当前模板类型 1:基础模板,2:经典模板
var shopType = 1; //店铺类型 1:单品牌,2:多品牌
var shopOperate = 'view'; //操作 editor:可编辑, view:查看不可编辑
var shopCategory = []; //店铺下所有的销售类目
var defaultSrc = "http://img01.yohoboys.com/staticimg/2016/05/19/15/01091c21f2317a64f123f1649fbbccf7ba.png"; //初始化默认图片路径
var ENUM = {
"editor-largePic":{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0},
... ... @@ -300,6 +301,7 @@ webpackJsonp([13],[
//最新上架,最热商品接口
if(shopOperate == 'editor'){
findShopCategory();
if(!jsonMain.resources.allNewProducts.data || jsonMain.resources.allNewProducts.data.length < 1){
findTopNewProducts();
}
... ... @@ -314,6 +316,20 @@ webpackJsonp([13],[
showMain();
},true);
}
//Ajax查询店铺下销售类目
function findShopCategory() {
common.util.__ajax({
url:'/shops/shopCategory/list',
data: {
shopId: jsonMain.shopsId
}
},function(rs){
console.log(rs);
if(rs.data){
shopCategory = rs.data;
}
},true);
}
//Ajax最新上架商品
function findTopNewProducts(){
common.util.__ajax({
... ... @@ -509,7 +525,14 @@ webpackJsonp([13],[
return "<input class='form-control inputChange' type=text name='name' value='"+item.name+"' data-index='"+item.__index+"' maxlength='5' />";
}},
{display:"链接", render:function(item){
return "<input class='form-control inputChange urlInput' type=text name='url' value='"+(item.url).replace(/'/g,'\"')+"' data-index='"+item.__index+"' />";
// return "<input class='form-control inputChange urlInput' type=text name='url' value='"+(item.url).replace(/'/g,'\"')+"' data-index='"+item.__index+"' />";
if(item.url != ''){
item.linkType = item.linkType || '0';
}else{
item.linkType = item.linkType || '1';
}
item.categoryId = item.categoryId || '-1';
return common.util.__template2($("#link").html(),{data:item, categoryList:shopCategory, index:item.__index});
}}
]
});
... ... @@ -744,10 +767,21 @@ webpackJsonp([13],[
}
}},
{display:"链接", render:function(item){
// if(item.__index == 0){
// return "http://店铺商品列表页(默认)";
// }else{
// return "<input class='form-control inputChange urlInput' type=text name='url' value='"+(item.url).replace(/'/g,'\"')+"' data-index='"+item.__index+"' />";
// }
if(item.__index == 0){
return "http://店铺商品列表页(默认)";
}else{
return "<input class='form-control inputChange urlInput' type=text name='url' value='"+(item.url).replace(/'/g,'\"')+"' data-index='"+item.__index+"' />";
if(item.url != ''){
item.linkType = item.linkType || '0';
}else{
item.linkType = item.linkType || '1';
}
item.categoryId = item.categoryId || '-1';
return common.util.__template2($("#link").html(),{data:item, categoryList:shopCategory, index:item.__index});
}
}},
{display:"操作", render:function(item){
... ... @@ -792,10 +826,21 @@ webpackJsonp([13],[
}
}},
{display:"链接", render:function(item){
// if(item.__index == 0){
// return "http://店铺商品列表页(默认)";
// }else{
// return "<input class='form-control inputChange urlInput' type=text name='url' value='"+(item.url).replace(/'/g,'\"')+"' data-index='"+item.__index+"' />";
// }
if(item.__index == 0){
return "http://店铺商品列表页(默认)";
}else{
return "<input class='form-control inputChange urlInput' type=text name='url' value='"+(item.url).replace(/'/g,'\"')+"' data-index='"+item.__index+"' />";
if(item.url != ''){
item.linkType = item.linkType || '0';
}else{
item.linkType = item.linkType || '1';
}
item.categoryId = item.categoryId || '-1';
return common.util.__template2($("#link").html(),{data:item, categoryList:shopCategory, index:item.__index});
}
}},
{display:"操作", render:function(item){
... ... @@ -1385,24 +1430,105 @@ webpackJsonp([13],[
}
//资源位图片代码生成器
function resourcesHtmlInit(item,resName){
var picList = item.data,
// var picList = item.data,
// htmlPic = "";
// for(var i=0; i<picList.length; i++){
// picList[i].url=picList[i].url.replace(/'/g,'\"'); // 字符串里面双引号转换成单引号
// htmlPic += "<div class='row'>" +
// "<div class='col-sm-2'><input type=file name='"+ resName +"Image' id='"+ resName +"Image_"+item.__index+"_"+i+"' value='"+picList[i].src+"' /></div>" +
// "<div class='col-sm-3'><input type=text class='form-control inputChange urlInput' name='url' value='"+picList[i].url+"' data-index='"+item.__index+"_"+i+"' /></div>" +
// "<div class='col-sm-2'>";
// if(i>0){
// htmlPic += "<input type=text class='form-control' disabled jsaction='time:end:endTime_"+item.__index+"_"+ i +"' id='startTime_"+item.__index+"_"+ i +"' name='startTime' value='"+ picList[i].startTime +"' />" +
// "<span style='color: #999; font-size: 12px'>*上一条结束时间</span>";
// }else{
// htmlPic += "<input type=text class='form-control inputChange' style='background-color:#fff' readOnly='true' jsaction='time:end:endTime_"+item.__index+"_"+ i +"' id='startTime_"+item.__index+"_"+ i +"' name='startTime' value='"+ picList[i].startTime +"' data-index='"+ item.__index +"_"+ i +"' />";
// }
// htmlPic += "</div><div class='col-sm-2'>" +
// "<input type=text class='form-control inputChange' style='background-color:#fff' readOnly='true' jsaction='time:start:startTime_"+item.__index+"_"+ i +"' id='endTime_"+item.__index+"_"+ i +"' name='endTime' value='"+ picList[i].endTime +"' data-index='"+ item.__index +"_"+ i +"' /></div>" +
// "<div class='col-sm-1'><span class='publishStatus' style='white-space: nowrap; line-height: 40px'>"+ checkdate(picList[i].startTime,picList[i].endTime) +"</span></div>" +
// "<div class='col-sm-2' style='line-height: 40px'>";
// if(i == (picList.length-1) && picList.length > 1){
// htmlPic += "<input type=button class='btn btn-danger btn-xs deleteBtn' value='删除' data-index='"+ item.__index +"_"+ i +"' /><br>";
// htmlPic += "<input type=button class='btn btn-info btn-xs addBtn' style='margin-top: 10px' value='添加一条' data-index='"+ item.__index +"_"+ i +"' />";
// }
// if(i < (picList.length-1) && picList.length > 1){
// htmlPic += "<input type=button class='btn btn-danger btn-xs deleteBtn' value='删除' data-index='"+ item.__index +"_"+ i +"' />";
// }
// if(i == (picList.length-1) && picList.length == 1){
// htmlPic += "<input type=button class='btn btn-info btn-xs addBtn' value='添加一条' data-index='"+ item.__index +"_"+ i +"' />";
// }
// htmlPic += "</div></div>";
// }
// return htmlPic;
var picList = item.data,
htmlPic = "";
for(var i=0; i<picList.length; i++){
picList[i].url=picList[i].url.replace(/'/g,'\"'); // 字符串里面双引号转换成单引号
htmlPic += "<div class='row'>" +
"<div class='col-sm-2'><input type=file name='"+ resName +"Image' id='"+ resName +"Image_"+item.__index+"_"+i+"' value='"+picList[i].src+"' /></div>" +
"<div class='col-sm-3'><input type=text class='form-control inputChange urlInput' name='url' value='"+picList[i].url+"' data-index='"+item.__index+"_"+i+"' /></div>" +
"<div class='col-sm-2'>";
//picList[i].url=picList[i].url.replace(/'/g,'\"'); // 字符串里面单引号转换成双引号
if(i == 0){
htmlPic += "<div class='row' style='padding: 10px 0'>";
}else{
htmlPic += "<div class='row' style='padding: 10px 0; border-top: 1px solid #dddddd'>";
}
//图片,大图资源位,小图资源位,水牌图片尺寸校验——fileType参数
htmlPic += "<div class='col-sm-2'>";
if(curPlatform == "pc"){
if(curDialogId == "editor-largePic"){//经典模板pc大图资源位
htmlPic += "<input type=file fileType='6' name='"+ resName +"Image' id='"+ resName +"Image_"+item.__index+"_"+i+"' value='"+picList[i].src+"' />";
}
if(curDialogId == "editor-smallPic"){//经典模板pc小图资源位
htmlPic += "<input type=file fileType='7' name='"+ resName +"Image' id='"+ resName +"Image_"+item.__index+"_"+i+"' value='"+picList[i].src+"' />";
}
if(curDialogId == "editor-signboard"){//基础模板水牌
htmlPic += "<input type=file fileType='3' name='"+ resName +"Image' id='"+ resName +"Image_"+item.__index+"_"+i+"' value='"+picList[i].src+"' />";
}
}
if(curPlatform == "app"){
if(curDialogId == "editor-largePic"){//经典模板app大图资源位
htmlPic += "<input type=file fileType='11' name='"+ resName +"Image' id='"+ resName +"Image_"+item.__index+"_"+i+"' value='"+picList[i].src+"' />";
}
if(curDialogId == "editor-smallPic"){//经典模板app小图资源位
htmlPic += "<input type=file fileType='12' name='"+ resName +"Image' id='"+ resName +"Image_"+item.__index+"_"+i+"' value='"+picList[i].src+"' />";
}
}
htmlPic += "</div>";
//url&销售类目
console.log(picList[i].url);
if(picList[i].url != ''){
picList[i].linkType = picList[i].linkType || '0';
}else{
picList[i].linkType = picList[i].linkType || '1';
}
picList[i].categoryId = picList[i].categoryId || '-1';
htmlPic += "<div class='col-sm-3'>";
htmlPic += common.util.__template2($("#link").html(),{data:picList[i], categoryList:shopCategory, index:item.__index+'_'+i});
htmlPic += "</div>";
//开始时间
htmlPic += "<div class='col-sm-2'>";
if(i>0){
htmlPic += "<input type=text class='form-control' disabled jsaction='time:end:endTime_"+item.__index+"_"+ i +"' id='startTime_"+item.__index+"_"+ i +"' name='startTime' value='"+ picList[i].startTime +"' />" +
"<span style='color: #999; font-size: 12px'>*上一条结束时间</span>";
"<span style='color: #999; font-size: 12px'>*上一条结束时间</span>";
}else{
htmlPic += "<input type=text class='form-control inputChange' style='background-color:#fff' readOnly='true' jsaction='time:end:endTime_"+item.__index+"_"+ i +"' id='startTime_"+item.__index+"_"+ i +"' name='startTime' value='"+ picList[i].startTime +"' data-index='"+ item.__index +"_"+ i +"' />";
}
htmlPic += "</div><div class='col-sm-2'>" +
"<input type=text class='form-control inputChange' style='background-color:#fff' readOnly='true' jsaction='time:start:startTime_"+item.__index+"_"+ i +"' id='endTime_"+item.__index+"_"+ i +"' name='endTime' value='"+ picList[i].endTime +"' data-index='"+ item.__index +"_"+ i +"' /></div>" +
"<div class='col-sm-1'><span class='publishStatus' style='white-space: nowrap; line-height: 40px'>"+ checkdate(picList[i].startTime,picList[i].endTime) +"</span></div>" +
"<div class='col-sm-2' style='line-height: 40px'>";
htmlPic += "</div>";
//结束时间
htmlPic += "<div class='col-sm-2'>"
+ "<input type=text class='form-control inputChange' style='background-color:#fff' readOnly='true' jsaction='time:start:startTime_"+item.__index+"_"+ i +"' id='endTime_"+item.__index+"_"+ i +"' name='endTime' value='"+ picList[i].endTime +"' data-index='"+ item.__index +"_"+ i +"' />"
+ "</div>";
//状态
htmlPic += "<div class='col-sm-1'><span class='publishStatus' style='white-space: nowrap; line-height: 40px'>"+ checkdate(picList[i].startTime,picList[i].endTime) +"</span></div>";
//操作
htmlPic += "<div class='col-sm-2' style='line-height: 40px'>";
if(i == (picList.length-1) && picList.length > 1){
htmlPic += "<input type=button class='btn btn-danger btn-xs deleteBtn' value='删除' data-index='"+ item.__index +"_"+ i +"' /><br>";
htmlPic += "<input type=button class='btn btn-info btn-xs addBtn' style='margin-top: 10px' value='添加一条' data-index='"+ item.__index +"_"+ i +"' />";
... ... @@ -1581,6 +1707,28 @@ webpackJsonp([13],[
function(){}
);
})
//销售类目&自定义切换
$(document).on("change", ".linkSelect", function () {
if($(this).val() == 0){ //自定义
$(this).next('.link_url').show().next('.link_category').hide();
}else{ //销售类目
$(this).next('.link_url').hide().next('.link_category').show();
}
});
//选择销售类目时,监听id跟名称
$(document).on("change", ".categoryChange", function () {
var _index = $(this).attr("data-index");
var indexList = _index.split("_");
var categoryName = this.options[this.selectedIndex].text;
if(indexList.length > 1){
(g.__rows[indexList[0]].data)[indexList[1]].categoryId = $(this).val();
(g.__rows[indexList[0]].data)[indexList[1]].categoryName = categoryName;
}else{
g.__rows[indexList[0]].categoryId = $(this).val();
g.__rows[indexList[0]].categoryName = categoryName;
}
});
//删除
$(document).on("click",".deleteBtn",function(){
var _index = $(this).data("index")+"";
... ...
... ... @@ -14,7 +14,7 @@
<td>说明:</td>
<td colspan="2">
1、上传文件必须是<span style="color:red;">.xlsx</span>文件<br>
2、Excel表头为:<span style="color: #67D267;">SKN、模块ID(品牌设置:1;奥莱设置:2;搜索设置:3)、排序值</span><br>
2、Excel表头为:<span style="color: #67D267;">SKN、模块ID(品牌设置:1)、排序值</span><br>
3、第一行为表头内容,第二行开始为正式内容<br>
4、每个文件控制在2500行以内<br>
5、<a href="/ajax/link/searchSort">下载样例</a>
... ...
... ... @@ -95,7 +95,7 @@
<td width="120px"><b>说明:</b></td>
<td>
1、上传文件必须是<span style="color:red;">.xlsx</span>文件<br>
2、Excel表头为:<span style="color: #67D267;">SKN、吊牌价、销售价、学生价、VIP折扣类型、VIP价、白金价、金卡价、银卡价</span><br>
2、Excel表头为:<span style="color: #67D267;">SKN、吊牌价、销售价、VIP折扣类型、VIP价、白金价、金卡价、银卡价</span><br>
3、第一行为表头内容,第二行开始为正式内容<br>
4、每个文件控制在2500行以内<br>
5、<a href="/ajax/link/batchUpdatePrice" style="margin: 0; text-decoration: underline">下载样例.xlsx</a>
... ... @@ -144,7 +144,6 @@
<table class="table table-striped table-bordered" style="margin: 0;border: 0">
<tr>
<th style="border-top: 0; border-left: 0">销售价</th>
<th style="border-top: 0;">学生价</th>
<th style="border-top: 0">VIP折扣类型</th>
<th style="border-top: 0">VIP</th>
<th style="border-top: 0">白金价</th>
... ... @@ -160,9 +159,6 @@
<td style="border-bottom: 0; border-left: 0">
<input class="sale-price form-control" type="text" value="{sales_price}" onkeyup="this.value=this.value.replace(/[^\d\.]|^\./gi,'')">
</td>
<td style="border-bottom: 0; border-left: 0">
<input class="student-price form-control" type="text" value="{student_price}" disabled>
</td>
<td style="border-bottom: 0">
<select class="discount-select form-control" style="width: 110px">
<option value="1">正常折扣</option>
... ... @@ -231,7 +227,6 @@
<tr>
<th>吊牌价</th>
<th>销售价</th>
<th>学生价</th>
<th>价格生效-<font color="green">开始时间</font></th>
<th>价格生效-<font color="red">结束时间</font></th>
<th>变价时间</th>
... ... @@ -245,7 +240,6 @@
<tr>
<td>[[item.retailPrice]]</td>
<td>[[item.salesPrice]]</td>
<td>[[item.studentPrice]]</td>
<td>[[item.effectiveTime]]</td>
<td>[[item.changePriceEndTime]]</td>
<td>[[item.createTime]]</td>
... ...
... ... @@ -355,5 +355,36 @@
</div>
</script>
<script type="text/template" id="link">
<select class="form-control inputChange linkSelect" name="linkType" style="margin-bottom: 10px" data-index='[[index]]'>
<option value="0" [[data.linkType==0?'selected':'']]>自定义</option>
<option value="1" [[data.linkType==1?'selected':'']]>销售类目</option>
</select>
[[if data.linkType == 0]]
<div class="link_url">
<input class='form-control inputChange urlInput' type=text name='url' value='[[data.url]]' data-index='[[index]]' />
</div>
<div class="link_category" style="display: none">
<select class="form-control categoryChange" name='categoryId' data-index='[[index]]'>
<option value="-1">-- 请选择销售类目 --</option>
[[each categoryList as item _index]]
<option value="[[item.categoryId]]" [[data.categoryId==item.categoryId?'selected':'']]>[[item.categoryName]]</option>
[[/each]]
</select>
</div>
[[else]]
<div class="link_url" style="display: none">
<input class='form-control inputChange urlInput' type=text name='url' value='[[data.url]]' data-index='[[index]]' />
</div>
<div class="link_category">
<select class="form-control categoryChange" name='categoryId' data-index='[[index]]'>
<option value="-1">-- 请选择销售类目 --</option>
[[each categoryList as item _index]]
<option value="[[item.categoryId]]" [[data.categoryId==item.categoryId?'selected':'']]>[[item.categoryName]]</option>
[[/each]]
</select>
</div>
[[/if]]
</script>
<%include '../common/__ui/footer'%>
\ No newline at end of file
... ...