Commit 28f9f005 authored by xuguangxing's avatar xuguangxing

feat: 增加保存时,优惠券批次id统一管理的操作

parent cae8fb42
......@@ -3,15 +3,15 @@ const protocol = EASY_ENV_IS_BROWSER ? window.location.protocol : 'http';
const hostMap = {
apiHost: `http://localhost:7002/`,
// apiHost: `http://192.168.28.199:7001/`,
// apiHost: 'https://quantum-blocks-test1.liangkebang.net/',
h5Host: 'https://quantum-h5-test1.liangkebang.net',
// apiHost: 'https://quantum-blocks-qa.liangkebang.net/',
h5Host: 'https://quantum-h5-qa.liangkebang.net',
qiniuHost: `https://appsync.lkbang.net`,
shenceUrl: `${protocol}//bn.xyqb.com/sa?project=default`,
opapiHost: `https://opapi-test1.liangkebang.net`,
opapiHost: `https://opapi-qa.liangkebang.net`,
qiniuUpHost: `${protocol}//up-z0.qiniup.com`,
// kdspHost: 'https://kdsp-api-test1.liangkebang.net',
talosHost: 'https://talos-test1.liangkebang.net',
kdspHost: 'https://kdsp-api-test1.liangkebang.net',
// kdspHost: 'https://kdsp-api-qa.liangkebang.net',
talosHost: 'https://talos-qa.liangkebang.net',
kdspHost: 'https://kdsp-api-qa.liangkebang.net',
yxmTenantId: 560761,
appIdMap: {
560761: 'wxe16bf9293671506c',
......
......@@ -63,6 +63,31 @@ export default class GoodsTabsMixin extends Vue {
return pageData;
}
handleCouponIds() {
const pageData = cloneDeep(this.pageData);
// 下方逻辑: 为一键领取优惠券统计页面所有优惠券组件所含优惠券批次id,并逗号分割,加入到一键领取组件的couponIds字段
const { elements } = pageData;
let ids: any = [];
const batchPickupIndexArr: any[] = []; // 记录一键领取索引值
elements.forEach((item, index) => {
console.log(item);
if (item.name == 'cs-coupon' && item.props.couponsList && item.props.couponsList.length) {
ids = ids.concat(item.props.couponsList);
}
if (item.name == 'cs-batch-pickup') {
batchPickupIndexArr.push(index);
}
});
ids = Array.from(new Set(ids));
ids = ids.join();
if (batchPickupIndexArr.length) {
for (let i = 0; i < batchPickupIndexArr.length; i++) {
elements[batchPickupIndexArr[i]].props.couponIds = ids;
}
}
return pageData;
}
parseGoodsTabs() {
const goodsTabs = {};
this.pageData.elements.forEach((element, idx) => {
......
......@@ -88,6 +88,7 @@ export default class DashBoard extends Mixins(ContextMenuMixin, GoodsTabsMixin,
let pageData = this.handleTabsRepaetCom();
pageData = this.handleComAchorScrollEnable();
pageData = this.handleGoodsTabs();
pageData = this.handleCouponIds();
const { pageName, pageDescribe, pageKeywords, coverImage, isPublish, isTemplate, shareCoverImage, shareOpenMethod, diversion } = pageConfig;
// !diversion shareCoverImage shareOpenMethod没有作为单独的sql字段存储下来,只是单纯的存储到的redis中
// 目前对此打了补丁,存放到page的props中
......@@ -100,7 +101,8 @@ export default class DashBoard extends Mixins(ContextMenuMixin, GoodsTabsMixin,
separateAllScheme(pageData.elements);
const pageInfo = { diversion, page: JSON.stringify(pageData), author: user?.account, isPublish, pageName, pageDescribe, pageKeywords, coverImage, isTemplate, shareCoverImage, shareOpenMethod } as pageInfo;
if (this.uuid) { pageInfo.uuid = this.uuid; }
await this.savePageData({ pageInfo, pageData: this.pageData });
const requestPageData = this.handleCouponIds();
await this.savePageData({ pageInfo, pageData: requestPageData });
if (this.uuid) { await this.getPageDate({ pageId: this.uuid }); }
this.showSubmitPopup = false;
// 清除新增数据时的缓存
......
......@@ -16,7 +16,7 @@
"@hubcarl/json-typescript-mapper": "^2.0.0",
"@qg/apollo-nodejs": "^2.1.2",
"@qg/cherry-ui": "2.23.10",
"@qg/citrus-ui": "0.3.43",
"@qg/citrus-ui": "0.3.44-beta3",
"@riophae/vue-treeselect": "^0.4.0",
"@types/lodash": "^4.14.117",
"@types/node": "^10.12.0",
......@@ -3081,9 +3081,9 @@
}
},
"node_modules/@qg/citrus-ui": {
"version": "0.3.43",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.3.43.tgz",
"integrity": "sha512-VlvbBVALr8XRrGy5/fVQwDtPqh3pE3O0TOMX6EYBC2o1HBr99JZglrVfvzmTmB2Q3cHWWw2hcLNbMdyGiOGMLA==",
"version": "0.3.44-beta3",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.3.44-beta3.tgz",
"integrity": "sha512-EcYubUlC7TAM326qPPD6EiRI++aGV1Jt0dYKD6jCqTAlUKCTZZd1hM9dpFpDHtD0wd1fL2L7vO3dy2p3yrWxPA==",
"license": "MIT",
"dependencies": {
"@better-scroll/core": "^2.1.1",
......@@ -23894,7 +23894,6 @@
},
"node_modules/npm/node_modules/lodash._baseindexof": {
"version": "3.1.0",
"extraneous": true,
"inBundle": true,
"license": "MIT"
},
......@@ -23909,19 +23908,16 @@
},
"node_modules/npm/node_modules/lodash._bindcallback": {
"version": "3.0.1",
"extraneous": true,
"inBundle": true,
"license": "MIT"
},
"node_modules/npm/node_modules/lodash._cacheindexof": {
"version": "3.0.2",
"extraneous": true,
"inBundle": true,
"license": "MIT"
},
"node_modules/npm/node_modules/lodash._createcache": {
"version": "3.1.2",
"extraneous": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
......@@ -23935,7 +23931,6 @@
},
"node_modules/npm/node_modules/lodash._getnative": {
"version": "3.9.1",
"extraneous": true,
"inBundle": true,
"license": "MIT"
},
......@@ -23951,7 +23946,6 @@
},
"node_modules/npm/node_modules/lodash.restparam": {
"version": "3.6.1",
"extraneous": true,
"inBundle": true,
"license": "MIT"
},
......@@ -38914,9 +38908,9 @@
}
},
"@qg/citrus-ui": {
"version": "0.3.43",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.3.43.tgz",
"integrity": "sha512-VlvbBVALr8XRrGy5/fVQwDtPqh3pE3O0TOMX6EYBC2o1HBr99JZglrVfvzmTmB2Q3cHWWw2hcLNbMdyGiOGMLA==",
"version": "0.3.44-beta3",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.3.44-beta3.tgz",
"integrity": "sha512-EcYubUlC7TAM326qPPD6EiRI++aGV1Jt0dYKD6jCqTAlUKCTZZd1hM9dpFpDHtD0wd1fL2L7vO3dy2p3yrWxPA==",
"requires": {
"@better-scroll/core": "^2.1.1",
"@qg/cherry-ui": "^2.23.9",
......@@ -54190,8 +54184,7 @@
},
"lodash._baseindexof": {
"version": "3.1.0",
"bundled": true,
"extraneous": true
"bundled": true
},
"lodash._baseuniq": {
"version": "4.6.0",
......@@ -54203,18 +54196,15 @@
},
"lodash._bindcallback": {
"version": "3.0.1",
"bundled": true,
"extraneous": true
"bundled": true
},
"lodash._cacheindexof": {
"version": "3.0.2",
"bundled": true,
"extraneous": true
"bundled": true
},
"lodash._createcache": {
"version": "3.1.2",
"bundled": true,
"extraneous": true,
"requires": {
"lodash._getnative": "^3.0.0"
}
......@@ -54225,8 +54215,7 @@
},
"lodash._getnative": {
"version": "3.9.1",
"bundled": true,
"extraneous": true
"bundled": true
},
"lodash._root": {
"version": "3.0.1",
......@@ -54238,8 +54227,7 @@
},
"lodash.restparam": {
"version": "3.6.1",
"bundled": true,
"extraneous": true
"bundled": true
},
"lodash.union": {
"version": "4.6.0",
......@@ -8,7 +8,7 @@
"test": "cross-env NODE_ENV=production EGG_SERVER_ENV=sit egg-scripts start --port 80 --workers 1",
"stop": "egg-scripts stop",
"backend": "nohup egg-scripts start --port 7001 --workers 4",
"dev": "cross-env NODE_ENV=test APOLLO_CLUSTER=k8s NAMESPACE=test1 npm run apollo && egg-bin dev -r egg-ts-helper/register --port 7002",
"dev": "cross-env NODE_ENV=test APOLLO_CLUSTER=k8s NAMESPACE=qa npm run apollo && egg-bin dev -r egg-ts-helper/register --port 7002",
"debug": "egg-bin debug -r egg-ts-helper/register",
"apollo": "node bin/apollo.js",
"build": "cross-env NODE_ENV=production APOLLO_CLUSTER=3C npm run apollo && cross-env COS_ENV=production easy build --devtool",
......@@ -30,7 +30,7 @@
"@hubcarl/json-typescript-mapper": "^2.0.0",
"@qg/apollo-nodejs": "^2.1.2",
"@qg/cherry-ui": "2.23.10",
"@qg/citrus-ui": "0.3.43",
"@qg/citrus-ui": "0.3.44-beta3",
"@riophae/vue-treeselect": "^0.4.0",
"@types/lodash": "^4.14.117",
"@types/node": "^10.12.0",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment