Bind.js 653 Bytes
var $ = require('jquery'),
    common=require('../../../common/common');

var getMaterialIdFromUrl = function() {
    var url = location.href + '';

    var index = url.lastIndexOf('/');
    var materialId = url.substring(index + 1);
    return +materialId;
}

$(document).ready(function() {
    var materialId = getMaterialIdFromUrl();
    common.util.__ajax({
        url: '/product/material/getBindProductInfo',
        data: {
            materialId: materialId
        },
        aysnc: false
    }, function(res) {
        if(res && res.code == 200) {
            $('#product-skn-list').text(JSON.stringify(res.data));
        }
    }, true);
});