var equipmentDetail = new Vue({
    el: "#equipmentDetail",
    data: {
        equipmentId: 0,
        userId: 6,
        userIdentity: '',
        recommends: []
    },
    computed: {},
    methods: {
        getRecommendById: function(){
            var _self = this;
            if(this.equipmentId ===0){return;}
            $.getJSON("/equipment/recommend",{equipmentId: this.equipmentId}).done(function (r) {
                if (r.code === 0 && r.data) {
                    _self.recommends = r.data;
                }
            });
        }
    },
    created: function () {
        this.equipmentId = getUrlParam("id") ? getUrlParam("id")*1 : 0;
        var userInfo = localStorage.getItem('userInfo');
        if(userInfo){
            this.userId = JSON.parse(userInfo).userId*1;
        }
        this.getRecommendById();
    },
    mounted: function () {
        $('.detailInfo').slide({
            mainCell:".tabCon"
            ,titCell:".tabTit span"
            ,trigger: "click"
        });
    }
});
