actions.js
2.71 KB
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
import * as Types from './types';
export default {
async fetchProduct({commit}, {productId}) {
commit(Types.FETCH_ORDER_PRODUCT_REQUEST);
// const result = await this.$api.get('/api/ufo/seller/entryGoodsSizeList', {
// productId,
// });
const result = {
"alg": "SALT_MD5",
"code": 200,
"data": {
productInfo:{
"productId": 10000078,
"productName": "Air Jordan XX9 Low “Chicago Bulls”",
"colorName":"红色",
"goodsImg" : "http://img11.static.yhbimg.com/goodsimg/2018/10/18/17/01699014e8981a532f27abc74730e40bbd.jpg?imageMogr2/thumbnail/{width}x{height}/background/d2hpdGU=/position/center/quality/80",
"sizeNum":5,
"storageNum":100,
"statuStr": "出售中",
"status": 1,
},
"data": [
{
"buttons": [
{
"code": "batch_cancel_sold",
"name": "BATCH_CANCEL_SOLD",
"text": "不卖了"
},
{
"code": "change_price",
"name": "CHANGE_PRICE",
"text": "调价"
}
],
"createTime": "2018-11-05 15:03:27",
"goodsInfo": {
"colorName": "",
"goodImg": "",
"goodPrice": "9.00",
"storageNum":100,
"sizeName": "L",
"storageId": 10000162,
"leastPrice": 1119
},
"secendLevelCreateTime": 1541401407,
"uid": 500031152
}
],
"page": 1,
"pageSize": 20,
"pagetotal": 1,
"total": 2
},
"md5": "42a616d78633c19d80eb410da1ae4644",
"message": "列表"
}
if (result && result.code === 200) {
commit(Types.FETCH_ORDER_PRODUCT_SUCCESS, {
order: result.data
});
} else {
commit(Types.FETCH_ORDER_PRODUCT_FAILD);
}
},
async postNoSale({commit}, {product}) {
commit(Types.POST_NOSALE_REQUEST);
// const result = await this.$api.get('/api/ufo/sellerOrder/batchDownShelf', product);
const result = {
"alg": "SALT_MD5",
"code": 200,
"data": true,
"md5": "40f3824dd1e55b340dc5357dd7ccab72",
"message": "批量取消成功"
};
if (result && result.code === 200) {
commit(Types.POST_NOSALE_SUCCESS, {
order: result.data
});
} else {
commit(Types.POST_NOSALE_FAILD);
}
return result || {};
}
};