Files
device-voice-h5/pages/silence-payment/silence-payment.vue
邹进 31ff18d66a
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 23m46s
feat: C 端套餐沉默期展示与自助延期
- 套餐历史展示沉默期状态、截止日期、累计延期与调整审批中,可延期时显示延期入口
- 新增延期页:资格、档位与自定义天数试算、支付方式、下单(request_id 幂等)
- 支付宝走现有支付页;微信为链接时在微信外直接跳转,否则展示二维码与复制链接
- 新增我的延期订单列表与详情、沉默期记录,沉默期错误码转客户提示
2026-11-07 13:19:33 +09:00

105 lines
2.6 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view class="container silence-pay-page">
<view v-if="!payment" class="card empty-card">未找到待支付的延期订单,请在"我的延期订单"中查看</view>
<template v-else>
<view class="card">
<view class="pay-title">微信支付</view>
<view class="pay-amount">¥{{ formatMoney(payment.amount) }}</view>
<view class="pay-order">订单号:{{ payment.orderNo || '-' }}</view>
</view>
<view class="card">
<view class="method-title">扫码支付</view>
<view class="qr-wrap">
<u-qrcode :val="payment.content" :size="220" unit="px" :show-loading="false"></u-qrcode>
</view>
<view class="qr-desc">长按识别二维码,或截图后用微信"扫一扫"支付</view>
</view>
<view v-if="isLink" class="card">
<view class="method-title">浏览器支付</view>
<view class="qr-desc">复制链接后在手机浏览器中打开完成支付</view>
<view class="btn-apple btn-secondary copy-btn" @tap="copyLink">复制支付链接</view>
</view>
<view class="btn-apple btn-primary done-btn" @tap="finish">我已完成支付</view>
</template>
</view>
</template>
<script setup>
import { computed, ref } from 'vue';
import { onShow } from '@dcloudio/uni-app';
import { formatMoney } from '@/utils/display.js';
import { isPaymentLink } from '@/utils/silence.js';
import { getPendingSilencePayment } from '@/utils/silence-payment.js';
const payment = ref(null);
const isLink = computed(() => isPaymentLink(payment.value?.content));
const copyLink = () => {
uni.setClipboardData({
data: payment.value.content,
success: () => uni.showToast({ title: '已复制', icon: 'success' })
});
};
// 返回上一页(延期页或订单详情),由上一页 onShow 查询订单状态
const finish = () => uni.navigateBack();
onShow(() => {
payment.value = getPendingSilencePayment();
});
</script>
<style lang="scss" scoped>
.silence-pay-page {
min-height: 100vh;
box-sizing: border-box;
}
.pay-title,
.method-title {
font-size: 30rpx;
font-weight: 600;
color: var(--text-primary);
}
.pay-amount {
margin-top: 16rpx;
font-size: 48rpx;
font-weight: 700;
color: var(--danger);
}
.pay-order {
margin-top: 8rpx;
font-size: 24rpx;
color: var(--text-tertiary);
}
.qr-wrap {
display: flex;
justify-content: center;
padding: 32rpx 0;
}
.qr-desc {
font-size: 24rpx;
color: var(--text-tertiary);
text-align: center;
}
.copy-btn,
.done-btn {
margin-top: 24rpx;
text-align: center;
}
.empty-card {
margin-top: 40rpx;
text-align: center;
color: var(--text-tertiary);
}
</style>