oil-station/gasStation-uni/pagesRefuel/orderSuccess/index.vue

93 lines
1.9 KiB
Vue
Raw Normal View History

2023-12-22 14:44:26 +08:00
<template>
<view class="content">
<view class="container">
<view class="my-header">
<view class="my-icons" @click="goBack"> <uni-icons type="left" size="16"></uni-icons> </view>
<view class="my-text">支付完成</view>
<view class="my-icons"></view>
</view>
2023-12-26 18:44:50 +08:00
<view style="text-align: center;margin-top: 20px;">
<view style="margin: 0 auto;">
<image style="width: 60%;" src="@/static/imgs/paymentSuccess.png"></image>
</view>
<view style="margin: 20px auto;font-size: 20px;color: #30a1ff;">支付成功</view>
<view style="color: gray">
您已完成支付<br/>
谢谢您对来个油惠的支持
</view>
<view @click="goBack" style="border: solid 1px #30a1ff;border-radius: 50px;margin: 20px auto;width: 150px;
2024-01-03 18:40:21 +08:00
height: 40px;line-height: 40px;color: #30a1ff;">{{timestamp}}s后返回首页</view>
2023-12-26 18:44:50 +08:00
</view>
2023-12-22 14:44:26 +08:00
</view>
</view>
</template>
<script>
export default {
data() {
return {
2024-01-04 18:44:52 +08:00
timestamp:3,
2023-12-22 14:44:26 +08:00
}
},
2024-01-03 18:40:21 +08:00
onLoad() {
this.countdown()
},
2023-12-22 14:44:26 +08:00
methods: {
2024-01-03 18:40:21 +08:00
// 倒计时刷新
countdown(){
let _this = this
let timer = setInterval(() => {
// countdown减1
_this.timestamp--;
// 如果倒计时为0清除定时器
if(_this.timestamp === 0) {
_this.goBack()
clearInterval(timer)
2024-01-04 18:44:52 +08:00
_this.timestamp = 3
2024-01-03 18:40:21 +08:00
}
}, 1000);
},
2023-12-22 14:44:26 +08:00
goBack() {
uni.reLaunch({
url: '/pages/index/index'
})
}
}
}
</script>
<style scoped lang="scss">
.content {
2023-12-26 18:44:50 +08:00
background: white;
2023-12-22 14:44:26 +08:00
}
.container {
width: 100%;
height: 100vh;
box-sizing: border-box;
padding-top: 88px;
}
.my-header {
width: 100%;
height: 88px;
background: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
color: #000;
box-sizing: border-box;
padding: 0px 15px;
padding-top: 40px;
.my-icons {
width: 20px;
}
position: fixed;
top: 0px;
}
</style>