修复:不同系统支付,显示支付方式不同
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<!-- 自定义导航栏 -->
|
||||
<nav-bar :title="$t('order.recharge')"></nav-bar>
|
||||
<!-- 活动充值金额 -->
|
||||
<view class="block" v-if="eventAmountList.length > 0">
|
||||
<view class="block" v-if="eventAmountList?.length > 0">
|
||||
<!-- <view class="text">{{$t('order.rechargeAmount')}}</view> -->
|
||||
<view class="text">活动充值金额</view>
|
||||
<view class="recharge">
|
||||
@@ -39,13 +39,11 @@
|
||||
<view class="cha_fangsh">
|
||||
<view class="cf_title">{{$t('user.paymentMethod')}}</view>
|
||||
<view class="cf_radio">
|
||||
<radio-group v-for="item in iosPaylist">
|
||||
<radio-group>
|
||||
<view>
|
||||
<view :class="payType == item.id ? 'Tab_xf cf_xuanx' : 'cf_xuanx'">
|
||||
<!-- <image class="pay_item_img" :src="item.imgUrl" mode="aspectFil">
|
||||
</image> -->
|
||||
<text>{{ item.title }}</text>
|
||||
<radio :checked="payType === item.id" @click="choseType(item.id)"></radio>
|
||||
<view class="cf_xuanx">
|
||||
<text>{{ isAndroid ? $t('user.googlePay') : $t('user.applePay')}}</text>
|
||||
<radio checked="true;" @click="choseType(item.id)"></radio>
|
||||
</view>
|
||||
</view>
|
||||
</radio-group>
|
||||
@@ -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)
|
||||
|
||||
/**
|
||||
@@ -257,10 +247,10 @@
|
||||
*/
|
||||
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({
|
||||
@@ -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);
|
||||
@@ -496,13 +486,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换支付方式
|
||||
*/
|
||||
const choseType = () => {
|
||||
// payType.value = val;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getDevName();
|
||||
getActivityDescriptionData()
|
||||
|
||||
Reference in New Issue
Block a user