|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <uv-navbar leftIcon="arrow-left" @leftClick="handleLeftClick" title="充值" ></uv-navbar>
|
|
|
|
|
|
|
+ <uv-navbar leftIcon="arrow-left" @leftClick="handleLeftClick" title="充值" bg-color="#C6171E" color="white"></uv-navbar>
|
|
|
<view class="container">
|
|
<view class="container">
|
|
|
<view class="title">请选择充值金额</view>
|
|
<view class="title">请选择充值金额</view>
|
|
|
<view class="amount-list">
|
|
<view class="amount-list">
|
|
@@ -9,16 +9,24 @@
|
|
|
:class="['amount-item', { 'active': state.chosenIdx === index }]"
|
|
:class="['amount-item', { 'active': state.chosenIdx === index }]"
|
|
|
@click="handleRechargeClick(item,index)"
|
|
@click="handleRechargeClick(item,index)"
|
|
|
>
|
|
>
|
|
|
- {{ (item.rechargeAmount/100).toFixed(0) }}
|
|
|
|
|
|
|
+ <view class="amount-text">{{ (item.rechargeAmount/100).toFixed(0) }}元</view>
|
|
|
|
|
+ <view v-if="item.grantsAmount > 0" class="gift-tag">
|
|
|
|
|
+ <uv-icon name="gift" size="12"></uv-icon>
|
|
|
|
|
+ {{ (item.grantsAmount/100).toFixed(0) }}元
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
- <view v-if="state.rechargeItem.grantsAmount>0" class="flex-inline gift-box">
|
|
|
|
|
- <uv-icon name="gift" size="20"></uv-icon>
|
|
|
|
|
- 赠送{{(state.rechargeItem.grantsAmount/100).toFixed(2)}}元</view>
|
|
|
|
|
-<!-- <button class="recharge-btn" type="primary" @click="startRecharge">立即充值</button>-->
|
|
|
|
|
|
|
+ <view class="selected-info" v-if="state.chosenIdx > -1">
|
|
|
|
|
+ <view class="selected-text">已选择:<span class="selected-amount">¥{{ (state.configList[state.chosenIdx].rechargeAmount/100).toFixed(2) }}</span></view>
|
|
|
|
|
+ <view v-if="state.rechargeItem.grantsAmount>0" class="gift-info">
|
|
|
|
|
+ <uv-icon name="gift" size="18"></uv-icon>
|
|
|
|
|
+ <span class="gift-amount">赠送¥{{(state.rechargeItem.grantsAmount/100).toFixed(2)}}</span>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
<view class="recharge-pay">
|
|
<view class="recharge-pay">
|
|
|
- <uv-button type="primary" shape="circle" iconColor="white" color="#C6171E" text="充值" @click="debounceConfirm"></uv-button>
|
|
|
|
|
|
|
+ <uv-button type="primary" shape="circle" iconColor="white" color="#C6171E" text="立即充值" @click="debounceConfirm" :disabled="state.chosenIdx < 0"></uv-button>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
@@ -124,66 +132,132 @@ const confirm = () => {
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
|
.container {
|
|
.container {
|
|
|
- padding: 20px;
|
|
|
|
|
- margin-top: 100px;
|
|
|
|
|
|
|
+ padding: 40rpx 20rpx;
|
|
|
|
|
+ margin-top: 90px;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
|
|
+ min-height: calc(100vh - 90px);
|
|
|
|
|
+ background-color: #f5f5f5;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.title {
|
|
.title {
|
|
|
- font-size: 17px;
|
|
|
|
|
|
|
+ font-size: 28rpx;
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
- margin-bottom: 30px;
|
|
|
|
|
|
|
+ margin-bottom: 40rpx;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ color: #333;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.amount-list {
|
|
.amount-list {
|
|
|
- display: flex;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
- flex-wrap: wrap;
|
|
|
|
|
- gap: 15px;
|
|
|
|
|
- margin-bottom: 20px;
|
|
|
|
|
|
|
+ display: grid;
|
|
|
|
|
+ grid-template-columns: repeat(3, 1fr);
|
|
|
|
|
+ gap: 20rpx;
|
|
|
|
|
+ margin-bottom: 40rpx;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.amount-item {
|
|
.amount-item {
|
|
|
- background-color: #eee;
|
|
|
|
|
- width: 140rpx;
|
|
|
|
|
- padding: 10px 12px;
|
|
|
|
|
|
|
+ background-color: white;
|
|
|
|
|
+ padding: 32rpx 0;
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
- border: 1px solid #eee;
|
|
|
|
|
- border-radius: 5px;
|
|
|
|
|
- font-size: 18px;
|
|
|
|
|
- font-weight: bold;
|
|
|
|
|
|
|
+ border: 2px solid #e0e0e0;
|
|
|
|
|
+ border-radius: 14rpx;
|
|
|
|
|
+ font-size: 30rpx;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ transition: all 0.3s ease;
|
|
|
|
|
+ box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
|
|
|
|
|
+ height: 120rpx;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.amount-item:active {
|
|
|
|
|
+ transform: scale(0.95);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.amount-item.active {
|
|
.amount-item.active {
|
|
|
background-color: #C6171E;
|
|
background-color: #C6171E;
|
|
|
color: white;
|
|
color: white;
|
|
|
border-color: #C6171E;
|
|
border-color: #C6171E;
|
|
|
|
|
+ box-shadow: 0 4rpx 12rpx rgba(198, 23, 30, 0.3);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.custom-amount input {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- padding: 10px;
|
|
|
|
|
- border: 1px solid #ccc;
|
|
|
|
|
- border-radius: 5px;
|
|
|
|
|
- margin-bottom: 20px;
|
|
|
|
|
|
|
+.amount-text {
|
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
|
+ font-weight: 600;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.recharge-btn {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
|
|
+.gift-tag {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: -10rpx;
|
|
|
|
|
+ right: -10rpx;
|
|
|
|
|
+ background-color: #FF6B6B;
|
|
|
|
|
+ color: white;
|
|
|
|
|
+ font-size: 18rpx;
|
|
|
|
|
+ padding: 4rpx 12rpx;
|
|
|
|
|
+ border-radius: 12rpx;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 4rpx;
|
|
|
|
|
+ animation: giftPulse 2s infinite;
|
|
|
|
|
+ box-shadow: 0 2rpx 6rpx rgba(255, 107, 107, 0.3);
|
|
|
}
|
|
}
|
|
|
-.gift-box{
|
|
|
|
|
- display: inline-flex;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
|
|
+
|
|
|
|
|
+@keyframes giftPulse {
|
|
|
|
|
+ 0% {
|
|
|
|
|
+ transform: scale(1);
|
|
|
|
|
+ }
|
|
|
|
|
+ 50% {
|
|
|
|
|
+ transform: scale(1.05);
|
|
|
|
|
+ }
|
|
|
|
|
+ 100% {
|
|
|
|
|
+ transform: scale(1);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.selected-info {
|
|
|
|
|
+ background-color: white;
|
|
|
|
|
+ padding: 30rpx;
|
|
|
|
|
+ border-radius: 12rpx;
|
|
|
|
|
+ margin-bottom: 40rpx;
|
|
|
|
|
+ box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.selected-text {
|
|
|
|
|
+ font-size: 26rpx;
|
|
|
|
|
+ color: #666;
|
|
|
|
|
+ margin-bottom: 10rpx;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.selected-amount {
|
|
|
|
|
+ font-size: 32rpx;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ color: #C6171E;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.gift-info {
|
|
|
|
|
+ display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
- margin-top: 10px;
|
|
|
|
|
|
|
+ gap: 10rpx;
|
|
|
|
|
+ font-size: 24rpx;
|
|
|
|
|
+ color: #FF6B6B;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.gift-amount {
|
|
|
|
|
+ font-weight: 600;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.recharge-pay {
|
|
.recharge-pay {
|
|
|
- width: calc(100vw - 40rpx);
|
|
|
|
|
|
|
+ width: calc(100vw - 60rpx);
|
|
|
position: fixed;
|
|
position: fixed;
|
|
|
- bottom: 30rpx;
|
|
|
|
|
- left: 20rpx;
|
|
|
|
|
|
|
+ bottom: 40rpx;
|
|
|
|
|
+ left: 30rpx;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
</style>
|
|
</style>
|