From 0ab3f711b01e3b0384d9fc18023d45c610f29104 Mon Sep 17 00:00:00 2001 From: Germey Date: Sun, 29 Dec 2024 00:38:38 +0800 Subject: [PATCH 1/2] update --- src/pages/console/subscription/Buy.vue | 28 +++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/pages/console/subscription/Buy.vue b/src/pages/console/subscription/Buy.vue index 92cba00f..a7b7e1da 100644 --- a/src/pages/console/subscription/Buy.vue +++ b/src/pages/console/subscription/Buy.vue @@ -103,6 +103,7 @@ import { SUNO_SERVICE_ID } from '@/constants/suno'; import { QRART_SERVICE_ID } from '@/constants/qrart'; import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; import { ROUTE_CONSOLE_APPLICATION_EXTRA, ROUTE_CONSOLE_ORDER_DETAIL } from '@/router'; +import { HEADSHOTS_SERVICE_ID, LUMA_SERVICE_ID } from '@/constants'; interface ISubscription { name: string; @@ -147,6 +148,9 @@ export default defineComponent({ }; }, computed: { + site() { + return this.$store.getters.site; + }, applicationId() { return this.$route.params?.id?.toString(); }, @@ -173,7 +177,9 @@ export default defineComponent({ } ]; for (const item of items) { + console.log('item', item); const pkgs = this.getPackages(item.duration); + console.log('pkgs', pkgs); if (pkgs) { item.price = pkgs.reduce((acc, pkg) => acc + pkg.price, 0); } @@ -192,7 +198,26 @@ export default defineComponent({ return items; }, serviceIds(): string[] { - return [CHAT_SERVICE_ID, MIDJOURNEY_SERVICE_ID, SUNO_SERVICE_ID, QRART_SERVICE_ID]; + let result = []; + const features = this.$store.getters.site.features; + console.log('features', features); + const keys = Object.keys(features) || []; + for (const key of keys) { + if (features[key] && features[key].enabled && features[key].service_id) { + result.push(features[key].service_id); + } + } + if (result.length > 0) { + return result; + } + return [ + CHAT_SERVICE_ID, + MIDJOURNEY_SERVICE_ID, + SUNO_SERVICE_ID, + QRART_SERVICE_ID, + LUMA_SERVICE_ID, + HEADSHOTS_SERVICE_ID + ]; }, applicationIds(): string[] { // eslint-disable-next-line vue/no-side-effects-in-computed-properties @@ -263,6 +288,7 @@ export default defineComponent({ id: this.serviceIds }); this.services = data.items; + console.log('services', this.services); }, async onFetchApplications() { const { data } = await applicationOperator.getAll({ From cd7627e1d569a67ce5f23bbe03ad095c748be96b Mon Sep 17 00:00:00 2001 From: Germey Date: Sun, 29 Dec 2024 00:41:47 +0800 Subject: [PATCH 2/2] fix --- ...acloud-nexior-a3adb6d7-fdc6-493c-8a61-ceb3a889acaa.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/@acedatacloud-nexior-a3adb6d7-fdc6-493c-8a61-ceb3a889acaa.json diff --git a/change/@acedatacloud-nexior-a3adb6d7-fdc6-493c-8a61-ceb3a889acaa.json b/change/@acedatacloud-nexior-a3adb6d7-fdc6-493c-8a61-ceb3a889acaa.json new file mode 100644 index 00000000..b06ee42d --- /dev/null +++ b/change/@acedatacloud-nexior-a3adb6d7-fdc6-493c-8a61-ceb3a889acaa.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "add dynamic services", + "packageName": "@acedatacloud/nexior", + "email": "germey@acedata.cloud", + "dependentChangeType": "patch" +}