DESKTOP-SYIYI\Dell пре 7 година
родитељ
комит
49284dd96a
2 измењених фајлова са 10 додато и 17 уклоњено
  1. 6 13
      src/components/order/list/OrderList.vue
  2. 4 4
      src/lib/api.js

+ 6 - 13
src/components/order/list/OrderList.vue

@@ -158,11 +158,8 @@
                 //退款
                 let refundOrder = (order_sn) => {
                     this.$store.commit('updateLoadingStatus', {isLoading: true});
-                    this.$http.jsonp(Api.refundOrder(), {_timeout: 5000}, {
-                        params: {
-                            order_sn: order_sn,
-                        }
-                    }).then(function (res) {
+                    this.$http.jsonp(Api.refundOrder(order_sn), {_timeout: 5000}).then(function (res) {
+                        _self.$store.commit('updateLoadingStatus', {isLoading: false});
                         if (res.body.code != 200) {
                             this.$vux.toast.show({
                                 type: 'text',
@@ -173,8 +170,8 @@
                             return;
                         }
                         _self.$store.commit("updateOrderState", {action: res.body.datas, action_id: new Date()});
-                        _self.$store.commit('updateLoadingStatus', {isLoading: false});
                     }, (err) => {
+                        _self.$store.commit('updateLoadingStatus', {isLoading: false});
                         this.$vux.toast.show({
                             type: 'text',
                             text: "网络错误",
@@ -186,12 +183,8 @@
                 //通知服务器改变状态
                 let changeState = (action, order_id) => {
                     this.$store.commit('updateLoadingStatus', {isLoading: true});
-                    this.$http.jsonp(Api.changeOrderState(), {_timeout: 5000}, {
-                        params: {
-                            act_type: action,
-                            order_id: order_id
-                        }
-                    }).then(function (res) {
+                    this.$http.jsonp(Api.changeOrderState(action, order_id), {_timeout: 5000}).then(function (res) {
+                        _self.$store.commit('updateLoadingStatus', {isLoading: false});
                         if (res.body.code != 200) {
                             this.$vux.toast.show({
                                 type: 'text',
@@ -202,8 +195,8 @@
                             return;
                         }
                         _self.$store.commit("updateOrderState", {action: res.body.datas, action_id: new Date()});
-                        _self.$store.commit('updateLoadingStatus', {isLoading: false});
                     }, (err) => {
+                        _self.$store.commit('updateLoadingStatus', {isLoading: false});
                         this.$vux.toast.show({
                             type: 'text',
                             text: "网络错误",

+ 4 - 4
src/lib/api.js

@@ -40,16 +40,16 @@ class Api {
         return this.host() + '/mobile/index.php?act=cart&op=list&client_type=ajax'
     }
 
-    static changeOrderState() {
-        return this.host() + '/mobile/index.php?act=member_order&op=change_state&client_type=ajax'
+    static changeOrderState(action,order_id) {
+        return this.host() + '/mobile/index.php?act=member_order&op=change_state&client_type=ajax&act_type='+action+"&order_id="+order_id
     }
 
     static orderList() {
         return this.host() + '/mobile/index.php?act=member_order&page=30&op=list&page=15&client_type=ajax'
     }
 
-    static refundOrder() {
-        return this.host() + '/mobile/index.php?act=member_refund&op=order_refund&client_type=ajax'
+    static refundOrder(order_sn) {
+        return this.host() + '/mobile/index.php?act=member_refund&op=order_refund&client_type=ajax&order_sn='+order_sn
     }
 
     static deliverInfo(order_id) {