<template>
    <view class="content">
        <uni-list :border="false">
            <uni-list-item :show-badge="item.chatCount > 0" badgeType="error" isDot badge-text="新消息" :title="item.title"
                :note="item.createTime" clickable v-for="(item, index) in store.data" :key="index" @click="jump(item)" />
        </uni-list>
        <Cn-empty v-if="store.empty"></Cn-empty>
        <uni-load-more v-if="store.data && store.data.length > 0" :status="store.status"></uni-load-more>
    </view>
</template>

<script>
import { queryFeedBackPage } from '../../common/api/feedback'
import list from '../../common/js/list'

export default {
    mixins: [list],
    data() {
        return {
            title: '灿能'
        }
    },
    onShow() {
        this.init()
    },
    methods: {
        init() {
            this.store = this.DataSource('/feedback/queryFeedBackPage')
            this.store.params.userId = uni.getStorageSync('userInfo').id
            this.store.reload()
        },
        jump(item) {
            uni.navigateTo({ url: '/pages/message/feedbackDetail?id=' + item.id +'&chatCount=' + item.chatCount  })
        }
    }
}
</script>

<style lang="scss">
.content {
    padding-top: 20rpx;
}


/deep/ .uni-list-item {
    background-color: $uni-theme-white !important;
}

/deep/ .uni-badge {
    background-color: unset !important;
    color: #dd524d !important;
    font-size: 28rpx !important;
}
</style>
