-
zhangwei
2024-08-23 e6dccb3b16847f4bda31f305113070596677caff
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<template>
    <view>
        <up-sticky bgColor="#fff">
            <up-subsection :list="list" :current="current4" activeColor="#f9ae3d"
                @change="sectionChange"></up-subsection>
        </up-sticky>
        <view class="full-page">
            <view class="listrecord c-p-20" v-for="(item,index) in listO.orderList">
                <view class="coreshop-ff chuany-bradius20">
                    <view class="c-p-26">
                        <view class="chuany-flex chuany-justify-between">
                            <text class="chuany-font34 chuany-text-bold">
                                {{item.orderName}}
                            </text>
                            <view class="chuany-flex chuany-justify-between">
                                <!-- <text class="c-p-r-20">
                                
                            </text> -->
                                <up-tag class='c-m-r-10' text="已结算" shape="circle" type="success" plain plainFill
                                    size='mini'></up-tag>
                                <up-tag text="已确认" shape="circle" type="success" plain plainFill size='mini'></up-tag>
                            </view>
                        </view>
                        <view class="chuany-flex chuany-justify-between c-p-t-20">
                            <view class="chuany-width50">
                                <text>
                                    方式:计时
                                </text>
                            </view>
                            <text class="chuany-width50">
                                工价:17元/小时
                            </text>
                        </view>
                    </view>
                </view>
            </view>
            <up-loadmore :status="status" />
        </view>
        <up-empty mode="order" icon="http://cdn.uviewui.com/uview/empty/order.png">
        </up-empty>
 
    </view>
</template>
 
<script setup>
    import {
        onLoad,
        onShow,
        onReachBottom
    } from "@dcloudio/uni-app";
    import {
        reactive,
        ref,
        getCurrentInstance
    } from 'vue';
    const {
        $upload,
        $api,
        $util,
        $db
    } = getCurrentInstance().appContext.config.globalProperties
    const state = reactive({
        pageIndex: 1,
        pageSize: 20,
    })
    let status = ref('loadmore')
    let totalPages = ref(0)
    let listO = reactive({
        orderList:[]
    })
    onReachBottom(() => {
            if (this.loadStatus != 'nomore') {
                PostMyListPageCompany();
            }
        }),
        onLoad(() => {
            $api.PostMyListPageCompany(state).then(res => {
                console.log(res, '---');
            })
        })
    const current4 = ref(0);
    const list = ref(['全部', '进行中', '已完成', '已取消']);
 
 
    const sectionChange = (index) => {
        current4.value = index;
    }
    const PostMyListPageCompany = () => {
        let data = {
            pageIndex: state.pageIndex,
            pageSize: state.pageSize,
        }
        this.loadStatus = 'loading';
        $api.PostMyListPageCompany(data).then(res => {
            if (res.code == 1) {
                if(state.pageIndex==1){
                    listO.orderList = res.data.items
                }else{
                    listO.orderList.concat(...res.data.items)
                }
                // totalPages.value = res.data.totalCount
                // 根据count数量判断是否还有数据
                if (res.data.totalCount > listO.orderList.length) {
                    status.value = 'loadmore';
                    state.pageIndex++
                } else {
                    // 数据已加载完毕
                    status.value = 'nomore';
                }
            } else {
                // _that.$refs.uToast.show({ message: res.msg, type: 'error' });
            }
        })
    }
</script>
 
<style>
    .content {
        /* width: 100%; */
        box-sizing: border-box;
    }
 
    .bgblue {
        background-color: #4e96f5;
        border-radius: 20rpx 20rpx 0 0;
        color: #fff;
    }
 
    .listrecord {
        width: 100%;
        box-sizing: border-box;
    }
</style>