提交 2ebe2f33 编写于 作者: zhaofengliang920817's avatar zhaofengliang920817

App 平台|调整provider 示例。#5843

上级 4e22bbe8
...@@ -54,7 +54,14 @@ ...@@ -54,7 +54,14 @@
} }
}, },
methods: { methods: {
clearProviderObj() {
this.serviceList.forEach((item : ProviderItem) => {
item.providerObj = []
item.providerObjMap = []
})
},
getProviderSync() { getProviderSync() {
this.clearProviderObj()
this.serviceList.forEach((item : ProviderItem) => { this.serviceList.forEach((item : ProviderItem) => {
let provider = uni.getProviderSync({ let provider = uni.getProviderSync({
service: item.service service: item.service
...@@ -64,6 +71,7 @@ ...@@ -64,6 +71,7 @@
}) })
}, },
getProvider() { getProvider() {
this.clearProviderObj()
this.serviceList.forEach((item : ProviderItem) => { this.serviceList.forEach((item : ProviderItem) => {
uni.getProvider({ uni.getProvider({
service: item.service, service: item.service,
...@@ -90,6 +98,7 @@ ...@@ -90,6 +98,7 @@
this.flag = true this.flag = true
this.getProvider() this.getProvider()
let objList = [] let objList = []
this.clearProviderObj()
this.serviceList.forEach((value) => { this.serviceList.forEach((value) => {
value.provider.forEach((provider) => { value.provider.forEach((provider) => {
let obj = uni.getProviderObjectById({ let obj = uni.getProviderObjectById({
...@@ -176,4 +185,4 @@ ...@@ -176,4 +185,4 @@
.btn-get-provider { .btn-get-provider {
margin-top: 30px; margin-top: 30px;
} }
</style> </style>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册