Index.js 2.03 KB
'use strict';
var $ = require('jquery'),
    common = require('../../../common/common');

require('../../../common/umeditor.config');
require('../../../common/umeditor');
require('../../../common/zh-cn');
var BUCKET = {
    bucket: "goodsimg"
};

var editType = $('.contentpanel').data('type');
/*if (window.NETSALEDATA && window.NETSALEDATA.baseProductInfo && window.NETSALEDATA.baseProductInfo.baseProduct.productSkn) {
    productSkn = window.NETSALEDATA.baseProductInfo.baseProduct.productSkn;
}*/





/*商品描述*/
window.UMdescriptioner = UM.getEditor('edit-descriptioner');
/*if (window.NETSALEDATA && window.NETSALEDATA.productExtBo.productDesc && window.NETSALEDATA.productExtBo.productDesc) {
    UMdescriptioner.setContent(window.NETSALEDATA.productExtBo.productDesc)
};*/

/*保存描述*/
$(document).on("click", "#btn-descriptioner", function () {
    common.util.__ajax({
        url:'/product/updateBatchProductDesc',
        data:{
            productSknStrs:common.util.__input('productSkn'),
            productDesc:UMdescriptioner.getContent(),
            brandId: common.util.__input("brandId"),
            maxSortId: tabTree.selected.length > 0 ? tabTree.selected[0].id : "", // 一级类目
            middleSortId: tabTree.selected.length > 1 ? tabTree.selected[1].id : "", // 二级类目
            smallSortId: tabTree.selected.length > 2 ? tabTree.selected[2].id : "", // 三级类目
        }
    });
});


    /*下拉选择
new common.dropDown({
    el: "#shopId",
    ajax: "queryShop"
});*/
new common.dropDown({
    el: "#brandId",
    ajax: "brand",
    params:function(){
        return {userLimitFlag:true};
    }
});


var tabTree = new common.tabTree("#sort");
tabTree.init();





var Bll = {
    toast: function(content, fn) {
        common.dialog.confirm("温馨提示", content, function() {
            common.util.__ajax({
                url: '/product/updateProductSknStatus',
                data: fn()
            }, function() {
                g.reload();
                loadTab();
            });
        });
    }
}