<template>
    <Cn-page :loading='loading'>
        <view slot='body'>
            <view class='index'>
                <uni-list>
                    <uni-list-item title="登录成功" rightText="9-18" />
                    <uni-list-item title="登录成功" rightText="9-18" />
                    <uni-list-item title="登录成功" note="新用户" rightText="9-18" />
                </uni-list>
                <uni-load-more status="nomore"></uni-load-more>
            </view>
        </view>
    </Cn-page>
</template>
<script>
import list from "@/common/js/list";

export default {
    mixins: [list],
    data() {
        return {
            loading: true,
        }
    },
    onShow() {
        this.init()
    },
    methods: {
        async init() {
            let dictData = await this.$util.getDictData('app_event')
            console.log(dictData)
            this.store = this.DataSource('/cs-harmonic-boot/event/queryEventList')
            this.store.params.type = 2
            this.store.firstCallBack = (res) => {
                this.store.data.forEach(item => {
                    item.title = item.equipmentName + dictData.find(item2 => item2.code === item.tag).name
                })
                console.log(this.store.data)
                this.loading = false
            }
            this.store.reload()
        },
        jump(item) {
            let str = JSON.stringify(item).replace(/%/g,'百分比')
            uni.navigateTo({url: '/pages/message/transientDetail?detail=' + encodeURIComponent(str)})
        },
    }
}
</script>
<style lang='scss'>
.index {}
/deep/ .uni-list-item {
    background-color: $uni-theme-white !important;
}
</style>