return {
    data: function () {
        return {
            announcementlist: [],
            getparameters:{
                roomid:0,
                apptoken:'',
                key:'',
                page:1,
                pagesize:10
            },
            /**当前页 */
            currentPage: 1,
            /**课程总页数*/
            pageCount: null,
            dialogVisible:false,
            announcementtitle:'',
            announcementcon:'',
        }
    },
    methods: {
        getList: function (p) {
            p = p || 1
            if(p==1){
              this.announcementlist = []
            }
            var that = this;
            that.currentPage = p;
            that.getparameters.page = p;
            GetManageRoomNoticeList(that.getparameters).then(function(res) {
                that.pageCount = res.pageCount * 10;
                if(res.result){
                    that.announcementlist = res.data
                }else{
                    that.announcementlist = []
                }
            })
        },
        lookAnnouncement:function(id) {
            var that = this
            that.dialogVisible = true

            ModifyRoomNotice({
                noticeid:id
            }).then(function (res) {
                if(res.result){
                    that.announcementtitle = res.data[0].Title
                    that.announcementcon=res.data[0].Contents
                }else{

                }
            })
            // if(that.announcementlist&&that.announcementlist.length){
            //     that.announcementlist.map(function (item) {
            //         if(item.ID==id){
            //             that.announcementtitle=item.Title
            //             that.announcementcon=item.Contents
            //         }
            //     })
            // }
            
        }
    },
    created: function () {
        var that = this;
        that.getparameters.roomid=that.$route.params.id
        that.$store.ready(function(state) {
            that.getparameters.apptoken = state.appToken
            that.getList()
        })
        
    }
}