From 3d32b84e9ff7435c11db3371faeae422daf76781 Mon Sep 17 00:00:00 2001 From: HCode <71808213+HCodePro@users.noreply.github.com> Date: Mon, 18 Aug 2025 18:35:40 +0800 Subject: [PATCH] Fix mj hover price (#263) --- ...nexior-e55d7074-f2ca-4904-a143-6aec3a08f779.json | 7 +++++++ src/components/midjourney/tasks/TaskItem.vue | 13 ++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 change/@acedatacloud-nexior-e55d7074-f2ca-4904-a143-6aec3a08f779.json diff --git a/change/@acedatacloud-nexior-e55d7074-f2ca-4904-a143-6aec3a08f779.json b/change/@acedatacloud-nexior-e55d7074-f2ca-4904-a143-6aec3a08f779.json new file mode 100644 index 00000000..3cc5887e --- /dev/null +++ b/change/@acedatacloud-nexior-e55d7074-f2ca-4904-a143-6aec3a08f779.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "fix mj hover", + "packageName": "@acedatacloud/nexior", + "email": "1348977728@qq.com", + "dependentChangeType": "patch" +} diff --git a/src/components/midjourney/tasks/TaskItem.vue b/src/components/midjourney/tasks/TaskItem.vue index f4a8a011..7e565e4d 100644 --- a/src/components/midjourney/tasks/TaskItem.vue +++ b/src/components/midjourney/tasks/TaskItem.vue @@ -62,7 +62,7 @@ :key="actionKey" class="box-item" effect="dark" - :content="descriptionMapping[action]" + :content="getActionDescriptionWithPrice(action, modelValue?.request?.mode)" placement="top-start" > ; @@ -421,9 +422,19 @@ export default defineComponent({ }, config() { return this.$store.state.midjourney?.config; + }, + service() { + return this.$store.state.midjourney?.service; } }, methods: { + getActionDescriptionWithPrice(action: string, mode?: string): string { + // @ts-ignore + const baseDescription = this.descriptionMapping[action]; + const price = getConsumption({ ...this.config, action: action, mode: mode }, this.service?.metadata?.price); + const unit = this.$t(`service.unit.${this.service?.unit || 'credits'}`); + return `${baseDescription} (${price} ${unit})`; + }, onCustom(action: string) { if (this.modelValue?.type === 'imagine') { this.$emit('custom', {