diff --git a/pages/API/provider/provider.test.js b/pages/API/provider/provider.test.js index 9329328e78f1b750511703a33b3819e405cb9fc9..4e23dd1a25a34982f7c6b4adcd31f2d21e09ccdf 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 544bd7a0e7c0ca7832e4cd5cbcc1b0db53932d49..f53645ec25c39e41177ab379015c7fad90276ae0 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