|
@@ -33,11 +33,26 @@
|
|
|
let _self = this;
|
|
|
if (_self.page.isUpdate) {
|
|
|
this.$store.commit('updateLoadingStatus', {isLoading: true});
|
|
|
- this.$http.jsonp(Api.orderList(), {params: {state_type: getParamState(_self.page.state)}}).then(function (res) {
|
|
|
+ this.$http.jsonp(Api.orderList(), {params: {state_type: getParamState(_self.page.state)}},{_timeout:5000}).then(function (res) {
|
|
|
+ if (res.body.code != 200) {
|
|
|
+ this.$vux.toast.show({
|
|
|
+ type: 'text',
|
|
|
+ text: res.body.message,
|
|
|
+ position: 'middle',
|
|
|
+ width: '600px'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
_self.datas = res.body.datas;
|
|
|
_self.page.isUpdate = false;
|
|
|
this.$store.commit('updateLoadingStatus', {isLoading: false});
|
|
|
+ },(err) => {
|
|
|
+ this.$vux.toast.show({
|
|
|
+ type: 'text',
|
|
|
+ text: "网络错误",
|
|
|
+ position: 'middle'
|
|
|
})
|
|
|
+ })
|
|
|
}
|
|
|
let ui;
|
|
|
if (!_self.datas || (this.datas.hasOwnProperty("orders") && this.datas.orders.length === 0)) {
|
|
@@ -86,28 +101,58 @@
|
|
|
//退款
|
|
|
let refundOrder = (order_sn) => {
|
|
|
this.$store.commit('updateLoadingStatus', {isLoading: true});
|
|
|
- this.$http.jsonp(Api.refundOrder(), {
|
|
|
+ this.$http.jsonp(Api.refundOrder(),{_timeout:5000},{
|
|
|
params: {
|
|
|
order_sn: order_sn,
|
|
|
}
|
|
|
}).then(function (res) {
|
|
|
+ if (res.body.code != 200) {
|
|
|
+ this.$vux.toast.show({
|
|
|
+ type: 'text',
|
|
|
+ text: res.body.message,
|
|
|
+ position: 'middle',
|
|
|
+ width: '600px'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
_self.$store.commit("updateOrderState", {action: res.body.datas, action_id: new Date()});
|
|
|
this.$store.commit('updateLoadingStatus', {isLoading: false});
|
|
|
+ },(err) => {
|
|
|
+ this.$vux.toast.show({
|
|
|
+ type: 'text',
|
|
|
+ text: "网络错误",
|
|
|
+ position: 'middle'
|
|
|
})
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
//通知服务器改变状态
|
|
|
let changeState = (action, order_id) => {
|
|
|
this.$store.commit('updateLoadingStatus', {isLoading: true});
|
|
|
- this.$http.jsonp(Api.changeOrderState(), {
|
|
|
+ this.$http.jsonp(Api.changeOrderState(),{_timeout:5000},{
|
|
|
params: {
|
|
|
act_type: action,
|
|
|
order_id: order_id
|
|
|
}
|
|
|
}).then(function (res) {
|
|
|
+ if (res.body.code != 200) {
|
|
|
+ this.$vux.toast.show({
|
|
|
+ type: 'text',
|
|
|
+ text: res.body.message,
|
|
|
+ position: 'middle',
|
|
|
+ width: '600px'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
_self.$store.commit("updateOrderState", {action: res.body.datas, action_id: new Date()});
|
|
|
this.$store.commit('updateLoadingStatus', {isLoading: false});
|
|
|
+ },(err) => {
|
|
|
+ this.$vux.toast.show({
|
|
|
+ type: 'text',
|
|
|
+ text: "网络错误",
|
|
|
+ position: 'middle'
|
|
|
})
|
|
|
+ })
|
|
|
}
|
|
|
//处理服务器返回的状态
|
|
|
let global_state = _self.$store.state.changeState;
|