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

调整uni.getProvider 的用法。#5843

上级 bc7be467
......@@ -88,17 +88,17 @@
uni.getProvider({
service: "location",
success: (e) => {
console.log("location success:" + JSON.stringify(e), e.providers.length);
let array = e.provider as string[]
console.log("location success:" + JSON.stringify(e), e.providerObjects.length);
let array = e.providerIds as string[]
array.forEach((value : string) => {
let locationProvider = e.providers.find((item) : boolean => {
let locationProvider = e.providerObjects.find((item) : boolean => {
return item.id == value
})
if (locationProvider != null) {
this.providerList.push({
name: locationProvider.description,
id: locationProvider.id,
provider: e.providers.find((item) : boolean => {
provider: e.providerObjects.find((item) : boolean => {
return item.id == locationProvider.id
})
} as LocationItem);
......
......@@ -26,14 +26,14 @@
service: "payment",
success: (e) => {
console.log("payment success:" + JSON.stringify(e));
let array = e.provider as string[]
let array = e.providerIds as string[]
array.forEach((value : string) => {
switch (value) {
case 'alipay':
this.providerList.push({
name: '支付宝',
id: "alipay",
provider: e.providers.find((item) : boolean => {
provider: e.providerObjects.find((item) : boolean => {
return item.id == 'alipay'
})
} as PayItem);
......@@ -42,7 +42,7 @@
this.providerList.push({
name: '微信',
id: "wxpay",
provider: e.providers.find((item) : boolean => {
provider: e.providerObjects.find((item) : boolean => {
return item.id == 'wxpay'
})
} as PayItem);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册