Authored by chaogeng

Merge branch 'dev_524_5.8逛二期' of http://git.yoho.cn/fe/yohobuy-portal-fe2 into dev_524_5.8逛二期

... ... @@ -23,4 +23,7 @@ module.exports = function (app){
//同步
app.post("/shareOrder/syn","shareOrderAudit_syn");
//同步
app.post("/shareOrder/synGuang","shareOrderAudit_synGuang");
}
\ No newline at end of file
... ...
... ... @@ -66,6 +66,15 @@ module.exports={
{name: 'commentId', type: 'Number'},
{name: 'result', type: 'String'}
]
},
synGuang:{
title:"同步",
url:"/shareOrder/guangSyncYesOrNo",
params:[
{name: 'commentId', type: 'Number'},
{name: 'result', type: 'String'}
]
}
}
}
\ No newline at end of file
... ...
... ... @@ -39,7 +39,7 @@
<div class="clearfix"></div>
<div class="panel-col">
<select id="socialSyncFlag" class="form-control">
<option value="">同步状态</option>
<option value="">社区同步状态</option>
<option value="1">已同步</option>
<option value="0">未同步</option>
</select>
... ...
... ... @@ -38,7 +38,8 @@ module.exports={
{name: 'coverImageType', type: 'Number'},
{name: 'articleType', type: 'Number'},
{name: 'adsImgSize', type: 'String'},
{name: 'isRecommend', type: 'Number'}
{name: 'isRecommend', type: 'Number'},
{name:"isTop",type:"Number"}
]
},
... ...
... ... @@ -330,6 +330,10 @@
<div class="col-sm-12">
<h3>添加链接</h3>
</div>
[[else if module.contentData.template_name=='video']]
<div class="col-sm-12">
<div class="col-sm-12"><h3>[[module.contentData.data.video_intro]]</h3></div>
</div>
[[else if module.contentData.template_name=='goodsGroup']]
<div class="form-group">
[[each module.contentData.data as items i]]
... ... @@ -834,6 +838,45 @@
</div>
</script>
<script type="text/template" id="template_dialog_video">
<div class="form-group">
<label class="col-sm-2 control-label">视频描述:</label>
<div class="col-sm-8">
<input type="hidden" id="video_size" value="[[contentData.data.size]]">
<input type="text" id="video_intro" class="form-control" placeholder="简介" value="[[contentData.data.video_intro]]">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">视频地址:<span class="red">*</span></label>
<div class="col-sm-8">
<input type="text" id="video_src" class="form-control" readonly="readonly" required="required" placeholder="视频地址" value="[[contentData.data.src]]">
</div>
</div>
<div class="form-group">
<div class="col-sm-6">
<div class="cover-image-list col-sm-10">
<ul class="cover-image-list col-sm-10" id="addVideo" style="padding: 0;margin: 0;">
<li class="cover-image-item fileinput-button">
<div class="goods-img">
<a class="fileinput-button-icon" id="imgATag" href="javascript:void(0);">+</a>
<input type="file" data-field="0.url" class="goods-img-upload picfile" name="picfile" id="picfile" placeholder="图片" multiple="true">
[[if contentData.data.src]]
<img id="imgTag" width="106" height="146" src="[[contentData.data.src]]?vframe/jpg/offset/0" >
[[else]]
<img id="imgTag" width="106" height="146">
[[/if]]
</div>
</li>
</ul>
</div>
</div>
</div>
</script>
<script type="text/template" id="template_default_1">
<option value="" selected="selected">选择跳转目的</option>
<option value="go.brand">品牌列表页</option>
... ...
... ... @@ -16,7 +16,8 @@ module.exports = {
couponId: {type: Number},
department: {type: Number},
couponName: {type: String},
status: {type: Number}
status: {type: Number},
couponType:{type:Number}
}
},
getCouponDetailById:{
... ...
<%include '../../../common/views/__ui/header'%>
<%include '../../../common/views/__partail/ListHeader'%>
<div class="contentpanel">
<div class="panel panel-default" style="margin-bottom:10px;">
<div class="panel-body" style="padding-bottom: 0">
... ... @@ -15,6 +14,18 @@
</div>
<div class="panel-col" id="departments"></div>
<div class="panel-col">
<select id="filter-couponType" tabindex="-1" class="select2-offscreen brandBtn-group observe">
<option value="-1">优惠券类型</option>
<option value="1">平台券</option>
<option value="2">B券</option>
<option value="3">券码</option>
<option value="4">生日券</option>
<option value="5">免邮券</option>
<option value="6">店铺券</option>
<option value="7">分享券</option>
</select>
</div>
<div class="panel-col">
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
<a id="all-btn" href="/market/couponList/index" class="btn btn-info">全部</a>
</div>
... ...
... ... @@ -192,6 +192,12 @@ var g = new common.grid({
}else if(items.socialSyncFlag == 1){
HtmArr.push('<a data-index="' + items.__index + '" data-type="noSync" href="JavaScript:;" class="btn btn-danger btn-xs synFlag">取消同步</a>');
}
if(items.guangSyncFlag == 0 ){
HtmArr.push('<a data-index="' + items.__index + '" data-type="sync" href="JavaScript:;" class="btn btn-primary btn-xs guangSynFlag">同步到逛</a>');
}else if(items.guangSyncFlag == 1){
HtmArr.push('<a data-index="' + items.__index + '" data-type="noSync" href="JavaScript:;" class="btn btn-danger btn-xs guangSynFlag">取消同步到逛</a>');
}
return HtmArr.join('');
}
}
... ... @@ -279,6 +285,29 @@ $(document).on('click', '.synFlag', function () {
});
// 同步
$(document).on('click', '.guangSynFlag', function () {
var item = g.rows[$(this).data("index")];
var type = $(this).data('type');
common.util.__ajax({
url: '/shareOrder/synGuang',
data: {
commentId: item.id,
result : type
}
}, function (res) {
g.reload();
/* if (res.code == 200) {
common.util.__tip('操作成功', 'success');
} else {
common.util.__tip(res.message,'danger');
}*/
}, false);
});
$(document).on('click', '#filter', function () {
g.reload();
});
... ... @@ -361,6 +390,7 @@ $('#batch-audit-fail').on('click', function () {
function encodeHtml(str, reg) {
return str ? str.replace(reg || /[&<">'](?:(amp|lt|quot|gt|#39|nbsp);)?/g, function(a, b) {
if (b) {
return a;
} else {
return {
... ...
... ... @@ -32,6 +32,7 @@ var components = new common.components(".modal-body", {
* 通用
*/
var Bll = {
d: null,
moduleimgs: [],
Brands: [],
... ... @@ -137,7 +138,11 @@ var Bll = {
if (module.contentData.dialog == "template_dialog_text") {
module.contentData.data.text = baidu.getContent();
}
if(module.contentData.dialog=='template_dialog_video'){
module.contentData.data.src = $("#video_src").val();
module.contentData.data.size = $("#video_size").val();
module.contentData.data.video_intro = $("#video_intro").val();
}
// 对于图片资源位,增加图片的原始尺寸
if(module.contentData.dialog == 'template_dialog_grid' || module.contentData.dialog == 'template_dialog_grid2') {
$.each(module.contentData.data, function(index, data) {
... ... @@ -163,6 +168,12 @@ var Bll = {
return false;
}
}
//视频描述限制
var videoIntroLimit=$("#video_intro").val();
if(videoIntroLimit&&videoIntroLimit.length>200){
common.util.__tip("视频描述不能超过200字", 'warning');
return false;
}
if (components.validate()) {
//TODO
!!~index ? Bll.contentDatas[index] = module : Bll.contentDatas.push(module);
... ... @@ -174,13 +185,46 @@ var Bll = {
css: "btn-primary"
}]
});
Bll.__editRender();
if (module.contentData.dialog != "template_dialog_video"){
Bll.__editRender();
}
Bll2.moveDrag();
if (module.contentData.dialog == "template_dialog_text") {
baidu && baidu.destroy();
baidu = UM.getEditor('baidueditor');
baidu.setContent(module.contentData.data.text);
}
};
if (module.contentData.dialog == "template_dialog_video") {
};
common.edit.ajaxfileupload(".picfile", {
params: {
__type: "import-video",
bucket: "goodsvideo"
},
valid_extensions: ['mp4','rmvb','avi','mov','wmv'],
// onStart: function(params) {
// loadModal = common.dialog.load();
// },
onComplete: function (response) {
console.log("批量接口返回数据",response);
if (response.status && response.code == 200) {
if(response.data.fileSize>50){
common.util.__tip("视频不能超过50M", 'warning');
}else{
$("#video_src").val(response.data.url);
$("#video_size").val(response.data.fileSize);
// if (loadModal) {
$("#imgTag").attr("src",response.data.url+"?vframe/jpg/offset/0");
$("#imgTag").show();
$("#imgATag").hide();
}
}
else {
common.util.__tip(response.message, 'warning');
}
}
});
},
renderDialog: function (templater) {
Bll.__render(".modal-body", templater, Bll.module);
... ... @@ -390,6 +434,16 @@ var Button = [
"url": ""
}
}]
},
{
template_intro: "添加视频",
dialog: "template_dialog_video",
template_name: "video",
data: {
"src":"",
"video_intro":"",
"size":""
}
}];
$("#content_btns").html(common.util.__template2($("#template_content_btns").html(), {
btns: Button
... ... @@ -1525,8 +1579,8 @@ $(document).on("click", "#submit", function () {
e.$tip(res.message || "接口异常报错");
}
});
});
});
... ...
... ... @@ -12,6 +12,8 @@ var artTemplate = common.artTemplate;
* ENUM tab参数
* @type {string[]}
*/
//下拉框
new common.dropDown({el: '#filter-couponType'});
var couponTypes = ["平台券", "B券", "券码", "生日券", "免邮券","店铺券","分享券"];
var useLimitTypes = ["无限制", "货物件数限制", "订单金额限制"];
... ... @@ -110,6 +112,7 @@ var g = new common.grid({
couponId: common.util.__input("choose-coupon"),
couponName: common.util.__input("filter-couponName"),
department: common.util.__input("choose-department"),
couponType:common.util.__input("filter-couponType"),
status: t.active
};
},
... ...
... ... @@ -196,6 +196,12 @@ webpackJsonp([0],[
}else if(items.socialSyncFlag == 1){
HtmArr.push('<a data-index="' + items.__index + '" data-type="noSync" href="JavaScript:;" class="btn btn-danger btn-xs synFlag">取消同步</a>');
}
if(items.guangSyncFlag == 0 ){
HtmArr.push('<a data-index="' + items.__index + '" data-type="sync" href="JavaScript:;" class="btn btn-primary btn-xs guangSynFlag">同步到逛</a>');
}else if(items.guangSyncFlag == 1){
HtmArr.push('<a data-index="' + items.__index + '" data-type="noSync" href="JavaScript:;" class="btn btn-danger btn-xs guangSynFlag">取消同步到逛</a>');
}
return HtmArr.join('');
}
}
... ... @@ -283,6 +289,29 @@ webpackJsonp([0],[
});
// 同步
$(document).on('click', '.guangSynFlag', function () {
var item = g.rows[$(this).data("index")];
var type = $(this).data('type');
common.util.__ajax({
url: '/shareOrder/synGuang',
data: {
commentId: item.id,
result : type
}
}, function (res) {
g.reload();
/* if (res.code == 200) {
common.util.__tip('操作成功', 'success');
} else {
common.util.__tip(res.message,'danger');
}*/
}, false);
});
$(document).on('click', '#filter', function () {
g.reload();
});
... ... @@ -365,6 +394,7 @@ webpackJsonp([0],[
function encodeHtml(str, reg) {
return str ? str.replace(reg || /[&<">'](?:(amp|lt|quot|gt|#39|nbsp);)?/g, function(a, b) {
if (b) {
return a;
} else {
return {
... ...
... ... @@ -37,6 +37,7 @@ webpackJsonp([62],{
* 通用
*/
var Bll = {
d: null,
moduleimgs: [],
Brands: [],
... ... @@ -101,7 +102,11 @@ webpackJsonp([62],{
if (!item.brandIco) {
var a = Bll.Brands1[item.id]
if (a) { // 如果之前选择的品牌没有log,则a取不到。页面报错
a.brandIco = common.util.__joinImg("brandLogo", a.brand_ico)
if(a.brand_ico.indexOf('http://') == 0){
a.brandIco = a.brand_ico.split("?")[0];
}else{
a.brandIco = common.util.__joinImg("brandLogo", a.brand_ico)
}
Brands2.push(a);
}
} else {
... ... @@ -138,7 +143,11 @@ webpackJsonp([62],{
if (module.contentData.dialog == "template_dialog_text") {
module.contentData.data.text = baidu.getContent();
}
if(module.contentData.dialog=='template_dialog_video'){
module.contentData.data.src = $("#video_src").val();
module.contentData.data.size = $("#video_size").val();
module.contentData.data.video_intro = $("#video_intro").val();
}
// 对于图片资源位,增加图片的原始尺寸
if(module.contentData.dialog == 'template_dialog_grid' || module.contentData.dialog == 'template_dialog_grid2') {
$.each(module.contentData.data, function(index, data) {
... ... @@ -164,6 +173,12 @@ webpackJsonp([62],{
return false;
}
}
//视频描述限制
var videoIntroLimit=$("#video_intro").val();
if(videoIntroLimit&&videoIntroLimit.length>200){
common.util.__tip("视频描述不能超过200字", 'warning');
return false;
}
if (components.validate()) {
//TODO
!!~index ? Bll.contentDatas[index] = module : Bll.contentDatas.push(module);
... ... @@ -175,13 +190,46 @@ webpackJsonp([62],{
css: "btn-primary"
}]
});
Bll.__editRender();
if (module.contentData.dialog != "template_dialog_video"){
Bll.__editRender();
}
Bll2.moveDrag();
if (module.contentData.dialog == "template_dialog_text") {
baidu && baidu.destroy();
baidu = UM.getEditor('baidueditor');
baidu.setContent(module.contentData.data.text);
}
};
if (module.contentData.dialog == "template_dialog_video") {
};
common.edit.ajaxfileupload(".picfile", {
params: {
__type: "import-video",
bucket: "goodsvideo"
},
valid_extensions: ['mp4','rmvb','avi','mov','wmv'],
// onStart: function(params) {
// loadModal = common.dialog.load();
// },
onComplete: function (response) {
console.log("批量接口返回数据",response);
if (response.status && response.code == 200) {
if(response.data.fileSize>50){
common.util.__tip("视频不能超过50M", 'warning');
}else{
$("#video_src").val(response.data.url);
$("#video_size").val(response.data.fileSize);
// if (loadModal) {
$("#imgTag").attr("src",response.data.url+"?vframe/jpg/offset/0");
$("#imgTag").show();
$("#imgATag").hide();
}
}
else {
common.util.__tip(response.message, 'warning');
}
}
});
},
renderDialog: function (templater) {
Bll.__render(".modal-body", templater, Bll.module);
... ... @@ -391,6 +439,16 @@ webpackJsonp([62],{
"url": ""
}
}]
},
{
template_intro: "添加视频",
dialog: "template_dialog_video",
template_name: "video",
data: {
"src":"",
"video_intro":"",
"size":""
}
}];
$("#content_btns").html(common.util.__template2($("#template_content_btns").html(), {
btns: Button
... ... @@ -518,8 +576,15 @@ webpackJsonp([62],{
// });
$("#brandCheckBox").val().split('|').forEach(function (item) {
var a = Bll.Brands1[item];
var brandCategory;
if(a && a.is_global == 'Y'){
brandCategory = 2;
}else{
brandCategory = 1;
}
Bll.Brdata.push({
"brandCategory": "1",
"brandCategory": brandCategory,
"id": item
});
});
... ... @@ -559,6 +624,7 @@ webpackJsonp([62],{
url: '/yohosearch/search',
data: {
// status: 1,
contain_global: 'Y',
query: product_skc.join(',')
}
}, function (res) {
... ... @@ -568,11 +634,17 @@ webpackJsonp([62],{
common.util.__tip("没有查询到符合的品牌");
}
res.data.list.forEach(function (item, index) {
var brandCategory;
if(item.is_global == 'Y'){
brandCategory = 2
}else{
brandCategory = 1
}
map[item.product_skn] = {
id: item.brand_id,
brandIco: item.brand_ico,
brandName: item.brand_name,
brandCategory: 1
brandCategory: brandCategory
};
});
var b = [];
... ... @@ -718,6 +790,8 @@ webpackJsonp([62],{
}
//加上是否搜索BLK的标识
var appType = $("#goodsgird").attr("appType");
var containGlobal = $("#goodsgird").attr("containGlobal");
var isGlobal = $("#goodsgird").attr("isGlobal");
return {
status: 1,
sales: "Y",
... ... @@ -730,7 +804,9 @@ webpackJsonp([62],{
msort: Bll2.getIds(Bll.sorts[2].list),
brand: Bll2.getIds(Bll.sorts[3].list),
gender: Bll2.getIds(Bll.sorts[4].list),
app_type:appType
app_type:appType,
contain_global:containGlobal,
is_global:isGlobal
};
},
columns: [
... ... @@ -746,7 +822,11 @@ webpackJsonp([62],{
}
else {
if (item.default_images) {
item.images_url = common.util.__joinImg("goodsimg", item.default_images);
if(item.default_images.indexOf('http://') == 0){
item.images_url = item.default_images.split("?")[0];
}else{
item.images_url = common.util.__joinImg("goodsimg", item.default_images);
}
}
else {
item.images_url = ""
... ... @@ -795,6 +875,8 @@ webpackJsonp([62],{
pic_src: item.images_url,
product_skn: item.product_skn,
tagName: item.product_name.substring(0,30),
is_global: item.is_global,
is_limitbuy: item.is_limitbuy,
}
})
Bll.module.contentData.data[0].tagList = Bll.module.contentData.data[0].tagList.concat(gs);
... ... @@ -830,11 +912,13 @@ webpackJsonp([62],{
return {
src: item.images_url,
id: item.product_skn,
product_skc: item.product_skc
product_skc: item.product_skc,
is_global: item.is_global,
is_limitbuy: item.is_limitbuy
}
})
Bll.module.contentData.data = Bll.module.contentData.data.concat(gs);
Bll.module.contentData.data = Unique(Bll.module.contentData.data, "product_skc")
//Bll.module.contentData.data = Unique(Bll.module.contentData.data, "product_skc")
Bll.__render("#goodspic", "template_dialog_goodsimgs", {
datas: Bll.module.contentData.data
});
... ... @@ -938,6 +1022,8 @@ webpackJsonp([62],{
$(document).on("click", "#search", function () {
$(".goods-list").show();
$("#goodsgird").attr("appType","0");
$("#goodsgird").attr("containGlobal","N");
$("#goodsgird").attr("isGlobal","N");
if (goodsgird.grid) {
goodsgird.reload(1);
} else {
... ... @@ -951,6 +1037,23 @@ webpackJsonp([62],{
$(document).on("click", "#searchBLK", function () {
$(".goods-list").show();
$("#goodsgird").attr("appType","1");
$("#goodsgird").attr("containGlobal","N");
$("#goodsgird").attr("isGlobal","N");
if (goodsgird.grid) {
goodsgird.reload(1);
} else {
goodsgird.init('/yohosearch/search');
}
});
/**
* 手动输入中“搜索全球购”按钮
*/
$(document).on("click", "#searchGlobal", function () {
$(".goods-list").show();
$("#goodsgird").attr("appType","");
$("#goodsgird").attr("containGlobal","Y");
$("#goodsgird").attr("isGlobal","Y");
if (goodsgird.grid) {
goodsgird.reload(1);
} else {
... ... @@ -1481,8 +1584,8 @@ webpackJsonp([62],{
e.$tip(res.message || "接口异常报错");
}
});
});
});
... ...
... ... @@ -193,6 +193,12 @@ webpackJsonp([63],[
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-success btn-xs info-recommend">推荐</a>');
}
if (items.isTop == 1) {
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-warning btn-xs info-sticky-cancel">取消置顶</a>');
} else {
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-success btn-xs info-sticky">置顶</a>');
}
return HtmArr.join('');
}
}]
... ... @@ -288,6 +294,48 @@ webpackJsonp([63],[
}, true);
});
//置顶
$(document).on('click', '.info-sticky', function () {
var item = g.rows[$(this).data("index")];
common.util.__ajax({
url: '/guang/article/operation',
data: {
id: item.id,
isTop: 1
}
}, function (res) {
if (res.code == 200) {
common.util.__tip('成功置顶', 'success');
g.reload();
} else {
common.util.__tip(res.message);
}
}, true);
});
//取消置顶
$(document).on('click', '.info-sticky-cancel', function () {
var item = g.rows[$(this).data("index")];
common.util.__ajax({
url: '/guang/article/operation',
data: {
id: item.id,
isTop: 0
}
}, function (res) {
if (res.code == 200) {
common.util.__tip('成功取消置顶', 'success');
g.reload();
} else {
common.util.__tip(res.message);
}
}, true);
});
//定时
$(document).on("click", ".info-time", function () {
var item = g.rows[$(this).data("index")];
... ...
... ... @@ -16,6 +16,8 @@ webpackJsonp([75],[
* ENUM tab参数
* @type {string[]}
*/
//下拉框
new common.dropDown({el: '#filter-couponType'});
var couponTypes = ["平台券", "B券", "券码", "生日券", "免邮券","店铺券","分享券"];
var useLimitTypes = ["无限制", "货物件数限制", "订单金额限制"];
... ... @@ -114,6 +116,7 @@ webpackJsonp([75],[
couponId: common.util.__input("choose-coupon"),
couponName: common.util.__input("filter-couponName"),
department: common.util.__input("choose-department"),
couponType:common.util.__input("filter-couponType"),
status: t.active
};
},
... ...