cr преди 4 години
родител
ревизия
4b49f4014f
променени са 5 файла, в които са добавени 372 реда и са изтрити 121 реда
  1. 7 0
      src/pages.json
  2. 2 2
      src/pages/youxuan/nav.vue
  3. 82 43
      src/pages/youxuan/order/detail.vue
  4. 119 76
      src/pages/youxuan/order/index.vue
  5. 162 0
      src/pages/youxuan/profit.vue

+ 7 - 0
src/pages.json

@@ -552,6 +552,13 @@
552 552
             "style": {
553 553
                 "navigationBarTitleText": "订单详情"
554 554
             }
555
+        },
556
+        {
557
+            "path": "pages/youxuan/profit",
558
+            "style": {
559
+                "navigationBarTitleText": "收益记录",
560
+                "enablePullDownRefresh": true
561
+            }
555 562
         }
556 563
     ]
557 564
 }

+ 2 - 2
src/pages/youxuan/nav.vue

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
     <div class="page">
3 3
         <ul class="list">
4
-            <li class="item" @click="jump('/pages/mina/set-data')">
4
+            <li class="item" @click="jump('/pages/youxuan/profit')">
5 5
                 <div class="name">记录收益</div>
6 6
                 <my-image
7 7
                     class="arrow"
@@ -16,7 +16,7 @@
16 16
                 ></my-image>
17 17
             </li>
18 18
             <li class="item" @click="jump('/pages/youxuan/brand')">
19
-                <div class="name">活动管理</div>
19
+                <div class="name">优选品牌</div>
20 20
                 <my-image
21 21
                     class="arrow"
22 22
                     src="/static/common/arrows_left.png"

+ 82 - 43
src/pages/youxuan/order/detail.vue

@@ -2,53 +2,39 @@
2 2
     <div class="page">
3 3
         <div class="order-info">
4 4
             <div class="info">
5
-                <div class="num">订单号:154546464666</div>
6
-                <div class="status">拣货中</div>
5
+                <div class="num">订单号:{{data.orderNo}}</div>
6
+                <div class="status">{{data.status | orderStatus}}</div>
7 7
             </div>
8 8
             <div class="con">
9
-                <my-image src="" class="img"></my-image>
9
+                <my-image :src="data.headIcon" class="img"></my-image>
10 10
                 <div class="main">
11 11
                     <div class="line">
12 12
                         <div class="name">
13
-                            商品名称xxxxxxx商品名称xxxxxxx商品名称xxxxxxx商品名称xxxxxxx
13
+                            {{data.nickName}}
14 14
                         </div>
15 15
                         <div class="money">
16
-                            合计:<span class="red-text">¥500.0</span>
16
+                            合计:<span class="red-text">¥{{data.amount / 100}}</span>
17 17
                         </div>
18 18
                     </div>
19 19
                     <div class="line">
20
-                        <div class="time">19:00</div>
21
-                        <div class="money">预估佣金:¥16.8</div>
20
+                        <div class="time"> {{ data.orderTime | dateFormat("hh:mm") }}</div>
21
+                        <div class="money">预估佣金:¥{{data.estimateComission / 100}}</div>
22 22
                     </div>
23 23
                 </div>
24 24
             </div>
25 25
         </div>
26 26
         <ul class="good-list">
27
-            <li>
28
-                <my-image class="good-img" src=""></my-image>
27
+            <li v-for="(item,index) of data.orderItems" :key="index">
28
+                <my-image class="good-img" :src="item.productImage"></my-image>
29 29
                 <div class="good-con">
30
-                    <div class="good-name">商品名称商品名称商品名称</div>
30
+                    <div class="good-name">{{item.productName}}</div>
31 31
                     <div class="info">
32
-                        <div class="sku">规格:43</div>
33
-                        <div class="count">数量:x1</div>
32
+                        <div class="sku">规格:{{item.productSpec}}</div>
33
+                        <div class="count">数量:{{item.count}}</div>
34 34
                     </div>
35 35
                     <div class="money">
36
-                        <div class="price">金额:¥13.4</div>
37
-                        <div class="commission">佣金:¥13.4</div>
38
-                    </div>
39
-                </div>
40
-            </li>
41
-            <li>
42
-                <my-image class="good-img" src=""></my-image>
43
-                <div class="good-con">
44
-                    <div class="good-name">商品名称</div>
45
-                    <div class="info">
46
-                        <div class="sku">规格:43</div>
47
-                        <div class="count">数量:x1</div>
48
-                    </div>
49
-                    <div class="money">
50
-                        <div class="price">金额:¥13.4</div>
51
-                        <div class="commission">佣金:¥13.4</div>
36
+                        <div class="price">金额:¥{{item.amount / 100}}</div>
37
+                        <div class="commission">佣金:¥{{item.estimateComission / 100}}</div>
52 38
                     </div>
53 39
                 </div>
54 40
             </li>
@@ -57,38 +43,42 @@
57 43
             <ul>
58 44
                 <li>
59 45
                     <div class="key">总件数:</div>
60
-                    <div class="value">x2</div>
46
+                    <div class="value">x{{data.totalCount}}</div>
61 47
 
62 48
                     <div class="key key-r">总金额:</div>
63
-                    <div class="value">¥50.0</div>
49
+                    <div class="value">¥{{data.totalAmount / 100}}</div>
64 50
                 </li>
65
-                <li>
66
-                    <div class="key">积分抵扣(2100分):</div>
67
-                    <div class="value">-¥5.0</div>
51
+                <li v-if="data.points">
52
+                    <div class="key">积分抵扣({{data.points}}分):</div>
53
+                    <div class="value">-¥{{data.pointsPrice}}</div>
68 54
                 </li>
69 55
                 <li>
70
-                    <div class="key">优惠券(满50减5):</div>
71
-                    <div class="value">-¥5.5</div>
56
+                    <div class="key">优惠券:</div>
57
+                    <div class="value">-¥{{data.couponAmount}}</div>
72 58
                 </li>
73 59
                 <li>
74
-                    <div class="key">配送费:</div>
75
-                    <div class="value">¥5.5</div>
60
+                    <div class="key">运费/配送费:</div>
61
+                    <div class="value">¥{{data.postage}}</div>
76 62
                 </li>
77 63
                 <li>
78 64
                     <div class="key">合计:</div>
79
-                    <div class="value red">¥50.5</div>
65
+                    <div class="value red">¥{{data.amount / 100}}</div>
80 66
                 </li>
81
-                <li>
67
+                <!-- <li>
82 68
                     <div class="key">佣金:</div>
83 69
                     <div class="value">
84 70
                         ¥50.5(佣金)-¥50.5(积分抵扣)=¥5
85 71
                     </div>
86
-                </li>
72
+                </li> -->
87 73
             </ul>
88 74
         </section>
89 75
         <section class="info-box">
90 76
             <ul>
91 77
                 <li>
78
+                    <div class="key">下单时间:</div>
79
+                    <div class="value">{{data.orderTime | dateFormat("yyyy-MM-dd hh:mm")}}</div>
80
+                </li>
81
+                <!-- <li>
92 82
                     <div class="key">支付时间:</div>
93 83
                     <div class="value">2021/01/01 11:00</div>
94 84
                 </li>
@@ -103,7 +93,7 @@
103 93
                 <li>
104 94
                     <div class="key">退款时间:</div>
105 95
                     <div class="value">2021/01/01 11:00</div>
106
-                </li>
96
+                </li> -->
107 97
             </ul>
108 98
         </section>
109 99
     </div>
@@ -111,19 +101,68 @@
111 101
 
112 102
 <script>
113 103
 import MyImage from "../../../components/image/index";
104
+let statusEnum = {
105
+    2: "待支付",
106
+    3: "待发货",
107
+    4: "待收货",
108
+    6: "已取消",
109
+    7: "售后中",
110
+    8: "已删除",
111
+    9: "已完成",
112
+    10: "已评价",
113
+    11: "已售后",
114
+    12: "已退款",
115
+    20: "待接单",
116
+    21: "拣货中",
117
+    22: "拣货完成",
118
+    23: "待配送",
119
+    24: "配送中",
120
+    25: "已送达",
121
+    26: "待提货",
122
+    27: "已提货",
123
+    31: "订单已推单",
124
+    32: "订单已被骑手接单",
125
+    33: "骑手已到店",
126
+    34: "骑手已取餐",
127
+    35: "订单完成",
128
+    36: "订单失败",
129
+};
114 130
 export default {
115 131
     name: "",
116 132
     components: { MyImage },
117 133
 
134
+    filter: {
135
+        orderStatus(v) {
136
+            return statusEnum[v] || "";
137
+        },
138
+    },
118 139
     // 数据
119 140
     data() {
120
-        return {};
141
+        return {
142
+            dataId: "",
143
+            data: {},
144
+        };
145
+    },
146
+
147
+    onLoad(opts) {
148
+        this.dataId = opts.id;
149
+        this.getDetail();
121 150
     },
122 151
 
123 152
     onShow() {},
124 153
 
125 154
     // 函数
126
-    methods: {},
155
+    methods: {
156
+        getDetail() {
157
+            uni.showLoading({
158
+                title: "加载中...",
159
+            });
160
+            this.api.get("/Yx/GetOrder", { id: this.dataId }).then((res) => {
161
+                uni.hideLoading();
162
+                this.data = res.data;
163
+            });
164
+        },
165
+    },
127 166
 
128 167
     // 数据计算
129 168
     computed: {},

+ 119 - 76
src/pages/youxuan/order/index.vue

@@ -18,117 +18,91 @@
18 18
                     v-model="filter.endDate"
19 19
             /></picker>
20 20
         </div>
21
-        <div class="card">
22
-            <h1 class="tit">今天</h1>
21
+        <div class="card" v-for="(item, index) of listData" :key="index">
22
+            <h1 class="tit">{{ item.date | dateFormat }}</h1>
23 23
             <ul class="order-list">
24 24
                 <li
25
+                    v-for="order of item.orderList"
26
+                    :key="order.id"
25 27
                     @click="
26 28
                         jump({
27 29
                             path: '/pages/youxuan/order/detail',
28
-                            query: { id: 1 },
30
+                            query: { id: order.id },
29 31
                         })
30 32
                     "
31 33
                 >
32 34
                     <div class="info">
33
-                        <div class="num">订单号:154546464666</div>
34
-                        <div class="status">拣货中</div>
35
-                    </div>
36
-                    <div class="con">
37
-                        <my-image class="img" src=""></my-image>
38
-                        <div class="main">
39
-                            <div class="line">
40
-                                <div class="name">商品名称xxxxxxx</div>
41
-                                <div class="money">
42
-                                    合计:<span class="red-text">¥500.0</span>
43
-                                </div>
44
-                            </div>
45
-                            <div class="line">
46
-                                <div class="time">19:00</div>
47
-                                <div class="money">预估佣金:¥16.8</div>
48
-                            </div>
35
+                        <div class="num">订单号:{{ order.orderNo }}</div>
36
+                        <div class="status">
37
+                            {{ order.status | orderStatus }}
49 38
                         </div>
50 39
                     </div>
51
-                </li>
52
-                <li>
53
-                    <div class="info">
54
-                        <div class="num">订单号:154546464666</div>
55
-                        <div class="status">拣货中</div>
56
-                    </div>
57 40
                     <div class="con">
58
-                        <my-image src="" class="img"></my-image>
41
+                        <my-image class="img" :src="order.headIcon"></my-image>
59 42
                         <div class="main">
60 43
                             <div class="line">
61
-                                <div class="name">商品名称xxxxxxx</div>
44
+                                <div class="name">{{ order.nickName }}</div>
62 45
                                 <div class="money">
63
-                                    合计:<span class="red-text">¥500.0</span>
46
+                                    合计:<span class="red-text"
47
+                                        >¥{{ order.amount / 100 }}</span
48
+                                    >
64 49
                                 </div>
65 50
                             </div>
66 51
                             <div class="line">
67
-                                <div class="time">19:00</div>
68
-                                <div class="money">预估佣金:¥16.8</div>
69
-                            </div>
70
-                        </div>
71
-                    </div>
72
-                </li>
73
-            </ul>
74
-        </div>
75
-        <div class="card">
76
-            <h1 class="tit">2021/09/05</h1>
77
-            <ul class="order-list">
78
-                <li>
79
-                    <div class="info">
80
-                        <div class="num">订单号:154546464666</div>
81
-                        <div class="status">拣货中</div>
82
-                    </div>
83
-                    <div class="con">
84
-                        <my-image class="img" src=""></my-image>
85
-                        <div class="main">
86
-                            <div class="line">
87
-                                <div class="name">商品名称xxxxxxx</div>
88
-                                <div class="money">
89
-                                    合计:<span class="red-text">¥500.0</span>
90
-                                </div>
91
-                            </div>
92
-                            <div class="line">
93
-                                <div class="time">19:00</div>
94
-                                <div class="money">预估佣金:¥16.8</div>
95
-                            </div>
96
-                        </div>
97
-                    </div>
98
-                </li>
99
-                <li>
100
-                    <div class="info">
101
-                        <div class="num">订单号:154546464666</div>
102
-                        <div class="status">拣货中</div>
103
-                    </div>
104
-                    <div class="con">
105
-                        <my-image src="" class="img"></my-image>
106
-                        <div class="main">
107
-                            <div class="line">
108
-                                <div class="name">
109
-                                    商品名称xxxxxxx商品名称xxxxxxx商品名称xxxxxxx商品名称xxxxxxx
52
+                                <div class="time">
53
+                                    {{ order.orderTime | dateFormat("hh:mm") }}
110 54
                                 </div>
111 55
                                 <div class="money">
112
-                                    合计:<span class="red-text">¥500.0</span>
56
+                                    预估佣金:¥{{
57
+                                        order.estimateComission / 100
58
+                                    }}
113 59
                                 </div>
114 60
                             </div>
115
-                            <div class="line">
116
-                                <div class="time">19:00</div>
117
-                                <div class="money">预估佣金:¥16.8</div>
118
-                            </div>
119 61
                         </div>
120 62
                     </div>
121 63
                 </li>
122 64
             </ul>
123 65
         </div>
66
+        <div class="more-text" v-if="dataEnd">- 没有更多数据了 -</div>
124 67
     </div>
125 68
 </template>
126 69
 
127 70
 <script>
128 71
 import MyImage from "../../../components/image/index";
72
+let statusEnum = {
73
+    2: "待支付",
74
+    3: "待发货",
75
+    4: "待收货",
76
+    6: "已取消",
77
+    7: "售后中",
78
+    8: "已删除",
79
+    9: "已完成",
80
+    10: "已评价",
81
+    11: "已售后",
82
+    12: "已退款",
83
+    20: "待接单",
84
+    21: "拣货中",
85
+    22: "拣货完成",
86
+    23: "待配送",
87
+    24: "配送中",
88
+    25: "已送达",
89
+    26: "待提货",
90
+    27: "已提货",
91
+    31: "订单已推单",
92
+    32: "订单已被骑手接单",
93
+    33: "骑手已到店",
94
+    34: "骑手已取餐",
95
+    35: "订单完成",
96
+    36: "订单失败",
97
+};
129 98
 export default {
130 99
     name: "",
131 100
     components: { MyImage },
101
+    filter: {
102
+        orderStatus(v) {
103
+            return statusEnum[v] || "";
104
+        },
105
+    },
132 106
     // 数据
133 107
     data() {
134 108
         return {
@@ -136,15 +110,76 @@ export default {
136 110
                 startDate: "",
137 111
                 endDate: "",
138 112
             },
113
+            pageIndex: 1,
114
+            dataEnd: false,
115
+            listData: [],
139 116
         };
140 117
     },
118
+    onLoad() {
119
+        this.getList();
120
+    },
141 121
 
142 122
     onShow() {},
123
+    onPullDownRefresh() {
124
+        this.getList(true);
125
+    },
126
+    onReachBottom() {
127
+        this.getMoreList();
128
+    },
143 129
 
144 130
     // 函数
145 131
     methods: {
132
+        getList(isPull) {
133
+            uni.showLoading({
134
+                title: "加载中...",
135
+            });
136
+            this.pageIndex = 1;
137
+            this.dataEnd = false;
138
+            let sendData = {
139
+                pageIndex: this.pageIndex++,
140
+            };
141
+            if (this.filter.startDate) {
142
+                sendData.startTime = this.filter.startDate;
143
+            }
144
+            if (this.filter.endDate) {
145
+                sendData.endTime = this.filter.endDate;
146
+            }
147
+            this.api.get("/Yx/GetOrderList", sendData).then((res) => {
148
+                if (isPull) {
149
+                    uni.stopPullDownRefresh();
150
+                }
151
+                uni.hideLoading();
152
+                this.listData = res.data;
153
+                if (!this.listData.length) {
154
+                    this.dataEnd = true;
155
+                }
156
+            });
157
+        },
158
+        getMoreList() {
159
+            uni.showLoading({
160
+                title: "加载中...",
161
+            });
162
+            let sendData = {
163
+                pageIndex: this.pageIndex++,
164
+            };
165
+            if (this.filter.startDate) {
166
+                sendData.startTime = this.filter.startDate;
167
+            }
168
+            if (this.filter.endDate) {
169
+                sendData.endTime = this.filter.endDate;
170
+            }
171
+            this.api.get("/Yx/GetOrderList", sendData).then((res) => {
172
+                uni.hideLoading();
173
+                this.listData = [...this.listData, ...res.data];
174
+                if (!this.listData.length) {
175
+                    this.dataEnd = true;
176
+                }
177
+            });
178
+        },
179
+
146 180
         dateChange(e, name) {
147 181
             this.filter[name] = e.detail.value;
182
+            this.getList();
148 183
         },
149 184
     },
150 185
 
@@ -274,4 +309,12 @@ export default {
274 309
         }
275 310
     }
276 311
 }
312
+
313
+.more-text {
314
+    display: flex;
315
+    justify-content: center;
316
+    padding-bottom: px(60);
317
+    font-size: px(34);
318
+    color: #999;
319
+}
277 320
 </style>

+ 162 - 0
src/pages/youxuan/profit.vue

@@ -0,0 +1,162 @@
1
+<template>
2
+    <div class="page">
3
+        <div class="profit-info">
4
+            <h6 class="tit">累计优选佣金</h6>
5
+            <div class="money">4505.8</div>
6
+        </div>
7
+
8
+        <div class="filter">
9
+            <span class="key">时间:</span>
10
+            <picker mode="date" @change="dateChange($event, 'startDate')"
11
+                ><input
12
+                    class="value"
13
+                    placeholder="开始日期"
14
+                    :disabled="true"
15
+                    v-model="filter.startDate"
16
+            /></picker>
17
+            <span class="row">至</span>
18
+            <picker mode="date" @change="dateChange($event, 'endDate')"
19
+                ><input
20
+                    class="value"
21
+                    placeholder="结束日期"
22
+                    :disabled="true"
23
+                    v-model="filter.endDate"
24
+            /></picker>
25
+        </div>
26
+
27
+        <ul class="list">
28
+            <li>
29
+                <div class="top">
30
+                    <div class="tit">订单佣金</div>
31
+                    <div class="money">+12.90</div>
32
+                </div>
33
+                <div class="info">
34
+                    <div class="date">2021/03/29</div>
35
+                    <div class="formula">¥16(佣金)-¥2(积分抵扣) = ¥16</div>
36
+                </div>
37
+                <div class="bottom">
38
+                    <div class="num">订单号:154546464666</div>
39
+                    <div class="link">查看订单</div>
40
+                </div>
41
+            </li>
42
+            <li>
43
+                <div class="top">
44
+                    <div class="tit">订单佣金</div>
45
+                    <div class="money">+12.90</div>
46
+                </div>
47
+                <div class="info">
48
+                    <div class="date">2021/03/29</div>
49
+                    <div class="formula">¥16(佣金)-¥2(积分抵扣) = ¥16</div>
50
+                </div>
51
+                <div class="bottom">
52
+                    <div class="num">订单号:154546464666</div>
53
+                    <div class="link">查看订单</div>
54
+                </div>
55
+            </li>
56
+        </ul>
57
+    </div>
58
+</template>
59
+
60
+<script>
61
+import MyImage from "../../components/image/index";
62
+export default {
63
+    name: "",
64
+    components: { MyImage },
65
+    // 数据
66
+    data() {
67
+        return {
68
+            filter: {
69
+                startDate: "",
70
+                endDate: "",
71
+            },
72
+        };
73
+    },
74
+
75
+    onShow() {},
76
+
77
+    // 函数
78
+    methods: {
79
+        dateChange(e, name) {
80
+            this.filter[name] = e.detail.value;
81
+        },
82
+    },
83
+
84
+    // 数据计算
85
+    computed: {},
86
+
87
+    // 数据监听
88
+    watch: {},
89
+};
90
+</script>
91
+
92
+<style lang="scss" scoped>
93
+.filter {
94
+    display: flex;
95
+    align-items: center;
96
+    padding: px(40);
97
+    font-size: px(44);
98
+    background-color: #fff;
99
+    .row {
100
+        padding: 0 px(20);
101
+        flex-shrink: 0;
102
+    }
103
+    .key {
104
+        flex-shrink: 0;
105
+    }
106
+    .value {
107
+        border: 1px solid #f1f1f1;
108
+        height: px(80);
109
+        width: px(200);
110
+        padding: 0 px(10);
111
+        width: 90%;
112
+    }
113
+}
114
+
115
+.profit-info {
116
+    text-align: center;
117
+    padding: px(60) px(40);
118
+    background-color: #fff;
119
+    .tit {
120
+        font-size: px(44);
121
+    }
122
+    .money {
123
+        font-size: px(56);
124
+        color: #ff4b26;
125
+        margin-top: px(30);
126
+    }
127
+}
128
+.list {
129
+    padding: px(50) 0;
130
+    border-top: 1px solid #f1f1f1;
131
+    background-color: #fff;
132
+    li {
133
+        border-bottom: 1px solid #f1f1f1;
134
+        padding: px(30) px(40);
135
+    }
136
+    .top,.info,.bottom{
137
+        display: flex;
138
+        align-items: center;
139
+        justify-content: space-between;
140
+    }
141
+    .tit{
142
+        font-size: px(48);
143
+    }
144
+    .money{
145
+        color:#ff4b26;
146
+    }
147
+    .info,.bottom{
148
+        font-size: px(40);
149
+        color: #666;
150
+        margin-top: px(10);
151
+    }
152
+    .formula{
153
+        font-weight: bold;
154
+    }
155
+    .link{
156
+        color: #4395ff;
157
+    }
158
+    .num{
159
+        color: #999;
160
+    }
161
+}
162
+</style>