Authored by liuyue

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

... ... @@ -32,7 +32,7 @@ var dist_dir = {
};
var cdn_domain = 'http://cdn.yoho.cn/';
var md5="";
var md5=crypto.createHash('md5').update(new Date().toString()).digest('hex');;
var ftpConfig = {
host: '218.94.75.58',
... ... @@ -74,7 +74,6 @@ gulp.task("clean",function(){
});
//发布js文件
gulp.task("buildjs",["js"],function(){
md5="-"+crypto.createHash('md5').update(new Date().toString()).digest('hex');
gulp.src(path.join(public_dir,"dist") + '/*.js')
.pipe(uglify())
.pipe(rename({
... ... @@ -102,7 +101,6 @@ gulp.task('assets', function() {
gulp.task("static-config",function(){
// var files = fs.readdirSync('./dist/libs');
var staticConfig={
test:{
path:'/dist'
},
... ...
... ... @@ -56,10 +56,10 @@ require('../util/datepicker');
HtmArr.push('<a href="/erpproduct/brands/edit/'+ items.id+'"" class="btn btn-info btn-xs">编辑</a>');
}
if (items.status === 0) {
HtmArr.push('<a data-id="' + items.id + '" href="JavaScript:;" class="btn btn-warning btn-xs open-brand">开启品牌</a>');
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-warning btn-xs open-brand">开启品牌</a>');
}
if (items.status === 1) {
HtmArr.push('<a data-id="' + items.id + '" href="JavaScript:;" class="btn btn-danger btn-xs close-brand">关闭品牌</a>');
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs close-brand">关闭品牌</a>');
}
return HtmArr.join('');
}}
... ... @@ -72,71 +72,27 @@ require('../util/datepicker');
g.reload(1);
});
var Bll={
}
// function operateAjax(options, callback) {
// $.ajax({
// type: 'POST',
// url: options.url,
// data: {
// id: options.id,
// status: options.status
// },
// dataType: 'json'
// }).then(function(res) {
// if (res.code === 200) {
// $.gritter.add({
// title: '操作成功',
// class_name: 'growl-success',
// sticky: false,
// time: '1000',
// after_open: function() {
// callback && callback();
// }
// });
// } else {
// $.gritter.add({
// title: '操作失败',
// class_name: 'growl-danger',
// sticky: false,
// time: '1000'
// });
// }
// })
// }
// //关闭品牌操作
// $('tbody').on('click', '.close-brand', function() {
// var that = this,
// id = $(that).data('id');
// $(that).attr('disabled', true);
// operateAjax({
// url: '/brand/edit',
// id: id,
// status: 0
// }, function() {
// g.reload();
// })
// });
// //开启品牌操作
// $('tbody').on('click', '.open-brand', function() {
// var that = this,
// id = $(that).data('id');
// $(that).attr('disabled', true);
// operateAjax({
// url: '/brand/edit',
// id: id,
// status: 1
// }, function() {
// g.reload();
// })
// });
//关闭品牌操作
$('tbody').on('click', '.close-brand', function() {
var item=g.rows[$(this).data("index")];
common.util.__ajax({
url:'/brand/edit',
data:{id:item.id,status:0}
},function(){
g.reload();
});
});
//开启品牌操作
$('tbody').on('click', '.open-brand', function() {
var item=g.rows[$(this).data("index")];
common.util.__ajax({
url:'/brand/edit',
data:{id:item.id,status:1}
},function(){
g.reload();
});
});
... ...
... ... @@ -80,13 +80,13 @@ var ENUM={
g.reload(1);
});
$("#all-btn").click(function(){
$('#supplier-name').val("-1").trigger("change");
$('#status').val("-1").trigger("change");
$('#time-sort').val("-1").trigger("change");
$('#isFreeze').val("-1").trigger("change");
g.reload();
});
// $("#all-btn").click(function(){
// $('#supplier-name').val("-1").trigger("change");
// $('#status').val("-1").trigger("change");
// $('#time-sort').val("-1").trigger("change");
// $('#isFreeze').val("-1").trigger("change");
// g.reload();
// });
var Bll={
toast:function(content,fn){
... ...
... ... @@ -5,7 +5,7 @@ var $ = require('jquery'),
common=require('../common/common');
if($("#status").val()==="200"){
if(+$("#status").val()===200){
$(".btn-return").add(".btn-submit").show();
}else{
$(".btn-return").add(".btn-submit").remove();
... ...
exports.domain = require('../config/common.js').domain;
exports.domain = "http://172.16.6.246:8081/platform/";//require('../config/common.js').domain;
//路由配置
exports.res = [{
// 店铺创建列表页面
... ...
exports.staticDir = {"development":{"path":"/dist"},"test":{"path":"/dist"},"preview":{"path":"http://cdn.yoho.cn/yohobuy-portal/0.1.0","md5":""},"production":{"path":"http://cdn.yoho.cn/yohobuy-portal/0.1.0","md5":""}}
\ No newline at end of file
exports.staticDir = {"test":{"path":"/dist"},"preview":{"path":"http://cdn.yoho.cn/yohobuy-portal/0.1.0"},"production":{"path":"http://cdn.yoho.cn/yohobuy-portal/0.1.0"}}
\ No newline at end of file
... ...
var request=require('request');
var fs=require('fs');
var domain = require('../../config/common.js').domain;
var env = process.env.NODE_ENV || 'development';
exports.uploadFile=function(req,res){
// TODO 代理上传
// 方法1
// if(req.is("multipart/form-data")){
// req.body.file=fs.createReadStream(req.files[req.body.filename].path);
// // if(req.body.type=="batch-import"){
// // request.post({url:domain+'/batch/import',formData:req.body},function optionalCallback(err, httpResponse, body){
// // res.json(JSON.parse(body));
// // });
// // }else{
// // request.post({url:domain+'/fileupload/upload',formData:req.body},function optionalCallback(err, httpResponse, body){
// // res.json(JSON.parse(body));
// // });
// // }
if(env==="development"){
res.json({
"code":200,
"data" : "https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=1444256491,538988776&fm=80",
"message":"success"
});
}else{
if(req.is("multipart/form-data")){
req.body.file=fs.createReadStream(req.files[req.body.filename].path);
// if(req.body.type=="batch-import"){
// request.post({url:domain+'/batch/import',formData:req.body},function optionalCallback(err, httpResponse, body){
// res.json(JSON.parse(body));
// });
// }else{
// request.post({url:domain+'/fileupload/upload',formData:req.body},function optionalCallback(err, httpResponse, body){
// res.json(JSON.parse(body));
// });
// }
// request.post({url:domain+'/fileupload/upload',formData:req.body},function optionalCallback(err, httpResponse, body){
// res.json(JSON.parse(body));
// });
// }else{
// res.json({code:"500",message:"请求类型错误"});
// }
res.json({
"code":200,
"data" : "https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=1444256491,538988776&fm=80",
"message":"success"
});
request.post({url:domain+'/fileupload/upload',formData:req.body},function optionalCallback(err, httpResponse, body){
res.json(JSON.parse(body));
});
}else{
res.json({code:"500",message:"请求类型错误"});
}
}
}
\ No newline at end of file
... ...
... ... @@ -54,7 +54,7 @@
</select>
{{/ searchIsfreez}}
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
<a id="all-btn" href="javascript:;" class="btn btn-info">全部</a>
<a id="all-btn" href="" class="btn btn-info">全部</a>
</div>
</div>
</div>
... ...
... ... @@ -152,9 +152,7 @@
<button type="button" class="btn btn-success btn-submit" style="display:hidden">审核通过</button>
<button type="button" class="btn btn-danger btn-return" style="display:hidden">审核驳回</button>
{{/edit}}
<!--
<button type="button" class="btn btn-success btn-freeze" style="display:hidden" data-model='{"id":{{id}},"isFreeze":N,"operations":4}'>冻结</button>
<button type="button" class="btn btn-danger btn-recovery" style="display:hidden" data-model='{"id":{{id}},"isFreeze":Y,"operations":3}'>解冻</button> -->
<button type="button" id="return" class="btn btn-default" onclick="javascript:history.go(-1);">返回</button>
</div>
</div>
... ...