Authored by weiqingting

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

... ... @@ -57,23 +57,30 @@ var Bll = {
button: [{
value: "保存",
callback: function () {
var couponIds=Bll.module.couponsIds||[];
var ids=[];
for(var i=0;i<couponIds.length;i++){
var couponIds = Bll.module.couponsIds || [];
var flag = true;
var ids = [];
for (var i = 0; i < couponIds.length; i++) {
ids.push(couponIds[i].id);
}
Bll.module.couponsIds=ids.join(",");
if (edit.validate()) {
if (ids.join(",").indexOf("-1") > -1) {
flag = false;
common.util.__tip("请正确选择优惠券ID", "warning");
} else {
Bll.module.couponsIds = ids.join(",");
}
//console.log("最终上传数据Bll.module",Bll.module);
if (edit.validate() && flag) {
common.util.__ajax({
url: "/couponSendManager/addOrUpdate",
data: Bll.module
data: Bll.module
}, function (res) {
if(res.code=='200'){
if (res.code == '200') {
g.reload();
d.close();
}
else{
common.util.__tip(res.message,"warning");
else {
common.util.__tip(res.message, "warning");
}
});
}
... ... @@ -99,7 +106,7 @@ var Bll = {
/*监听输入框变化*/
$(document).on("change", ".observe", function () {
var $this = $(this);
var name = $this.data("field")?$this.data("field"):$this.data("name");
var name = $this.data("field") ? $this.data("field") : $this.data("name");
Bll.module = common.util.__buildobj(name, '.', Bll.module, function (obj, name) {
obj[name] = $this.val();
});
... ...
... ... @@ -124,7 +124,11 @@ function initDialog(){
function initForm(data) {
var parentName = "";
getParentsName(data.parentSC);
data.parentName = (parentName == ""?"(无根目录)":parentName);
if(data.curParent){
data.parentName = (parentName == "" ? data.curParent : parentName + "&nbsp;&nbsp;>&nbsp;&nbsp;" + data.curParent);
}else{
data.parentName = (parentName == "" ? "(无根目录)" : parentName);
}
$(".saleCategoryEdit").html(common.util.__template2(editHtml, data)),
e = new common.edit('#basicForm', {bucket: 'taobaocms'});
... ... @@ -135,7 +139,7 @@ function initForm(data) {
if(parentsData && parentsData.length > 0){
var parent = parentsData[0];
parentName += parent.categoryName;
if(parent.items) parentName += "<span style='color: #3071a9; font-weight: bold; padding: 0 5px'>&nbsp;>&nbsp;</span>";
if(parent.items) parentName += "&nbsp;&nbsp;>&nbsp;&nbsp;";
getParentsName(parent.items, parentName);
}else{
return parentName;
... ... @@ -183,6 +187,7 @@ $(document).on('click', '.add-sub-category', function() {
var data = {};
data.action = '/sale/salesCategory/addSC';
data.parentSC = res.data.parentSC;
data.curParent = res.data.categoryName;
data.subCategoryName = res.data.categoryName;
data.parentId = res.data.categoryId;
initForm(data);
... ...
... ... @@ -29,7 +29,7 @@ var config = {
//domain:'http://192.168.102.216:8180/platform', //李健2
//domain: 'http://172.16.6.243:8088/platform', //谭玲
//domain: 'http://172.16.6.204:8088/platform', //陆斌斌
yohoSearch: 'http://192.168.102.208:8087/yohosearch',
yohoSearch: 'http://192.168.10.64:8080/yohosearch',
loggers: {
api: {
level: 'verbose'
... ... @@ -49,7 +49,7 @@ var config = {
},
apiKey: 'sd4H1ecAqlp',
domain: 'http://192.168.102.202:8088/platform',
yohoSearch: 'http://192.168.102.208:8087/yohosearch',
yohoSearch: 'http://192.168.10.64:8080/yohosearch',
logsFile: '/Data/logs/node/yohobuy-portal-log/',
loggers: {
api: {
... ... @@ -70,7 +70,7 @@ var config = {
},
apiKey: 'sd4H1ecAqlp',
domain: 'http://192.168.102.202:8081/platform',
yohoSearch: 'http://192.168.102.208:8087/yohosearch',
yohoSearch: 'http://192.168.10.64:8080/yohosearch',
logsFile: '/Data/logs/node/yohobuy-portal-log/',
loggers: {
api: {
... ... @@ -91,7 +91,7 @@ var config = {
},
apiKey: 'sd4H1ecAqlp',
domain: 'http://192.168.81.6:8189/yoho-admin-portal',
yohoSearch: 'http://192.168.102.208:8087/yohosearch',
yohoSearch: 'http://192.168.10.64:8080/yohosearch',
logsFile: '/Data/logs/node/yohobuy-portal-log/',
loggers: {
api: {
... ...
... ... @@ -4,18 +4,17 @@ var fs = require('fs');
var searchDomain = require('../../config/common.js').yohoSearch;
exports.brandlist = function (req, res) {
request.get(searchDomain+"/brand/list.json").pipe(res);
request.get(searchDomain + "/brand/list.json").pipe(res);
};
exports.search = function (req, res) {
var size = 10;//每页数据量
var params = [];
for (var key in req.body) {
params.push(key + "=" + req.body[key]);
params.push(key + "=" + encodeURI(req.body[key]));
}
console.log("params",params);
var url = searchDomain+"/search.json?viewNum=" + size + "&"+params.join('&');
console.log("请求url",url);
var url = searchDomain + "/search.json?viewNum=" + size + "&" + params.join('&');
//console.log("请求url",url);
request({url: url}, function (error, response, body) {
var data = {};
data.list = [];
... ... @@ -31,13 +30,12 @@ exports.search = function (req, res) {
for (var i = 0; i < goodslist.length; i++) {
goodslist1[i] = _.assign({}, goodslist[i].a, goodslist[i].b);
}
//data.list=body.data.product_list;
data.list = goodslist1.concat();//显示数据
data.page = body.data.page;//页码
data.totalPage = body.data.page_total;
data.nums = data.list.length;//记录每一页数据量
//console.log("最终data", data);
res.json({data: {data: data,code:200}});
res.json({data: {data: data, code: 200}});
});
};
... ...
... ... @@ -58,11 +58,11 @@
</select>
</div>
<div class="col-sm-2">
<a class="col-sm-4 btn btn-primary addBtn">+</a>
<a class="col-sm-4 btn btn-primary addBtn" data-index="[[index]]">+</a>
[[if index==0]]
<a class="col-sm-4 col-sm-offset-2 btn btn-danger delBtn" disabled="true">-</a>
<a class="col-sm-4 col-sm-offset-2 btn btn-danger delBtn" disabled="true" data-index="[[index]]">-</a>
[[else]]
<a class="col-sm-4 col-sm-offset-2 btn btn-danger delBtn" >-</a>
<a class="col-sm-4 col-sm-offset-2 btn btn-danger delBtn" data-index="[[index]]">-</a>
[[/if]]
</div>
... ...
... ... @@ -155,7 +155,7 @@
<div class="rows">
<div class="form-group">
<div class="panel-col2">
<input class="form-control" id="skns" placeholder="输入SKN(多个skn以逗号分隔)" />
<input class="form-control" id="skns" placeholder="输入SKN(多个skn以逗号分隔)或产品名称" />
</div>
<div class="panel-col">
<input type="number" id="beginPrice" name="begin_price" class="form-control"
... ...