quanwei
2025-11-01 121b714d710cf3c865f4a1b5efe81abec11056d1
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<template>
    <view class="refund-list">
        <view class="top-tabbar">
            <view :class="state_active==-1?'tab-item active':'tab-item'" @click="stateFunc(-1)">
                全部
            </view>
            <view :class="state_active==0?'tab-item active':'tab-item'" @click="stateFunc(0)">
                待处理
            </view>
        </view>
        <scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'" lower-threshold="50"
            @scrolltoupper="scrolltoupperFunc" @scrolltolower="scrolltolowerFunc">
            <view :class="topRefresh?'top-refresh open':'top-refresh'">
                <view class="circle" v-for="(circle,n) in 3" :key="n"></view>
            </view>
            <view class="list">
                <view class="item bg-white p30 mb20" v-for="(item,index) in tableData" :key="index">
                    <view class="d-b-c">
                        <text>{{item.create_time}}</text>
                        <text class="red">{{item.state_text}}</text>
                    </view>
                    <view class="one-product d-s-c pt20">
                        <view class="cover">
                            <image :src="item.orderproduct.image.file_path" mode="aspectFit"></image>
                        </view>
                        <view class="flex-1">
                            <view class="pro-info">{{item.orderproduct.product_name}}</view>
                        </view>
                    </view>
                    <view class="d-e-c pt20">
                        <view>
                            商品金额:
                            <text class="red">¥{{item.orderproduct.line_price}}</text>
                        </view>
                    </view>
                    <view class="d-e-c pt10">
                        <view>
                            订单实付金额:
                            <text class="red">¥{{item.orderproduct.total_price}}</text>
                        </view>
                    </view>
                    <view class="d-e-c mt20 pt20 border-t">
                        <button type="default" class="btn-gray-border"
                            @click="gotoRefundDetail(item.order_refund_id)">查看详情</button>
                    </view>
                </view>
                <!-- 没有记录 -->
                <view class="d-c-c p30" v-if="tableData.length==0 && !loading">
                    <text class="iconfont icon-wushuju"></text>
                    <text class="cont">亲,暂无相关记录哦</text>
                </view>
                <uni-load-more v-else :loadingType="loadingType"></uni-load-more>
            </view>
        </scroll-view>
    </view>
</template>
 
<script>
    import uniLoadMore from "@/components/uni-load-more.vue";
    export default {
        components: {
            uniLoadMore
        },
        data() {
            return {
                /*手机高度*/
                phoneHeight: 0,
                /*可滚动视图区域高度*/
                scrollviewHigh: 0,
                /*选中状态*/
                state_active: -1,
                /*页面数据*/
                tableData: [],
                list_rows: 5,
                last_page: 0,
                page: 1,
                no_more: false,
                loading: true,
                /*顶部刷新*/
                topRefresh: false,
                shop_supplier_id: '',
            }
        },
        computed: {
            /*加载中状态*/
            loadingType() {
                if (this.loading) {
                    return 1;
                } else {
                    if (this.tableData.length != 0 && this.no_more) {
                        return 2;
                    } else {
                        return 0;
                    }
                }
            }
        },
        onLoad(e) {
            this.shop_supplier_id = e.shop_supplier_id;
        },
        mounted() {
            this.init();
            /*获取页面数据*/
            this.getData();
 
        },
        methods: {
            /*初始化*/
            init() {
                let self = this;
                uni.getSystemInfo({
                    success(res) {
                        self.phoneHeight = res.windowHeight;
                        // 计算组件的高度
                        let view = uni.createSelectorQuery().select('.top-tabbar');
                        view.boundingClientRect(data => {
                            let h = self.phoneHeight - data.height;
                            self.scrollviewHigh = h;
                        }).exec();
                    }
                });
            },
            /*页面数据*/
            getData() {
                let self = this;
                self.loading = true;
                let page = self.page;
                let state = self.state_active;
                let list_rows = self.list_rows;
                self._get('user.refund/lists', {
                    shop_supplier_id: self.shop_supplier_id,
                    state: state,
                    page: page || 1,
                    list_rows: list_rows,
                    type:2
                }, function(data) {
                    self.loading = false;
                    self.tableData = self.tableData.concat(data.data.list.data);
                    // console.log(self.tableData);
                    self.last_page = data.data.list.last_page;
                    if (self.last_page <= 1) {
                        self.no_more = true;
                        return false;
                    }
                });
 
            },
            /*类别切换*/
            stateFunc(e) {
                let self = this;
                if (self.state_active != e) {
                    self.tableData = [];
                    self.loading = true;
                    self.page = 1;
                    self.state_active = e;
                    self.getData();
                }
            },
            /*查看售后详情*/
            gotoRefundDetail(e) {
                this.gotoPage('/pages/order/refund/detail/detail?source=supplier&order_refund_id=' + e);
            },
            /*可滚动视图区域到底触发*/
            scrolltolowerFunc() {
                let self = this;
                if (self.no_more) {
                    return;
                }
                self.page++;
                if (self.page <= self.last_page) {
                    self.getData();
                } else {
                    self.no_more = true;
                }
            }
 
        }
    }
</script>
 
<style>
 
</style>