|
@@ -23,6 +23,36 @@ class PlatformActService extends CrudService {
|
|
|
rs = await this.afterQuery(filter, rs);
|
|
|
return rs;
|
|
|
}
|
|
|
+
|
|
|
+ getActText(data) {
|
|
|
+ const { type } = data;
|
|
|
+ let text = '';
|
|
|
+ if (type === '2') {
|
|
|
+ text = '赠品';
|
|
|
+ } else if (type === '3') {
|
|
|
+ text = '特价';
|
|
|
+ } else if (type === '4') {
|
|
|
+ text = '加价购';
|
|
|
+ } else if (type === '5') {
|
|
|
+ const discount = _.get(data, 'config.discount', []);
|
|
|
+ for (const i of discount) {
|
|
|
+ const { limit, number } = i;
|
|
|
+ text = `${text}满${limit}减${number};`;
|
|
|
+ }
|
|
|
+ } else if (type === '6') {
|
|
|
+ const discount = _.get(data, 'config.discount', []);
|
|
|
+ for (const i of discount) {
|
|
|
+ const { limit, number, max } = i;
|
|
|
+ text = `满${limit}打${number}折`;
|
|
|
+ if (max) text = `${text}(最多减免${max}元)`;
|
|
|
+ text = `${text};`;
|
|
|
+ }
|
|
|
+ } else if (type === '7') {
|
|
|
+ text = '套装';
|
|
|
+ }
|
|
|
+ return text;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
module.exports = PlatformActService;
|