更新:充值消费列表

This commit is contained in:
2025-11-26 15:30:32 +08:00
parent d9c9e5bac3
commit 37b9a4d02a
5 changed files with 111 additions and 68 deletions

View File

@@ -1,15 +1,15 @@
<template>
<view class="recharge-page">
<!-- 自定义导航栏 -->
<nav-bar :title="$t('user.recharge')"></nav-bar>
<nav-bar :title="$t('order.recharge')"></nav-bar>
<view class="block">
<view class="text">充值金额</view>
<view class="text">{{$t('order.rechargeAmount')}}</view>
<view class="recharge">
<view class="recharge_block" @click="chosPric(item)"
:class="aloneItem.priceTypeId === item.priceTypeId ? 'selected' : ''"
v-for="item in rechargeList.bookBuyConfigList" :key="item.priceTypeId">
<view class="recharge_money">{{item.money}}</view>
<view>{{item.realMoney}}天医币</view>
<view>{{item.realMoney}}{{$t('order.virtualCoin')}}</view>
<!-- 红框位置的618活动标签 -->
<!-- <view class="activity-tag">618活动</view> -->
<span class="activity-label" v-if="item.givejf >0">618充值活动</span>
@@ -21,30 +21,30 @@
<view v-html="remark.remark"></view>
</view>
<view class="cha_fangsh">
<view class="cf_title PM_font">支付方式</view>
<view class="cf_title PM_font">{{$t('user.paymentMethod')}}</view>
<view class="cf_radio">
<radio-group v-for="item in iosPaylist" @change="choseType(item.id)">
<radio-group v-for="item in iosPaylist" @click="choseType(item.id)">
<view style="width: 100%">
<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" style="float: right"></radio>
<radio :checked="payType === item.id"></radio>
</view>
</view>
</radio-group>
</view>
</view>
<view class="agree_wo flexbox">
<radio-group class="agree" v-for="(item, index) in argee" :key="index" @change="radioCheck">
<radio-group class="agree" v-for="(item, index) in argee" :key="index" @click="radioCheck">
<view>
<radio class="agreeRadio" :value="item.id" :checked="state" color="#007bff"></radio>
</view>
</radio-group>
<view>我已阅读并同意<span class="highlight" @click="showAgreement">增值服务协议</span></view>
<view>{{$t('order.readAgree')}}<span class="highlight" @click="showAgreement">{{$t('order.valueAddedServices')}}</span></view>
</view>
<view class="bottom-button-container">
<button class="recharge-button" @click="handleRecharge">立即充值</button>
<button class="recharge-button" @click="handleRecharge">{{$t('order.recharge')}}</button>
</view>
<wd-popup v-model="agreemenState" position="bottom" :closeable="true">
<view class="agreement">
@@ -61,10 +61,11 @@
<script setup lang="ts">
import { ref, computed, onMounted, toRefs, reactive } from 'vue'
import { useI18n } from 'vue-i18n'
import { useMessage } from '@/uni_modules/wot-design-uni'
import { getBookBuyConfigList, getAgreement, getActivityDescription } from '@/api/modules/user'
const googlePay = uni.requireNativePlugin("sn-googlepay5");
// const googlePay = uni.requireNativePlugin("sn-googlepay5");
const { t } = useI18n()
const message = useMessage()
const payType = ref('1')
const iosPaylist = ref([
@@ -108,9 +109,11 @@
const isConnected = ref(false)
/**
* 获取使用环境
*/
const getDevName = () => {
// 获取使用环境
if (uni.getSystemInfoSync().platform === "android") {
qudao.value = 'Google'
isAndroid.value = true;
@@ -132,8 +135,8 @@
* 勾选协议
*/
const radioCheck = () => {
console.log('点击了', state.value);
state.value = !state.value
console.log('点击了', state.value);
}
/**
@@ -151,7 +154,6 @@
console.log(rechargeList.value.bookBuyConfigList, '充值列表');
// 默认选择第一个金额
aloneItem.value = rechargeList.value.bookBuyConfigList[0]
getGooglePay()
} catch (error) {
console.error('获取订单列表失败:', error)
}
@@ -194,7 +196,16 @@
}
const handleRecharge = () => {
if(!state.value){
uni.showToast({
title: t('order.readAgreeServices'),
icon: 'none'
})
return
}
uni.showLoading({ title: '加载中...' })
console.log('立即充值');
getGooglePay()
}
/**
@@ -202,8 +213,6 @@
*/
const getGooglePay = () => {
googlePay.init({
// autoReconnect: true, // 是否自动重连(插件实现)
// enableAutoServiceReconnection: true, //是否自动重连8.0+支持)
}, (e:any) => {
console.log('init', e);
if (e.code == 0) {
@@ -262,9 +271,6 @@
getDevName();
getActivityDescriptionData()
getAgreementData()
})
</script>
@@ -300,7 +306,7 @@
.recharge_money {
font-size: 30rpx;
margin-bottom: 30rpx;
margin-bottom: 10rpx;
}
@@ -376,9 +382,12 @@
.cf_xuanx {
font-size: 24rpx;
padding: 20rpx 0;
padding: 10rpx 0;
margin-bottom: 20rpx;
border-bottom: 1px solid #ededed;
display: flex;
justify-content: space-between;
align-items:center;
image {
width: 40rpx;