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()