mutations.js
1.47 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
import * as Types from './types';
// import { find, set } from 'lodash';
export default {
/*
* @ description: 更新二手商品详情页
* @ author: huzhiming
* @ date: 2019-11-22 19:09:49
* @ version: v1.0.0
*/
[Types.UPDATE_PRODUCT_DETAIL](state, { info }) {
if (info) {
state.info = info;
} else {
state.info = {
imageList: [],
price: '',
sizeName: '',
shoeBoxDesc: '',
productId: '',
productName: '',
productCode: '',
colorName: '',
describeInfo: '',
brandName: '',
shoeQualityDesc: '',
soldTime: '',
image: ''
};
}
},
/*
* @ description: 更新相同尺寸 二手商品列表
* @ author: huzhiming
* @ date: 2019-11-22 19:09:02
* @ version: v1.0.0
*/
[Types.UPDATE_PRODUCT_LIST](state, { data: { product_list, page_total, page, total }, isReset, error }) {
if (error) {
state.isShowEmpty = true;
return false;
}
if (product_list) {
if (page_total > page) {
state.isMore = true;
state.pageTotal = page_total;
state.page = page + 1;
} else {
state.isMore = false;
}
if (isReset) {
state.productList = product_list;
} else {
state.productList = state.productList.push(...product_list);
}
state.total = total;
}
},
[Types.UPDATE_PRODUCT_FILTER](state, { filter }) {
state.filterData = filter;
}
};