后端 + 前端:优惠劵更新功能

This commit is contained in:
YunaiV
2019-04-06 00:57:00 +08:00
parent 7f024bec9d
commit f8ae2153ba
18 changed files with 1137 additions and 53 deletions

View File

@@ -1,15 +1,14 @@
import {message} from 'antd';
import {
deleteProductRecommend,
updateProductRecommend,
updateProductRecommendStatus,
addCouponCardTemplate,
updateCouponCardTemplate,
getCouponCardTemplatePage,
} from '../../services/promotion';
import PaginationHelper from '../../../helpers/PaginationHelper';
const SEARCH_PARAMS_DEFAULT = {
// type: 1,
title: '',
};
export default {
@@ -50,7 +49,7 @@ export default {
list: response.data.list,
pagination: PaginationHelper.formatPagination(response.data, payload),
searchParams: {
// type: payload.type
title: payload.title
}
},
});
@@ -100,7 +99,7 @@ export default {
});
// 请求
const response = yield call(updateProductRecommend, body);
const response = yield call(updateCouponCardTemplate, body);
// 响应
if (response.code === 0) {
if (callback) {
@@ -138,21 +137,21 @@ export default {
}
},
* delete({ payload }, { call, put }) {
// 请求
const response = yield call(deleteProductRecommend, payload);
// 响应
if (response.code === 0) {
message.info('删除成功!');
// 刷新列表
yield put({
type: 'query',
payload: {
...PaginationHelper.defaultPayload
},
});
}
},
// * delete({ payload }, { call, put }) {
// // 请求
// const response = yield call(deleteProductRecommend, payload);
// // 响应
// if (response.code === 0) {
// message.info('删除成功!');
// // 刷新列表
// yield put({
// type: 'query',
// payload: {
// ...PaginationHelper.defaultPayload
// },
// });
// }
// },
},