Files
h5-meike/pages/ticket/paysuccess.vue
T
jacobxu666andClaude Opus 4.8 77e5cb9510 feat: 全站 UI 按 Minimalist Modern 重设计,新增返回悬浮钮
- 设计令牌层:mm-* CSS 变量与工具类、uView 换肤、优设标题黑字体
- 九个页面全部重写为新风格(列表/详情/下单/出行人/订单/支付成功/登录)
- 补齐 H5 运行时缺失的基础样式(uni-view/scroll-view/toast/swiper 等,App.vue 全局)
- 修复:详情头图轮播、预订须知弹层滚动、出行人数量按购买数限制、订单详情去箭头
- 新增 gmy-back-touch 返回悬浮钮,除首页外全页接入,点击返回上一页

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-05 12:48:45 +08:00

189 lines
4.0 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 v-if="obj" class="page mm-page">
<gmy-back-touch></gmy-back-touch>
<!-- xuchao: 成功状态英雄区 —— 渐变对勾 + 柔光 -->
<view class="hero mm-fade-up">
<view class="hero__icon mm-grad">
<u-icon name="checkmark" color="#ffffff" size="64"></u-icon>
</view>
<view class="hero__title mm-display">支付成功</view>
<view class="hero__sub">门票订单已提交,请留意出票通知</view>
</view>
<!-- xuchao: 支付信息卡 -->
<view class="card mm-card mm-fade-up">
<view class="row">
<text class="row__label">支付方式</text>
<text class="row__val">微信支付</text>
</view>
<view class="row">
<text class="row__label">实付金额</text>
<view class="row__price">
<text class="row__cur">¥</text>
<text class="row__num mm-display mm-grad-text">{{(obj.order.orderAmount/100).toFixed(2)||0}}</text>
</view>
</view>
</view>
<!-- xuchao: 操作按钮 —— 主操作渐变、次操作描边 -->
<view class="acts mm-fade-up">
<view class="mm-btn" @tap="seeOrder()">查看订单</view>
<view class="mm-btn-ghost" @tap="toMall()">继续逛逛</view>
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
// xuchao: 支付成功页 —— 支付完成后跳入,轮询订单状态直到后端确认
var that = ''
import gmyBackTouch from "@/components/gmy-back-touch/gmy-back-touch.vue"
export default {
components: {
'gmy-back-touch': gmyBackTouch
},
data() {
return {
id: '',
obj: "",
// xuchao: 轮询订单状态(等待后端支付回调把订单从"待支付"更新掉)
pollTimer: null,
pollTimes: 5
}
},
onLoad(e) {
that = this
that.id = e.id
that.getOrderDetail()
},
onUnload() {
clearInterval(this.pollTimer)
},
methods: {
seeOrder() {
uni.reLaunch({
url: 'orderlist'
})
},
// xuchao: "继续逛逛"回到门票列表(旧版指向的商城页已不存在)
toMall() {
uni.reLaunch({
url: '/pages/ticket/scenic'
})
},
getOrderDetail() {
that.$u.api.getTicketsOrderDetail({
id: this.id,
}).then(res => {
if (res) {
this.obj = res.data
// 订单仍为待支付时轮询,最多 5 次(每次间隔 2 秒)
if (this.obj.order.orderStatus == 'WAITPAY' && this.pollTimes > 0) {
clearInterval(this.pollTimer)
this.pollTimer = setInterval(() => {
this.pollTimes--
if (this.pollTimes <= 0) {
clearInterval(this.pollTimer)
return
}
this.getOrderDetail()
}, 2000)
} else {
clearInterval(this.pollTimer)
}
}
})
}
}
}
</script>
<style scoped lang="less">
.page {
padding: 96rpx 32rpx 60rpx;
}
/* ---------- 英雄区 ---------- */
.hero {
display: flex;
flex-direction: column;
align-items: center;
}
.hero__icon {
width: 128rpx;
height: 128rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
box-shadow: var(--mm-shadow-accent), 0 0 0 24rpx rgba(0, 82, 255, 0.06);
}
.hero__title {
margin-top: 36rpx;
font-size: 48rpx;
color: var(--mm-fg);
}
.hero__sub {
margin-top: 12rpx;
font-size: 24rpx;
color: var(--mm-muted-fg);
}
/* ---------- 支付信息卡 ---------- */
.card {
margin-top: 64rpx;
padding: 8rpx 32rpx;
}
.row {
display: flex;
align-items: center;
justify-content: space-between;
height: 104rpx;
&:first-child {
border-bottom: 2rpx solid var(--mm-muted);
}
}
.row__label {
font-size: 28rpx;
color: var(--mm-muted-fg);
}
.row__val {
font-size: 28rpx;
font-weight: 500;
color: var(--mm-fg);
}
.row__price {
display: flex;
align-items: baseline;
}
.row__cur {
font-size: 26rpx;
font-weight: 600;
color: var(--mm-accent);
margin-right: 4rpx;
}
.row__num {
font-size: 44rpx;
line-height: 1;
}
/* ---------- 操作按钮 ---------- */
.acts {
margin-top: 64rpx;
display: flex;
flex-direction: column;
gap: 24rpx;
}
</style>