Authored by weiqingting

Merge branch 'master' into develop

# Conflicts:
#	client/js/common/edit.js
#	server/views/partials/netsale/editor-recommend.html
... ... @@ -127,6 +127,7 @@ edit.prototype = {
}
/*初始化文件上传*/
<<<<<<< HEAD
if ($('input[type="file"]', that.el).length > 0) {
$('input[type="file"]', that.el).each(function() {
var src = $(this).attr("value");
... ... @@ -140,6 +141,24 @@ edit.prototype = {
Temp += '<video width="76" height="80" src="' + src + '"></video>';
} else {
Temp += '<img width="76" height="80" src="' + src + '">';
=======
if($('input[type="file"]',that.el).length>0){
$('input[type="file"]',that.el).each(function(){
var src=$(this).attr("value");
var _id=$(this).attr("id")||$(this).attr("name");
var Temp='<ul class="upload-image-list" id="img-'+_id+'">';
Temp+='<li class="fileinput-button">';
Temp+='<a class="fileinput-button-icon" href="javascript:void(0);">';
if(src){
var ext = src.split('.').pop().toLowerCase();
if("mp4,rmvb,avi,mov".indexOf(ext)>-1){
Temp+='<video width="76" height="80" src="'+src+'"></video>';
}else{
Temp+='<img width="76" height="80" src="'+src+'">';
}
}else{
Temp+='+';
>>>>>>> master
}
} else {
Temp += '+';
... ... @@ -161,6 +180,7 @@ edit.prototype = {
// $(this).attr("value",response.data);
// }
// });
<<<<<<< HEAD
$('input[type="file"]', that.el).ajaxfileupload({
'action': '/ajax/upload',
'params': {
... ... @@ -168,6 +188,14 @@ edit.prototype = {
"bucket": that.option.bucket || 'smart',
__type: "upload"
},
=======
if(!that.option.bucket){
alert("bucket不存在");
}
$('input[type="file"]',that.el).ajaxfileupload({
'action': '/ajax/upload',
'params':{"userId":543883,"bucket":that.option.bucket,__type:"upload"},
>>>>>>> master
'onComplete': function(response) {
if (response.status && response.code == 200) {
var _w = $(this).next().find('.fileinput-button-icon');
... ...
... ... @@ -18,6 +18,7 @@ $.fn.ajaxfileupload = function(options) {
$.extend(settings, options);
}
return this.each(function() {
var $element = $(this);
if ($element.data('ajaxUploader-setup') === true) return;
... ... @@ -27,6 +28,12 @@ $.fn.ajaxfileupload = function(options) {
if (ext) {
settings.valid_extensions = ext.split(',');
}
var bucket = $element.attr("bucket");
if(bucket){
settings.params.bucket=bucket;
}
console.log(settings.params);
$element.change(function() {
uploading_file = false;
if (settings.submit_button == null) {
... ...
... ... @@ -3,248 +3,251 @@ exports.domain = require('../config/common.js').domain;
//exports.domain = 'http://172.16.6.162:8088/platform';
//营销管理路由配置
exports.res = [{
//营销码管理 -> 页面渲染
route: '/market/coupon/index',
method: 'GET',
view: 'pages/market/index',
src: '/market/coupon',
noApi: true,
data: {
pageTitle: '优惠码列表',
filter: true,
createUrl: '/market/coupon/add',
gridurl: '/market/coupon/getPromotion'
// tabUrl: '/getCodeCount',
// sendUrl: '/sendPromotion',
// auditUrl: '/auditPromotion'
}
}, {
//营销码管理 -> 列表数据
route: '/market/coupon/getPromotion',
method: 'POST',
url: '/promotioncode/getPromotionCodeList',
isJsonRaw: true,
params: [{
name: 'status',
type: 'Number'
}, {
name: 'page',
type: 'Number'
}, {
name: 'size',
type: 'Number'
}, {
name: 'batchNo',
type: 'Number'
}, {
name: 'name',
type: 'String'
}, {
name: 'reqDepartment',
type: 'String'
}]
}, {
//营销码管理 -> 列表操作
route: '/market/coupon/auditPromotion',
method: 'POST',
url: '/promotioncode/auditPromotionCode',
isJsonRaw: true,
params: [{
name: 'id',
type: 'Number'
}, {
name: 'status',
type: 'Number'
}, {
name: 'reason',
type: 'String'
}]
}, {
//营销码管理 -> 发放列表
route: '/market/coupon/sendPromotion',
method: 'POST',
url: '/promotioncode/getPromotionCodeSendList',
isJsonRaw: true,
params: [{
name: 'auditTime',
type: 'String'
}]
}, {
//营销码管理 -> tab卡数据
route: '/market/coupon/getCodeCount',
method: 'POST',
url: '/promotioncode/getPromotionCodeCountByStatus',
isJsonRaw: true,
params: [{
name: 'reqDepartment',
type: 'String'
}, {
name: 'name',
type: 'String'
}, {
name: 'batchNo',
type: 'Number'
}]
}, {
//营销码管理 -> 添加优惠码页面渲染
route: '/market/coupon/add',
method: 'GET',
view: 'pages/market/coupon-edit',
src: '/market/coupon-edit',
data: {
action: "/market/coupon/addCode",
type: "add",
data: {
limitTimes: "0",
reqDepartment: "零售部/营销策划",
userSourceLimit: "1",
userTypeLimit: "1",
userUseLimit: "1",
staff: "admin",
status: "0"
}
}
}, {
//营销码管理 -> 添加优惠码
route: '/market/coupon/addCode',
method: 'POST',
url: '/promotioncode/addPromotionCode',
isJsonRaw: true,
params: [{
name: 'name',
type: 'String'
}, {
name: 'limitTimes',
type: 'String'
}, {
name: 'code',
type: 'String'
}, {
name: 'describe',
type: 'String'
}, {
name: 'promotionInfo',
type: 'String'
}, {
name: 'userSourceLimit',
type: 'String'
}, {
name: 'userTypeLimit',
type: 'String'
}, {
name: 'creatorId',
type: 'String'
}, {
name: 'limitDateFrom',
type: 'String'
}, {
name: 'limitDateTo',
type: 'String'
}, {
name: 'createTime',
type: 'String'
}, {
name: 'reqDepartment',
type: 'String'
}, {
name: 'status',
type: 'String'
}, {
name: 'staff',
type: 'String'
}]
}, {
//营销码管理 -> 编辑优惠码页面渲染
route: '/market/coupon/update/:id',
method: 'GET',
view: 'pages/market/coupon-edit',
url: '/promotioncode/getPromotionCode',
isJsonRaw: true,
data: {
action: "/market/coupon/updateCode",
type: "update"
},
src: '/market/coupon-edit',
params: [{
name: "id",
type: "String"
}]
}, {
//营销码管理 -> 优惠码详情
route: '/market/coupon/info/:id',
method: 'GET',
view: 'pages/market/coupon-edit',
url: '/promotioncode/getPromotionCode',
isJsonRaw: true,
src: '/market/coupon-edit',
data: {
type: "info"
},
params: [{
name: "id",
type: "String"
}]
}, {
//营销码管理 -> 验证优惠码
route: '/market/coupon/checkPromotionCode',
method: 'POST',
url: '/promotioncode/checkPromotionCode',
isJsonRaw: true,
params: [{
name: 'code',
type: 'String'
}]
}, {
//营销码管理 -> 编辑优惠码
route: '/market/coupon/updateCode',
method: 'POST',
url: '/promotioncode/updatePromotionCode',
isJsonRaw: true,
params: [{
name: 'id',
type: 'String'
}, {
name: 'name',
type: 'String'
}, {
name: 'limitTimes',
type: 'String'
}, {
name: 'code',
type: 'String'
}, {
name: 'describe',
type: 'String'
}, {
name: 'promotionInfo',
type: 'String'
}, {
name: 'userSourceLimit',
type: 'String'
}, {
name: 'userTypeLimit',
type: 'String'
}, {
name: 'creatorId',
type: 'String'
}, {
name: 'limitDateFrom',
type: 'String'
}, {
name: 'limitDateTo',
type: 'String'
}, {
name: 'createTime',
type: 'String'
}, {
name: 'reqDepartment',
type: 'String'
}, {
name: 'status',
type: 'String'
}]
}, {
exports.res = [
// {
// //营销码管理 -> 页面渲染
// route: '/market/coupon/index',
// method: 'GET',
// view: 'pages/market/index',
// src: '/market/coupon',
// noApi: true,
// data: {
// pageTitle: '优惠码列表',
// filter: true,
// createUrl: '/market/coupon/add',
// gridurl: '/market/coupon/getPromotion'
// // tabUrl: '/getCodeCount',
// // sendUrl: '/sendPromotion',
// // auditUrl: '/auditPromotion'
// }
// },
// {
// //营销码管理 -> 列表数据
// route: '/market/coupon/getPromotion',
// method: 'POST',
// url: '/promotioncode/getPromotionCodeList',
// isJsonRaw: true,
// params: [{
// name: 'status',
// type: 'Number'
// }, {
// name: 'page',
// type: 'Number'
// }, {
// name: 'size',
// type: 'Number'
// }, {
// name: 'batchNo',
// type: 'Number'
// }, {
// name: 'name',
// type: 'String'
// }, {
// name: 'reqDepartment',
// type: 'String'
// }]
// }, {
// //营销码管理 -> 列表操作
// route: '/market/coupon/auditPromotion',
// method: 'POST',
// url: '/promotioncode/auditPromotionCode',
// isJsonRaw: true,
// params: [{
// name: 'id',
// type: 'Number'
// }, {
// name: 'status',
// type: 'Number'
// }, {
// name: 'reason',
// type: 'String'
// }]
// }, {
// //营销码管理 -> 发放列表
// route: '/market/coupon/sendPromotion',
// method: 'POST',
// url: '/promotioncode/getPromotionCodeSendList',
// isJsonRaw: true,
// params: [{
// name: 'auditTime',
// type: 'String'
// }]
// }, {
// //营销码管理 -> tab卡数据
// route: '/market/coupon/getCodeCount',
// method: 'POST',
// url: '/promotioncode/getPromotionCodeCountByStatus',
// isJsonRaw: true,
// params: [{
// name: 'reqDepartment',
// type: 'String'
// }, {
// name: 'name',
// type: 'String'
// }, {
// name: 'batchNo',
// type: 'Number'
// }]
// }, {
// //营销码管理 -> 添加优惠码页面渲染
// route: '/market/coupon/add',
// method: 'GET',
// view: 'pages/market/coupon-edit',
// src: '/market/coupon-edit',
// data: {
// action: "/market/coupon/addCode",
// type: "add",
// data: {
// limitTimes: "0",
// reqDepartment: "零售部/营销策划",
// userSourceLimit: "1",
// userTypeLimit: "1",
// userUseLimit: "1",
// staff: "admin",
// status: "0"
// }
// }
// }, {
// //营销码管理 -> 添加优惠码
// route: '/market/coupon/addCode',
// method: 'POST',
// url: '/promotioncode/addPromotionCode',
// isJsonRaw: true,
// params: [{
// name: 'name',
// type: 'String'
// }, {
// name: 'limitTimes',
// type: 'String'
// }, {
// name: 'code',
// type: 'String'
// }, {
// name: 'describe',
// type: 'String'
// }, {
// name: 'promotionInfo',
// type: 'String'
// }, {
// name: 'userSourceLimit',
// type: 'String'
// }, {
// name: 'userTypeLimit',
// type: 'String'
// }, {
// name: 'creatorId',
// type: 'String'
// }, {
// name: 'limitDateFrom',
// type: 'String'
// }, {
// name: 'limitDateTo',
// type: 'String'
// }, {
// name: 'createTime',
// type: 'String'
// }, {
// name: 'reqDepartment',
// type: 'String'
// }, {
// name: 'status',
// type: 'String'
// }, {
// name: 'staff',
// type: 'String'
// }]
// }, {
// //营销码管理 -> 编辑优惠码页面渲染
// route: '/market/coupon/update/:id',
// method: 'GET',
// view: 'pages/market/coupon-edit',
// url: '/promotioncode/getPromotionCode',
// isJsonRaw: true,
// data: {
// action: "/market/coupon/updateCode",
// type: "update"
// },
// src: '/market/coupon-edit',
// params: [{
// name: "id",
// type: "String"
// }]
// }, {
// //营销码管理 -> 优惠码详情
// route: '/market/coupon/info/:id',
// method: 'GET',
// view: 'pages/market/coupon-edit',
// url: '/promotioncode/getPromotionCode',
// isJsonRaw: true,
// src: '/market/coupon-edit',
// data: {
// type: "info"
// },
// params: [{
// name: "id",
// type: "String"
// }]
// }, {
// //营销码管理 -> 验证优惠码
// route: '/market/coupon/checkPromotionCode',
// method: 'POST',
// url: '/promotioncode/checkPromotionCode',
// isJsonRaw: true,
// params: [{
// name: 'code',
// type: 'String'
// }]
// }, {
// //营销码管理 -> 编辑优惠码
// route: '/market/coupon/updateCode',
// method: 'POST',
// url: '/promotioncode/updatePromotionCode',
// isJsonRaw: true,
// params: [{
// name: 'id',
// type: 'String'
// }, {
// name: 'name',
// type: 'String'
// }, {
// name: 'limitTimes',
// type: 'String'
// }, {
// name: 'code',
// type: 'String'
// }, {
// name: 'describe',
// type: 'String'
// }, {
// name: 'promotionInfo',
// type: 'String'
// }, {
// name: 'userSourceLimit',
// type: 'String'
// }, {
// name: 'userTypeLimit',
// type: 'String'
// }, {
// name: 'creatorId',
// type: 'String'
// }, {
// name: 'limitDateFrom',
// type: 'String'
// }, {
// name: 'limitDateTo',
// type: 'String'
// }, {
// name: 'createTime',
// type: 'String'
// }, {
// name: 'reqDepartment',
// type: 'String'
// }, {
// name: 'status',
// type: 'String'
// }]
// },
{
//限购码管理 -> 页面渲染
route: '/market/limitcode/index',
method: 'GET',
... ...
... ... @@ -157,7 +157,7 @@
<!-- Mov avi rmvb mp4 -->
<div class="row">
<div id="upload-wrapper1" class="col-md-3">
<input id="videofile" name="videofile" type="file" extend="mp4,rmvb,avi,mov" class="btn btn-primary ml10" value="{attachUrl}">
<input id="videofile" name="videofile" type="file" bucket="goodsvideo" extend="mp4,rmvb,avi,mov" class="btn btn-primary ml10" value="{attachUrl}">
</div>
<div class="col-md-9">
<div class="row">
... ...
<div class="panel panel-default">
<form action="" class="form-horizontal form-bordered">
<div class="panel-heading">
<div class="panel-btns" style="display: none;">
<a href="" class="panel-minimize tooltips" data-toggle="tooltip" title=""><i class="fa fa-minus"></i></a>
... ... @@ -7,14 +6,17 @@
<h2 class="panel-title">小编推荐</h2>
</div>
<div class="panel-body nopadding">
<<<<<<< HEAD
<script id="edit-recommender" type="text/plain" style="width:100%;height:500px;"></script>
<p>
<span class="red">提示:与商品相关的逛信息自动抓取到下列各模块中,若要在商品详情中展示,请将其编辑在【小编推荐】中。
</span>
</p>
=======
<script id="editor" type="text/plain" style="width:100%;height:400px;"></script>
>>>>>>> master
</div>
<div class="panel-footer">
<button class="btn btn-primary" id="btn-recommand">保存</button>
</div>
</form>
</div>
\ No newline at end of file
... ...