From cbf69e754199dd4a2b7b2a219db6a446a77858e1 Mon Sep 17 00:00:00 2001 From: zhaofengliang Date: Mon, 2 Sep 2024 13:02:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20provider=20=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/provider/provider.uvue | 56 ++------------------------------ 1 file changed, 3 insertions(+), 53 deletions(-) diff --git a/pages/API/provider/provider.uvue b/pages/API/provider/provider.uvue index 6c190c66..331eda40 100644 --- a/pages/API/provider/provider.uvue +++ b/pages/API/provider/provider.uvue @@ -7,19 +7,10 @@ {{item.name}}: - - - {{item2}} - {{item.providerObjMap.length > 0 ? ':' + JSON.stringify(item.providerObjMap[index2]) : '' }} - - - {{item2}} {{item.providerObj.length > 0 ? ':' + JSON.stringify(item.providerObj[index2]) : '' }} - - @@ -34,8 +25,7 @@ service : string, name : string, provider : string[], - providerObj : UniProvider[], - providerObjMap : Object[], + providerObj : UniProvider[] } export default { @@ -44,8 +34,8 @@ title: 'provider', flag: false, serviceList: [ - { service: "payment", name: "支付", provider: [], providerObj: [], providerObjMap: [] }, - { service: "location", name: "定位", provider: [], providerObj: [], providerObjMap: [] } + { service: "payment", name: "支付", provider: [], providerObj: []}, + { service: "location", name: "定位", provider: [], providerObj: []} ] as ProviderItem[], providerIds: [] as string[], providerObjects: [] as UniProvider[], @@ -81,49 +71,9 @@ console.log(isWeChatInstalled) } // #endif - - // #ifdef APP-IOS - const providerObjMap = this.getProviderObjectMap(obj) - console.log(providerObjMap) - item.providerObjMap.push(providerObjMap) - // #endif - }) } - }, - - // #ifdef APP-IOS - getProviderObjectMap(provider : UniProvider) { - - const map = new Map() - if (this.hasProperty(provider, 'id') && provider.id != null) { - map.set('id', provider.id) - } - - if (this.hasProperty(provider, 'description') && provider.description != null) { - map.set('description', provider.description) - } - - if (this.hasProperty(provider, 'isAppExist') && provider.isAppExist != null) { - map.set('isAppExist', provider.isAppExist) - } - - if (this.hasProperty(provider, 'isWeChatInstalled') && provider.isWeChatInstalled != null) { - map.set('isWeChatInstalled', provider.isWeChatInstalled) - } - - if (this.hasMethod(provider, 'uniqueMethodForProvider')) { - map.set('func-uniqueMethodForProvider', provider.uniqueMethodForProvider()) - } - return Object.fromEntries(map) - }, - hasMethod(provider : UniProvider, methodName : string) { - return typeof provider[methodName] === 'function'; - }, - hasProperty(provider : UniProvider, propName : string) { - return propName in provider } - // #endif } } -- GitLab