移动系统liao
2024-05-15 d7c7a6e9d05eec7b38b41b8ae39f373f650ca891
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
<template>
    <view class="orderWrap">
        <u-navbar title="售后列表" safeAreaInsetTop fixed placeholder>
            <view class="coreshop-navbar-left-slot" slot="left">
                <u-icon name="arrow-left" size="19" @click="goNavigateBack"></u-icon>
                <u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
                <u-icon name="home" size="22" @click="goHome"></u-icon>
            </view>
            <view slot="right">
            </view>
        </u-navbar>
        <view v-if="order.length>0">
            <view class="orderList" v-for="(item, key) in order" :key="key">
                <view class="top">
                    <view class="left coreshop-flex coreshop-flex-direction-row coreshop-justify-between" @click="doCopyData(item.aftersalesId)">
                        <u-icon name="home" :size="18" color="rgb(94,94,94)" :label="'售后单号:'+item.aftersalesId" labelSize="13"></u-icon>
                        <u-icon name="arrow-right" color="rgb(203,203,203)" :size="13" v-if="item.status == 1" label="待审核" labelSize="13" labelPos="left"></u-icon>
                        <u-icon name="arrow-right" color="rgb(203,203,203)" :size="13" v-else-if="item.status == 2" label="审核通过" labelSize="13" labelPos="left"></u-icon>
                        <u-icon name="arrow-right" color="rgb(203,203,203)" :size="13" v-else-if="item.status == 3" label="审核拒绝" labelSize="13" labelPos="left"></u-icon>
                    </view>
                </view>
                <view class="item" v-for="(v, k) in item.items" :key="k" @click="showOrder(item.aftersalesId)">
                    <view class="left">
                        <u--image :showLoading="true" :src="v.imageUrl" width="80px" height="80px" mode="aspectFill"></u--image>
                    </view>
                    <view class="content">
                        <view class="title u-line-2">{{v.name}}</view>
                        <view class="type">{{v.addon}}</view>
                    </view>
                    <view class="right">
                        <view class="number">x{{ v.nums }}</view>
                    </view>
                </view>
                <!-- 订单底部 -->
                <view class="bottom">
                    <view class="more">退款金额:¥{{item.refundAmount}}</view>
                    <view class='logistics coreshop-btn' @click="showOrder(item.aftersalesId)">查看详情</view>
                </view>
            </view>
            <u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" margin-top="20" margin-bottom="20" />
        </view>
 
        <!-- 无数据时默认显示 -->
        <view class="coreshop-emptybox" v-else>
            <u-empty :icon="$globalConstVars.apiFilesUrl+'/static/images/empty/order.png'" icon-size="150" text="暂无提现明细" mode="list"></u-empty>
        </view>
 
    </view>
</template>
 
<script>
 
    export default {
 
        data() {
            return {
                order: [], //订单列表
                page: 1, //当前页
                limit: 10, //每页显示几条
                orderId: "",
                status: 'loadmore',
                iconType: 'flower',
                loadText: {
                    loadmore: '轻轻上拉',
                    loading: '努力加载中',
                    nomore: '实在没有了'
                }
            }
        },
        onShow() {
            this.getOrderList();
        },
        onLoad(e) {
            this.order = [];
            this.orderId = e.orderId;
        },
        onReachBottom() {
            if (this.status === 'loadmore') {
                this.getOrderList()
            }
        },
        methods: {
            //获取订单数据
            getOrderList() {
                let data = {};
                this.status = 'loading'
                data['page'] = this.page;
                data['limit'] = this.limit;
                if (this.orderId) {
                    data['id'] = this.orderId;
                }
                this.$u.api.afterSalesList(data).then(res => {
                    let orderList = this.dataFormat(res.data.list);
                    this.order = this.order.concat(orderList);
                    this.page = res.data.page * 1 + 1;
                    let allpage = res.data.totalPage;
                    if (allpage < this.page) {
                        this.status = 'nomore'
                    } else {
                        this.status = 'loadmore'
                    }
                });
            },
 
            //数据格式处理
            dataFormat(data) {
                for (var i = 0; i < data.length; i++) {
                    let countnum = 0
                    if (data[i].order && data[i].order.items) {
                        for (var j = 0; j < data[i].order.items.length; j++) {
                            countnum += data[i].order.items[j].nums;
                        }
                        data[i].countnum = countnum;
                    }
                }
                return data;
            },
 
            //查看详情
            showOrder(aftersalesId) {
                this.$u.route('/pages/member/afterSales/detail/detail?aftersalesId=' + aftersalesId);
            }
        },
    }
</script>
 
<style lang="scss" scoped>
</style>