This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
</view>
|
||||
|
||||
<view class="package-summary">
|
||||
<view class="summary-label">{{ summaryLabel }}</view>
|
||||
<view class="summary-name">{{ summaryName }}</view>
|
||||
<view v-if="summaryPrice" class="summary-price">¥{{ summaryPrice }}</view>
|
||||
</view>
|
||||
|
||||
<view class="payment-methods">
|
||||
@@ -65,6 +65,7 @@
|
||||
const submitting = ref(false);
|
||||
const packageIds = ref([]);
|
||||
const packageNames = ref([]);
|
||||
const renewalPrice = ref(null);
|
||||
const paymentMethod = ref('alipay');
|
||||
const allowedPaymentMethods = ref([]);
|
||||
const assetInfo = ref({});
|
||||
@@ -73,10 +74,12 @@
|
||||
const paymentMethodOptions = computed(() => getPaymentMethodOptions(allowedPaymentMethods.value));
|
||||
const packageNamesText = computed(() => packageNames.value.filter(Boolean).join('、') || '当前套餐');
|
||||
const popupTitle = computed(() => operationMode.value === 'order-payment' ? '立即支付' : '立即续费');
|
||||
const summaryLabel = computed(() => operationMode.value === 'order-payment' ? '支付订单' : '续费套餐');
|
||||
const summaryName = computed(() => operationMode.value === 'order-payment'
|
||||
? packageNamesText.value.replace(/^当前套餐$/, '当前订单')
|
||||
: packageNamesText.value);
|
||||
const summaryPrice = computed(() => renewalPrice.value === null || renewalPrice.value === undefined || renewalPrice.value === ''
|
||||
? ''
|
||||
: formatMoney(renewalPrice.value));
|
||||
const confirmText = computed(() => operationMode.value === 'order-payment' ? '确认支付' : '确认续费');
|
||||
|
||||
const hasPreparedPaymentData = (paymentData) => {
|
||||
@@ -94,9 +97,10 @@
|
||||
paymentMethod.value = getDefaultPaymentMethod(allowedPaymentMethods.value);
|
||||
};
|
||||
|
||||
const open = async (ids, names = []) => {
|
||||
const open = async (ids, names = [], price = null) => {
|
||||
operationMode.value = 'renewal';
|
||||
orderPaymentId.value = null;
|
||||
renewalPrice.value = price;
|
||||
const validIds = [...new Set((Array.isArray(ids) ? ids : [ids])
|
||||
.map((value) => Number(value))
|
||||
.filter((value) => Number.isInteger(value) && value > 0))];
|
||||
@@ -149,6 +153,7 @@
|
||||
|
||||
operationMode.value = 'order-payment';
|
||||
orderPaymentId.value = orderId;
|
||||
renewalPrice.value = null;
|
||||
packageIds.value = [];
|
||||
packageNames.value = Array.isArray(names) ? names.filter(Boolean) : [];
|
||||
try {
|
||||
@@ -397,25 +402,27 @@
|
||||
}
|
||||
|
||||
.package-summary {
|
||||
padding: 40rpx 30rpx 30rpx;
|
||||
background: linear-gradient(135deg, rgba(85, 171, 92, 0.05) 0%, rgba(85, 171, 92, 0.02) 100%);
|
||||
border-bottom: 1rpx solid var(--border-light);
|
||||
padding: 32rpx 30rpx 24rpx;
|
||||
background: transparent;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.summary-label {
|
||||
color: var(--text-tertiary);
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.summary-name {
|
||||
margin: 20rpx 0 0;
|
||||
margin: 0;
|
||||
color: var(--text-primary);
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.summary-price {
|
||||
margin-top: 14rpx;
|
||||
color: var(--primary);
|
||||
font-size: 48rpx;
|
||||
font-weight: 700;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.payment-methods {
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user