From b5649d946ca9825af67f9f5fb444244395e1088c Mon Sep 17 00:00:00 2001 From: mahaifeng Date: Fri, 9 Aug 2024 12:19:22 +0800 Subject: [PATCH] =?UTF-8?q?[provider]=E8=A1=A5=E5=85=85provider=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/provider/provider.test.js | 7 +++++++ pages/API/provider/provider.uvue | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/pages/API/provider/provider.test.js b/pages/API/provider/provider.test.js index 9329328e..4e23dd1a 100644 --- a/pages/API/provider/provider.test.js +++ b/pages/API/provider/provider.test.js @@ -21,5 +21,12 @@ describe("provider", () => { expect(providerIds[1]).toEqual('alipay') expect(providerIds[2]).toEqual('system') expect(providerIds[3]).toEqual('tencent') + + let providerObjects = await page.data('providerObjects') + expect(providerObjects[0].description).toEqual('微信支付') + expect(providerObjects[1].description).toEqual('支付宝') + expect(providerObjects[2].description).toEqual('系统定位') + expect(providerObjects[3].description).toEqual('腾讯定位') + expect(providerObjects.length).toEqual(4) }); }); diff --git a/pages/API/provider/provider.uvue b/pages/API/provider/provider.uvue index 544bd7a0..f53645ec 100644 --- a/pages/API/provider/provider.uvue +++ b/pages/API/provider/provider.uvue @@ -47,7 +47,8 @@ { service: "payment", name: "支付", provider: [], providerObj: [], providerObjMap: [] }, { service: "location", name: "定位", provider: [], providerObj: [], providerObjMap: [] } ] as ProviderItem[], - providerIds: [] as string[] + providerIds: [] as string[], + providerObjects : [] as UniProvider[], } }, methods: { @@ -73,8 +74,10 @@ }); if (item != null && provider != null) { item.provider = provider + item.providerObj = uniProvider item.providerObj.forEach((obj) => { + this.providerObjects.push(obj) // #ifdef APP-ANDROID if (obj instanceof UniPaymentWxpayProvider) {//判断微信是否安装 var isWeChatInstalled = (obj as UniPaymentWxpayProvider).isWeChatInstalled -- GitLab