From 1910e9f27373b8b4da75f076762025ceb3419965 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期四, 12 六月 2025 15:40:50 +0800
Subject: [PATCH] fix: 暂时隐藏电信充值通道
---
packages/core-vue/src/plugin.ts | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/packages/core-vue/src/plugin.ts b/packages/core-vue/src/plugin.ts
index af1966d..ca1fdec 100644
--- a/packages/core-vue/src/plugin.ts
+++ b/packages/core-vue/src/plugin.ts
@@ -1,5 +1,5 @@
-import { BlLifeRecharge } from '@life-payment/core';
-import { inject, shallowReactive } from 'vue';
+import { BlLifeRecharge, BlLifeRechargeOptions } from '@life-payment/core';
+import { inject, reactive, provide, ref } from 'vue';
import type { InjectionKey, UnwrapNestedRefs, Ref } from 'vue';
export type LifeRechargeContext = {
@@ -12,10 +12,25 @@
blLifeRecharge: BlLifeRecharge;
};
+function updateState(state: Record<string, unknown>, update: Record<string, any>): void {
+ Object.keys(state).forEach((key) => {
+ state[key] = update[key];
+ });
+}
+
export const VueLifeRechargePlugin = {
install: (app: any, { blLifeRecharge }: VueLifeRechargePluginOptions) => {
+ const _blLifeRecharge = reactive(blLifeRecharge);
+ _blLifeRecharge.init();
+
+ // blLifeRecharge.listener.addListener({
+ // update: (state) => {
+ // updateState(_blLifeRecharge, state);
+ // },
+ // });
+
app.provide(clientKey, {
- blLifeRecharge: shallowReactive(blLifeRecharge),
+ blLifeRecharge: _blLifeRecharge,
});
},
};
--
Gitblit v1.9.1