Files
h5-meike/pages/ticket/paysuccess.vue
T
xuchaoandClaude Opus 4.8 4190565eb7 feat: 质惠游 H5 一期 —— 门票模块全链路(微信公众号版)
从 xghmall(云闪付版湘工游)迁移民票模块,改造为微信公众号 H5:

- 技术栈沿用 uni-app + Vue2 + uView(含定制版日历组件)
- 登录/支付独立成层(common/auth.js、common/pay.js):
  一期假登录(测试手机号)+ 模拟支付,后端微信接口就绪后只换这两处
- 登录页重写:短信验证码 + 公众号网页授权(code 换用户信息)预留
- 门票列表页为入口页(进页必须登录),加订单悬浮按钮
- 支付成功页接通:查看订单/继续逛逛 + 订单状态轮询
- 详情页定位导航改用 uni.openLocation + 高德网页兜底
- 出行人页:身份证 18 位格式校验,删除死的删除按钮,修正证件类型回显笔误
- 清理云闪付 SDK、支付宝授权、死页面引用等残留

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 00:43:59 +08:00

164 lines
3.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 v-if="obj">
<view class="od_top">
<view class="od_top_first">
<image src="http://cdn.hntgov.net/online/static/ps_ps.png"></image>支付成功
</view>
</view>
<view style="background-color: #fff;">
<view class="od_sh">
<image style="width: 32rpx;height: 28rpx;" src="http://cdn.hntgov.net/online/static/pas_ps.png">
</image>
<view class="od_sh_right">
<!-- xuchao: 支付方式改为微信支付 -->
<text style="color: #696969;">支付方式:<text style="color: #3D3D3D;">微信支付</text></text>
<text style="color: #696969;padding-top: 16rpx;">实付金额:<text
style="color: #3D3D3D;">¥{{(obj.order.orderAmount/100).toFixed(2)||0}}</text></text>
</view>
</view>
<view class="od_line"></view>
<view class="ps_item">
<!-- xuchao: 接通"查看订单"入口(旧版此按钮被注释成了死页面) -->
<view class="ps_item_item" style="color: #181617;" @tap='seeOrder()'>查看订单</view>
<view style="width: 1rpx;height: 48rpx;background-color: #E7E6E6;"></view>
<view class="ps_item_item" style="color: #ED2D38;" @tap='toMall()'>继续逛逛</view>
</view>
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
// xuchao: 支付成功页 —— 支付完成后跳入,轮询订单状态直到后端确认
var that = ''
export default {
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>
page {
background-color: #f7f7f7;
}
</style>
<style scoped lang="scss">
.ps_item {
width: 690rpx;
margin-left: 30rpx;
height: 96rpx;
align-items: center;
display: flex;
.ps_item_item {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
font-size: 30rpx;
font-weight: bold;
}
}
.od_top {
width: 750rpx;
height: 210rpx;
background: linear-gradient(90deg, #FF3F3C -8%, #FFA371 107%);
padding-top: 56rpx;
padding-left: 70rpx;
display: flex;
flex-direction: column;
}
.od_top_first {
display: flex;
align-items: center;
color: #FFF;
font-size: 34rpx;
}
.od_top_first image {
width: 50rpx;
height: 50rpx;
margin-right: 20rpx;
}
.od_sh {
padding: 30rpx;
display: flex;
align-items: center;
font-size: 26rpx;
background-color: #fff;
.od_sh_right {
width: 640rpx;
margin-left: 18rpx;
display: flex;
flex-direction: column;
}
}
.od_line {
width: 690rpx;
height: 1rpx;
background-color: #E7E6E6;
margin-left: 30rpx;
}
</style>