Jacob
2026-10-12 85aed6cbf2e5693f980e182febd113b3b13f8813
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
184
185
186
<template>
   <view>
       <view class='return-list pad30' v-if="orderList.length">
           <view class='goodWrapper borRadius14' v-for="(item,index) in orderList" :key="index" @click='goOrderDetails(item.orderId)'>
               <view class='iconfont icon-tuikuanzhong powder' v-if="item.refundStatus==1 || item.refundStatus==3"></view>
               <view class='iconfont icon-yituikuan' v-if="item.refundStatus==2"></view>
               <view class='orderNum'>订单号:{{item.orderId}}</view>
               <view class='item acea-row row-between-wrapper' v-for="(items,index) in item.orderInfoList" :key="index">
                   <view class='pictrue'>
                       <image :src='items.image'></image>
                   </view>
                   <view class='text'>
                       <view class='acea-row row-between-wrapper'>
                           <view class='name line1'>{{items.storeName}}</view>
                           <view class='num'>x {{items.cartNum}}</view>
                       </view>
                       <view class='attr line1' v-if="items.suk">{{items.suk}}</view>
                       <view class='attr line1' v-else>{{items.storeName}}</view>
                       <view class='money'>¥{{items.price}}</view>
                   </view>
               </view>
               <view class='totalSum'>共{{item.totalNum || 0}}件商品,总金额 <text class='font-color price'>¥{{item.payPrice}}</text></view>
           </view>
       </view>
       <view class='loadingicon acea-row row-center-wrapper' v-if="orderList.length">
           <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
       </view>
       <view v-if="orderList.length == 0">
           <emptyPage title="暂无订单~"></emptyPage>
       </view>
       <!-- #ifdef MP -->
       <!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
       <!-- #endif -->
       <home></home>
   </view>
</template>
 
<script>
   import home from '@/components/home';
   import emptyPage from '@/components/emptyPage.vue'
   import {
       getOrderList
   } from '@/api/order.js';
   import {
       toLogin
   } from '@/libs/login.js';
   import {
       mapGetters
   } from "vuex";
   export default {
       components: {
           emptyPage,
           home,
       },
       data() {
           return {
               loading: false,
               loadend: false,
               loadTitle: '加载更多', //提示语
               orderList: [], //订单数组
               orderStatus: -3, //订单状态
               page: 1,
               limit: 20,
               isAuto: false, //没有授权的不会自动授权
               isShowAuth: false //是否隐藏授权
           };
       },
       computed: mapGetters(['isLogin']),
       watch:{
           isLogin:{
               handler:function(newV,oldV){
                   if(newV){
                       this.getOrderList();
                   }
               },
               deep:true
           }
       },
       onLoad() {
           if (this.isLogin) {
               this.getOrderList();
           } else {
               toLogin(this);
           }
       },
       /**
        * 页面上拉触底事件的处理函数
        */
       onReachBottom: function() {
           this.getOrderList();
       },
       methods: {
           onLoadFun() {
               this.getOrderList();
           },
           // 授权关闭
           authColse: function(e) {
               this.isShowAuth = e
           },
           /**
            * 去订单详情
            */
           goOrderDetails: function(order_id) {
               if (!order_id) return that.$util.Tips({
                   title: '缺少订单号无法查看订单详情'
               });
               uni.navigateTo({
                   url: '/pages/order_details/index?order_id=' + order_id + '&isReturen=1'
               })
           },
 
           /**
            * 获取订单列表
            */
           getOrderList: function() {
               let that = this;
               if (that.loadend) return;
               if (that.loading) return;
               that.loading = true;
               that.loadTitle = "";
               getOrderList({
                   type: that.orderStatus,
                   page: that.page,
                   limit: that.limit,
               }).then(res => {
                   let list = res.data.list || [];
                   let loadend = list.length < that.limit;
                   that.orderList = that.$util.SplitArray(list, that.orderList);
                   that.$set(that,'orderList',that.orderList);
                   that.loadend = loadend;
                   that.loading = false;
                   that.loadTitle = loadend ? "我也是有底线的" : '加载更多';
                   that.page = that.page + 1;
               }).catch(err => {
                   that.loading = false;
                   that.loadTitle = "加载更多";
               });
           }
       }
   }
</script>
 
<style lang="scss" scoped>
   .return-list .goodWrapper {
       background-color: #fff;
       margin-top: 20rpx;
       position: relative;
       padding: 0rpx 24rpx;
   }
 
   .return-list .goodWrapper .orderNum {
       border-bottom: 1px solid #eee;
       height: 87rpx;
       line-height: 87rpx;
       font-size: 30rpx;
       color: #333333;
   }
 
   .return-list .goodWrapper .item {
       border-bottom: 0;
   }
 
   .return-list .goodWrapper .totalSum {
       padding: 0 30rpx 32rpx 30rpx;
       text-align: right;
       font-size: 26rpx;
       color: #282828;
   }
 
   .return-list .goodWrapper .totalSum .price {
       font-size: 28rpx;
       font-weight: bold;
   }
 
   .return-list .goodWrapper .iconfont {
       position: absolute;
       font-size: 109rpx;
       top: 7rpx;
       right: 22rpx;
       color: #ccc;
   }
 
   .return-list .goodWrapper .iconfont.powder {
       color: #f8c1bd;
   }
</style>