jqMultipleShow("click", ".navList", ".tab", ".con");
var helpSuggestion = new Vue({
    el: "#dashboard",
    data: {
        btnLoading: false,
        isRequset:true,
        userId: 0,
        degree:'',
        isCheckedAll:false,
        messagesList:[],//消息列表
    },
    methods: {
        GetMyPcMymessageInfo:function(){
            var _self = this;
            UserApi.GetMymessageList({userId:_self.userId},function (response) {
                if(response.code == 0){
                    var data = response.data;
                    _self.isRequset = false;
                }else{
                    CAIMEI.Alert(response.msg, '确定', false);
                }
            })
        },
        checkedAllFn :function(){
            var _self = this;
            _self.isCheckedAll = !_self.isCheckedAll;
            _self.updateBothCheckBtn();
        },
        checkedItemFn :function(item){
            var _self = this;
            item.isCheck = !item.isCheck;
            _self.updateCheckAllBtn();
        },
        updateBothCheckBtn:function() {// 全选勾选
            var _self = this;
            _self.messagesList.forEach(function(item){
                item.isCheck = _self.isCheckedAll ;
         })
        },
        updateCheckAllBtn:function() {// 全选勾选判断
            var _self = this;
            var goodsCheckedLength = 0,
                messagesList = _self.messagesList;
            _self.messagesList.forEach(function(item){
                if(item.isCheck) { goodsCheckedLength++; }
            });
            _self.isCheckedAll = goodsCheckedLength === messagesList.length;
        },
        deleteMessageFn: function(){//删除消息

        },
        signMessageFn: function(){//标记为已读

        },
        showBadge:function(n){//处理标签
            var num ='';
            if(n>100){num = 99}else{num = n;}
            return num;
        },
        toFixedFn:function(text){//处理小数点后两位数
            return Number(text).toFixed(2);
        },

    },
    mounted: function () {
        if(globalUserData){
            this.userId = globalUserData.userId;
            this.GetMyPcMymessageInfo();
        }
    }
});
