From 9e00409e5e8c1c102f4280503695fa405667abb5 Mon Sep 17 00:00:00 2001
From: fuchao <2577131060@qq.com>
Date: Mon, 15 Dec 2025 11:18:22 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E4=B8=8D=E5=90=8C?=
=?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=94=AF=E4=BB=98=EF=BC=8C=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E6=94=AF=E4=BB=98=E6=96=B9=E5=BC=8F=E4=B8=8D=E5=90=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/user/recharge/index.vue | 47 +++++++++++------------------------
1 file changed, 15 insertions(+), 32 deletions(-)
diff --git a/pages/user/recharge/index.vue b/pages/user/recharge/index.vue
index 5922221..56b9a1c 100644
--- a/pages/user/recharge/index.vue
+++ b/pages/user/recharge/index.vue
@@ -3,7 +3,7 @@
-
+
活动充值金额
@@ -39,13 +39,11 @@
{{$t('user.paymentMethod')}}
-
+
-
-
- {{ item.title }}
-
+
+ {{ isAndroid ? $t('user.googlePay') : $t('user.applePay')}}
+
@@ -88,14 +86,6 @@
const userStore = useUserStore()
const { t } = useI18n()
const message = useMessage()
- const payType = ref('1')
- const iosPaylist = ref([
- {
- title: "Google Pay",
- id: '1',
- // imgUrl: "/static/icon/currency.png"
- }
- ])
// 充值列表
const rechargeList = ref([])
// 金额列表单独每项
@@ -135,7 +125,7 @@
const eventAmountList = ref([])
//正常金额数据
const standardAmountList = ref([])
-
+ // 声明ios实例
const iapChannel = ref(null)
/**
@@ -251,16 +241,16 @@
}
});
}
-
+
/**
* 查询后台配置的商品信息
*/
const getProductInfo = () => {
const id = String(aloneItem.value.priceTypeId)
- iapChannel.value.requestProduct([id], (res: any) => {
+ iapChannel.value.requestProduct([id], (res : any) => {
console.log(res, '查询苹果后台配置的商品id');
topay(id)
- }, (err: any) => {
+ }, (err : any) => {
uni.showToast({ title: '未获取到产品信息,请联系管理员', icon: 'none' });
console.error('失败', err);
});
@@ -269,7 +259,7 @@
/**
* 准备支付-调出支付窗口
*/
- const topay = (id: string) => {
+ const topay = (id : string) => {
return new Promise((resolve, reject) => {
uni.hideLoading()
uni.requestPayment({
@@ -297,7 +287,7 @@
});
})
}
-
+
/**
* 调用后台支付-ios
*/
@@ -317,7 +307,7 @@
}
}
-
+
/**
* 检查是否存在未关闭的订单
*/
@@ -325,9 +315,9 @@
return new Promise((resolve, reject) => {
iapChannel.value.restoreCompletedTransactions({
manualFinishTransaction: true,
- }, (res: unknown) => {
+ }, (res : unknown) => {
console.log(res, '成功-restoreCompletedTransactions');
- res.map((item: any) => {
+ res.map((item : any) => {
finishTransaction(item)
})
resolve(res);
@@ -337,7 +327,7 @@
})
});
}
-
+
/**
* 关闭订单
*/
@@ -496,13 +486,6 @@
}
}
- /**
- * 切换支付方式
- */
- const choseType = () => {
- // payType.value = val;
- }
-
onMounted(() => {
getDevName();
getActivityDescriptionData()