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

181 lines
4.4 KiB
Vue
Raw Normal View History

2024-08-16 18:26:19 +08:00
<template>
<view class="content">
<view class="container">
2024-09-18 14:13:55 +08:00
<!-- <view class="my-header">
2024-08-16 18:26:19 +08:00
<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>
2024-09-18 14:13:55 +08:00
</view> -->
2024-08-16 18:26:19 +08:00
<view style="text-align: center;margin-top: 20px;">
<view style="margin: 0 auto;">
2024-09-18 14:13:55 +08:00
<image src="../../static/icon/zfcg.png" style="width: 80px; height: 80px; "></image>
</view>
<view style="margin: 20px auto;font-size: 16px;color: #22AF5B;">支付成功</view>
2024-10-08 17:58:46 +08:00
<view class="m_num">{{orderInfo.goodsMoney}}</view>
2024-09-18 14:13:55 +08:00
<view class="m_bs">
<view class="">门店名称</view>
2024-10-08 17:58:46 +08:00
<view class="">{{orderInfo.storeName}}</view>
2024-08-16 18:26:19 +08:00
</view>
2024-09-18 14:13:55 +08:00
<view class="x_"></view>
<view class="m_bs">
<view class="">交易类型</view>
2024-10-08 17:58:46 +08:00
<view class="">{{orderInfo.content}}</view>
2024-08-16 18:26:19 +08:00
</view>
2024-09-18 14:13:55 +08:00
<view class="m_bs">
<view class="">支付方式</view>
2024-10-08 17:58:46 +08:00
<view class="" v-if="orderInfo.payType=='ALIPAY'">支付宝</view>
<view class="" v-if="orderInfo.payType=='WECHAT'">微信</view>
<view class="" v-if="orderInfo.payType=='UNIONPAY'">银联二维码</view>
<view class="" v-if="orderInfo.payType=='CASH'">现金</view>
<view class="" v-if="orderInfo.payType=='APPLET_CODE'">小程序码</view>
<view class="" v-if="orderInfo.payType=='card_value'">储值卡</view>
<view class="" v-if="orderInfo.payType=='fule_card'">囤油卡</view>
<view class="" v-if="orderInfo.payType=='car_card_value'">车队卡</view>
<view class="" v-if="orderInfo.payType=='car_fule_card'">车队囤油卡</view>
<view class="" v-if="orderInfo.payType=='after_pay'">挂账</view>
2024-09-18 14:13:55 +08:00
</view>
<view class="m_bs">
<view class="">流水编号</view>
2024-10-08 17:58:46 +08:00
<view class="">{{orderInfo.orderNo}}</view>
2024-09-18 14:13:55 +08:00
</view>
2024-10-08 17:58:46 +08:00
<view v-if="orderInfo.type==1" @click="goOrderInfo" style="border: solid 1px #FA6400;margin: 20px auto;width: 70%;
2024-09-18 14:13:55 +08:00
height: 40px;line-height: 40px;color: #FA6400;">{{timestamp}}s后去评价</view>
<view v-else @click="goBack" style="border: solid 1px #FA6400;margin: 20px auto;width: 70%;
height: 40px;line-height: 40px;color: #FA6400;">{{timestamp}}s后返回首页</view>
2024-08-16 18:26:19 +08:00
</view>
</view>
</view>
</template>
<script>
2024-10-08 17:58:46 +08:00
import request from '../../utils/request'
2024-08-16 18:26:19 +08:00
export default {
data() {
return {
2024-09-18 14:13:55 +08:00
timestamp: 3,
timer: {},
2024-10-08 17:58:46 +08:00
orderNo: "234520241008171716e578f0",
orderInfo: {},
oilOrder:{},
2024-08-16 18:26:19 +08:00
}
},
onLoad(e) {
2024-09-18 14:13:55 +08:00
if (e.orderNo) {
2024-08-16 18:26:19 +08:00
this.orderNo = e.orderNo
}
2024-10-08 17:58:46 +08:00
this.getOrder()
this.countdown()
2024-08-16 18:26:19 +08:00
},
methods: {
2024-10-08 17:58:46 +08:00
getOrder() {
request({
url: "/business/allOrderInfo/queryByOrderNo",
method: 'get',
params: {
orderNo: this.orderNo,
},
}).then((res) => {
this.orderInfo = res.data
if (res.data.type == 1){
request({
url: "business/oilOrder/oilOrderId/" + this.orderNo,
method: 'get',
}).then((res) => {
if(res.data){
this.oilOrder = res.data
}
})
}
})
},
2024-09-18 14:13:55 +08:00
goOrderInfo() {
2024-08-16 18:26:19 +08:00
clearInterval(this.timer)
uni.navigateTo({
2024-10-08 17:58:46 +08:00
url: '/pagesMy/comment/comment?orderId=' + this.oilOrder.id
2024-08-16 18:26:19 +08:00
})
},
// 倒计时刷新
2024-09-18 14:13:55 +08:00
countdown() {
2024-08-16 18:26:19 +08:00
let _this = this
this.timer = setInterval(() => {
2024-09-18 14:13:55 +08:00
// countdown减1
_this.timestamp--;
// 如果倒计时为0清除定时器
if (_this.timestamp === 0) {
2024-10-08 17:58:46 +08:00
if (_this.orderInfo.type==1) {
2024-08-16 18:26:19 +08:00
_this.goOrderInfo()
2024-09-18 14:13:55 +08:00
} else {
2024-08-16 18:26:19 +08:00
_this.goBack()
}
2024-09-18 14:13:55 +08:00
2024-08-16 18:26:19 +08:00
clearInterval(this.timer)
_this.timestamp = 3
2024-09-18 14:13:55 +08:00
}
2024-08-16 18:26:19 +08:00
}, 1000);
},
goBack() {
clearInterval(this.timer)
uni.reLaunch({
url: '/pages/index/index'
})
}
}
}
</script>
<style scoped lang="scss">
.content {
background: white;
}
2024-09-18 14:13:55 +08:00
2024-08-16 18:26:19 +08:00
.container {
width: 100%;
height: 100vh;
box-sizing: border-box;
2024-09-18 14:13:55 +08:00
2024-08-16 18:26:19 +08:00
}
2024-09-18 14:13:55 +08:00
2024-08-16 18:26:19 +08:00
.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;
2024-09-18 14:13:55 +08:00
2024-08-16 18:26:19 +08:00
.my-icons {
width: 20px;
2024-09-18 14:13:55 +08:00
2024-08-16 18:26:19 +08:00
}
2024-09-18 14:13:55 +08:00
2024-08-16 18:26:19 +08:00
position: fixed;
top: 0px;
}
2024-09-18 14:13:55 +08:00
.m_num {
font-size: 30px;
color: #333333;
}
.m_bs {
width: 100%;
box-sizing: border-box;
padding: 5px 15px;
display: flex;
align-items: center;
justify-content: space-between;
}
.x_ {
width: 95%;
border-bottom: 1px solid #EEEEEE;
margin: 5px auto;
}
2024-08-16 18:26:19 +08:00
</style>