wangzhibo
4 天以前 10595d8632f959d0954d1939243196f4eed02372
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<template>
    <cl-page>
        <view class="page">
            <view class="item" v-for="item in list" :key="item.id" @tap="toDetail(item)">
                <cl-card :label="item.status ? '已解决' : '待解决'" more>
                    <cl-text
                        :value="item.content"
                        :line-height="1.4"
                        block
                        :size="28"
                        :ellipsis="3"
                    />
                    <cl-text
                        :value="item.createTime"
                        block
                        :margin="[20, 0, 0, 0]"
                        color="info"
                        :size="24"
                    />
                </cl-card>
            </view>
 
            <cl-empty v-if="list.length == 0" />
        </view>
 
        <cl-footer>
            <cl-button type="primary" custom @tap="router.push('./submit')">我要反馈</cl-button>
        </cl-footer>
    </cl-page>
</template>
 
<script setup lang="ts">
import { onShow } from "@dcloudio/uni-app";
import { useCool, usePager } from "/@/cool";
 
const { service, router } = useCool();
const { onRefresh, list } = usePager();
 
function refresh(params?: any) {
    const { data, next } = onRefresh(params);
    next(service.app.feedback.page(data));
}
 
function toDetail(item: Eps.AppFeedbackEntity) {
    router.push({
        path: "./detail",
        query: {
            id: item.id,
        },
    });
}
 
onShow(() => {
    refresh();
});
 
defineExpose({
    refresh,
});
</script>
 
<style lang="scss" scoped>
.page {
    padding: 24rpx;
 
    .list {
        .item {
            background-color: #fff;
            border-radius: 16rpx;
            margin-bottom: 24rpx;
            padding: 30rpx;
        }
    }
}
</style>