var instrumentDetail = new Vue({
    el: "#instrumentDetail",
    data: {
        instrumentId: 0,
        userId: 6,
        userIdentity: '',
        recommends: []
    },
    computed: {},
    methods: {
        getRecommendById: function(){
            var _self = this;
            if(this.instrumentId ===0){return;}
            $.getJSON("/instrument/recommend",{instrumentId: this.instrumentId}).done(function (r) {
                if (r.code === 0 && r.data) {
                    _self.recommends = r.data;
                }
            });
        }
    },
    created: function () {
        this.instrumentId = 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"
        });
    }
});
