提交 9eb17436 编写于 作者: M mahaifeng

修改支付示例

上级 ac4b8a54
......@@ -8,7 +8,7 @@
</template>
<script>
export type PayItem = { id : string, name : string }
export type PayItem = { id : string, name : string, provider ?: UniProvider }
export default {
data() {
return {
......@@ -33,12 +33,18 @@
this.providerList.push({
name: '支付宝',
id: "alipay",
provider: e.providers.find((item) : boolean => {
return item?.id == 'alipay'
})
} as PayItem);
break;
case 'wxpay':
this.providerList.push({
name: '微信',
id: "wxpay",
provider: e.providers.find((item) : boolean => {
return item?.id == 'wxpay'
})
} as PayItem);
break;
default:
......@@ -57,8 +63,17 @@
if (provider == "alipay") {
this.payAli()
} else if (provider == "wxpay") {
if (e.provider != null && e.provider?.isAppExist==false) {
uni.showToast({
title: "微信没有安装",
icon:'error'
})
} else {
this.payWX()
}
}
},
payAli() {
uni.showLoading({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册