Browse Source

修改订单接口 购物车对接

liude 1 year ago
parent
commit
7b96afbcec

+ 15 - 0
src/api/client/order.js

@@ -15,6 +15,21 @@ export function userOrdersApi(data) {
   });
 }
 
+/**
+ * 订单接口 - 获取用户的订单列表
+ * @returns
+ */
+export function getUserOrderList(data) {
+  return request({
+    url: '/maintain/order/paging',
+    method: 'get',
+    data: data,
+    header: {
+      'content-type': 'application/x-www-form-urlencoded',
+    },
+  });
+}
+
 /**
  * 订单接口 - 支付成功回调
  * @returns

+ 26 - 17
src/pages/client/clientPackage/orderAll.vue

@@ -15,29 +15,38 @@
 </template>
 
 <script>
-import { userOrdersApi } from '@/api/client/order';
+import { userOrdersApi , getUserOrderList } from '@/api/client/order';
 export default {
   data() {
     return {
       current: 0,
       type: 'ALL',
       size: 20,
+      // 订单状态:0->待付款;1->待发货;2->已发货;3->已完成;4->已关闭;5->无效订单
       list: [
         {
-          name: '全部',
-          type: 'ALL',
+          name: '待付款',
+          type: 0,
         },
         {
-          name: '待付款',
-          type: 'WAIT_PAY',
+          name: '待发货',
+          type: 1,
+        },
+        {
+          name: '已发货',
+          type: 2,
         },
         {
-          name: '已付款',
-          type: 'WAIT_EVALUATE',
+          name: '已完成',
+          type: 3,
         },
         {
-          name: '待评价',
-          type: 'CANCELLED',
+          name: '已关闭',
+          type: 4,
+        },
+        {
+          name: '无效订单',
+          type: 5,
         },
       ],
       init_list: [],
@@ -55,15 +64,15 @@ export default {
     },
 
     async userOrdersPage(type) {
-      let orderStatus = type == undefined ? 'ALL' : `${type}`;
-      let res = await userOrdersApi({
-        orderStatus,
-        size: this.size,
+      let orderStatus = type == undefined ? 0 : `${type}`;
+      let res = await getUserOrderList({
+        status:orderStatus,
+        paging: '1,20',
       });
-
-      if ((res.code = 200 && res.data)) {
-        this.init_list = res.data;
-      }
+      console.log("@@@@res",res);
+      // if ((res.code = 200 && res.data)) {
+      //   this.init_list = res.data;
+      // }
     },
   },
 };

+ 1 - 1
src/pages/client/clientPackage/storeDetail.vue

@@ -224,7 +224,7 @@
         // 获取锚点
         hotMerchant(this.queryParams.id).then();
 
-        addShoppingCart({}).then(res=>{
+        addShoppingCart({merchantId:this.ids}).then(res=>{
           console.log('addShoppingCart',res);
         })
       },

+ 1 - 1
src/utils/request.js

@@ -3,7 +3,7 @@ import {
 } from '@/utils/system';
 import store from '@/store';
 
- const BASE_URL = 'http://192.168.43.175:11000';
+ const BASE_URL = 'http://192.168.68.77:11000';
 // const BASE_URL = 'https://test.api.chelvc.com';
 const TIME_OUT = 60000;
 const errStatus = {