Authored by 王钱钧

Merge branch 'develop' of http://git.dev.yoho.cn/platform/yohobuy-portal-fe into develop

... ... @@ -17,28 +17,28 @@ $("button").click(function(){
});
})*/
var $=require('jquery');
var $ = require('jquery');
var Validator = require('./validate');
require('./upload');
require('../util/datepicker');
require('../util/jquery.gritter');
var edit=function(el,option){
this.registerEvent={
validate:[],
bind:[],
render:[],
callback:[]
};
this.el=el;
this.option=option||{};
//typeof option==="string"?option:option.el;
var edit = function(el, option) {
this.registerEvent = {
validate: [],
bind: [],
render: [],
callback: []
};
this.el = el;
this.option = option || {};
//typeof option==="string"?option:option.el;
// new edit.prototype.init(this);
}
edit.prototype={
constructor:edit,
on:function (name,callback) {
edit.prototype = {
constructor: edit,
on: function(name, callback) {
var __self = this;
var _e = __self.registerEvent[name];
if (_e) {
... ... @@ -46,40 +46,40 @@ edit.prototype={
}
return _e;
},
off:function (name, callback) {
off: function(name, callback) {
var __self = this;
var _e = __self.registerEvent[name];
var e = [];
me.each(_e, function (name, _callback) {
me.each(_e, function(name, _callback) {
if (_callback === callback) {
e.push(name);
}
});
me.each(e.reverse(), function (name, _callback) {
me.each(e.reverse(), function(name, _callback) {
_e.splice(_callback, 1);
});
},
init:function(){
init: function() {
var __self = this;
this.render();
this.bind();
return this;
},
render:function(){
var that=this;
render: function() {
var that = this;
/*初始化checkbox和radis*/
$("input:hidden",that.el).each(function(){
var $this=$(this);
var name=$this.attr("id"),
values=String.prototype.split.call($this.val(),'|'),
type=$this.attr("for");
if(type){
$(":"+type+"[name="+name+"]").each(function(){
var $that=$(this);
$.each(values,function(index,value){
if($that.val()===value){
$("input:hidden", that.el).each(function() {
var $this = $(this);
var name = $this.attr("id"),
values = String.prototype.split.call($this.val(), '|'),
type = $this.attr("for");
if (type) {
$(":" + type + "[name=" + name + "]").each(function() {
var $that = $(this);
$.each(values, function(index, value) {
if ($that.val() === value) {
$that.prop("checked", true);
}
})
... ... @@ -87,14 +87,14 @@ edit.prototype={
}
});
/*初始化dropdown*/
$("select").each(function(){
var _value=$(this).attr("value");
if(_value){
$("option[value='"+_value+"']",$(this)).attr("selected", true);
$("select").each(function() {
var _value = $(this).attr("value");
if (_value) {
$("option[value='" + _value + "']", $(this)).attr("selected", true);
}
});
/*时间插件初始化*/
/*时间插件初始化*/
var fdatepicker = {};
$("input[jsaction]", that.el)
.add("input[jsaction]", that.el)
... ... @@ -127,6 +127,21 @@ edit.prototype={
}
/*初始化文件上传*/
<<<<<<< HEAD
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 (ext == "mp4") {
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");
... ... @@ -136,17 +151,21 @@ edit.prototype={
Temp+='<a class="fileinput-button-icon" href="javascript:void(0);">';
if(src){
var ext = src.split('.').pop().toLowerCase();
if(ext=="mp4"){
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
}
Temp+='</a>';
Temp+='</li>';
Temp+='</ul>';
} else {
Temp += '+';
}
Temp += '</a>';
Temp += '</li>';
Temp += '</ul>';
$(this).after(Temp);
});
// edit.ajaxfileupload(that.el+" input[type='file']",{
... ... @@ -161,128 +180,152 @@ edit.prototype={
// $(this).attr("value",response.data);
// }
// });
<<<<<<< HEAD
$('input[type="file"]', that.el).ajaxfileupload({
'action': '/ajax/upload',
'params': {
"userId": 543883,
"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||'smart',__type:"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');
var _img=$('img',_w).add('video',_w);
if(_img.length>0){
_img.attr("src",response.data);
}else{
if (response.status && response.code == 200) {
var _w = $(this).next().find('.fileinput-button-icon');
var _img = $('img', _w).add('video', _w);
if (_img.length > 0) {
_img.attr("src", response.data);
} else {
var ext = response.data.split('.').pop().toLowerCase();
if(ext=="mp4"){
_w.prepend('<video width="76" height="80" src="'+response.data+'"></video>');
}else{
_w.prepend('<img width="76" height="80" src="'+response.data+'">');
if (ext == "mp4") {
_w.prepend('<video width="76" height="80" src="' + response.data + '"></video>');
} else {
_w.prepend('<img width="76" height="80" src="' + response.data + '">');
}
}
$(this).attr("value",response.data);
that.__listen("callback",{key:"file_onComplete_"+$(this).attr("id"),data:response.data});
}else{
$(this).attr("value", response.data);
that.__listen("callback", {
key: "file_onComplete_" + $(this).attr("id"),
data: response.data
});
} else {
that.$tip(response.message);
}
},
'onStart': function() {
that.__listen("callback",{key:"file_onStart_"+$(this).attr("id")});
that.__listen("callback", {
key: "file_onStart_" + $(this).attr("id")
});
},
'onCancel': function() {
that.__listen("callback",{key:"file_onCancel_"+$(this).attr("id")});
that.__listen("callback", {
key: "file_onCancel_" + $(this).attr("id")
});
}
});
}
that.__listen("render");
},
bind:function(){
var that=this;
var cr={};
$(":checkbox",that.el).add(":radio",that.el).change(function(){
var $this=$(this);
var id=$this.attr("name"),
value=$this.val();
bind: function() {
var that = this;
var cr = {};
$(":checkbox", that.el).add(":radio", that.el).change(function() {
var $this = $(this);
var id = $this.attr("name"),
value = $this.val();
cr[id]=[];
cr[id] = [];
if($this.is(":checkbox")){
$(":checked[name="+id+"]",that.el).each(function(){
cr[id].push($(this).val())
if ($this.is(":checkbox")) {
$(":checked[name=" + id + "]", that.el).each(function() {
cr[id].push($(this).val())
});
}
if($this.is(":radio")){
cr[id][0]=value;
if ($this.is(":radio")) {
cr[id][0] = value;
}
$("#"+id,that.el).val(cr[id].join('|'));
$("#" + id, that.el).val(cr[id].join('|'));
});
that.__listen("bind");
},
validate:function(){
var that=this;
var rules = {},data = {},attributes={};
validate: function() {
var that = this;
var rules = {},
data = {},
attributes = {};
var err=[];
var err = [];
$("input:text",that.el)
.add("input[type=number]",that.el)
.add("input:hidden",that.el)
.add("textarea",that.el)
.each(function() {
var id = $(this).attr("id");
var name = $(this).attr("name");
var value =$.trim($(this).val());
if($(this).attr("type")=="file"){
value=!!$(this).attr("value")?$(this).attr("value"):$(this).val();
}
var name=$(this).attr("placeholder")&&!(/^\d+$/.test($(this).attr("placeholder")))?$(this).attr("placeholder").replace(/请填写/g,''):$(this).parents(".form-group").find("label").text().replace(/\*/g,'');
// var rule = [];
$("input:text", that.el)
.add("input[type=number]", that.el)
.add("input:hidden", that.el)
.add("textarea", that.el)
.each(function() {
var id = $(this).attr("id");
var name = $(this).attr("name");
var value = $.trim($(this).val());
if ($(this).attr("type") == "file") {
value = !!$(this).attr("value") ? $(this).attr("value") : $(this).val();
}
var name = $(this).attr("placeholder") && !(/^\d+$/.test($(this).attr("placeholder"))) ? $(this).attr("placeholder").replace(/请填写/g, '') : $(this).parents(".form-group").find("label").text().replace(/\*/g, '');
// var rule = [];
if ((id||name)&&$(this).attr("required")) {
new Validator.init($(this)[0],{
rules:{required:true}
}).validate(function(obj){
err.push("<p>"+name+"不可为空</p>");
});
}
if ((id || name) && $(this).attr("required")) {
new Validator.init($(this)[0], {
rules: {
required: true
}
}).validate(function(obj) {
err.push("<p>" + name + "不可为空</p>");
});
}
// if ($(this).attr("maxlength")) {
// rule.push("max:" + $(this).attr("maxlength"));
// }
// if ($(this).attr("minlength")) {
// rule.push("max:" + $(this).attr("minlength"));
// }
// if ($(this).attr("maxlength")) {
// rule.push("max:" + $(this).attr("maxlength"));
// }
// if ($(this).attr("minlength")) {
// rule.push("max:" + $(this).attr("minlength"));
// }
// var pattern=$(this).attr("pattern");
// if (pattern) {
// if(/(^\/)|(\/&)/.test(pattern)){
// rule.push("regex:" + $(this).attr("pattern"));
// }else{
// rule.push(pattern);
// }
// }
});
// var pattern=$(this).attr("pattern");
// if (pattern) {
// if(/(^\/)|(\/&)/.test(pattern)){
// rule.push("regex:" + $(this).attr("pattern"));
// }else{
// rule.push(pattern);
// }
// }
});
//文件上传
$("input[type=file]",that.el).each(function(){
$("input[type=file]", that.el).each(function() {
var id = $(this).attr("id");
var value =$.trim($(this).attr("value"));
var name=$(this).attr("placeholder")&&!(/^\d+$/.test($(this).attr("placeholder")))?$(this).attr("placeholder").replace(/请填写/g,''):$(this).parents(".form-group").find("label").text().replace(/\*/g,'');
if (id&&$(this).attr("required")&&!value) {
err.push("<p>"+name+"不可为空</p>");
}
var value = $.trim($(this).attr("value"));
var name = $(this).attr("placeholder") && !(/^\d+$/.test($(this).attr("placeholder"))) ? $(this).attr("placeholder").replace(/请填写/g, '') : $(this).parents(".form-group").find("label").text().replace(/\*/g, '');
if (id && $(this).attr("required") && !value) {
err.push("<p>" + name + "不可为空</p>");
}
});
//下拉选择
$("select",that.el).each(function(){
$("select", that.el).each(function() {
var id = $(this).attr("id");
var value =$.trim($(this).val());
var name=$(this).attr("placeholder")&&!(/^\d+$/.test($(this).attr("placeholder")))?$(this).attr("placeholder").replace(/请填写/g,''):$(this).parents(".form-group").find("label").text().replace(/\*/g,'');
if ($(this).attr("required")&&(+value==-1||+value=="")) {
err.push("<p>请选择 "+name+"</p>");
var value = $.trim($(this).val());
var name = $(this).attr("placeholder") && !(/^\d+$/.test($(this).attr("placeholder"))) ? $(this).attr("placeholder").replace(/请填写/g, '') : $(this).parents(".form-group").find("label").text().replace(/\*/g, '');
if ($(this).attr("required") && (+value == -1 || +value == "")) {
err.push("<p>请选择 " + name + "</p>");
}
});
});
// var v = Validator.make(data, rules);
// v.mergeAttribute(attributes);
... ... @@ -294,45 +337,45 @@ edit.prototype={
// that.__err(err.join(''));
// return false;
// }
if(err.length>0){
if (err.length > 0) {
that.__err(err.join(''));
return false;
}
var zierr=0;
that.__listen("validate",'',function(data){
if(data==false||typeof data=="string"){
var zierr = 0;
that.__listen("validate", '', function(data) {
if (data == false || typeof data == "string") {
zierr++;
typeof data=="string"?err.push("<p>"+data+"</p>"):'';
typeof data == "string" ? err.push("<p>" + data + "</p>") : '';
}
});
if(zierr>0){
if (zierr > 0) {
that.__err(err.join(''));
return false;
}
return true;
},
submit:function(url,callback){
var that=this;
if(!that.validate()){
submit: function(url, callback) {
var that = this;
if (!that.validate()) {
return false;
}
var data={};
$("input:text",that.el)//number
.add("input[type=number]",that.el)
.add("input:hidden",that.el)
.add("select",that.el)
.add("textarea",that.el)
.each(function(){
var name=$(this).attr("id");
var value=$.trim($(this).val());
data[name]=value;
});
$("input[type=file]",that.el).each(function(){
var name=$(this).attr("id");
var value=$(this).attr("value");
data[name]=value;
var data = {};
$("input:text", that.el) //number
.add("input[type=number]", that.el)
.add("input:hidden", that.el)
.add("select", that.el)
.add("textarea", that.el)
.each(function() {
var name = $(this).attr("id");
var value = $.trim($(this).val());
data[name] = value;
});
$("input[type=file]", that.el).each(function() {
var name = $(this).attr("id");
var value = $(this).attr("value");
data[name] = value;
});
var options = {
... ... @@ -348,52 +391,53 @@ edit.prototype={
return false;
}
};
callback&&callback(options);
if(!options.debug){
callback && callback(options);
if (!options.debug) {
$.ajax(options);
} else {
return options.data;
}
//return false;
},
__listen:function(key,o,callback){
var __self=this;
if (__self.registerEvent[key]&&__self.registerEvent[key].length > 0) {
__listen: function(key, o, callback) {
var __self = this;
if (__self.registerEvent[key] && __self.registerEvent[key].length > 0) {
for (_e in __self.registerEvent[key]) {
var a=__self.registerEvent[key][_e](o);
if(callback){
var a = __self.registerEvent[key][_e](o);
if (callback) {
callback(a);
}
}
}
},
__err:function(msg,callback){
if(msg){
this.$tip(msg,callback);
__err: function(msg, callback) {
if (msg) {
this.$tip(msg, callback);
}
},
$tip:function(msg,callback,type){
$tip: function(msg, callback, type) {
$.gritter.add({
title: msg,
class_name: type||'growl-warning',
class_name: type || 'growl-warning',
sticky: false,
time:1000,
time: 1000,
after_open: setTimeout(function() {
callback&&callback();
},1000)
});
callback && callback();
}, 1000)
});
}
};
edit.ajaxfileupload=function(el,option){
edit.ajaxfileupload = function(el, option) {
$(el).ajaxfileupload({
'action': '/ajax/upload',
'params':$.extend({},{__type:"fileupload-upload"},option.params),
onComplete:option.onComplete,
onStart: option.onStart,
valid_extensions:option.valid_extensions||["xlsx"]
'params': $.extend({}, {
__type: "fileupload-upload"
}, option.params),
onComplete: option.onComplete,
onStart: option.onStart,
valid_extensions: option.valid_extensions || ["xlsx"]
})
}
edit.prototype.init.prototype=edit.prototype;
module.exports=edit;
edit.prototype.init.prototype = edit.prototype;
module.exports = edit;
\ No newline at end of file
... ...
... ... @@ -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) {
... ...
... ... @@ -8,50 +8,50 @@ require('../util/custom.js');
window.NETSALEDATA = require('./partials/data.js');
window.GOLABDATA={
on:function(key,callback){
var that=this;
if(!that.registerEvent){
that.registerEvent={};
window.GOLABDATA = {
on: function(key, callback) {
var that = this;
if (!that.registerEvent) {
that.registerEvent = {};
}
if(!that.registerEvent[key]){
that.registerEvent[key]=[];
if (!that.registerEvent[key]) {
that.registerEvent[key] = [];
}
if(that.registerEvent[key].indexOf(callback)==-1){
if (that.registerEvent[key].indexOf(callback) == -1) {
that.registerEvent[key].push(callback);
}
},
fire:function(key){
var that=this;
fire: function(key) {
var that = this;
if (!this.registerEvent) return;
if(key){
if(!this.registerEvent[key])return;
var listeners=that.registerEvent[key];
var args=[].slice.call(arguments,1);
for(var i in listeners){
return listeners[i].apply(this,args);
if (key) {
if (!this.registerEvent[key]) return;
var listeners = that.registerEvent[key];
var args = [].slice.call(arguments, 1);
for (var i in listeners) {
return listeners[i].apply(this, args);
}
}else{
var map={},args=[].slice.call(arguments,1);
for(var key in that.registerEvent){
var listeners=that.registerEvent[key];
for(var i in listeners){
map[key]=listeners[i].apply(this,args);
} else {
var map = {},
args = [].slice.call(arguments, 1);
for (var key in that.registerEvent) {
var listeners = that.registerEvent[key];
for (var i in listeners) {
map[key] = listeners[i].apply(this, args);
}
}
return map;
}
}
};
//获取skn
if(NETSALEDATA&&NETSALEDATA.baseProductInfo&&NETSALEDATA.baseProductInfo.baseProduct){
if (NETSALEDATA && NETSALEDATA.baseProductInfo && NETSALEDATA.baseProductInfo.baseProduct) {
$('#productSkn').val(NETSALEDATA.baseProductInfo.baseProduct.productSkn);
}else{
} else {
common.util.__tip("SKN不存在");
}
... ... @@ -71,4 +71,8 @@ require('./partials/netsale-ty.js');
if ($('.contentpanel').data('type') == 'info') {
$('form').find('input').prop('disabled', true);
$('form').find('.btn').addClass('disabled');
}
\ No newline at end of file
}
$(document).on("click", "#saveAllInfo", function() {
console.log(GOLABDATA.fire());
})
\ No newline at end of file
... ...
... ... @@ -82,11 +82,13 @@ if ($('.contentpanel').data('type') == 'info') {
var e = new common.edit('#basicInfoWrap');
e.init();
var mapData = {};
$('#saveBasicInfo').on('click', function() {
e.submit('/goods/product/saveNetSaleBaseInfo', function(option) {
var list = option.data.sellChannels.split('|').join(',');
option.data.productSkn = $('#productSkn').val();
option.data.sellChannels = list;
mapData = option.data;
option.success = function(res) {
res = res.data;
if (res.code == '200') {
... ... @@ -97,4 +99,15 @@ $('#saveBasicInfo').on('click', function() {
return false;
}
});
});
GOLABDATA.on("basicInfo", function() {
return e.submit('', function(option) {
var list = option.data.sellChannels.split('|').join(',');
option.data.productSkn = $('#productSkn').val();
option.data.sellChannels = list;
mapData = option.data;
option.debug = true;
});
});
\ No newline at end of file
... ...
... ... @@ -195,12 +195,7 @@ $(document).on("click","#dapeiTable .edit",function(){
// Bll.toast("添加搭配",item,"/netSale/updateCollocation");
});
// GOLABDATA.on("bianjiqi",function(){
// // return {
// // recommend:UMrecommender.getContent(),
// // productDesc:UMdescriptioner.getContent()
// // }
// });
/*封面设置*/
var goodsImagesList={};
... ... @@ -274,6 +269,7 @@ GOLABDATA.on("fenmian",function(){
goodsImagesBoList:[]
};
$.each(goodsImagesList,function(index,item){
map.isDefault=item.isDefault;
if(item.isDefault=="Y"){
map.productSkc=item.productSkc;
map.productSkn=item.productSkn;
... ...
... ... @@ -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',
... ...
// exports.domain = require('../config/common.js').domain;
exports.domain = 'http://172.16.6.227:8083/yohobuy-platform-web';
exports.domain = 'http://172.16.6.227:8084/yohobuy-platform-web';
exports.res = [
//商品描述
{
... ... @@ -71,11 +71,12 @@ exports.res = [
]
},
{//单独维护封面信息
//http://172.16.6.227:8083/yohobuy-platform-web/product/manageProductImg
route:'/netSale/manageProductImg',
method:'POST',
url: '/product/manageProductImg',
params: [
{name: 'goodsImagesReq', type: 'String'}
{name: 'goodsImagesReq', type: 'Object'}
]
}
];
\ No newline at end of file
... ...
... ... @@ -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
... ...